<?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations.  -->
<repository xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:doc="http://www.gtk.org/introspection/doc/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0" version="1.2">
  <include name="GLib" version="2.0"/>
  <package name="glib-2.0"/>
  <c:include name="glib-unix.h"/>
  <c:include name="glib.h"/>
  <doc:format name="gi-docgen"/>
  <namespace name="GLibUnix" version="2.0" shared-library="libgobject-2.0.so.0,libglib-2.0.so.0" c:identifier-prefixes="GUnix,G" c:symbol-prefixes="glib,g_unix,g">
    <callback name="FDSourceFunc" c:type="GUnixFDSourceFunc">
      <doc xml:space="preserve">The type of functions to be called when a UNIX fd watch source
triggers.</doc>
      <return-value transfer-ownership="none">
        <doc xml:space="preserve">%FALSE if the source should be removed</doc>
        <type name="gboolean" c:type="gboolean"/>
      </return-value>
      <parameters>
        <parameter name="fd" transfer-ownership="none">
          <doc xml:space="preserve">the fd that triggered the event</doc>
          <type name="gint" c:type="gint"/>
        </parameter>
        <parameter name="condition" transfer-ownership="none">
          <doc xml:space="preserve">the IO conditions reported on @fd</doc>
          <type name="GLib.IOCondition" c:type="GIOCondition"/>
        </parameter>
        <parameter name="user_data" transfer-ownership="none" nullable="1" allow-none="1" closure="2">
          <doc xml:space="preserve">user data passed to g_unix_fd_add()</doc>
          <type name="gpointer" c:type="gpointer"/>
        </parameter>
      </parameters>
    </callback>
    <record name="Pipe" c:type="GUnixPipe" version="2.80">
      <doc xml:space="preserve">A Unix pipe. The advantage of this type over `int[2]` is that it can
be closed automatically when it goes out of scope, using `g_auto(GUnixPipe)`,
on compilers that support that feature.</doc>
      <field name="fds" writable="1">
        <doc xml:space="preserve">A pair of file descriptors, each negative if closed or not yet opened.
 The file descriptor with index %G_UNIX_PIPE_END_READ is readable.
 The file descriptor with index %G_UNIX_PIPE_END_WRITE is writable.</doc>
        <array zero-terminated="0" fixed-size="2">
          <type name="gint" c:type="int"/>
        </array>
      </field>
      <function name="clear" c:identifier="g_unix_pipe_clear" version="2.80" introspectable="0">
        <doc xml:space="preserve">Close both ends of the pipe, unless they have already been closed or
stolen. Any errors are ignored: use g_unix_pipe_close() or g_clear_fd()
if error-handling is required.

This function is async-signal safe if @error is %NULL and each member
of @fds are either negative or a valid open file descriptor.
As a result, it is safe to call this function or use `g_auto(GUnixPipe)`
(on compilers that support it) in a signal handler or a
#GSpawnChildSetupFunc, as long as those conditions are ensured to be true.
See [`signal(7)`](man:signal(7)) and
[`signal-safety(7)`](man:signal-safety(7)) for more details.

This function preserves the value of `errno`.</doc>
        <return-value transfer-ownership="none">
          <type name="none" c:type="void"/>
        </return-value>
        <parameters>
          <parameter name="self" transfer-ownership="none">
            <doc xml:space="preserve">a #GUnixPipe</doc>
            <type name="GLibUnix.Pipe" c:type="GUnixPipe*"/>
          </parameter>
        </parameters>
      </function>
      <function name="close" c:identifier="g_unix_pipe_close" version="2.80" introspectable="0" throws="1">
        <doc xml:space="preserve">Close one of the ends of the pipe and set the relevant member of @fds
to `-1` before returning, equivalent to g_clear_fd().

Like g_close(), if closing the file descriptor fails, the error is
stored in both %errno and @error. If this function succeeds,
%errno is undefined.

This function is async-signal safe if @error is %NULL and the relevant
member of @fds is either negative or a valid open file descriptor.
This makes it safe to call from a signal handler or a #GSpawnChildSetupFunc
under those conditions.
See [`signal(7)`](man:signal(7)) and
[`signal-safety(7)`](man:signal-safety(7)) for more details.

To close both file descriptors and ignore any errors, use
g_unix_pipe_clear() instead.</doc>
        <return-value transfer-ownership="none">
          <doc xml:space="preserve">%TRUE on success</doc>
          <type name="gboolean" c:type="gboolean"/>
        </return-value>
        <parameters>
          <parameter name="self" transfer-ownership="none">
            <doc xml:space="preserve">A pair of file descriptors</doc>
            <type name="GLibUnix.Pipe" c:type="GUnixPipe*"/>
          </parameter>
          <parameter name="end" transfer-ownership="none">
            <doc xml:space="preserve">One of the ends of the pipe</doc>
            <type name="GLibUnix.PipeEnd" c:type="GUnixPipeEnd"/>
          </parameter>
        </parameters>
      </function>
      <function name="get" c:identifier="g_unix_pipe_get" version="2.80" introspectable="0">
        <doc xml:space="preserve">Return one of the ends of the pipe. It remains owned by @self.

This function is async-signal safe (see [`signal(7)`](man:signal(7)) and
[`signal-safety(7)`](man:signal-safety(7))), making it safe to call from a
signal handler or a #GSpawnChildSetupFunc.

This function preserves the value of `errno`.</doc>
        <return-value transfer-ownership="none">
          <doc xml:space="preserve">a non-negative file descriptor owned by @self, which must not
 be closed by the caller, or a negative number if the corresponding
 end of the pipe was already closed or stolen</doc>
          <type name="gint" c:type="int"/>
        </return-value>
        <parameters>
          <parameter name="self" transfer-ownership="none">
            <doc xml:space="preserve">A pair of file descriptors</doc>
            <type name="GLibUnix.Pipe" c:type="GUnixPipe*"/>
          </parameter>
          <parameter name="end" transfer-ownership="none">
            <doc xml:space="preserve">One of the ends of the pipe</doc>
            <type name="GLibUnix.PipeEnd" c:type="GUnixPipeEnd"/>
          </parameter>
        </parameters>
      </function>
      <function name="open" c:identifier="g_unix_pipe_open" version="2.80" introspectable="0" throws="1">
        <doc xml:space="preserve">Open a pipe. This is the same as g_unix_open_pipe(), but uses the
#GUnixPipe data structure.</doc>
        <return-value transfer-ownership="none">
          <doc xml:space="preserve">%TRUE on success</doc>
          <type name="gboolean" c:type="gboolean"/>
        </return-value>
        <parameters>
          <parameter name="self" transfer-ownership="none">
            <doc xml:space="preserve">A pair of file descriptors</doc>
            <type name="GLibUnix.Pipe" c:type="GUnixPipe*"/>
          </parameter>
          <parameter name="flags" transfer-ownership="none">
            <doc xml:space="preserve">Flags to pass to g_unix_open_pipe(), typically `O_CLOEXEC`</doc>
            <type name="gint" c:type="int"/>
          </parameter>
        </parameters>
      </function>
      <function name="steal" c:identifier="g_unix_pipe_steal" version="2.80" introspectable="0">
        <doc xml:space="preserve">Return one of the ends of the pipe. It becomes owned by the caller,
and the file descriptor in the data structure is set to `-1`,
similar to g_steal_fd().

This function is async-signal safe (see [`signal(7)`](man:signal(7)) and
[`signal-safety(7)`](man:signal-safety(7))), making it safe to call from a
signal handler or a #GSpawnChildSetupFunc.

This function preserves the value of `errno`.</doc>
        <return-value transfer-ownership="none">
          <doc xml:space="preserve">a non-negative file descriptor, which becomes owned by the
 caller and must be closed by the caller if required, or a negative
 number if the corresponding end of the pipe was already closed or stolen</doc>
          <type name="gint" c:type="int"/>
        </return-value>
        <parameters>
          <parameter name="self" transfer-ownership="none">
            <doc xml:space="preserve">A pair of file descriptors</doc>
            <type name="GLibUnix.Pipe" c:type="GUnixPipe*"/>
          </parameter>
          <parameter name="end" transfer-ownership="none">
            <doc xml:space="preserve">One of the ends of the pipe</doc>
            <type name="GLibUnix.PipeEnd" c:type="GUnixPipeEnd"/>
          </parameter>
        </parameters>
      </function>
    </record>
    <enumeration name="PipeEnd" version="2.80" c:type="GUnixPipeEnd">
      <doc xml:space="preserve">Mnemonic constants for the ends of a Unix pipe.</doc>
      <member name="read" value="0" c:identifier="G_UNIX_PIPE_END_READ">
        <doc xml:space="preserve">The readable file descriptor 0</doc>
      </member>
      <member name="write" value="1" c:identifier="G_UNIX_PIPE_END_WRITE">
        <doc xml:space="preserve">The writable file descriptor 1</doc>
      </member>
    </enumeration>
    <function name="closefrom" c:identifier="g_closefrom">
      <return-value transfer-ownership="none">
        <type name="gint" c:type="int"/>
      </return-value>
      <parameters>
        <parameter name="lowfd" transfer-ownership="none">
          <type name="gint" c:type="int"/>
        </parameter>
      </parameters>
    </function>
    <function name="error_quark" c:identifier="g_unix_error_quark">
      <return-value transfer-ownership="none">
        <type name="GLib.Quark" c:type="GQuark"/>
      </return-value>
    </function>
    <function name="fd_add" c:identifier="g_unix_fd_add" introspectable="0">
      <return-value transfer-ownership="none">
        <type name="guint" c:type="guint"/>
      </return-value>
      <parameters>
        <parameter name="fd" transfer-ownership="none">
          <type name="gint" c:type="gint"/>
        </parameter>
        <parameter name="condition" transfer-ownership="none">
          <type name="GLib.IOCondition" c:type="GIOCondition"/>
        </parameter>
        <parameter name="function" transfer-ownership="none" closure="3">
          <type name="GLib.UnixFDSourceFunc" c:type="GUnixFDSourceFunc"/>
        </parameter>
        <parameter name="user_data" transfer-ownership="none" nullable="1" allow-none="1">
          <type name="gpointer" c:type="gpointer"/>
        </parameter>
      </parameters>
    </function>
    <function name="fd_add_full" c:identifier="g_unix_fd_add_full">
      <return-value transfer-ownership="none">
        <type name="guint" c:type="guint"/>
      </return-value>
      <parameters>
        <parameter name="priority" transfer-ownership="none">
          <type name="gint" c:type="gint"/>
        </parameter>
        <parameter name="fd" transfer-ownership="none">
          <type name="gint" c:type="gint"/>
        </parameter>
        <parameter name="condition" transfer-ownership="none">
          <type name="GLib.IOCondition" c:type="GIOCondition"/>
        </parameter>
        <parameter name="function" transfer-ownership="none" scope="notified" closure="4" destroy="5">
          <type name="GLib.UnixFDSourceFunc" c:type="GUnixFDSourceFunc"/>
        </parameter>
        <parameter name="user_data" transfer-ownership="none" nullable="1" allow-none="1">
          <type name="gpointer" c:type="gpointer"/>
        </parameter>
        <parameter name="notify" transfer-ownership="none" scope="async">
          <type name="GLib.DestroyNotify" c:type="GDestroyNotify"/>
        </parameter>
      </parameters>
    </function>
    <function name="fd_query_path" c:identifier="g_unix_fd_query_path" throws="1">
      <return-value transfer-ownership="full">
        <type name="utf8" c:type="char*"/>
      </return-value>
      <parameters>
        <parameter name="fd" transfer-ownership="none">
          <type name="gint" c:type="int"/>
        </parameter>
      </parameters>
    </function>
    <function name="fd_source_new" c:identifier="g_unix_fd_source_new">
      <return-value transfer-ownership="full">
        <type name="GLib.Source" c:type="GSource*"/>
      </return-value>
      <parameters>
        <parameter name="fd" transfer-ownership="none">
          <type name="gint" c:type="gint"/>
        </parameter>
        <parameter name="condition" transfer-ownership="none">
          <type name="GLib.IOCondition" c:type="GIOCondition"/>
        </parameter>
      </parameters>
    </function>
    <function name="fdwalk_set_cloexec" c:identifier="g_fdwalk_set_cloexec">
      <return-value transfer-ownership="none">
        <type name="gint" c:type="int"/>
      </return-value>
      <parameters>
        <parameter name="lowfd" transfer-ownership="none">
          <type name="gint" c:type="int"/>
        </parameter>
      </parameters>
    </function>
    <function name="get_passwd_entry" c:identifier="g_unix_get_passwd_entry" throws="1">
      <return-value transfer-ownership="none" nullable="1">
        <type name="gpointer" c:type="passwd*"/>
      </return-value>
      <parameters>
        <parameter name="user_name" transfer-ownership="none">
          <type name="utf8" c:type="const gchar*"/>
        </parameter>
      </parameters>
    </function>
    <function name="open_pipe" c:identifier="g_unix_open_pipe" throws="1">
      <return-value transfer-ownership="none">
        <type name="gboolean" c:type="gboolean"/>
      </return-value>
      <parameters>
        <parameter name="fds" transfer-ownership="none">
          <type name="gint" c:type="gint*"/>
        </parameter>
        <parameter name="flags" transfer-ownership="none">
          <type name="gint" c:type="gint"/>
        </parameter>
      </parameters>
    </function>
    <function name="set_fd_nonblocking" c:identifier="g_unix_set_fd_nonblocking" throws="1">
      <return-value transfer-ownership="none">
        <type name="gboolean" c:type="gboolean"/>
      </return-value>
      <parameters>
        <parameter name="fd" transfer-ownership="none">
          <type name="gint" c:type="gint"/>
        </parameter>
        <parameter name="nonblock" transfer-ownership="none">
          <type name="gboolean" c:type="gboolean"/>
        </parameter>
      </parameters>
    </function>
    <function name="signal_add" c:identifier="g_unix_signal_add" introspectable="0">
      <return-value transfer-ownership="none">
        <type name="guint" c:type="guint"/>
      </return-value>
      <parameters>
        <parameter name="signum" transfer-ownership="none">
          <type name="gint" c:type="gint"/>
        </parameter>
        <parameter name="handler" transfer-ownership="none" closure="2">
          <type name="GLib.SourceFunc" c:type="GSourceFunc"/>
        </parameter>
        <parameter name="user_data" transfer-ownership="none" nullable="1" allow-none="1">
          <type name="gpointer" c:type="gpointer"/>
        </parameter>
      </parameters>
    </function>
    <function name="signal_add_full" c:identifier="g_unix_signal_add_full">
      <return-value transfer-ownership="none">
        <type name="guint" c:type="guint"/>
      </return-value>
      <parameters>
        <parameter name="priority" transfer-ownership="none">
          <type name="gint" c:type="gint"/>
        </parameter>
        <parameter name="signum" transfer-ownership="none">
          <type name="gint" c:type="gint"/>
        </parameter>
        <parameter name="handler" transfer-ownership="none" scope="notified" closure="3" destroy="4">
          <type name="GLib.SourceFunc" c:type="GSourceFunc"/>
        </parameter>
        <parameter name="user_data" transfer-ownership="none" nullable="1" allow-none="1">
          <type name="gpointer" c:type="gpointer"/>
        </parameter>
        <parameter name="notify" transfer-ownership="none" scope="async">
          <type name="GLib.DestroyNotify" c:type="GDestroyNotify"/>
        </parameter>
      </parameters>
    </function>
    <function name="signal_source_new" c:identifier="g_unix_signal_source_new">
      <return-value transfer-ownership="full">
        <type name="GLib.Source" c:type="GSource*"/>
      </return-value>
      <parameters>
        <parameter name="signum" transfer-ownership="none">
          <type name="gint" c:type="gint"/>
        </parameter>
      </parameters>
    </function>
  </namespace>
</repository>
