-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgetinfo.h
More file actions
89 lines (78 loc) · 1.82 KB
/
getinfo.h
File metadata and controls
89 lines (78 loc) · 1.82 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* SPDX-License-Identifier: GPL-2.0-only
* Copyright (C) 2025 Bardia Moshiri <bardia@furilabs.com>
*/
#ifndef GETINFO_H
#define GETINFO_H
#include <glib.h>
/**
* BatmanState:
* @active: Whether the batman service is currently active
* @enabled: Whether the batman service is enabled at boot
*
* Structure containing the current state of the batman service
*/
typedef struct {
gboolean active;
gboolean enabled;
} BatmanState;
extern BatmanState bm_state;
/**
* check_batman_active:
*
* Checks if the batman service is currently active using systemd D-Bus interface
*
* Returns: 0 on success, -1 on failure
*/
int
check_batman_active(void);
/**
* check_batman_enabled:
*
* Checks if the batman service is enabled at boot using systemd D-Bus interface
*
* Returns: 0 on success, -1 on failure
*/
int
check_batman_enabled(void);
/**
* start_batman_service:
* @error: (nullable): Return location for error
*
* Starts the batman systemd service using D-Bus
*
* Returns: %TRUE on success, %FALSE if an error occurred
*/
gboolean
start_batman_service(GError **error);
/**
* stop_batman_service:
* @error: (nullable): Return location for error
*
* Stops the batman systemd service using D-Bus
*
* Returns: %TRUE on success, %FALSE if an error occurred
*/
gboolean
stop_batman_service(GError **error);
/**
* enable_batman_service:
* @error: (nullable): Return location for error
*
* Enables the batman systemd service using D-Bus
*
* Returns: %TRUE on success, %FALSE if an error occurred
*/
gboolean
enable_batman_service(GError **error);
/**
* disable_batman_service:
* @error: (nullable): Return location for error
*
* Disables the batman systemd service using D-Bus
*
* Returns: %TRUE on success, %FALSE if an error occurred
*/
gboolean
disable_batman_service(GError **error);
#endif /* GETINFO_H */