From 2a9dff08f61002f495f3a55ace168e21fc249902 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 18 Jan 2010 13:06:07 +0000 Subject: trivial: convert freebsd private object to using upower prefix (no ABI or API changes) --- src/freebsd/up-acpi-native.c | 146 ++++++++++++++++++++-------------------- src/freebsd/up-acpi-native.h | 46 ++++++------- src/freebsd/up-acpi-native.vala | 6 +- src/freebsd/up-backend-acpi.h | 4 +- src/freebsd/up-backend.c | 36 +++++----- src/freebsd/up-devd.c | 58 ++++++++-------- src/freebsd/up-devd.h | 12 ++-- src/freebsd/up-device-supply.c | 38 +++++------ src/freebsd/up-native.c | 6 +- src/freebsd/up-util.c | 14 ++-- src/freebsd/up-util.h | 20 +++--- 11 files changed, 193 insertions(+), 193 deletions(-) (limited to 'src/freebsd') diff --git a/src/freebsd/up-acpi-native.c b/src/freebsd/up-acpi-native.c index c6b4968..eb58db5 100644 --- a/src/freebsd/up-acpi-native.c +++ b/src/freebsd/up-acpi-native.c @@ -1,5 +1,5 @@ -/* dkp-acpi-native.c generated by valac, the Vala compiler - * generated from dkp-acpi-native.vala, do not modify */ +/* up-acpi-native.c generated by valac, the Vala compiler + * generated from up-acpi-native.vala, do not modify */ #include @@ -8,69 +8,69 @@ #include -#define TYPE_DKP_ACPI_NATIVE (dkp_acpi_native_get_type ()) -#define DKP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DKP_ACPI_NATIVE, DkpAcpiNative)) -#define DKP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DKP_ACPI_NATIVE, DkpAcpiNativeClass)) -#define IS_DKP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DKP_ACPI_NATIVE)) -#define IS_DKP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DKP_ACPI_NATIVE)) -#define DKP_ACPI_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DKP_ACPI_NATIVE, DkpAcpiNativeClass)) +#define TYPE_UP_ACPI_NATIVE (up_acpi_native_get_type ()) +#define UP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UP_ACPI_NATIVE, UpAcpiNative)) +#define UP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UP_ACPI_NATIVE, UpAcpiNativeClass)) +#define IS_UP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UP_ACPI_NATIVE)) +#define IS_UP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UP_ACPI_NATIVE)) +#define UP_ACPI_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UP_ACPI_NATIVE, UpAcpiNativeClass)) -typedef struct _DkpAcpiNative DkpAcpiNative; -typedef struct _DkpAcpiNativeClass DkpAcpiNativeClass; -typedef struct _DkpAcpiNativePrivate DkpAcpiNativePrivate; +typedef struct _UpAcpiNative UpAcpiNative; +typedef struct _UpAcpiNativeClass UpAcpiNativeClass; +typedef struct _UpAcpiNativePrivate UpAcpiNativePrivate; #define _g_free0(var) (var = (g_free (var), NULL)) #define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL))) #define _g_match_info_free0(var) ((var == NULL) ? NULL : (var = (g_match_info_free (var), NULL))) #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) -struct _DkpAcpiNative { +struct _UpAcpiNative { GObject parent_instance; - DkpAcpiNativePrivate * priv; + UpAcpiNativePrivate * priv; }; -struct _DkpAcpiNativeClass { +struct _UpAcpiNativeClass { GObjectClass parent_class; }; -struct _DkpAcpiNativePrivate { +struct _UpAcpiNativePrivate { gchar *_driver; gint _unit; gchar *_path; }; -static gpointer dkp_acpi_native_parent_class = NULL; +static gpointer up_acpi_native_parent_class = NULL; -GType dkp_acpi_native_get_type (void); -#define DKP_ACPI_NATIVE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DKP_ACPI_NATIVE, DkpAcpiNativePrivate)) +GType up_acpi_native_get_type (void); +#define UP_ACPI_NATIVE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_UP_ACPI_NATIVE, UpAcpiNativePrivate)) enum { - DKP_ACPI_NATIVE_DUMMY_PROPERTY, - DKP_ACPI_NATIVE_DRIVER, - DKP_ACPI_NATIVE_UNIT, - DKP_ACPI_NATIVE_PATH + UP_ACPI_NATIVE_DUMMY_PROPERTY, + UP_ACPI_NATIVE_DRIVER, + UP_ACPI_NATIVE_UNIT, + UP_ACPI_NATIVE_PATH }; -DkpAcpiNative* dkp_acpi_native_new (const char* path); -DkpAcpiNative* dkp_acpi_native_construct (GType object_type, const char* path); -DkpAcpiNative* dkp_acpi_native_new_driver_unit (const char* driver, gint unit); -DkpAcpiNative* dkp_acpi_native_construct_driver_unit (GType object_type, const char* driver, gint unit); -const char* dkp_acpi_native_get_driver (DkpAcpiNative* self); -gint dkp_acpi_native_get_unit (DkpAcpiNative* self); -const char* dkp_acpi_native_get_path (DkpAcpiNative* self); -static void dkp_acpi_native_finalize (GObject* obj); -static void dkp_acpi_native_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +UpAcpiNative* up_acpi_native_new (const char* path); +UpAcpiNative* up_acpi_native_construct (GType object_type, const char* path); +UpAcpiNative* up_acpi_native_new_driver_unit (const char* driver, gint unit); +UpAcpiNative* up_acpi_native_construct_driver_unit (GType object_type, const char* driver, gint unit); +const char* up_acpi_native_get_driver (UpAcpiNative* self); +gint up_acpi_native_get_unit (UpAcpiNative* self); +const char* up_acpi_native_get_path (UpAcpiNative* self); +static void up_acpi_native_finalize (GObject* obj); +static void up_acpi_native_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); -DkpAcpiNative* dkp_acpi_native_construct (GType object_type, const char* path) { +UpAcpiNative* up_acpi_native_construct (GType object_type, const char* path) { GError * _inner_error_; - DkpAcpiNative * self; + UpAcpiNative * self; GRegex* r; GMatchInfo* mi; gboolean ret = FALSE; char* _tmp9_; g_return_val_if_fail (path != NULL, NULL); _inner_error_ = NULL; - self = (DkpAcpiNative*) g_object_new (object_type, NULL); + self = (UpAcpiNative*) g_object_new (object_type, NULL); r = NULL; mi = NULL; { @@ -128,17 +128,17 @@ DkpAcpiNative* dkp_acpi_native_construct (GType object_type, const char* path) { } -DkpAcpiNative* dkp_acpi_native_new (const char* path) { - return dkp_acpi_native_construct (TYPE_DKP_ACPI_NATIVE, path); +UpAcpiNative* up_acpi_native_new (const char* path) { + return up_acpi_native_construct (TYPE_UP_ACPI_NATIVE, path); } -DkpAcpiNative* dkp_acpi_native_construct_driver_unit (GType object_type, const char* driver, gint unit) { - DkpAcpiNative * self; +UpAcpiNative* up_acpi_native_construct_driver_unit (GType object_type, const char* driver, gint unit) { + UpAcpiNative * self; char* _tmp0_; char* _tmp1_; g_return_val_if_fail (driver != NULL, NULL); - self = (DkpAcpiNative*) g_object_new (object_type, NULL); + self = (UpAcpiNative*) g_object_new (object_type, NULL); self->priv->_driver = (_tmp0_ = g_strdup (driver), _g_free0 (self->priv->_driver), _tmp0_); self->priv->_unit = unit; self->priv->_path = (_tmp1_ = g_strdup_printf ("dev.%s.%i", self->priv->_driver, self->priv->_unit), _g_free0 (self->priv->_path), _tmp1_); @@ -146,12 +146,12 @@ DkpAcpiNative* dkp_acpi_native_construct_driver_unit (GType object_type, const c } -DkpAcpiNative* dkp_acpi_native_new_driver_unit (const char* driver, gint unit) { - return dkp_acpi_native_construct_driver_unit (TYPE_DKP_ACPI_NATIVE, driver, unit); +UpAcpiNative* up_acpi_native_new_driver_unit (const char* driver, gint unit) { + return up_acpi_native_construct_driver_unit (TYPE_UP_ACPI_NATIVE, driver, unit); } -const char* dkp_acpi_native_get_driver (DkpAcpiNative* self) { +const char* up_acpi_native_get_driver (UpAcpiNative* self) { const char* result; g_return_val_if_fail (self != NULL, NULL); result = self->priv->_driver; @@ -159,7 +159,7 @@ const char* dkp_acpi_native_get_driver (DkpAcpiNative* self) { } -gint dkp_acpi_native_get_unit (DkpAcpiNative* self) { +gint up_acpi_native_get_unit (UpAcpiNative* self) { gint result; g_return_val_if_fail (self != NULL, 0); result = self->priv->_unit; @@ -167,7 +167,7 @@ gint dkp_acpi_native_get_unit (DkpAcpiNative* self) { } -const char* dkp_acpi_native_get_path (DkpAcpiNative* self) { +const char* up_acpi_native_get_path (UpAcpiNative* self) { const char* result; g_return_val_if_fail (self != NULL, NULL); result = self->priv->_path; @@ -175,53 +175,53 @@ const char* dkp_acpi_native_get_path (DkpAcpiNative* self) { } -static void dkp_acpi_native_class_init (DkpAcpiNativeClass * klass) { - dkp_acpi_native_parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (DkpAcpiNativePrivate)); - G_OBJECT_CLASS (klass)->get_property = dkp_acpi_native_get_property; - G_OBJECT_CLASS (klass)->finalize = dkp_acpi_native_finalize; - g_object_class_install_property (G_OBJECT_CLASS (klass), DKP_ACPI_NATIVE_DRIVER, g_param_spec_string ("driver", "driver", "driver", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - g_object_class_install_property (G_OBJECT_CLASS (klass), DKP_ACPI_NATIVE_UNIT, g_param_spec_int ("unit", "unit", "unit", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - g_object_class_install_property (G_OBJECT_CLASS (klass), DKP_ACPI_NATIVE_PATH, g_param_spec_string ("path", "path", "path", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +static void up_acpi_native_class_init (UpAcpiNativeClass * klass) { + up_acpi_native_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (UpAcpiNativePrivate)); + G_OBJECT_CLASS (klass)->get_property = up_acpi_native_get_property; + G_OBJECT_CLASS (klass)->finalize = up_acpi_native_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), UP_ACPI_NATIVE_DRIVER, g_param_spec_string ("driver", "driver", "driver", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), UP_ACPI_NATIVE_UNIT, g_param_spec_int ("unit", "unit", "unit", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), UP_ACPI_NATIVE_PATH, g_param_spec_string ("path", "path", "path", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); } -static void dkp_acpi_native_instance_init (DkpAcpiNative * self) { - self->priv = DKP_ACPI_NATIVE_GET_PRIVATE (self); +static void up_acpi_native_instance_init (UpAcpiNative * self) { + self->priv = UP_ACPI_NATIVE_GET_PRIVATE (self); } -static void dkp_acpi_native_finalize (GObject* obj) { - DkpAcpiNative * self; - self = DKP_ACPI_NATIVE (obj); +static void up_acpi_native_finalize (GObject* obj) { + UpAcpiNative * self; + self = UP_ACPI_NATIVE (obj); _g_free0 (self->priv->_driver); _g_free0 (self->priv->_path); - G_OBJECT_CLASS (dkp_acpi_native_parent_class)->finalize (obj); + G_OBJECT_CLASS (up_acpi_native_parent_class)->finalize (obj); } -GType dkp_acpi_native_get_type (void) { - static GType dkp_acpi_native_type_id = 0; - if (dkp_acpi_native_type_id == 0) { - static const GTypeInfo g_define_type_info = { sizeof (DkpAcpiNativeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dkp_acpi_native_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DkpAcpiNative), 0, (GInstanceInitFunc) dkp_acpi_native_instance_init, NULL }; - dkp_acpi_native_type_id = g_type_register_static (G_TYPE_OBJECT, "DkpAcpiNative", &g_define_type_info, 0); +GType up_acpi_native_get_type (void) { + static GType up_acpi_native_type_id = 0; + if (up_acpi_native_type_id == 0) { + static const GTypeInfo g_define_type_info = { sizeof (UpAcpiNativeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) up_acpi_native_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UpAcpiNative), 0, (GInstanceInitFunc) up_acpi_native_instance_init, NULL }; + up_acpi_native_type_id = g_type_register_static (G_TYPE_OBJECT, "UpAcpiNative", &g_define_type_info, 0); } - return dkp_acpi_native_type_id; + return up_acpi_native_type_id; } -static void dkp_acpi_native_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - DkpAcpiNative * self; - self = DKP_ACPI_NATIVE (object); +static void up_acpi_native_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + UpAcpiNative * self; + self = UP_ACPI_NATIVE (object); switch (property_id) { - case DKP_ACPI_NATIVE_DRIVER: - g_value_set_string (value, dkp_acpi_native_get_driver (self)); + case UP_ACPI_NATIVE_DRIVER: + g_value_set_string (value, up_acpi_native_get_driver (self)); break; - case DKP_ACPI_NATIVE_UNIT: - g_value_set_int (value, dkp_acpi_native_get_unit (self)); + case UP_ACPI_NATIVE_UNIT: + g_value_set_int (value, up_acpi_native_get_unit (self)); break; - case DKP_ACPI_NATIVE_PATH: - g_value_set_string (value, dkp_acpi_native_get_path (self)); + case UP_ACPI_NATIVE_PATH: + g_value_set_string (value, up_acpi_native_get_path (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); diff --git a/src/freebsd/up-acpi-native.h b/src/freebsd/up-acpi-native.h index 987e330..2128e5d 100644 --- a/src/freebsd/up-acpi-native.h +++ b/src/freebsd/up-acpi-native.h @@ -1,8 +1,8 @@ -/* dkp-acpi-native.h generated by valac, the Vala compiler, do not modify */ +/* up-acpi-native.h generated by valac, the Vala compiler, do not modify */ -#ifndef __DKP_ACPI_NATIVE_H__ -#define __DKP_ACPI_NATIVE_H__ +#ifndef __UP_ACPI_NATIVE_H__ +#define __UP_ACPI_NATIVE_H__ #include #include @@ -12,35 +12,35 @@ G_BEGIN_DECLS -#define TYPE_DKP_ACPI_NATIVE (dkp_acpi_native_get_type ()) -#define DKP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DKP_ACPI_NATIVE, DkpAcpiNative)) -#define DKP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DKP_ACPI_NATIVE, DkpAcpiNativeClass)) -#define IS_DKP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DKP_ACPI_NATIVE)) -#define IS_DKP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DKP_ACPI_NATIVE)) -#define DKP_ACPI_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DKP_ACPI_NATIVE, DkpAcpiNativeClass)) +#define TYPE_UP_ACPI_NATIVE (up_acpi_native_get_type ()) +#define UP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UP_ACPI_NATIVE, UpAcpiNative)) +#define UP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UP_ACPI_NATIVE, UpAcpiNativeClass)) +#define IS_UP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UP_ACPI_NATIVE)) +#define IS_UP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UP_ACPI_NATIVE)) +#define UP_ACPI_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UP_ACPI_NATIVE, UpAcpiNativeClass)) -typedef struct _DkpAcpiNative DkpAcpiNative; -typedef struct _DkpAcpiNativeClass DkpAcpiNativeClass; -typedef struct _DkpAcpiNativePrivate DkpAcpiNativePrivate; +typedef struct _UpAcpiNative UpAcpiNative; +typedef struct _UpAcpiNativeClass UpAcpiNativeClass; +typedef struct _UpAcpiNativePrivate UpAcpiNativePrivate; -struct _DkpAcpiNative { +struct _UpAcpiNative { GObject parent_instance; - DkpAcpiNativePrivate * priv; + UpAcpiNativePrivate * priv; }; -struct _DkpAcpiNativeClass { +struct _UpAcpiNativeClass { GObjectClass parent_class; }; -GType dkp_acpi_native_get_type (void); -DkpAcpiNative* dkp_acpi_native_new (const char* path); -DkpAcpiNative* dkp_acpi_native_construct (GType object_type, const char* path); -DkpAcpiNative* dkp_acpi_native_new_driver_unit (const char* driver, gint unit); -DkpAcpiNative* dkp_acpi_native_construct_driver_unit (GType object_type, const char* driver, gint unit); -const char* dkp_acpi_native_get_driver (DkpAcpiNative* self); -gint dkp_acpi_native_get_unit (DkpAcpiNative* self); -const char* dkp_acpi_native_get_path (DkpAcpiNative* self); +GType up_acpi_native_get_type (void); +UpAcpiNative* up_acpi_native_new (const char* path); +UpAcpiNative* up_acpi_native_construct (GType object_type, const char* path); +UpAcpiNative* up_acpi_native_new_driver_unit (const char* driver, gint unit); +UpAcpiNative* up_acpi_native_construct_driver_unit (GType object_type, const char* driver, gint unit); +const char* up_acpi_native_get_driver (UpAcpiNative* self); +gint up_acpi_native_get_unit (UpAcpiNative* self); +const char* up_acpi_native_get_path (UpAcpiNative* self); G_END_DECLS diff --git a/src/freebsd/up-acpi-native.vala b/src/freebsd/up-acpi-native.vala index 7710798..796d97e 100644 --- a/src/freebsd/up-acpi-native.vala +++ b/src/freebsd/up-acpi-native.vala @@ -1,4 +1,4 @@ -public class DkpAcpiNative : Object { +public class UpAcpiNative : Object { private string? _driver; private int _unit; private string _path; @@ -15,7 +15,7 @@ public class DkpAcpiNative : Object { get { return _path; } } - public DkpAcpiNative (string path) { + public UpAcpiNative (string path) { Regex r; MatchInfo mi; bool ret; @@ -38,7 +38,7 @@ public class DkpAcpiNative : Object { _path = path; } - public DkpAcpiNative.driver_unit (string driver, int unit) { + public UpAcpiNative.driver_unit (string driver, int unit) { _driver = driver; _unit = unit; _path = "dev.%s.%i".printf (_driver, _unit); diff --git a/src/freebsd/up-backend-acpi.h b/src/freebsd/up-backend-acpi.h index 73aaa3f..118fbaa 100644 --- a/src/freebsd/up-backend-acpi.h +++ b/src/freebsd/up-backend-acpi.h @@ -1,6 +1,6 @@ /*************************************************************************** * - * dkp-backend-acpi.h : define some backend objects + * up-backend-acpi.h : define some backend objects * * Copyright (C) 2006, 2009 Joe Marcus Clarke * @@ -27,6 +27,6 @@ #include "up-devd.h" -extern DkpDevdHandler up_backend_acpi_devd_handler; +extern UpDevdHandler up_backend_acpi_devd_handler; #endif /* _UP_BACKEND_ACPI_H */ diff --git a/src/freebsd/up-backend.c b/src/freebsd/up-backend.c index 7118ebd..e34d2c9 100644 --- a/src/freebsd/up-backend.c +++ b/src/freebsd/up-backend.c @@ -55,7 +55,7 @@ static void up_backend_finalize (GObject *object); static gboolean up_backend_refresh_devices (gpointer user_data); static gboolean up_backend_acpi_devd_notify (UpBackend *backend, const gchar *system, const gchar *subsystem, const gchar *type, const gchar *data); -static gboolean up_backend_create_new_device (UpBackend *backend, DkpAcpiNative *native); +static gboolean up_backend_create_new_device (UpBackend *backend, UpAcpiNative *native); static void up_backend_lid_coldplug (UpBackend *backend); static gboolean up_backend_supports_sleep_state (const gchar *state); @@ -83,7 +83,7 @@ static const gchar *handlers[] = { "battery", }; -DkpDevdHandler up_backend_acpi_devd_handler = { +UpDevdHandler up_backend_acpi_devd_handler = { .notify = up_backend_acpi_devd_notify }; @@ -118,13 +118,13 @@ static gboolean up_backend_acpi_devd_notify (UpBackend *backend, const gchar *system, const gchar *subsystem, const gchar *type, const gchar *data) { GObject *object = NULL; - DkpAcpiNative *native = NULL; + UpAcpiNative *native = NULL; if (strcmp (system, "ACPI")) return FALSE; if (!strcmp (subsystem, "ACAD")) { - native = dkp_acpi_native_new ("hw.acpi.acline"); + native = up_acpi_native_new ("hw.acpi.acline"); object = up_device_list_lookup (backend->priv->device_list, G_OBJECT (native)); } else if (!strcmp (subsystem, "CMBAT")) { gchar *ptr; @@ -133,7 +133,7 @@ up_backend_acpi_devd_notify (UpBackend *backend, const gchar *system, const gcha ptr = strstr (type, ".BAT"); if (ptr != NULL && sscanf (ptr, ".BAT%i", &unit)) { - native = dkp_acpi_native_new_driver_unit ("battery", unit); + native = up_acpi_native_new_driver_unit ("battery", unit); object = up_device_list_lookup (backend->priv->device_list, G_OBJECT (native)); if (object == NULL) { gpointer hptr; @@ -186,7 +186,7 @@ out: * up_backend_create_new_device: **/ static gboolean -up_backend_create_new_device (UpBackend *backend, DkpAcpiNative *native) +up_backend_create_new_device (UpBackend *backend, UpAcpiNative *native) { UpDevice *device; gboolean ret; @@ -196,14 +196,14 @@ up_backend_create_new_device (UpBackend *backend, DkpAcpiNative *native) if (!ret) g_object_unref (device); else { - if (!strncmp (dkp_acpi_native_get_path (native), "dev.", strlen ("dev."))) { + if (!strncmp (up_acpi_native_get_path (native), "dev.", strlen ("dev."))) { const gchar *path; - path = dkp_acpi_native_get_path (native); - if (dkp_has_sysctl ("%s.%%location", path)) { + path = up_acpi_native_get_path (native); + if (up_has_sysctl ("%s.%%location", path)) { gchar *location; - location = dkp_get_string_sysctl (NULL, "%s.%%location", path); + location = up_get_string_sysctl (NULL, "%s.%%location", path); if (location != NULL && strstr (location, "handle=") != NULL) { gchar *handle; @@ -229,7 +229,7 @@ up_backend_lid_coldplug (UpBackend *backend) { gchar *lid_state; - lid_state = dkp_get_string_sysctl (NULL, "hw.acpi.lid_switch_state"); + lid_state = up_get_string_sysctl (NULL, "hw.acpi.lid_switch_state"); if (lid_state && strcmp (lid_state, "NONE")) { g_object_set (backend->priv->daemon, "lid-is-present", TRUE, NULL); } @@ -249,7 +249,7 @@ up_backend_lid_coldplug (UpBackend *backend) gboolean up_backend_coldplug (UpBackend *backend, UpDaemon *daemon) { - DkpAcpiNative *acnative; + UpAcpiNative *acnative; int i; backend->priv->daemon = g_object_ref (daemon); @@ -258,12 +258,12 @@ up_backend_coldplug (UpBackend *backend, UpDaemon *daemon) for (i = 0; i < (int) G_N_ELEMENTS (handlers); i++) { int j; - for (j = 0; dkp_has_sysctl ("dev.%s.%i.%%driver", handlers[i], j); j++) { - DkpAcpiNative *native; + for (j = 0; up_has_sysctl ("dev.%s.%i.%%driver", handlers[i], j); j++) { + UpAcpiNative *native; UpDevice *device; GObject *object; - native = dkp_acpi_native_new_driver_unit (handlers[i], j); + native = up_acpi_native_new_driver_unit (handlers[i], j); object = up_device_list_lookup (backend->priv->device_list, G_OBJECT (native)); if (object != NULL) { device = UP_DEVICE (object); @@ -284,11 +284,11 @@ up_backend_coldplug (UpBackend *backend, UpDaemon *daemon) up_backend_lid_coldplug (backend); - acnative = dkp_acpi_native_new ("hw.acpi.acline"); + acnative = up_acpi_native_new ("hw.acpi.acline"); up_backend_create_new_device (backend, acnative); g_object_unref (acnative); - dkp_devd_init (backend); + up_devd_init (backend); backend->priv->poll_timer_id = g_timeout_add_seconds (UP_BACKEND_REFRESH_TIMEOUT, @@ -394,7 +394,7 @@ up_backend_supports_sleep_state (const gchar *state) gchar *sleep_states; gboolean ret = FALSE; - sleep_states = dkp_get_string_sysctl (NULL, "hw.acpi.supported_sleep_state"); + sleep_states = up_get_string_sysctl (NULL, "hw.acpi.supported_sleep_state"); if (sleep_states != NULL) { if (strstr (sleep_states, state) != NULL) ret = TRUE; diff --git a/src/freebsd/up-devd.c b/src/freebsd/up-devd.c index a84d2a5..7aa030a 100644 --- a/src/freebsd/up-devd.c +++ b/src/freebsd/up-devd.c @@ -1,6 +1,6 @@ /*************************************************************************** * - * dkp-devd.c : process devd events + * up-devd.c : process devd events * * Copyright (C) 2006, 2007 Joe Marcus Clarke * @@ -36,22 +36,22 @@ #include "up-backend-acpi.h" #include "up-devd.h" -#define DKP_DEVD_SOCK_PATH "/var/run/devd.pipe" +#define UP_DEVD_SOCK_PATH "/var/run/devd.pipe" -#define DKP_DEVD_EVENT_NOTIFY '!' -#define DKP_DEVD_EVENT_ADD '+' -#define DKP_DEVD_EVENT_REMOVE '-' -#define DKP_DEVD_EVENT_NOMATCH '?' +#define UP_DEVD_EVENT_NOTIFY '!' +#define UP_DEVD_EVENT_ADD '+' +#define UP_DEVD_EVENT_REMOVE '-' +#define UP_DEVD_EVENT_NOMATCH '?' -static DkpDevdHandler *handlers[] = { +static UpDevdHandler *handlers[] = { &up_backend_acpi_devd_handler, }; -static gboolean dkp_devd_inited = FALSE; +static gboolean up_devd_inited = FALSE; #if 0 static GHashTable * -dkp_devd_parse_params (const gchar *str) +up_devd_parse_params (const gchar *str) { GHashTable *params; gchar **pairs; @@ -77,7 +77,7 @@ dkp_devd_parse_params (const gchar *str) #endif static gboolean -dkp_devd_parse_notify (const gchar *event, +up_devd_parse_notify (const gchar *event, gchar **system, gchar **subsystem, gchar **type, @@ -118,7 +118,7 @@ end: } static void -dkp_devd_process_notify_event (UpBackend *backend, +up_devd_process_notify_event (UpBackend *backend, const gchar *system, const gchar *subsystem, const gchar *type, @@ -140,7 +140,7 @@ dkp_devd_process_notify_event (UpBackend *backend, } static void -dkp_devd_process_event (const gchar *event, gpointer user_data) +up_devd_process_event (const gchar *event, gpointer user_data) { UpBackend *backend; @@ -151,21 +151,21 @@ dkp_devd_process_event (const gchar *event, gpointer user_data) egg_debug("received devd event: '%s'", event); switch (event[0]) { - case DKP_DEVD_EVENT_ADD: - case DKP_DEVD_EVENT_REMOVE: + case UP_DEVD_EVENT_ADD: + case UP_DEVD_EVENT_REMOVE: /* Do nothing as we don't currently hotplug ACPI devices. */ return; - case DKP_DEVD_EVENT_NOTIFY: { + case UP_DEVD_EVENT_NOTIFY: { gchar *system; gchar *subsystem; gchar *type; gchar *data; - if (!dkp_devd_parse_notify (event + 1, &system, &subsystem, &type, &data)) + if (!up_devd_parse_notify (event + 1, &system, &subsystem, &type, &data)) goto malformed; - dkp_devd_process_notify_event (backend, system, subsystem, type, data); + up_devd_process_notify_event (backend, system, subsystem, type, data); g_free (system); g_free (subsystem); @@ -174,7 +174,7 @@ dkp_devd_process_event (const gchar *event, gpointer user_data) } return; - case DKP_DEVD_EVENT_NOMATCH: + case UP_DEVD_EVENT_NOMATCH: /* Do nothing. */ return; } @@ -184,7 +184,7 @@ malformed: } static gboolean -dkp_devd_event_cb (GIOChannel *source, GIOCondition condition, +up_devd_event_cb (GIOChannel *source, GIOCondition condition, gpointer user_data) { gchar *event; @@ -195,11 +195,11 @@ dkp_devd_event_cb (GIOChannel *source, GIOCondition condition, if (status == G_IO_STATUS_NORMAL) { event[terminator] = 0; - dkp_devd_process_event(event, user_data); + up_devd_process_event(event, user_data); g_free(event); } else if (status == G_IO_STATUS_AGAIN) { - dkp_devd_init (UP_BACKEND(user_data)); - if (dkp_devd_inited) { + up_devd_init (UP_BACKEND(user_data)); + if (up_devd_inited) { int fd; fd = g_io_channel_unix_get_fd (source); @@ -214,7 +214,7 @@ dkp_devd_event_cb (GIOChannel *source, GIOCondition condition, } void -dkp_devd_init (UpBackend *backend) +up_devd_init (UpBackend *backend) { int event_fd; struct sockaddr_un addr; @@ -222,23 +222,23 @@ dkp_devd_init (UpBackend *backend) event_fd = socket(PF_UNIX, SOCK_STREAM, 0); if (event_fd < 0) { egg_warning("failed to create event socket: '%s'", g_strerror(errno)); - dkp_devd_inited = FALSE; + up_devd_inited = FALSE; return; } addr.sun_family = AF_UNIX; - strncpy (addr.sun_path, DKP_DEVD_SOCK_PATH, sizeof(addr.sun_path)); + strncpy (addr.sun_path, UP_DEVD_SOCK_PATH, sizeof(addr.sun_path)); if (connect (event_fd, (struct sockaddr *)&addr, sizeof(addr)) == 0) { GIOChannel *channel; channel = g_io_channel_unix_new (event_fd); - g_io_add_watch (channel, G_IO_IN, dkp_devd_event_cb, backend); + g_io_add_watch (channel, G_IO_IN, up_devd_event_cb, backend); g_io_channel_unref (channel); - dkp_devd_inited = TRUE; + up_devd_inited = TRUE; } else { - egg_warning ("failed to connect to %s: '%s'", DKP_DEVD_SOCK_PATH, + egg_warning ("failed to connect to %s: '%s'", UP_DEVD_SOCK_PATH, g_strerror(errno)); close (event_fd); - dkp_devd_inited = FALSE; + up_devd_inited = FALSE; } } diff --git a/src/freebsd/up-devd.h b/src/freebsd/up-devd.h index 3bbb589..9c17630 100644 --- a/src/freebsd/up-devd.h +++ b/src/freebsd/up-devd.h @@ -1,6 +1,6 @@ /*************************************************************************** * - * dkp-devd.h : process devd events + * up-devd.h : process devd events * * Copyright (C) 2006, 2009 Joe Marcus Clarke * @@ -20,8 +20,8 @@ * **************************************************************************/ -#ifndef _DKP_DEVD_H -#define _DKP_DEVD_H +#ifndef _UP_DEVD_H +#define _UP_DEVD_H #include "config.h" @@ -38,8 +38,8 @@ typedef struct const char *subsystem, const char *type, const char *data); /* may be NULL */ -} DkpDevdHandler; +} UpDevdHandler; -void dkp_devd_init (UpBackend *backend); +void up_devd_init (UpBackend *backend); -#endif /* _DKP_DEVD_H */ +#endif /* _UP_DEVD_H */ diff --git a/src/freebsd/up-device-supply.c b/src/freebsd/up-device-supply.c index d0b815c..07c7855 100644 --- a/src/freebsd/up-device-supply.c +++ b/src/freebsd/up-device-supply.c @@ -45,16 +45,16 @@ #include "up-enum.h" #include "up-device-supply.h" -#define DKP_ACPIDEV "/dev/acpi" +#define UP_ACPIDEV "/dev/acpi" G_DEFINE_TYPE (UpDeviceSupply, up_device_supply, UP_TYPE_DEVICE) static gboolean up_device_supply_refresh (UpDevice *device); static UpDeviceTechnology up_device_supply_convert_device_technology (const gchar *type); static gboolean up_device_supply_acline_coldplug (UpDevice *device); -static gboolean up_device_supply_battery_coldplug (UpDevice *device, DkpAcpiNative *native); +static gboolean up_device_supply_battery_coldplug (UpDevice *device, UpAcpiNative *native); static gboolean up_device_supply_acline_set_properties (UpDevice *device); -static gboolean up_device_supply_battery_set_properties (UpDevice *device, DkpAcpiNative *native); +static gboolean up_device_supply_battery_set_properties (UpDevice *device, UpAcpiNative *native); static gboolean up_device_supply_get_on_battery (UpDevice *device, gboolean *on_battery); static gboolean up_device_supply_get_low_battery (UpDevice *device, gboolean *low_battery); static gboolean up_device_supply_get_online (UpDevice *device, gboolean *online); @@ -62,7 +62,7 @@ static gboolean up_device_supply_get_online (UpDevice *device, gboolean *onlin /** * up_device_supply_convert_device_technology: * - * This is taken from linux/dkp-device-supply.c. + * This is taken from linux/up-device-supply.c. **/ static UpDeviceTechnology up_device_supply_convert_device_technology (const gchar *type) @@ -142,7 +142,7 @@ up_device_supply_acline_coldplug (UpDevice *device) * up_device_supply_battery_coldplug: **/ static gboolean -up_device_supply_battery_coldplug (UpDevice *device, DkpAcpiNative *native) +up_device_supply_battery_coldplug (UpDevice *device, UpAcpiNative *native) { gboolean ret; @@ -156,7 +156,7 @@ up_device_supply_battery_coldplug (UpDevice *device, DkpAcpiNative *native) * up_device_supply_battery_set_properties: **/ static gboolean -up_device_supply_battery_set_properties (UpDevice *device, DkpAcpiNative *native) +up_device_supply_battery_set_properties (UpDevice *device, UpAcpiNative *native) { gint fd; gdouble volt, dvolt, rate, lastfull, cap, dcap, lcap, capacity; @@ -168,14 +168,14 @@ up_device_supply_battery_set_properties (UpDevice *device, DkpAcpiNative *native UpDeviceState state; union acpi_battery_ioctl_arg battif, battst, battinfo; - if (!dkp_has_sysctl ("hw.acpi.battery.units")) + if (!up_has_sysctl ("hw.acpi.battery.units")) return FALSE; battif.unit = battst.unit = battinfo.unit = - dkp_acpi_native_get_unit (native); - fd = open (DKP_ACPIDEV, O_RDONLY); + up_acpi_native_get_unit (native); + fd = open (UP_ACPIDEV, O_RDONLY); if (fd < 0) { - egg_warning ("unable to open %s: '%s'", DKP_ACPIDEV, g_strerror (errno)); + egg_warning ("unable to open %s: '%s'", UP_ACPIDEV, g_strerror (errno)); return FALSE; } @@ -204,9 +204,9 @@ up_device_supply_battery_set_properties (UpDevice *device, DkpAcpiNative *native goto end; } - vendor = dkp_make_safe_string (battif.bif.oeminfo); - model = dkp_make_safe_string (battif.bif.model); - serial = dkp_make_safe_string (battif.bif.serial); + vendor = up_make_safe_string (battif.bif.oeminfo); + model = up_make_safe_string (battif.bif.model); + serial = up_make_safe_string (battif.bif.serial); technology = up_device_supply_convert_device_technology (battif.bif.type); g_object_set (device, @@ -330,7 +330,7 @@ up_device_supply_acline_set_properties (UpDevice *device) { int acstate; - if (dkp_get_int_sysctl (&acstate, NULL, "hw.acpi.acline")) { + if (up_get_int_sysctl (&acstate, NULL, "hw.acpi.acline")) { g_object_set (device, "online", acstate ? TRUE : FALSE, NULL); return TRUE; } @@ -345,16 +345,16 @@ up_device_supply_acline_set_properties (UpDevice *device) static gboolean up_device_supply_coldplug (UpDevice *device) { - DkpAcpiNative *native; + UpAcpiNative *native; const gchar *native_path; const gchar *driver; gboolean ret = FALSE; up_device_supply_reset_values (device); - native = DKP_ACPI_NATIVE (up_device_get_native (device)); - native_path = dkp_acpi_native_get_path (native); - driver = dkp_acpi_native_get_driver (native); + native = UP_ACPI_NATIVE (up_device_get_native (device)); + native_path = up_acpi_native_get_path (native); + driver = up_acpi_native_get_driver (native); if (native_path == NULL) { egg_warning ("could not get native path for %p", device); goto out; @@ -396,7 +396,7 @@ up_device_supply_refresh (UpDevice *device) break; case UP_DEVICE_TYPE_BATTERY: object = up_device_get_native (device); - ret = up_device_supply_battery_set_properties (device, DKP_ACPI_NATIVE (object)); + ret = up_device_supply_battery_set_properties (device, UP_ACPI_NATIVE (object)); break; default: g_assert_not_reached (); diff --git a/src/freebsd/up-native.c b/src/freebsd/up-native.c index caa1fbd..fd693ce 100644 --- a/src/freebsd/up-native.c +++ b/src/freebsd/up-native.c @@ -34,7 +34,7 @@ const gchar * dkp_native_get_native_path (GObject *object) { - return dkp_acpi_native_get_path (DKP_ACPI_NATIVE (object)); + return up_acpi_native_get_path (UP_ACPI_NATIVE (object)); } /*************************************************************************** @@ -47,7 +47,7 @@ void dkp_native_test (gpointer user_data) { EggTest *test = (EggTest *) user_data; - DkpAcpiNative *dan; + UpAcpiNative *dan; const gchar *path; if (!egg_test_start (test, "DkpNative")) @@ -55,7 +55,7 @@ dkp_native_test (gpointer user_data) /************************************************************/ egg_test_title (test, "get instance"); - dan = dkp_acpi_native_new_driver_unit ("battery", 0); + dan = up_acpi_native_new_driver_unit ("battery", 0); path = dkp_native_get_native_path (dan); egg_test_assert (test, (g_strcmp0 (path, "dev.battery.0") == 0)); g_object_unref (dan); diff --git a/src/freebsd/up-util.c b/src/freebsd/up-util.c index e1f3a6b..6e75407 100644 --- a/src/freebsd/up-util.c +++ b/src/freebsd/up-util.c @@ -1,6 +1,6 @@ /*************************************************************************** * - * dkp-util.c : utilities + * up-util.c : utilities * * Copyright (C) 2006, 2007 Jean-Yves Lefort * @@ -34,7 +34,7 @@ #include "up-util.h" gboolean -dkp_has_sysctl (const gchar *format, ...) +up_has_sysctl (const gchar *format, ...) { va_list args; gchar *name; @@ -54,7 +54,7 @@ dkp_has_sysctl (const gchar *format, ...) } gboolean -dkp_get_int_sysctl (int *value, GError **err, const gchar *format, ...) +up_get_int_sysctl (int *value, GError **err, const gchar *format, ...) { va_list args; gchar *name; @@ -77,7 +77,7 @@ dkp_get_int_sysctl (int *value, GError **err, const gchar *format, ...) } gchar * -dkp_get_string_sysctl (GError **err, const gchar *format, ...) +up_get_string_sysctl (GError **err, const gchar *format, ...) { va_list args; gchar *name; @@ -108,12 +108,12 @@ dkp_get_string_sysctl (GError **err, const gchar *format, ...) } /** - * dkp_util_make_safe_string: + * up_util_make_safe_string: * - * This is adapted from linux/dkp-device-supply.c. + * This is adapted from linux/up-device-supply.c. **/ gchar * -dkp_make_safe_string (const gchar *text) +up_make_safe_string (const gchar *text) { guint i; guint idx = 0; diff --git a/src/freebsd/up-util.h b/src/freebsd/up-util.h index 24385d8..1cb8d8e 100644 --- a/src/freebsd/up-util.h +++ b/src/freebsd/up-util.h @@ -1,6 +1,6 @@ /*************************************************************************** * - * dkp-util.h : utilities + * up-util.h : utilities * * Copyright (C) 2006, 2007 Jean-Yves Lefort * @@ -20,30 +20,30 @@ * **************************************************************************/ -#ifndef _DKP_UTIL_H -#define _DKP_UTIL_H +#ifndef _UP_UTIL_H +#define _UP_UTIL_H #include "config.h" #include #include -#define DKP_BOOL_TO_STRING(val) ((val) ? "true" : "false") +#define UP_BOOL_TO_STRING(val) ((val) ? "true" : "false") -#define DKP_LIST_FOREACH(var, head) \ +#define UP_LIST_FOREACH(var, head) \ for ((var) = (head); \ (var); \ (var) = (var)->next) -gboolean dkp_has_sysctl (const gchar *format, ...) G_GNUC_PRINTF(1, 2); -gboolean dkp_get_int_sysctl (int *value, +gboolean up_has_sysctl (const gchar *format, ...) G_GNUC_PRINTF(1, 2); +gboolean up_get_int_sysctl (int *value, GError **err, const gchar *format, ...) G_GNUC_PRINTF(3, 4); -gchar *dkp_get_string_sysctl (GError **err, +gchar *up_get_string_sysctl (GError **err, const gchar *format, ...) G_GNUC_PRINTF(2, 3); -gchar *dkp_make_safe_string (const gchar *text); +gchar *up_make_safe_string (const gchar *text); -#endif /* _DKP_UTIL_H */ +#endif /* _UP_UTIL_H */ -- cgit v1.2.1