create_floppy_devices_SOURCES = \
create_floppy_devices.c \
../../libudev/libudev.h \
+ ../../libudev/libudev-private.h \
../../libudev/libudev.c \
../../libudev/libudev-list.c \
../../libudev/libudev-util.c \
+ ../../libudev/libudev-util-private.c \
../../libudev/libudev-device.c \
- ../../libudev/libudev-enumerate.c \
- ../../udev/udev.h \
- ../../udev/udev-util.c
+ ../../libudev/libudev-enumerate.c
if USE_SELINUX
create_floppy_devices_SOURCES += \
- ../../udev/udev-selinux.c
+ ../../libudev/libudev-selinux-private.c
create_floppy_devices_LDADD = \
$(SELINUX_LIBS)
endif
#include "libudev.h"
#include "libudev-private.h"
-#include "../../udev/udev.h"
static char *table[] = {
"", "d360", "h1200", "u360", "u720", "h360", "h720",
#include <string.h>
#include <sys/stat.h>
-#include "udev.h"
+#include "libudev.h"
+#include "libudev-private.h"
static size_t devpath_to_db_path(struct udev *udev, const char *devpath, char *filename, size_t len)
{
#include "libudev.h"
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define UDEV_MAX(a,b) ((a) > (b) ? (a) : (b))
+#define READ_END 0
+#define WRITE_END 1
static inline void __attribute__((always_inline, format(printf, 2, 3)))
udev_log_null(struct udev *udev, const char *format, ...) {}
int udev_queue_export_device_finished(struct udev_queue_export *udev_queue_export, struct udev_device *udev_device);
int udev_queue_export_device_failed(struct udev_queue_export *udev_queue_export, struct udev_device *udev_device);
-/* libudev-utils.c */
+/* libudev-util.c */
#define UTIL_PATH_SIZE 1024
#define UTIL_LINE_SIZE 2048
#define UTIL_NAME_SIZE 512
int udev_util_encode_string(const char *str, char *str_enc, size_t len);
void util_set_fd_cloexec(int fd);
unsigned int util_string_hash32(const char *str);
+
+/* libudev-util-private.c */
+int util_create_path(struct udev *udev, const char *path);
+int util_delete_path(struct udev *udev, const char *path);
+int util_unlink_secure(struct udev *udev, const char *filename);
+uid_t util_lookup_user(struct udev *udev, const char *user);
+gid_t util_lookup_group(struct udev *udev, const char *group);
+int util_run_program(struct udev *udev, const char *command, char **envp,
+ char *result, size_t ressize, size_t *reslen);
+int util_resolve_subsys_kernel(struct udev *udev, const char *string,
+ char *result, size_t maxsize, int read_value);
+
+/* libudev-selinux-private.c */
+#ifndef USE_SELINUX
+static inline void udev_selinux_init(struct udev *udev) {}
+static inline void udev_selinux_exit(struct udev *udev) {}
+static inline void udev_selinux_lsetfilecon(struct udev *udev, const char *file, unsigned int mode) {}
+static inline void udev_selinux_setfscreatecon(struct udev *udev, const char *file, unsigned int mode) {}
+static inline void udev_selinux_resetfscreatecon(struct udev *udev) {}
+#else
+void udev_selinux_init(struct udev *udev);
+void udev_selinux_exit(struct udev *udev);
+void udev_selinux_lsetfilecon(struct udev *udev, const char *file, unsigned int mode);
+void udev_selinux_setfscreatecon(struct udev *udev, const char *file, unsigned int mode);
+void udev_selinux_resetfscreatecon(struct udev *udev);
+#endif
#endif
* DISCLAIMER - The file format mentioned here is private to udev/libudev,
* and may be changed without notice.
*
- *
* The udev event queue is exported as a binary log file.
* Each log record consists of a sequence number followed by the device path.
*
* The queue does not grow indefinitely. It is periodically re-created
* to remove finished events. Atomic rename() makes this transparent to readers.
*
- *
* The queue file starts with a single sequence number which specifies the
* minimum sequence number in the log that follows. Any events prior to this
* sequence number have already finished.
#include <sys/types.h>
#include <assert.h>
-#include "udev.h"
+#include "libudev.h"
+#include "libudev-private.h"
static int rebuild_queue_file(struct udev_queue_export *udev_queue_export);
unlink(filename);
}
-
static int skip_to(FILE *file, long offset)
{
long old_offset;
return -1;
}
-
enum device_state {
DEVICE_QUEUED,
DEVICE_FINISHED,
/*
- * Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
+ * libudev - interface to udev device information
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*/
#include <stdio.h>
#include <unistd.h>
#include <selinux/selinux.h>
-#include "udev.h"
+#include "libudev.h"
+#include "libudev-private.h"
static int selinux_enabled;
security_context_t selinux_prev_scontext;
/*
- * Copyright (C) 2004-2008 Kay Sievers <kay.sievers@vrfy.org>
+ * libudev - interface to udev device information
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2004-2009 Kay Sievers <kay.sievers@vrfy.org>
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*/
#include <stdlib.h>
#include <grp.h>
#include <sys/wait.h>
-#include "udev.h"
+#include "libudev.h"
+#include "libudev-private.h"
int util_create_path(struct udev *udev, const char *path)
{
udev-watch.c \
udev-node.c \
udev-rules.c \
- udev-util.c \
../libudev/libudev.h \
../libudev/libudev-private.h \
../libudev/libudev.c \
../libudev/libudev-list.c \
../libudev/libudev-util.c \
+ ../libudev/libudev-util-private.c \
../libudev/libudev-device.c \
../libudev/libudev-device-db-write.c \
../libudev/libudev-monitor.c \
if USE_SELINUX
common_files += \
- udev-selinux.c
+ ../libudev/libudev-selinux-private.c
common_ldadd += \
$(SELINUX_LIBS)
endif
#define UDEV_CTRL_SOCK_PATH "@" UDEV_PREFIX "/org/kernel/udev/udevd"
-#define UDEV_MAX(a,b) ((a) > (b) ? (a) : (b))
-#define READ_END 0
-#define WRITE_END 1
-
struct udev_event {
struct udev *udev;
struct udev_device *dev;
int udev_node_remove(struct udev_device *dev);
void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev_old);
-/* udev-util.c */
-int util_create_path(struct udev *udev, const char *path);
-int util_delete_path(struct udev *udev, const char *path);
-int util_unlink_secure(struct udev *udev, const char *filename);
-uid_t util_lookup_user(struct udev *udev, const char *user);
-gid_t util_lookup_group(struct udev *udev, const char *group);
-int util_run_program(struct udev *udev, const char *command, char **envp,
- char *result, size_t ressize, size_t *reslen);
-int util_resolve_subsys_kernel(struct udev *udev, const char *string,
- char *result, size_t maxsize, int read_value);
-
-/* udev-selinux.c */
-#ifndef USE_SELINUX
-static inline void udev_selinux_init(struct udev *udev) {}
-static inline void udev_selinux_exit(struct udev *udev) {}
-static inline void udev_selinux_lsetfilecon(struct udev *udev, const char *file, unsigned int mode) {}
-static inline void udev_selinux_setfscreatecon(struct udev *udev, const char *file, unsigned int mode) {}
-static inline void udev_selinux_resetfscreatecon(struct udev *udev) {}
-#else
-void udev_selinux_init(struct udev *udev);
-void udev_selinux_exit(struct udev *udev);
-void udev_selinux_lsetfilecon(struct udev *udev, const char *file, unsigned int mode);
-void udev_selinux_setfscreatecon(struct udev *udev, const char *file, unsigned int mode);
-void udev_selinux_resetfscreatecon(struct udev *udev);
-#endif
-
/* udevadm commands */
int udevadm_monitor(struct udev *udev, int argc, char *argv[]);
int udevadm_info(struct udev *udev, int argc, char *argv[]);