Commit 43a593b5 authored by David Herrmann's avatar David Herrmann

Initial import

Import initial libgudev from systemd-218. This includes the libgudev
sources, the introspection data and gtk-doc reference documentation.
parents
*.a
*.cache
*.gir
*.html
*.la
*.lo
*.log
*.o
*.plist
*.pyc
*.stamp
*.swp
*.trs
*.typelib
*~
.deps/
.dirstamp
.libs/
/*.gcda
/*.gcno
/*.tar.bz2
/*.tar.gz
/*.tar.xz
/Makefile
/Makefile.in
/aclocal.m4
/build-aux/
/config.h
/config.h.in
/config.log
/config.status
/configure
/gtk-doc.make
/gudev/gudevenumtypes.h
/gudev/gudevenumtypes.c
/gudev/gudevmarshal.h
/gudev/gudevmarshal.c
/gudev-1.0.pc
/libtool
/m4/
/stamp-*
# ------------------------------------------------------------------------------
# Common variables
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AUTOMAKE_OPTIONS = color-tests parallel-tests
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
SUBDIRS = .
lib_LTLIBRARIES =
noinst_DATA =
MANPAGES =
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST =
BUILT_SOURCES =
GCC_COLORS ?= 'ooh, shiny!'
export GCC_COLORS
# remove targets if the command fails
.DELETE_ON_ERROR:
# keep intermediate files
.SECONDARY:
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
AM_MAKEFLAGS = --no-print-directory
AM_CPPFLAGS =
AM_CFLAGS =
# ------------------------------------------------------------------------------
# Version numbers
LIBGUDEV_CURRENT=2
LIBGUDEV_REVISION=0
LIBGUDEV_AGE=2
# ------------------------------------------------------------------------------
# libgudev
libgudev_includedir = $(includedir)/gudev-1.0/gudev
libgudev_include_HEADERS = \
gudev/gudev.h \
gudev/gudevenums.h \
gudev/gudevenumtypes.h \
gudev/gudevtypes.h \
gudev/gudevclient.h \
gudev/gudevdevice.h \
gudev/gudevenumerator.h
lib_LTLIBRARIES += \
libgudev-1.0.la
pkgconfig_DATA += \
gudev-1.0.pc
EXTRA_DIST += \
gudev-1.0.pc.in \
gudev/gudevmarshal.list \
gudev/gudevenumtypes.h.template \
gudev/gudevenumtypes.c.template \
scripts/gjs-example.js \
scripts/seed-example-enum.js \
scripts/seed-example.js
libgudev_1_0_la_SOURCES = \
libgudev-1.0.sym \
gudev/gudevenums.h \
gudev/gudevenumtypes.h \
gudev/gudevenumtypes.h\
gudev/gudevtypes.h \
gudev/gudevclient.h \
gudev/gudevclient.c \
gudev/gudevdevice.h \
gudev/gudevdevice.c \
gudev/gudevenumerator.h \
gudev/gudevenumerator.c \
gudev/gudevprivate.h
nodist_libgudev_1_0_la_SOURCES = \
gudev/gudevmarshal.h \
gudev/gudevmarshal.c \
gudev/gudevenumtypes.h \
gudev/gudevenumtypes.c
BUILT_SOURCES += \
$(nodist_libgudev_1_0_la_SOURCES)
libgudev_1_0_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_builddir)/gudev \
-I$(top_srcdir)/gudev \
-D_POSIX_PTHREAD_SEMANTICS \
-D_REENTRANT \
-D_GUDEV_COMPILATION \
-DG_LOG_DOMAIN=\"GUdev\"
libgudev_1_0_la_CFLAGS = \
$(AM_CFLAGS) \
-fvisibility=default \
$(LIBUDEV_CFLAGS) \
$(GLIB_CFLAGS)
libgudev_1_0_la_LIBADD = \
$(LIBUDEV_LIBS) \
$(GLIB_LIBS)
libgudev_1_0_la_LDFLAGS = \
$(AM_LDFLAGS) \
-version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
-export-dynamic \
-no-undefined \
-Wl,--version-script=$(top_srcdir)/libgudev-1.0.sym
gudev/gudevmarshal.h: gudev/gudevmarshal.list
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
gudev/gudevmarshal.c: gudev/gudevmarshal.list
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)echo '#include "gudevmarshal.h"' > $@ && \
glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
gudev/gudevenumtypes.%: gudev/gudevenumtypes.%.template gudev/gudevenums.h
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)glib-mkenums --template $^ > $@
if HAVE_INTROSPECTION
-include $(INTROSPECTION_MAKEFILE)
gudev/GUdev-1.0.gir: libgudev-1.0.la
gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
gudev_GUdev_1_0_gir_CFLAGS = \
$(AM_CFLAGS) \
$(INCLUDES) \
-D_GUDEV_COMPILATION \
-D_GUDEV_WORK_AROUND_DEV_T_BUG \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/gudev \
-I$(top_builddir)/gudev
gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
gudev_GUdev_1_0_gir_SCANNERFLAGS = \
--pkg-export=gudev-1.0 \
--warn-all
gudev_GUdev_1_0_gir_FILES = \
gudev/gudev.h \
gudev/gudevtypes.h \
gudev/gudevenums.h \
gudev/gudevenumtypes.h \
gudev/gudevclient.h \
gudev/gudevdevice.h \
gudev/gudevenumerator.h \
gudev/gudevclient.c \
gudev/gudevdevice.c \
gudev/gudevenumerator.c
INTROSPECTION_GIRS = gudev/GUdev-1.0.gir
INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
girdir = $(datadir)/gir-1.0
gir_DATA = \
gudev/GUdev-1.0.gir
typelibsdir = $(libdir)/girepository-1.0
typelibs_DATA = \
gudev/GUdev-1.0.typelib
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
endif # HAVE_INTROSPECTION
# ------------------------------------------------------------------------------
# docs
if ENABLE_GTK_DOC
SUBDIRS += docs
endif
#docs/html:
# $(AM_V_at)$(MKDIR_P) $(dir $@)
# $(AM_V_LN)$(LN_S) -f ../gudev/html $@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
which gnome-autogen.sh || {
echo "You need to install gnome-common from the GNOME git"
exit 1
}
git submodule update --init --recursive
REQUIRED_AUTOCONF_VERSION=2.64
REQUIRED_AUTOMAKE_VERSION=1.11
REQUIRED_INTLTOOL_VERSION=0.40.0
REQUIRED_PKG_CONFIG_VERSION=0.22
. gnome-autogen.sh
AC_PREREQ([2.64])
AC_INIT([libgudev],
[220],
[http://bugzilla.gnome.org/enter_bug.cgi?product=gudev],
[libgudev],
[https://developer.gnome.org/gudev])
AC_CONFIG_SRCDIR([gudev/gudev.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AM_MAINTAINER_MODE([enable])
AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects parallel-tests])
AM_SILENT_RULES([yes])
AC_CANONICAL_HOST
LT_PREREQ([2.2])
LT_INIT([disable-static])
AC_PROG_MKDIR_P
AC_PROG_LN_S
AC_PROG_SED
AC_PROG_GREP
AC_PROG_AWK
AC_PROG_CC_C99
PKG_PROG_PKG_CONFIG
# gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
m4_ifdef([GTK_DOC_CHECK], [
GTK_DOC_CHECK([1.18],[--flavour no-tmpl])],
[AM_CONDITIONAL([ENABLE_GTK_DOC], [false])
enable_gtk_doc=no])
m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
GOBJECT_INTROSPECTION_CHECK([1.31.1])
], [
AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
enable_introspection=no])
PKG_CHECK_MODULES([LIBUDEV], [libudev >= 218])
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0 gio-2.0])
AC_CONFIG_FILES([
Makefile
gudev-1.0.pc
docs/Makefile
docs/version.xml
])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE_NAME $VERSION
gintrospection: ${enable_introspection}
gtk-doc: ${enable_gtk_doc}
prefix: ${prefix}
exec_prefix: ${exec_prefix}
includedir: ${includedir}
libdir: ${libdir}
CFLAGS: ${CFLAGS}
CPPFLAGS: ${CPPFLAGS}
LDFLAGS: ${LDFLAGS}
])
/*.txt
/Makefile
/Makefile.in
/gudev.args
/gudev.hierarchy
/gudev.interfaces
/gudev.prerequisites
/gudev.signals
/html/
/tmpl/
/version.xml
/xml/
## Process this file with automake to produce Makefile.in
# We require automake 1.10 at least.
AUTOMAKE_OPTIONS = 1.10 color-tests
# This is a blank Makefile.am for using gtk-doc.
# Copy this to your project's API docs directory and modify the variables to
# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
# of using the various options.
# The name of the module, e.g. 'glib'.
DOC_MODULE=gudev
# Uncomment for versioned docs and specify the version of the module, e.g. '2'.
#DOC_MODULE_VERSION=2
# The top-level SGML file. You can change this if you want to.
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
# The directory containing the source code. Relative to $(srcdir).
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting the functions and macros.
# e.g. DOC_SOURCE_DIR=../../../gtk
DOC_SOURCE_DIR=$(top_srcdir)/gudev $(top_builddir)/gudev
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS=
# Extra options to supply to gtkdoc-scan.
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
SCAN_OPTIONS=
# Extra options to supply to gtkdoc-mkdb.
# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
MKDB_OPTIONS=--xml-mode --output-format=xml --name-space=g_udev
# Extra options to supply to gtkdoc-mktmpl
# e.g. MKTMPL_OPTIONS=--only-section-tmpl
MKTMPL_OPTIONS=
# Extra options to supply to gtkdoc-mkhtml
MKHTML_OPTIONS=--path=$(abs_srcdir) --path=$(abs_builddir)
# Extra options to supply to gtkdoc-fixref. Not normally needed.
# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
FIXXREF_OPTIONS=>/dev/null 2>&1
# Used for dependencies. The docs will be rebuilt if any of these change.
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
HFILE_GLOB=$(top_srcdir)/gudev/*.h
CFILE_GLOB=$(top_srcdir)/gudev/*.c
# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
EXTRA_HFILES=
# Header files to ignore when scanning. Use base file name, no paths
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
IGNORE_HFILES=gudevenumtypes.h gudevmarshal.h
# Images to copy into HTML directory.
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
HTML_IMAGES=
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
content_files = version.xml
# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
# These files must be listed here *and* in content_files
# e.g. expand_content_files=running.sgml
expand_content_files=
# Hack, hack. You silly gtk-doc, you must not add CFLAGS multiple
# times when calling gcc; it surely can not work with options that must
# be listed only once.
# Kill CFLAGS here because gtk-doc thinks adding CFLAGS to CC _and_ also
# adding CFLAGS itself again would work.
override CFLAGS=
override LDFLAGS=
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
# Only needed if you are using gtkdoc-scangobj to dynamically query widget
# signals and properties.
# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
GTKDOC_CFLAGS = \
$(GLIB_CFLAGS) \
-I$(top_srcdir)/gudev \
-I$(top_builddir)/gudev
GTKDOC_LIBS = \
$(GLIB_LIBS) \
$(top_builddir)/libgudev-1.0.la
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
# e.g. EXTRA_DIST += version.xml.in
EXTRA_DIST += version.xml.in
# Files not to distribute
# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
#DISTCLEANFILES +=
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
<!ENTITY version SYSTEM "version.xml">
]>
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
<title>GUdev Reference Manual</title>
<releaseinfo>
For version &version; — the latest version of this
documentation can be found at
<ulink role="online-location" url="https://developer.gnome.org/gudev">
https://developer.gnome.org/gudev
</ulink>.
</releaseinfo>
<copyright>
<year>2009-2015</year>
<holder>David Zeuthen &lt;davidz@redhat.com&gt;</holder>
<holder>Bastien Nocera &lt;hadess@hadess.net&gt;</holder>
<holder>David Herrmann &lt;dh.herrmann@gmail.com&gt;</holder>
</copyright>
</bookinfo>
<chapter id="ref-API">
<title>API Reference</title>
<xi:include href="xml/gudevclient.xml"/>
<xi:include href="xml/gudevdevice.xml"/>
<xi:include href="xml/gudevenumerator.xml"/>
</chapter>
<chapter id="gudev-hierarchy">
<title>Object Hierarchy</title>
<xi:include href="xml/tree_index.sgml"/>
</chapter>
<index id="api-index-full">
<title>API Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
<index role="165">
<title>Index of new symbols in 165</title>
<xi:include href="xml/api-index-165.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-deprecated" role="deprecated">
<title>Index of deprecated API</title>
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</book>
<SECTION>
<FILE>gudevclient</FILE>
<TITLE>GUdevClient</TITLE>
GUdevClient
GUdevClientClass
GUdevDeviceType
GUdevDeviceNumber
g_udev_client_new
g_udev_client_query_by_subsystem
g_udev_client_query_by_device_number
g_udev_client_query_by_device_file
g_udev_client_query_by_sysfs_path
g_udev_client_query_by_subsystem_and_name
<SUBSECTION Standard>
G_UDEV_CLIENT
G_UDEV_IS_CLIENT
G_UDEV_TYPE_CLIENT
g_udev_client_get_type
G_UDEV_CLIENT_CLASS
G_UDEV_IS_CLIENT_CLASS
G_UDEV_CLIENT_GET_CLASS
<SUBSECTION Private>
GUdevClientPrivate
</SECTION>
<SECTION>
<FILE>gudevdevice</FILE>
<TITLE>GUdevDevice</TITLE>
GUdevDevice
GUdevDeviceClass
g_udev_device_get_subsystem
g_udev_device_get_devtype
g_udev_device_get_name
g_udev_device_get_number
g_udev_device_get_sysfs_path
g_udev_device_get_driver
g_udev_device_get_action
g_udev_device_get_seqnum
g_udev_device_get_device_type
g_udev_device_get_device_number
g_udev_device_get_device_file
g_udev_device_get_device_file_symlinks
g_udev_device_get_parent
g_udev_device_get_parent_with_subsystem
g_udev_device_get_tags
g_udev_device_get_is_initialized
g_udev_device_get_usec_since_initialized
g_udev_device_get_property_keys
g_udev_device_has_property
g_udev_device_get_property
g_udev_device_get_property_as_int
g_udev_device_get_property_as_uint64
g_udev_device_get_property_as_double
g_udev_device_get_property_as_boolean
g_udev_device_get_property_as_strv
g_udev_device_get_sysfs_attr_keys
g_udev_device_has_sysfs_attr
g_udev_device_get_sysfs_attr
g_udev_device_get_sysfs_attr_as_int
g_udev_device_get_sysfs_attr_as_uint64
g_udev_device_get_sysfs_attr_as_double
g_udev_device_get_sysfs_attr_as_boolean
g_udev_device_get_sysfs_attr_as_strv
<SUBSECTION Standard>
G_UDEV_DEVICE
G_UDEV_IS_DEVICE
G_UDEV_TYPE_DEVICE
g_udev_device_get_type
G_UDEV_DEVICE_CLASS
G_UDEV_IS_DEVICE_CLASS
G_UDEV_DEVICE_GET_CLASS
<SUBSECTION Private>
GUdevDevicePrivate
</SECTION>
<SECTION>
<FILE>gudevenumerator</FILE>
<TITLE>GUdevEnumerator</TITLE>
GUdevEnumerator
GUdevEnumeratorClass
g_udev_enumerator_new
g_udev_enumerator_add_match_subsystem
g_udev_enumerator_add_nomatch_subsystem
g_udev_enumerator_add_match_sysfs_attr
g_udev_enumerator_add_nomatch_sysfs_attr
g_udev_enumerator_add_match_property
g_udev_enumerator_add_match_name
g_udev_enumerator_add_match_tag
g_udev_enumerator_add_match_is_initialized
g_udev_enumerator_add_sysfs_path
g_udev_enumerator_execute
<SUBSECTION Standard>
G_UDEV_ENUMERATOR
G_UDEV_IS_ENUMERATOR
G_UDEV_TYPE_ENUMERATOR
g_udev_enumerator_get_type
G_UDEV_ENUMERATOR_CLASS
G_UDEV_IS_ENUMERATOR_CLASS
G_UDEV_ENUMERATOR_GET_CLASS
<SUBSECTION Private>
GUdevEnumeratorPrivate
</SECTION>
g_udev_device_type_get_type
g_udev_device_get_type
g_udev_client_get_type
g_udev_enumerator_get_type
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: gudev-1.0
Description: GObject bindings for libudev
Version: @VERSION@
Requires: glib-2.0, gobject-2.0
Libs: -L${libdir} -lgudev-1.0
Cflags: -I${includedir}/gudev-1.0
/* -*- Mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2008 David Zeuthen <davidz@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __G_UDEV_H__
#define __G_UDEV_H__
#define _GUDEV_INSIDE_GUDEV_H
#include <gudev/gudevenums.h>
#include <gudev/gudevenumtypes.h>
#include <gudev/gudevtypes.h>
#include <gudev/gudevclient.h>
#include <gudev/gudevdevice.h>
#include <gudev/gudevenumerator.h>
#undef _GUDEV_INSIDE_GUDEV_H
#endif /* __G_UDEV_H__ */
/* -*- Mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2008-2010 David Zeuthen <davidz@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include "gudevclient.h"
#include "gudevdevice.h"
#include "gudevmarshal.h"
#include "gudevprivate.h"
/**
* SECTION:gudevclient
* @short_description: Query devices and listen to uevents
*
* #GUdevClient is used to query information about devices on a Linux
* system from the Linux kernel and the udev device
* manager.
*
* Device information is retrieved from the kernel (through the
* <literal>sysfs</literal> filesystem) and the udev daemon (through a
* <literal>tmpfs</literal> filesystem) and presented through
* #GUdevDevice objects. This means that no blocking IO ever happens
* (in both cases, we are essentially just reading data from kernel
* memory) and as such there are no asynchronous versions of the
* provided methods.
*
* To get #GUdevDevice objects, use
* g_udev_client_query_by_subsystem(),
* g_udev_client_query_by_device_number(),
* g_udev_client_query_by_device_file(),
* g_udev_client_query_by_sysfs_path(),
* g_udev_client_query_by_subsystem_and_name()
* or the #GUdevEnumerator type.
*
* To listen to uevents, connect to the #GUdevClient::uevent signal.
*/
struct _GUdevClientPrivate
{
GSource *watch_source;
struct udev *udev;
struct udev_monitor *monitor;
gchar **subsystems;
};
enum
{
PROP_0,
PROP_SUBSYSTEMS,
};
enum
{
UEVENT_SIGNAL,
LAST_SIGNAL,
};
static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GUdevClient, g_udev_client, G_TYPE_OBJECT)
/* ---------------------------------------------------------------------------------------------------- */
static gboolean
monitor_event (GIOChannel *source,
GIOCondition condition,
gpointer data)
{
GUdevClient *client = (GUdevClient *) data;
GUdevDevice *device;
struct udev_device *udevice;
if (client->priv->monitor == NULL)
goto out;
udevice = udev_monitor_receive_device (client->priv->monitor);
if (udevice == NULL)
goto out;
device = _g_udev_device_new (udevice);
udev_device_unref (udevice);
g_signal_emit (client,
signals[UEVENT_SIGNAL],
0,
g_udev_device_get_action (device),
device);
g_object_unref (device);
out:
return TRUE;
}
static void
g_udev_client_finalize (GObject *object)
{
GUdevClient *client = G_UDEV_CLIENT (object);
if (client->priv->watch_source != NULL)
{
g_source_destroy (client->priv->watch_source);
client->priv->watch_source = NULL;
}
if (client->priv->monitor != NULL)
{
udev_monitor_unref (client->priv->monitor);
client->priv->monitor