]> gitweb.michael.orlitzky.com - xfce4-hdaps.git/blob - panel-plugin/hdaps.h
Fixed build with --enable-debug=full thanks to Evgeni Golov.
[xfce4-hdaps.git] / panel-plugin / hdaps.h
1 /*
2 * xfce4-hdaps, an XFCE4 panel plugin for the HDAPS system.
3 *
4 * Copyright 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 General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (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 General Public License for more details.
17 *
18 * http://www.fsf.org/licensing/licenses/gpl.html
19 */
20
21 #ifndef __HDAPS_H__
22 #define __HDAPS_H__
23
24 #include <stdio.h>
25
26 #define HDAPS_ERROR -1
27 #define HDAPS_OFF 0
28 #define HDAPS_ON 1
29 #define UNLOAD_HEADS_FMT "/sys/block/%s/device/unload_heads"
30
31 /* The most devices we'll consider. Gotta stop somewhere. */
32 #define MAX_HDAPS_DEVICES 12
33
34 int parse_int_from_file(const char* filename);
35 int slurp_file(const char* filename, char* buf, int max_bytes);
36 int get_hdaps_device_list(char list[MAX_HDAPS_DEVICES][FILENAME_MAX]);
37
38 #endif