From ea0c351409b26d1b288442b8cc206bd908e64faf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 28 Apr 2024 23:22:13 +0200 Subject: [PATCH] lsfd: move interface of decode-file-flags to header MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use a proper header file to declare lsfd_decode_file_flags(). Signed-off-by: Thomas Weißschuh --- lsfd-cmd/Makemodule.am | 1 + lsfd-cmd/decode-file-flags.c | 3 +-- lsfd-cmd/decode-file-flags.h | 8 ++++++++ lsfd-cmd/file.c | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 lsfd-cmd/decode-file-flags.h diff --git a/lsfd-cmd/Makemodule.am b/lsfd-cmd/Makemodule.am index 577a780f5e..d28f869589 100644 --- a/lsfd-cmd/Makemodule.am +++ b/lsfd-cmd/Makemodule.am @@ -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 \ diff --git a/lsfd-cmd/decode-file-flags.c b/lsfd-cmd/decode-file-flags.c index bd87c7d794..7035d79d17 100644 --- a/lsfd-cmd/decode-file-flags.c +++ b/lsfd-cmd/decode-file-flags.c @@ -50,9 +50,8 @@ #endif #include /* 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 index 0000000000..88cd0d0bef --- /dev/null +++ b/lsfd-cmd/decode-file-flags.h @@ -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 */ diff --git a/lsfd-cmd/file.c b/lsfd-cmd/file.c index 25477cf2f1..02db8da5ee 100644 --- a/lsfd-cmd/file.c +++ b/lsfd-cmd/file.c @@ -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); -- 2.47.3