forked from mer-hybris/mce-plugin-libhybris
-
Notifications
You must be signed in to change notification settings - Fork 2
/
sysfs-val.h
53 lines (46 loc) · 2.14 KB
/
sysfs-val.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
48
49
50
51
52
53
/** @file sysfs-val.h
*
* mce-plugin-libhybris - Libhybris plugin for Mode Control Entity
* <p>
* Copyright (c) 2017 Jolla Ltd.
* Copyright (c) 2024 Jollyboys Ltd.
* <p>
* @author Simo Piiroinen <[email protected]>
*
* mce-plugin-libhybris is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
*
* mce-plugin-libhybris is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with mce-plugin-libhybris; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SYSFS_VAL_H_
# define SYSFS_VAL_H_
#include <stdbool.h>
/* ========================================================================= *
* TYPES
* ========================================================================= */
typedef struct sysfsval_t sysfsval_t;
/* ========================================================================= *
* PROTOS
* ========================================================================= */
sysfsval_t *sysfsval_create (void);
void sysfsval_delete (sysfsval_t *self);
void sysfsval_delete_at (sysfsval_t **pself);
bool sysfsval_open_rw (sysfsval_t *self, const char *path);
bool sysfsval_open_ro (sysfsval_t *self, const char *path);
void sysfsval_close (sysfsval_t *self);
const char *sysfsval_path (const sysfsval_t *self);
int sysfsval_get (const sysfsval_t *self);
bool sysfsval_set (sysfsval_t *self, int value);
void sysfsval_assume (sysfsval_t *self, int value);
void sysfsval_invalidate(sysfsval_t *self);
bool sysfsval_refresh (sysfsval_t *self);
#endif /* SYSFS_VAL_H_ */