]> gitweb.michael.orlitzky.com - xfce4-hdaps.git/blob - panel-plugin/hdaps.h
configure.ac.in: declare a "foreign" package and drop redundant NEWS file.
[xfce4-hdaps.git] / panel-plugin / hdaps.h
1 /*
2 * xfce4-hdaps, an XFCE4 panel plugin for the HDAPS system.
3 *
4 * Copyright (C) 2019 Michael Orlitzky
5 *
6 * http://michael.orlitzky.com/
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details:
17 *
18 * https://www.gnu.org/licenses/agpl-3.0.html
19 *
20 */
21
22 #ifndef __HDAPS_H__
23 #define __HDAPS_H__
24
25 #include <stdio.h>
26
27 #define HDAPS_ERROR -1
28 #define HDAPS_OFF 0
29 #define HDAPS_ON 1
30 #define UNLOAD_HEADS_FMT "/sys/block/%s/device/unload_heads"
31
32 /* The most devices we'll consider. Gotta stop somewhere. */
33 #define MAX_HDAPS_DEVICES 12
34
35 int parse_int_from_file(const char* filename);
36 int slurp_file(const char* filename, char* buf, int max_bytes);
37 int get_hdaps_device_list(char list[MAX_HDAPS_DEVICES][FILENAME_MAX]);
38
39 #endif