chiark / gitweb /
add SUSE rules
[elogind.git] / udev_utils.h
1 /*
2  * udev_utils.c - generic stuff used by udev
3  *
4  * Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
5  *
6  *      This program is free software; you can redistribute it and/or modify it
7  *      under the terms of the GNU General Public License as published by the
8  *      Free Software Foundation version 2 of the License.
9  * 
10  *      This program is distributed in the hope that it will be useful, but
11  *      WITHOUT ANY WARRANTY; without even the implied warranty of
12  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  *      General Public License for more details.
14  * 
15  *      You should have received a copy of the GNU General Public License along
16  *      with this program; if not, write to the Free Software Foundation, Inc.,
17  *      675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  */
20
21 #ifndef _UDEV_COMMON_H_
22 #define _UDEV_COMMON_H_
23
24 #include "udev.h"
25 #include "list.h"
26
27 struct name_entry {
28         struct list_head node;
29         char name[PATH_SIZE];
30 };
31
32 extern int strcmp_pattern(const char *p, const char *s);
33 extern int kernel_release_satisfactory(unsigned int version, unsigned int patchlevel, unsigned int sublevel);
34 extern int create_path(const char *path);
35 extern int log_priority(const char *priority);
36 extern int string_is_true(const char *str);
37 extern int parse_get_pair(char **orig_string, char **left, char **right);
38 extern int unlink_secure(const char *filename);
39 extern int file_map(const char *filename, char **buf, size_t *bufsize);
40 extern void file_unmap(void *buf, size_t bufsize);
41 extern size_t buf_get_line(const char *buf, size_t buflen, size_t cur);
42 extern void remove_trailing_char(char *path, char c);
43 extern void replace_untrusted_chars(char *string);
44 extern int name_list_add(struct list_head *name_list, const char *name, int sort);
45 extern int name_list_key_add(struct list_head *name_list, const char *key, const char *value);
46 extern int add_matching_files(struct list_head *name_list, const char *dirname, const char *suffix);
47 extern int pass_env_to_socket(const char *name, const char *devpath, const char *action);
48 extern int execute_program(const char *command, const char *subsystem,
49                            char *result, size_t ressize, size_t *reslen);
50
51 #endif