]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - include/path.h
scriptreplay: add --stream to the man page
[thirdparty/util-linux.git] / include / path.h
index ebdb58d05ddf2d6c7905bd9109a86ab96de0e27f..d39a8ca372c0597e3eccaf30ed63702bf5d1358a 100644 (file)
@@ -3,10 +3,11 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <stdint.h>
 #include <sys/types.h>
 #include <dirent.h>
 
+#include "c.h"
+
 struct path_cxt {
        int     dir_fd;
        char    *dir_path;
@@ -21,7 +22,7 @@ struct path_cxt {
        int     (*redirect_on_enoent)(struct path_cxt *, const char *, int *);
 };
 
-struct path_cxt *ul_new_path(const char *dir);
+struct path_cxt *ul_new_path(const char *dir, ...);
 void ul_unref_path(struct path_cxt *pc);
 void ul_ref_path(struct path_cxt *pc);
 
@@ -38,6 +39,8 @@ void *ul_path_get_dialect(struct path_cxt *pc);
 
 int ul_path_set_enoent_redirect(struct path_cxt *pc, int (*func)(struct path_cxt *, const char *, int *));
 int ul_path_get_dirfd(struct path_cxt *pc);
+void ul_path_close_dirfd(struct path_cxt *pc);
+int ul_path_isopen_dirfd(struct path_cxt *pc);
 
 char *ul_path_get_abspath(struct path_cxt *pc, char *buf, size_t bufsz, const char *path, ...)
                                __attribute__ ((__format__ (__printf__, 4, 5)));
@@ -74,6 +77,10 @@ int ul_path_read_string(struct path_cxt *pc, char **str, const char *path);
 int ul_path_readf_string(struct path_cxt *pc, char **str, const char *path, ...)
                                __attribute__ ((__format__ (__printf__, 3, 4)));
 
+int ul_path_read_buffer(struct path_cxt *pc, char *buf, size_t bufsz, const char *path);
+int ul_path_readf_buffer(struct path_cxt *pc, char *buf, size_t bufsz, const char *path, ...)
+                               __attribute__ ((__format__ (__printf__, 4, 5)));
+
 int ul_path_scanf(struct path_cxt *pc, const char *path, const char *fmt, ...);
 int ul_path_scanff(struct path_cxt *pc, const char *path, va_list ap, const char *fmt, ...)
                                __attribute__ ((__format__ (__scanf__, 4, 5)));
@@ -102,6 +109,7 @@ int ul_path_write_string(struct path_cxt *pc, const char *str, const char *path)
 int ul_path_writef_string(struct path_cxt *pc, const char *str, const char *path, ...)
                                __attribute__ ((__format__ (__printf__, 3, 4)));
 
+int ul_path_write_s64(struct path_cxt *pc, int64_t num, const char *path);
 int ul_path_write_u64(struct path_cxt *pc, uint64_t num, const char *path);
 int ul_path_writef_u64(struct path_cxt *pc, uint64_t num, const char *path, ...)
                                __attribute__ ((__format__ (__printf__, 3, 4)));
@@ -110,6 +118,7 @@ int ul_path_count_dirents(struct path_cxt *pc, const char *path);
 int ul_path_countf_dirents(struct path_cxt *pc, const char *path, ...)
                                __attribute__ ((__format__ (__printf__, 2, 3)));
 
+FILE *ul_prefix_fopen(const char *prefix, const char *path, const char *mode);
 
 
 #ifdef HAVE_CPU_SET_T