]> git.ipfire.org Git - thirdparty/systemd.git/blame - udev_utils.h
[PATCH] udev-test.pl: add test for DEVNAME export to RUN environment
[thirdparty/systemd.git] / udev_utils.h
CommitLineData
c81b35c0
KS
1/*
2 * udev_lib - generic stuff used by udev
3 *
4 * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
5 *
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 675 Mass Ave, Cambridge, MA 02139, USA.
19 *
20 */
21
22#ifndef _UDEV_LIB_H_
23#define _UDEV_LIB_H_
24
7a947ce5 25#include "udev.h"
c81b35c0 26
f0308095
KS
27struct name_entry {
28 struct list_head node;
63f61c5c 29 char name[PATH_SIZE];
f0308095
KS
30};
31
fb39f056 32extern int udev_init_device(struct udevice *udev, const char* devpath, const char *subsystem, const char *action);
e48fc108
KS
33extern void udev_cleanup_device(struct udevice *udev);
34
85925517 35extern int kernel_release_satisfactory(unsigned int version, unsigned int patchlevel, unsigned int sublevel);
2b41e68a 36extern int create_path(const char *path);
9f8dfa19 37extern int parse_get_pair(char **orig_string, char **left, char **right);
c1ab0461 38extern int unlink_secure(const char *filename);
c81b35c0
KS
39extern int file_map(const char *filename, char **buf, size_t *bufsize);
40extern void file_unmap(char *buf, size_t bufsize);
9f8dfa19 41extern size_t buf_get_line(const char *buf, size_t buflen, size_t cur);
18614ab2
KS
42extern void remove_trailing_char(char *path, char c);
43extern void replace_untrusted_chars(char *string);
f0308095 44extern int name_list_add(struct list_head *name_list, const char *name, int sort);
67747e1d 45extern int add_matching_files(struct list_head *name_list, const char *dirname, const char *suffix);
fb39f056 46extern int execute_command(const char *command, const char *subsystem);
67747e1d 47
c81b35c0 48#endif