summaryrefslogtreecommitdiff
path: root/src/util/file/file.h
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2026-08-25 19:35:41 -0400
committerAndrew Opalach <andrew@akon.city> 2026-08-25 19:35:41 -0400
commitd2d8e2fa52c5633f6376e4d3b1d7aca9a9ea14b0 (patch)
tree8ffa2790d581fc375720d1ab1146d6ac3cb63bff /src/util/file/file.h
parenta389b8f2f9c55b76fe5a28c3f1fea798ed37aa98 (diff)
downloadlibnaunet-d2d8e2fa52c5633f6376e4d3b1d7aca9a9ea14b0.tar.gz
libnaunet-d2d8e2fa52c5633f6376e4d3b1d7aca9a9ea14b0.tar.bz2
libnaunet-d2d8e2fa52c5633f6376e4d3b1d7aca9a9ea14b0.zip
File fixes
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/util/file/file.h')
-rw-r--r--src/util/file/file.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/util/file/file.h b/src/util/file/file.h
index 4df4c96..77344f8 100644
--- a/src/util/file/file.h
+++ b/src/util/file/file.h
@@ -3,6 +3,15 @@
#include <al/str.h>
#include <al/lib.h>
+/*
+#if defined NAUNET_ON_WINDOWS && defined AL_WE_32BIT
+AL_ASSERT_TYPE_SIZE(off_t, 4);
+#else
+AL_ASSERT_TYPE_SIZE(off_t, 8);
+#endif
+*/
+AL_ASSERT_TYPE_SIZE(off_t, 8);
+
#ifdef NAUNET_NEEDS_STDIO_ASSIST
// It seems meson adds _FILE_OFFSET_BITS=64 on all "linuxlike" compilers even MinGW.
// https://github.com/mesonbuild/meson/commit/853634a48da025c59eef70161dba0d150833f60d
@@ -52,7 +61,7 @@ struct nn_file {
#endif
#endif
str path;
- size_t size;
+ off_t size;
};
struct nn_dir {
@@ -77,7 +86,11 @@ struct nn_dir_entry {
#endif
};
+void nn_path_append(str *path, str *part);
+void nn_path_prepend(str *path, str *part);
+
bool nn_file_open(struct nn_file *file, str *path, s32 flags);
+bool nn_file_wrap_fd(struct nn_file *file, s32 fd);
bool nn_file_exists(str *path);
bool nn_file_create(str *path);
bool nn_file_truncate(struct nn_file *file, off_t size);