summaryrefslogtreecommitdiffstats
path: root/src/shared/open-file.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/open-file.h')
-rw-r--r--src/shared/open-file.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/shared/open-file.h b/src/shared/open-file.h
index bb63ec8..4999c96 100644
--- a/src/shared/open-file.h
+++ b/src/shared/open-file.h
@@ -1,8 +1,8 @@
-
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "list.h"
+#include "macro.h"
typedef enum OpenFileFlag {
OPENFILE_READ_ONLY = 1 << 0,
@@ -27,10 +27,12 @@ int open_file_validate(const OpenFile *of);
int open_file_to_string(const OpenFile *of, char **ret);
-OpenFile *open_file_free(OpenFile *of);
+OpenFile* open_file_free(OpenFile *of);
DEFINE_TRIVIAL_CLEANUP_FUNC(OpenFile*, open_file_free);
-void open_file_free_many(OpenFile **head);
+static inline void open_file_free_many(OpenFile **head) {
+ LIST_CLEAR(open_files, *ASSERT_PTR(head), open_file_free);
+}
-const char *open_file_flags_to_string(OpenFileFlag t) _const_;
+const char* open_file_flags_to_string(OpenFileFlag t) _const_;
OpenFileFlag open_file_flags_from_string(const char *t) _pure_;