summaryrefslogtreecommitdiff
path: root/src/d_bus_commands.h
blob: 51ad2fe50e4db173dc41becf0df859a4eeb8bc51 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef D_BUS_COMMANDS_H
#define D_BUS_COMMANDS_H

#include <stdbool.h>

#include "d_bus.h"
#include "d_bus_variant.h"

#ifdef __cplusplus
extern "C" {
#endif

#define COMMAND_UNKNOWN -1
typedef struct
{
    int command;
    const string_quadruple_t * path;
}command_dbus_path_t;



typedef struct
{
    int command;
    dbus_value_variant_t member;
}command_dbus_member_t;

typedef struct
{
    const char* name;
    int command;
    const char* help;
}universal_command_t;

int parse_command2enum(const char* command, const universal_command_t* cmds);
const string_quadruple_t* get_dbus_command_interface(int cmd, const command_dbus_path_t* pathes);
const char* get_dbus_command_member_string(int cmd, const command_dbus_member_t* values);
const dbus_value_variant_t* get_dbus_command_member(int cmd, const command_dbus_member_t* values);
int com_dbus_property( char *arg, const universal_command_t* commands, const command_dbus_path_t* paths, const command_dbus_member_t* values);
void print_command_help(const universal_command_t* cmds);
const command_dbus_member_t* get_dbus_command_by_member(const char* member, const command_dbus_member_t* values);
const universal_command_t* get_command_by_enum(int cmd, const universal_command_t* cmds);

#ifdef __cplusplus
}
#endif

#endif // D_BUS_COMMANDS_H