| 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 | /* SPDX-FileCopyrightText: 2022-2024 Bartosz Golaszewski <[email protected]> */ |
| 3 | |
| 4 | #ifndef __GPIODGLIB_MISC_H__ |
| 5 | #define __GPIODGLIB_MISC_H__ |
| 6 | |
| 7 | #if !defined(__INSIDE_GPIOD_GLIB_H__) && !defined(GPIODGLIB_COMPILATION) |
| 8 | #error "Only <gpiod-glib.h> can be included directly." |
| 9 | #endif |
| 10 | |
| 11 | #include <glib.h> |
| 12 | |
| 13 | G_BEGIN_DECLS |
| 14 | |
| 15 | /** |
| 16 | * gpiodglib_is_gpiochip_device: |
| 17 | * @path: Path to check. |
| 18 | * |
| 19 | * Check if the file pointed to by path is a GPIO chip character device. |
| 20 | * |
| 21 | * Returns: TRUE if the file exists and is either a GPIO chip character device |
| 22 | * or a symbolic link to one, FALSE otherwise. |
| 23 | */ |
| 24 | gboolean gpiodglib_is_gpiochip_device(const gchar *path); |
| 25 | |
| 26 | /** |
| 27 | * gpiodglib_api_version: |
| 28 | * |
| 29 | * Get the API version of the library as a human-readable string. |
| 30 | * |
| 31 | * Returns: A valid pointer to a human-readable string containing the library |
| 32 | * version. The pointer is valid for the lifetime of the program and must not |
| 33 | * be freed by the caller. |
| 34 | */ |
| 35 | const gchar *gpiodglib_api_version(void); |
| 36 | |
| 37 | G_END_DECLS |
| 38 | |
| 39 | #endif /* __GPIODGLIB_MISC_H__ */ |