-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspm.h
47 lines (40 loc) · 852 Bytes
/
spm.h
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
#ifndef SPM_H
#define SPM_H
#include <getopt.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "format.h"
#include "logger.h"
#include "power_options.h"
#include "battery_monitor.h"
#ifdef _ENABLE_GUI
#include "gui.h"
#endif /* ENABLE_GUI */
typedef struct
{
bool monitor;
bool poweroff;
bool hibernate;
bool reboot;
bool suspend;
bool help;
size_t time_to_wait;
} Options;
bool as_daemon;
bool debug;
bool verbose;
char* log_file;
const char* prog_name;
char* locker_cmd;
const char* version = "SPM v1.4.1";
uint8_t usage(void);
uint8_t exec_option(const Options* options);
void* run_locker(void* locker_cmd);
void run_timer(size_t seconds);
void monitorize(bool monitor);
#endif