mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-01-23 23:20:29 +01:00
openbsd: add skeleton code
Signed-off-by: Richard Hughes <richard@hughsie.com>
This commit is contained in:
parent
ad04d9fd44
commit
4746c7df50
3 changed files with 130 additions and 0 deletions
26
src/openbsd/Makefile.am
Normal file
26
src/openbsd/Makefile.am
Normal file
|
|
@ -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 *~
|
||||
|
||||
89
src/openbsd/up-backend.c
Normal file
89
src/openbsd/up-backend.c
Normal file
|
|
@ -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;
|
||||
}
|
||||
15
src/openbsd/up-native.c
Normal file
15
src/openbsd/up-native.c
Normal file
|
|
@ -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 ? */
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue