GVM User Suite
User tools for the GVM open source project.
device.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 2666680 Ontario Inc.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  */
19 #ifndef UTILS_DEVICE_H
20 #define UTILS_DEVICE_H
21 
22 #include <stdint.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
41 uint8_t device_exists(const char* device_name);
42 
59 int32_t get_major(const char* device);
60 
84 int32_t get_param(const char* filename, const char* parameter);
85 
86 #ifdef __cplusplus
87 };
88 #endif
89 
90 #endif
uint8_t device_exists(const char *device_name)
Does a device file exist?
Definition: device.c:30
int32_t get_major(const char *device)
Gets the device major id from /proc/devices.
Definition: device.c:42
int32_t get_param(const char *filename, const char *parameter)
Gets a parameter from a driver param file.
Definition: device.c:71