From 4746c7df50ccb4a4edec1502a22a5ef4e6291b67 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Sat, 26 Feb 2011 14:40:54 +0100 Subject: [PATCH] openbsd: add skeleton code Signed-off-by: Richard Hughes --- src/openbsd/Makefile.am | 26 ++++++++++++ src/openbsd/up-backend.c | 89 ++++++++++++++++++++++++++++++++++++++++ src/openbsd/up-native.c | 15 +++++++ 3 files changed, 130 insertions(+) create mode 100644 src/openbsd/Makefile.am create mode 100644 src/openbsd/up-backend.c create mode 100644 src/openbsd/up-native.c diff --git a/src/openbsd/Makefile.am b/src/openbsd/Makefile.am new file mode 100644 index 0000000..3fbce0a --- /dev/null +++ b/src/openbsd/Makefile.am @@ -0,0 +1,26 @@ +## Process this file with automake to produce Makefile.in + +INCLUDES = \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -DUP_COMPILATION \ + -DG_LOG_DOMAIN=\"UPower-Openbsd\" \ + -I$(top_srcdir)/libupower-glib \ + $(DBUS_GLIB_CFLAGS) \ + $(POLKIT_CFLAGS) \ + $(GLIB_CFLAGS) + +if BACKEND_TYPE_OPENBSD +noinst_LTLIBRARIES = libupshared.la +endif + +libupshared_la_SOURCES = \ + up-backend.c \ + up-native.c \ + $(BUILT_SOURCES) + +libupshared_la_CFLAGS = \ + $(WARNINGFLAGS_C) + +clean-local : + rm -f *~ + diff --git a/src/openbsd/up-backend.c b/src/openbsd/up-backend.c new file mode 100644 index 0000000..e30746b --- /dev/null +++ b/src/openbsd/up-backend.c @@ -0,0 +1,89 @@ + +#include "up-backend.h" +#include "up-daemon.h" + +#define UP_BACKEND_SUSPEND_COMMAND "/usr/sbin/zzz" + +/** + * up_backend_coldplug: + * @backend: The %UpBackend class instance + * @daemon: The %UpDaemon controlling instance + * + * Finds all the devices already plugged in, and emits device-add signals for + * each of them. + * + * Return value: %TRUE for success + **/ +gboolean +up_backend_coldplug (UpBackend *backend, UpDaemon *daemon) +{ +} + +/** + * up_backend_get_powersave_command: + **/ +const gchar * +up_backend_get_powersave_command (UpBackend *backend, gboolean powersave) +{ + return NULL; +} + +/** + * up_backend_get_suspend_command: + **/ +const gchar * +up_backend_get_suspend_command (UpBackend *backend) +{ + return UP_BACKEND_SUSPEND_COMMAND; +} + +/** + * up_backend_get_hibernate_command: + **/ +const gchar * +up_backend_get_hibernate_command (UpBackend *backend) +{ + return NULL; +} + +/** + * up_backend_kernel_can_suspend: + **/ +gboolean +up_backend_kernel_can_suspend (UpBackend *backend) +{ + return FALSE; +} + +/** + * up_backend_kernel_can_hibernate: + **/ +gboolean +up_backend_kernel_can_hibernate (UpBackend *backend) +{ + return FALSE; +} + +gboolean +up_backend_has_encrypted_swap (UpBackend *backend) +{ + return FALSE; +} + +/* Return value: a percentage value */ +gfloat +up_backend_get_used_swap (UpBackend *backend) +{ + return 0; +} + +/** + * up_backend_new: + * + * Return value: a new %UpBackend object. + **/ +UpBackend * +up_backend_new (void) +{ + return NULL; +} diff --git a/src/openbsd/up-native.c b/src/openbsd/up-native.c new file mode 100644 index 0000000..402957f --- /dev/null +++ b/src/openbsd/up-native.c @@ -0,0 +1,15 @@ +#include "up-native.h" + +/** + * up_native_get_native_path: + * @object: the native tracking object + * + * This converts a GObject used as the device data into a native path. + * + * Return value: The native path for the device which is unique, e.g. "/sys/class/power/BAT1" + **/ +const gchar * +up_native_get_native_path (GObject *object) +{ + return '/foo'; /* return sysctl acpiacX/acpibatX path ? */ +}