Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
upower
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
75
Issues
75
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
upower
upower
Commits
2a9dff08
Commit
2a9dff08
authored
Jan 18, 2010
by
Richard Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trivial: convert freebsd private object to using upower prefix (no ABI or API changes)
parent
8d4ec582
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
193 additions
and
193 deletions
+193
-193
src/freebsd/up-acpi-native.c
src/freebsd/up-acpi-native.c
+73
-73
src/freebsd/up-acpi-native.h
src/freebsd/up-acpi-native.h
+23
-23
src/freebsd/up-acpi-native.vala
src/freebsd/up-acpi-native.vala
+3
-3
src/freebsd/up-backend-acpi.h
src/freebsd/up-backend-acpi.h
+2
-2
src/freebsd/up-backend.c
src/freebsd/up-backend.c
+18
-18
src/freebsd/up-devd.c
src/freebsd/up-devd.c
+29
-29
src/freebsd/up-devd.h
src/freebsd/up-devd.h
+6
-6
src/freebsd/up-device-supply.c
src/freebsd/up-device-supply.c
+19
-19
src/freebsd/up-native.c
src/freebsd/up-native.c
+3
-3
src/freebsd/up-util.c
src/freebsd/up-util.c
+7
-7
src/freebsd/up-util.h
src/freebsd/up-util.h
+10
-10
No files found.
src/freebsd/up-acpi-native.c
View file @
2a9dff08
/*
dk
p-acpi-native.c generated by valac, the Vala compiler
* generated from
dk
p-acpi-native.vala, do not modify */
/*
u
p-acpi-native.c generated by valac, the Vala compiler
* generated from
u
p-acpi-native.vala, do not modify */
#include <glib.h>
...
...
@@ -8,69 +8,69 @@
#include <string.h>
#define TYPE_
DKP_ACPI_NATIVE (dk
p_acpi_native_get_type ())
#define
DKP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DKP_ACPI_NATIVE, Dk
pAcpiNative))
#define
DKP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DKP_ACPI_NATIVE, Dk
pAcpiNativeClass))
#define IS_
DKP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DK
P_ACPI_NATIVE))
#define IS_
DKP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DK
P_ACPI_NATIVE))
#define
DKP_ACPI_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DKP_ACPI_NATIVE, Dk
pAcpiNativeClass))
#define TYPE_
UP_ACPI_NATIVE (u
p_acpi_native_get_type ())
#define
UP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UP_ACPI_NATIVE, U
pAcpiNative))
#define
UP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UP_ACPI_NATIVE, U
pAcpiNativeClass))
#define IS_
UP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_U
P_ACPI_NATIVE))
#define IS_
UP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_U
P_ACPI_NATIVE))
#define
UP_ACPI_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UP_ACPI_NATIVE, U
pAcpiNativeClass))
typedef
struct
_
DkpAcpiNative
Dk
pAcpiNative
;
typedef
struct
_
DkpAcpiNativeClass
Dk
pAcpiNativeClass
;
typedef
struct
_
DkpAcpiNativePrivate
Dk
pAcpiNativePrivate
;
typedef
struct
_
UpAcpiNative
U
pAcpiNative
;
typedef
struct
_
UpAcpiNativeClass
U
pAcpiNativeClass
;
typedef
struct
_
UpAcpiNativePrivate
U
pAcpiNativePrivate
;
#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
_
Dk
pAcpiNative
{
struct
_
U
pAcpiNative
{
GObject
parent_instance
;
Dk
pAcpiNativePrivate
*
priv
;
U
pAcpiNativePrivate
*
priv
;
};
struct
_
Dk
pAcpiNativeClass
{
struct
_
U
pAcpiNativeClass
{
GObjectClass
parent_class
;
};
struct
_
Dk
pAcpiNativePrivate
{
struct
_
U
pAcpiNativePrivate
{
gchar
*
_driver
;
gint
_unit
;
gchar
*
_path
;
};
static
gpointer
dk
p_acpi_native_parent_class
=
NULL
;
static
gpointer
u
p_acpi_native_parent_class
=
NULL
;
GType
dk
p_acpi_native_get_type
(
void
);
#define
DKP_ACPI_NATIVE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DKP_ACPI_NATIVE, Dk
pAcpiNativePrivate))
GType
u
p_acpi_native_get_type
(
void
);
#define
UP_ACPI_NATIVE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_UP_ACPI_NATIVE, U
pAcpiNativePrivate))
enum
{
DK
P_ACPI_NATIVE_DUMMY_PROPERTY
,
DK
P_ACPI_NATIVE_DRIVER
,
DK
P_ACPI_NATIVE_UNIT
,
DK
P_ACPI_NATIVE_PATH
U
P_ACPI_NATIVE_DUMMY_PROPERTY
,
U
P_ACPI_NATIVE_DRIVER
,
U
P_ACPI_NATIVE_UNIT
,
U
P_ACPI_NATIVE_PATH
};
DkpAcpiNative
*
dk
p_acpi_native_new
(
const
char
*
path
);
DkpAcpiNative
*
dk
p_acpi_native_construct
(
GType
object_type
,
const
char
*
path
);
DkpAcpiNative
*
dk
p_acpi_native_new_driver_unit
(
const
char
*
driver
,
gint
unit
);
DkpAcpiNative
*
dk
p_acpi_native_construct_driver_unit
(
GType
object_type
,
const
char
*
driver
,
gint
unit
);
const
char
*
dkp_acpi_native_get_driver
(
Dk
pAcpiNative
*
self
);
gint
dkp_acpi_native_get_unit
(
Dk
pAcpiNative
*
self
);
const
char
*
dkp_acpi_native_get_path
(
Dk
pAcpiNative
*
self
);
static
void
dk
p_acpi_native_finalize
(
GObject
*
obj
);
static
void
dk
p_acpi_native_get_property
(
GObject
*
object
,
guint
property_id
,
GValue
*
value
,
GParamSpec
*
pspec
);
UpAcpiNative
*
u
p_acpi_native_new
(
const
char
*
path
);
UpAcpiNative
*
u
p_acpi_native_construct
(
GType
object_type
,
const
char
*
path
);
UpAcpiNative
*
u
p_acpi_native_new_driver_unit
(
const
char
*
driver
,
gint
unit
);
UpAcpiNative
*
u
p_acpi_native_construct_driver_unit
(
GType
object_type
,
const
char
*
driver
,
gint
unit
);
const
char
*
up_acpi_native_get_driver
(
U
pAcpiNative
*
self
);
gint
up_acpi_native_get_unit
(
U
pAcpiNative
*
self
);
const
char
*
up_acpi_native_get_path
(
U
pAcpiNative
*
self
);
static
void
u
p_acpi_native_finalize
(
GObject
*
obj
);
static
void
u
p_acpi_native_get_property
(
GObject
*
object
,
guint
property_id
,
GValue
*
value
,
GParamSpec
*
pspec
);
DkpAcpiNative
*
dk
p_acpi_native_construct
(
GType
object_type
,
const
char
*
path
)
{
UpAcpiNative
*
u
p_acpi_native_construct
(
GType
object_type
,
const
char
*
path
)
{
GError
*
_inner_error_
;
Dk
pAcpiNative
*
self
;
U
pAcpiNative
*
self
;
GRegex
*
r
;
GMatchInfo
*
mi
;
gboolean
ret
=
FALSE
;
char
*
_tmp9_
;
g_return_val_if_fail
(
path
!=
NULL
,
NULL
);
_inner_error_
=
NULL
;
self
=
(
Dk
pAcpiNative
*
)
g_object_new
(
object_type
,
NULL
);
self
=
(
U
pAcpiNative
*
)
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
*
dk
p_acpi_native_new
(
const
char
*
path
)
{
return
dkp_acpi_native_construct
(
TYPE_DK
P_ACPI_NATIVE
,
path
);
UpAcpiNative
*
u
p_acpi_native_new
(
const
char
*
path
)
{
return
up_acpi_native_construct
(
TYPE_U
P_ACPI_NATIVE
,
path
);
}
DkpAcpiNative
*
dk
p_acpi_native_construct_driver_unit
(
GType
object_type
,
const
char
*
driver
,
gint
unit
)
{
Dk
pAcpiNative
*
self
;
UpAcpiNative
*
u
p_acpi_native_construct_driver_unit
(
GType
object_type
,
const
char
*
driver
,
gint
unit
)
{
U
pAcpiNative
*
self
;
char
*
_tmp0_
;
char
*
_tmp1_
;
g_return_val_if_fail
(
driver
!=
NULL
,
NULL
);
self
=
(
Dk
pAcpiNative
*
)
g_object_new
(
object_type
,
NULL
);
self
=
(
U
pAcpiNative
*
)
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
*
dk
p_acpi_native_new_driver_unit
(
const
char
*
driver
,
gint
unit
)
{
return
dkp_acpi_native_construct_driver_unit
(
TYPE_DK
P_ACPI_NATIVE
,
driver
,
unit
);
UpAcpiNative
*
u
p_acpi_native_new_driver_unit
(
const
char
*
driver
,
gint
unit
)
{
return
up_acpi_native_construct_driver_unit
(
TYPE_U
P_ACPI_NATIVE
,
driver
,
unit
);
}
const
char
*
dkp_acpi_native_get_driver
(
Dk
pAcpiNative
*
self
)
{
const
char
*
up_acpi_native_get_driver
(
U
pAcpiNative
*
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
(
Dk
pAcpiNative
*
self
)
{
gint
up_acpi_native_get_unit
(
U
pAcpiNative
*
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
(
Dk
pAcpiNative
*
self
)
{
const
char
*
up_acpi_native_get_path
(
U
pAcpiNative
*
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
(
Dk
pAcpiNativeClass
*
klass
)
{
dk
p_acpi_native_parent_class
=
g_type_class_peek_parent
(
klass
);
g_type_class_add_private
(
klass
,
sizeof
(
Dk
pAcpiNativePrivate
));
G_OBJECT_CLASS
(
klass
)
->
get_property
=
dk
p_acpi_native_get_property
;
G_OBJECT_CLASS
(
klass
)
->
finalize
=
dk
p_acpi_native_finalize
;
g_object_class_install_property
(
G_OBJECT_CLASS
(
klass
),
DK
P_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
),
DK
P_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
),
DK
P_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
(
U
pAcpiNativeClass
*
klass
)
{
u
p_acpi_native_parent_class
=
g_type_class_peek_parent
(
klass
);
g_type_class_add_private
(
klass
,
sizeof
(
U
pAcpiNativePrivate
));
G_OBJECT_CLASS
(
klass
)
->
get_property
=
u
p_acpi_native_get_property
;
G_OBJECT_CLASS
(
klass
)
->
finalize
=
u
p_acpi_native_finalize
;
g_object_class_install_property
(
G_OBJECT_CLASS
(
klass
),
U
P_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
),
U
P_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
),
U
P_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
(
Dk
pAcpiNative
*
self
)
{
self
->
priv
=
DK
P_ACPI_NATIVE_GET_PRIVATE
(
self
);
static
void
up_acpi_native_instance_init
(
U
pAcpiNative
*
self
)
{
self
->
priv
=
U
P_ACPI_NATIVE_GET_PRIVATE
(
self
);
}
static
void
dk
p_acpi_native_finalize
(
GObject
*
obj
)
{
Dk
pAcpiNative
*
self
;
self
=
DK
P_ACPI_NATIVE
(
obj
);
static
void
u
p_acpi_native_finalize
(
GObject
*
obj
)
{
U
pAcpiNative
*
self
;
self
=
U
P_ACPI_NATIVE
(
obj
);
_g_free0
(
self
->
priv
->
_driver
);
_g_free0
(
self
->
priv
->
_path
);
G_OBJECT_CLASS
(
dk
p_acpi_native_parent_class
)
->
finalize
(
obj
);
G_OBJECT_CLASS
(
u
p_acpi_native_parent_class
)
->
finalize
(
obj
);
}
GType
dk
p_acpi_native_get_type
(
void
)
{
static
GType
dk
p_acpi_native_type_id
=
0
;
if
(
dk
p_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
)
dk
p_acpi_native_instance_init
,
NULL
};
dkp_acpi_native_type_id
=
g_type_register_static
(
G_TYPE_OBJECT
,
"Dk
pAcpiNative"
,
&
g_define_type_info
,
0
);
GType
u
p_acpi_native_get_type
(
void
)
{
static
GType
u
p_acpi_native_type_id
=
0
;
if
(
u
p_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
)
u
p_acpi_native_instance_init
,
NULL
};
up_acpi_native_type_id
=
g_type_register_static
(
G_TYPE_OBJECT
,
"U
pAcpiNative"
,
&
g_define_type_info
,
0
);
}
return
dk
p_acpi_native_type_id
;
return
u
p_acpi_native_type_id
;
}
static
void
dk
p_acpi_native_get_property
(
GObject
*
object
,
guint
property_id
,
GValue
*
value
,
GParamSpec
*
pspec
)
{
Dk
pAcpiNative
*
self
;
self
=
DK
P_ACPI_NATIVE
(
object
);
static
void
u
p_acpi_native_get_property
(
GObject
*
object
,
guint
property_id
,
GValue
*
value
,
GParamSpec
*
pspec
)
{
U
pAcpiNative
*
self
;
self
=
U
P_ACPI_NATIVE
(
object
);
switch
(
property_id
)
{
case
DK
P_ACPI_NATIVE_DRIVER
:
g_value_set_string
(
value
,
dk
p_acpi_native_get_driver
(
self
));
case
U
P_ACPI_NATIVE_DRIVER
:
g_value_set_string
(
value
,
u
p_acpi_native_get_driver
(
self
));
break
;
case
DK
P_ACPI_NATIVE_UNIT
:
g_value_set_int
(
value
,
dk
p_acpi_native_get_unit
(
self
));
case
U
P_ACPI_NATIVE_UNIT
:
g_value_set_int
(
value
,
u
p_acpi_native_get_unit
(
self
));
break
;
case
DK
P_ACPI_NATIVE_PATH
:
g_value_set_string
(
value
,
dk
p_acpi_native_get_path
(
self
));
case
U
P_ACPI_NATIVE_PATH
:
g_value_set_string
(
value
,
u
p_acpi_native_get_path
(
self
));
break
;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
property_id
,
pspec
);
...
...
src/freebsd/up-acpi-native.h
View file @
2a9dff08
/*
dk
p-acpi-native.h generated by valac, the Vala compiler, do not modify */
/*
u
p-acpi-native.h generated by valac, the Vala compiler, do not modify */
#ifndef __
DK
P_ACPI_NATIVE_H__
#define __
DK
P_ACPI_NATIVE_H__
#ifndef __
U
P_ACPI_NATIVE_H__
#define __
U
P_ACPI_NATIVE_H__
#include <glib.h>
#include <glib-object.h>
...
...
@@ -12,35 +12,35 @@
G_BEGIN_DECLS
#define TYPE_
DKP_ACPI_NATIVE (dk
p_acpi_native_get_type ())
#define
DKP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DKP_ACPI_NATIVE, Dk
pAcpiNative))
#define
DKP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DKP_ACPI_NATIVE, Dk
pAcpiNativeClass))
#define IS_
DKP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DK
P_ACPI_NATIVE))
#define IS_
DKP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DK
P_ACPI_NATIVE))
#define
DKP_ACPI_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DKP_ACPI_NATIVE, Dk
pAcpiNativeClass))
#define TYPE_
UP_ACPI_NATIVE (u
p_acpi_native_get_type ())
#define
UP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UP_ACPI_NATIVE, U
pAcpiNative))
#define
UP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UP_ACPI_NATIVE, U
pAcpiNativeClass))
#define IS_
UP_ACPI_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_U
P_ACPI_NATIVE))
#define IS_
UP_ACPI_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_U
P_ACPI_NATIVE))
#define
UP_ACPI_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UP_ACPI_NATIVE, U
pAcpiNativeClass))
typedef
struct
_
DkpAcpiNative
Dk
pAcpiNative
;
typedef
struct
_
DkpAcpiNativeClass
Dk
pAcpiNativeClass
;
typedef
struct
_
DkpAcpiNativePrivate
Dk
pAcpiNativePrivate
;
typedef
struct
_
UpAcpiNative
U
pAcpiNative
;
typedef
struct
_
UpAcpiNativeClass
U
pAcpiNativeClass
;
typedef
struct
_
UpAcpiNativePrivate
U
pAcpiNativePrivate
;
struct
_
Dk
pAcpiNative
{
struct
_
U
pAcpiNative
{
GObject
parent_instance
;
Dk
pAcpiNativePrivate
*
priv
;
U
pAcpiNativePrivate
*
priv
;
};
struct
_
Dk
pAcpiNativeClass
{
struct
_
U
pAcpiNativeClass
{
GObjectClass
parent_class
;
};
GType
dk
p_acpi_native_get_type
(
void
);
DkpAcpiNative
*
dk
p_acpi_native_new
(
const
char
*
path
);
DkpAcpiNative
*
dk
p_acpi_native_construct
(
GType
object_type
,
const
char
*
path
);
DkpAcpiNative
*
dk
p_acpi_native_new_driver_unit
(
const
char
*
driver
,
gint
unit
);
DkpAcpiNative
*
dk
p_acpi_native_construct_driver_unit
(
GType
object_type
,
const
char
*
driver
,
gint
unit
);
const
char
*
dkp_acpi_native_get_driver
(
Dk
pAcpiNative
*
self
);
gint
dkp_acpi_native_get_unit
(
Dk
pAcpiNative
*
self
);
const
char
*
dkp_acpi_native_get_path
(
Dk
pAcpiNative
*
self
);
GType
u
p_acpi_native_get_type
(
void
);
UpAcpiNative
*
u
p_acpi_native_new
(
const
char
*
path
);
UpAcpiNative
*
u
p_acpi_native_construct
(
GType
object_type
,
const
char
*
path
);
UpAcpiNative
*
u
p_acpi_native_new_driver_unit
(
const
char
*
driver
,
gint
unit
);
UpAcpiNative
*
u
p_acpi_native_construct_driver_unit
(
GType
object_type
,
const
char
*
driver
,
gint
unit
);
const
char
*
up_acpi_native_get_driver
(
U
pAcpiNative
*
self
);
gint
up_acpi_native_get_unit
(
U
pAcpiNative
*
self
);
const
char
*
up_acpi_native_get_path
(
U
pAcpiNative
*
self
);
G_END_DECLS
...
...
src/freebsd/up-acpi-native.vala
View file @
2a9dff08
public
class
Dk
pAcpiNative
:
Object
{
public
class
U
pAcpiNative
:
Object
{
private
string
?
_driver
;
private
int
_unit
;
private
string
_path
;
...
...
@@ -15,7 +15,7 @@ public class DkpAcpiNative : Object {
get
{
return
_path
;
}
}
public
Dk
pAcpiNative
(
string
path
)
{
public
U
pAcpiNative
(
string
path
)
{
Regex
r
;
MatchInfo
mi
;
bool
ret
;
...
...
@@ -38,7 +38,7 @@ public class DkpAcpiNative : Object {
_path
=
path
;
}
public
Dk
pAcpiNative
.
driver_unit
(
string
driver
,
int
unit
)
{
public
U
pAcpiNative
.
driver_unit
(
string
driver
,
int
unit
)
{
_driver
=
driver
;
_unit
=
unit
;
_path
=
"dev.%s.%i"
.
printf
(
_driver
,
_unit
);
...
...
src/freebsd/up-backend-acpi.h
View file @
2a9dff08
/***************************************************************************
*
*
dk
p-backend-acpi.h : define some backend objects
*
u
p-backend-acpi.h : define some backend objects
*
* Copyright (C) 2006, 2009 Joe Marcus Clarke <marcus@FreeBSD.org>
*
...
...
@@ -27,6 +27,6 @@
#include "up-devd.h"
extern
Dk
pDevdHandler
up_backend_acpi_devd_handler
;
extern
U
pDevdHandler
up_backend_acpi_devd_handler
;
#endif
/* _UP_BACKEND_ACPI_H */
src/freebsd/up-backend.c
View file @
2a9dff08
...
...
@@ -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
,
Dk
pAcpiNative
*
native
);
static
gboolean
up_backend_create_new_device
(
UpBackend
*
backend
,
U
pAcpiNative
*
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"
,
};
Dk
pDevdHandler
up_backend_acpi_devd_handler
=
{
U
pDevdHandler
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
;
Dk
pAcpiNative
*
native
=
NULL
;
U
pAcpiNative
*
native
=
NULL
;
if
(
strcmp
(
system
,
"ACPI"
))
return
FALSE
;
if
(
!
strcmp
(
subsystem
,
"ACAD"
))
{
native
=
dk
p_acpi_native_new
(
"hw.acpi.acline"
);
native
=
u
p_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
=
dk
p_acpi_native_new_driver_unit
(
"battery"
,
unit
);
native
=
u
p_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
,
Dk
pAcpiNative
*
native
)
up_backend_create_new_device
(
UpBackend
*
backend
,
U
pAcpiNative
*
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
(
dk
p_acpi_native_get_path
(
native
),
"dev."
,
strlen
(
"dev."
)))
{
if
(
!
strncmp
(
u
p_acpi_native_get_path
(
native
),
"dev."
,
strlen
(
"dev."
)))
{
const
gchar
*
path
;
path
=
dk
p_acpi_native_get_path
(
native
);
if
(
dk
p_has_sysctl
(
"%s.%%location"
,
path
))
{
path
=
u
p_acpi_native_get_path
(
native
);
if
(
u
p_has_sysctl
(
"%s.%%location"
,
path
))
{
gchar
*
location
;
location
=
dk
p_get_string_sysctl
(
NULL
,
"%s.%%location"
,
path
);
location
=
u
p_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
=
dk
p_get_string_sysctl
(
NULL
,
"hw.acpi.lid_switch_state"
);
lid_state
=
u
p_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
)
{
Dk
pAcpiNative
*
acnative
;
U
pAcpiNative
*
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
;
dk
p_has_sysctl
(
"dev.%s.%i.%%driver"
,
handlers
[
i
],
j
);
j
++
)
{
Dk
pAcpiNative
*
native
;
for
(
j
=
0
;
u
p_has_sysctl
(
"dev.%s.%i.%%driver"
,
handlers
[
i
],
j
);
j
++
)
{
U
pAcpiNative
*
native
;
UpDevice
*
device
;
GObject
*
object
;
native
=
dk
p_acpi_native_new_driver_unit
(
handlers
[
i
],
j
);
native
=
u
p_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
=
dk
p_acpi_native_new
(
"hw.acpi.acline"
);
acnative
=
u
p_acpi_native_new
(
"hw.acpi.acline"
);
up_backend_create_new_device
(
backend
,
acnative
);
g_object_unref
(
acnative
);
dk
p_devd_init
(
backend
);
u
p_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
=
dk
p_get_string_sysctl
(
NULL
,
"hw.acpi.supported_sleep_state"
);
sleep_states
=
u
p_get_string_sysctl
(
NULL
,
"hw.acpi.supported_sleep_state"
);
if
(
sleep_states
!=
NULL
)
{
if
(
strstr
(
sleep_states
,
state
)
!=
NULL
)
ret
=
TRUE
;
...
...
src/freebsd/up-devd.c
View file @
2a9dff08
/***************************************************************************
*
*
dk
p-devd.c : process devd events
*
u
p-devd.c : process devd events
*
* Copyright (C) 2006, 2007 Joe Marcus Clarke <marcus@FreeBSD.org>
*
...
...
@@ -36,22 +36,22 @@
#include "up-backend-acpi.h"
#include "up-devd.h"
#define
DK
P_DEVD_SOCK_PATH "/var/run/devd.pipe"
#define
U
P_DEVD_SOCK_PATH "/var/run/devd.pipe"
#define
DK
P_DEVD_EVENT_NOTIFY '!'
#define
DK
P_DEVD_EVENT_ADD '+'
#define
DK
P_DEVD_EVENT_REMOVE '-'
#define
DK
P_DEVD_EVENT_NOMATCH '?'
#define
U
P_DEVD_EVENT_NOTIFY '!'
#define
U
P_DEVD_EVENT_ADD '+'
#define
U
P_DEVD_EVENT_REMOVE '-'
#define
U
P_DEVD_EVENT_NOMATCH '?'
static
Dk
pDevdHandler
*
handlers
[]
=
{
static
U
pDevdHandler
*
handlers
[]
=
{
&
up_backend_acpi_devd_handler
,
};
static
gboolean
dk
p_devd_inited
=
FALSE
;
static
gboolean
u
p_devd_inited
=
FALSE
;
#if 0
static GHashTable *
dk
p_devd_parse_params (const gchar *str)
u
p_devd_parse_params (const gchar *str)
{
GHashTable *params;
gchar **pairs;
...
...
@@ -77,7 +77,7 @@ dkp_devd_parse_params (const gchar *str)
#endif
static
gboolean
dk
p_devd_parse_notify
(
const
gchar
*
event
,
u
p_devd_parse_notify
(
const
gchar
*
event
,
gchar
**
system
,
gchar
**
subsystem
,
gchar
**
type
,
...
...
@@ -118,7 +118,7 @@ end:
}
static
void
dk
p_devd_process_notify_event
(
UpBackend
*
backend
,
u
p_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
dk
p_devd_process_event
(
const
gchar
*
event
,
gpointer
user_data
)
u
p_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
DK
P_DEVD_EVENT_ADD
:
case
DK
P_DEVD_EVENT_REMOVE
:
case
U
P_DEVD_EVENT_ADD
:
case
U
P_DEVD_EVENT_REMOVE
:
/* Do nothing as we don't currently hotplug ACPI devices. */
return
;
case
DK
P_DEVD_EVENT_NOTIFY
:
{
case
U
P_DEVD_EVENT_NOTIFY
:
{
gchar
*
system
;
gchar
*
subsystem
;
gchar
*
type
;
gchar
*
data
;
if
(
!
dk
p_devd_parse_notify
(
event
+
1
,
&
system
,
&
subsystem
,
&
type
,
&
data
))
if
(
!
u
p_devd_parse_notify
(
event
+
1
,
&
system
,
&
subsystem
,
&
type
,
&
data
))
goto
malformed
;
dk
p_devd_process_notify_event
(
backend
,
system
,
subsystem
,
type
,
data
);
u
p_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
DK
P_DEVD_EVENT_NOMATCH
:
case
U
P_DEVD_EVENT_NOMATCH
:
/* Do nothing. */
return
;
}
...
...
@@ -184,7 +184,7 @@ malformed:
}
static
gboolean
dk
p_devd_event_cb
(
GIOChannel
*
source
,
GIOCondition
condition
,
u
p_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
;
dk
p_devd_process_event
(
event
,
user_data
);
u
p_devd_process_event
(
event
,
user_data
);
g_free
(
event
);
}
else
if
(
status
==
G_IO_STATUS_AGAIN
)
{
dk
p_devd_init
(
UP_BACKEND
(
user_data
));
if
(
dk
p_devd_inited
)
{
u
p_devd_init
(
UP_BACKEND
(
user_data
));
if
(
u
p_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
dk
p_devd_init
(
UpBackend
*
backend
)
u
p_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
));
dk
p_devd_inited
=
FALSE
;
u
p_devd_inited
=
FALSE
;
return
;
}
addr
.
sun_family
=
AF_UNIX
;
strncpy
(
addr
.
sun_path
,
DK
P_DEVD_SOCK_PATH
,
sizeof
(
addr
.
sun_path
));
strncpy
(
addr
.
sun_path
,
U
P_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
,
dk
p_devd_event_cb
,
backend
);
g_io_add_watch
(
channel
,
G_IO_IN
,
u
p_devd_event_cb
,
backend
);
g_io_channel_unref
(
channel
);
dk
p_devd_inited
=
TRUE
;
u
p_devd_inited
=
TRUE
;
}
else
{
egg_warning
(
"failed to connect to %s: '%s'"