]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: move interface of decode-file-flags to header
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 28 Apr 2024 21:22:13 +0000 (23:22 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Sun, 28 Apr 2024 21:27:06 +0000 (23:27 +0200)
Use a proper header file to declare lsfd_decode_file_flags().

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
lsfd-cmd/Makemodule.am
lsfd-cmd/decode-file-flags.c
lsfd-cmd/decode-file-flags.h [new file with mode: 0644]
lsfd-cmd/file.c

index 577a780f5efac420fb0b881adc3cb6002002a861..d28f8695890eed0303d65e9c22eaa08f78056b9a 100644 (file)
@@ -9,6 +9,7 @@ lsfd_SOURCES = \
        lsfd-cmd/lsfd.c \
        lsfd-cmd/lsfd.h \
        lsfd-cmd/decode-file-flags.c \
+       lsfd-cmd/decode-file-flags.h \
        lsfd-cmd/file.c \
        lsfd-cmd/cdev.c \
        lsfd-cmd/bdev.c \
index bd87c7d794f3e4e566ff382d63f3665b136f0ec6..7035d79d17f8d1ace9810278e0ea37e325f8e8e2 100644 (file)
@@ -50,9 +50,8 @@
 #endif
 
 #include <stddef.h>            /* for size_t */
-struct ul_buffer;
 
-void lsfd_decode_file_flags(struct ul_buffer *buf, int flags);
+#include "decode-file-flags.h"
 
 /* We cannot include buffer.h because buffer.h includes
  * /usr/include/fcntl.h indirectly. */
diff --git a/lsfd-cmd/decode-file-flags.h b/lsfd-cmd/decode-file-flags.h
new file mode 100644 (file)
index 0000000..88cd0d0
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef UTIL_LINUX_LSFD_DECODE_FILE_FLAGS_H
+#define UTIL_LINUX_LSFD_DECODE_FILE_FLAGS_H
+
+struct ul_buffer;
+
+void lsfd_decode_file_flags(struct ul_buffer *buf, int flags);
+
+#endif /* UTIL_LINUX_LSFD_DECODE_FILE_FLAGS_H */
index 25477cf2f1da79a17b16332dd0ac0157d47eb823..02db8da5ee5b2f31b4ce9ec4e042b00b9ea62910 100644 (file)
@@ -47,6 +47,7 @@
 #include "lsfd.h"
 #include "pidfd.h"
 #include "pidfd-utils.h"
+#include "decode-file-flags.h"
 
 static size_t pagesize;
 
@@ -84,7 +85,6 @@ static const char *assocstr[N_ASSOCS] = {
        [ASSOC_SHM]       = "shm",
 };
 
-extern void lsfd_decode_file_flags(struct ul_buffer *buf, int flags);
 static void file_fill_flags_buf(struct ul_buffer *buf, int flags)
 {
        lsfd_decode_file_flags(buf, flags);