~jpsamaroo/DBus.jl

ref: 9e5239501e185e95ce1b6d1a321da3de82b169ba DBus.jl/src/api.jl -rw-r--r-- 822 bytes
9e523950Julian P Samaroo Initial commit 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
struct DBusError
    name::Cstring
    message::Cstring

    dummy1::Cuint
    dummy2::Cuint
    dummy3::Cuint
    dummy4::Cuint
    dummy5::Cuint

    padding::Ptr{Cvoid}
end

function dbus_error_init(error)
    ccall((:dbus_error_init, libdbus), Cvoid, (Ptr{DBusError},), error)
end
function dbus_error_free(error)
    ccall((:dbus_error_free, libdbus), Cvoid, (Ptr{DBusError},), error)
end
function dbus_error_is_set(error)
    ccall((:dbus_error_is_set, libdbus), Cint, (Ptr{DBusError},), error) != 0
end

const DBusConnection = Cvoid
@enum DBusBusType begin
    DBUS_BUS_SESSION = Cint(0)
    DBUS_BUS_SYSTEM = Cint(1)
    DBUS_BUS_STARTER = Cint(2)
end

function dbus_bus_get(bus_type::DBusBusType, error)
    ccall((:dbus_bus_get, libdbus), Ptr{DBusConnection}, (DBusBusType, Ptr{DBusError},), bus_type, error)
end