]>
gitweb.michael.orlitzky.com - xfce4-hdaps.git/blob - panel-plugin/hdaps.h
2 * xfce4-hdaps, an XFCE4 panel plugin for the HDAPS system.
4 * Copyright (C) 2019 Michael Orlitzky
6 * http://michael.orlitzky.com/
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.
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:
18 * https://www.gnu.org/licenses/agpl-3.0.html
27 #define HDAPS_ERROR -1
30 #define UNLOAD_HEADS_FMT "/sys/block/%s/device/unload_heads"
32 /* The most devices we'll consider. Gotta stop somewhere. */
33 #define MAX_HDAPS_DEVICES 12
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
]);