glib/docs/reference/glib
Simon McVittie b393413321 gstdio: Add g_clear_fd() and g_autofd
Inspired by libglnx's glnx_close_fd() and glnx_autofd, these let us
have the same patterns as g_clear_object() and g_autoptr(GObject), but
for file descriptors. g_clear_fd() is cross-platform, while g_autofd
is syntactic sugar requiring a supported compiler (gcc or clang).

Now that g_close() checks for EBADF as a programming error, we can
implement the equivalent of glnx_autofd as an inline function without
needing to have errno and EBADF in the header file.

g_clear_fd() is like glnx_close_fd(), but with error checking.
The private _g_clear_fd_ignore_error() function used to implement
g_autofd is a closer equivalent of glnx_close_fd().

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-26 19:05:33 +01:00
..
xml docs: Change Bugzilla references to GitLab 2018-06-15 13:04:39 +01:00
building.xml Improve default value of glib_debug option 2022-08-03 17:07:13 -05:00
changes.xml tree: Fix various typos and outdated terminology 2020-06-12 15:01:08 +01:00
compiling.xml compiling.xml: Don't recommend backticks 2021-06-09 10:13:27 +00:00
cross.xml Make ld executable configurable 2019-11-04 15:08:33 +00:00
file-name-encodings.png Huh? This was a 6-byte file. Replaced it with the correct one. 2006-01-12 19:47:02 +00:00
file-name-encodings.sxd Replaced with the correct file. 2006-01-12 19:49:32 +00:00
glib-docs.xml docs: Add 2.76 release series documentation pages to the build 2022-10-14 16:03:29 +01:00
glib-gettextize.xml docs: Improve man page consistency 2012-08-03 23:36:45 -04:00
glib-overrides.txt meson: Define G_OS_DARWIN when compiling under OSX or iOS 2022-10-20 03:37:03 +02:00
glib-sections.txt.in gstdio: Add g_clear_fd() and g_autofd 2022-10-26 19:05:33 +01:00
gtester-report.xml glib: Deprecate gtester and gtester-report 2019-05-14 12:14:54 +01:00
gtester.xml glib: Deprecate gtester and gtester-report 2019-05-14 12:14:54 +01:00
gvariant-text.xml tree: Fix various typos and outdated terminology 2020-06-12 15:01:08 +01:00
gvariant-varargs.xml docs: Improve GVariant docs 2021-11-29 15:24:15 +05:30
mainloop-states.eps add images 2000-12-05 20:43:58 +00:00
mainloop-states.fig add images 2000-12-05 20:43:58 +00:00
mainloop-states.gif add images 2000-12-05 20:43:58 +00:00
mainloop-states.png add images 2000-12-05 20:43:58 +00:00
meson.build Fix symbol visibility macros on Windows 2022-10-13 20:53:56 -04:00
programming.xml docs: fix grammar in Writing GLib Applications/Threads 2016-01-31 12:54:28 -05:00
regex-syntax.xml replace pcre1 with pcre2 2022-07-12 11:46:34 +00:00
resources.xml docs: Remove mentions of mailing lists 2019-07-23 11:27:30 +01:00
running.xml docs: Wrap a code example more tightly to reduce minimum page width 2021-06-03 12:52:51 +01:00
Sorted_binary_tree_breadth-first_traversal.svg More GTree and GNode formatting and documentation fixes 2014-01-19 23:49:12 -05:00
Sorted_binary_tree_inorder.svg More GTree and GNode formatting and documentation fixes 2014-01-19 23:49:12 -05:00
Sorted_binary_tree_postorder.svg More GTree and GNode formatting and documentation fixes 2014-01-19 23:49:12 -05:00
Sorted_binary_tree_preorder.svg More GTree and GNode formatting and documentation fixes 2014-01-19 23:49:12 -05:00
version.xml.in Add version info to API docs. 2002-11-23 01:37:17 +00:00