File: util_udev.h

package info (click to toggle)
s390-tools 2.35.0-3
  • links: PTS
  • area: main
  • in suites: forky
  • size: 12,248 kB
  • sloc: ansic: 184,236; sh: 12,152; cpp: 4,954; makefile: 2,763; perl: 2,519; asm: 1,085; python: 697; xml: 29
file content (44 lines) | stat: -rw-r--r-- 1,021 bytes parent folder | download | duplicates (3)
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
/*
 * @defgroup util_udev_h  util_udev: UDEV interface
 * @{
 * @brief Work with UDEV files
 *
 * Copyright IBM Corp. 2022
 *
 * s390-tools is free software; you can redistribute it and/or modify
 * it under the terms of the MIT license. See LICENSE for details.
 */

#ifndef LIB_UTIL_UDEV_H
#define LIB_UTIL_UDEV_H

#include <stdbool.h>
#include "lib/util_exit_code.h"
#include "lib/util_list.h"

/* Single key-operator-value entry in a udev rule line.*/
struct util_udev_entry_node {
	struct util_list_node node;
	char *key;
	char *op;
	char *value;
};

/* Single udev line in a udev rule file. */
struct util_udev_line_node {
	struct util_list_node node;
	struct util_list entries;
	char *line;
};

/* Udev rule file. */
struct util_udev_file {
	struct util_list lines;
};

util_exit_code_t util_udev_read_file(const char *path,
				     struct util_udev_file **file_ptr);
void util_udev_free_file(struct util_udev_file *file);
void util_udev_file_print(struct util_udev_file *file);

#endif /** LIB_UTIL_UDEV_H @} */