summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-05-26 15:09:11 +0000
committermidipix <writeonce@midipix.org>2024-05-26 15:09:11 +0000
commit0ee4a827bc3b3a71234df5c44288d15ad697b724 (patch)
tree023d290cc147a4a2833b0f55af41216e7469048f
parent4cb6ae148e6bd9d832c637a5fdd01d68febdbf67 (diff)
downloadtpax-0ee4a827bc3b3a71234df5c44288d15ad697b724.tar.bz2
tpax-0ee4a827bc3b3a71234df5c44288d15ad697b724.tar.xz
library api's: _io_ (low level interfaces) namespace overhaul.
-rw-r--r--include/tpax/tpax.h10
-rw-r--r--project/common.mk4
-rw-r--r--project/tree.mk1
-rw-r--r--src/io/tpax_create_memory_snapshot.c (renamed from src/logic/tpax_file_create_memory_snapshot.c)2
-rw-r--r--src/io/tpax_create_tmpfs_snapshot.c (renamed from src/logic/tpax_file_create_tmpfs_snapshot.c)2
-rw-r--r--src/logic/tpax_archive_write.c4
6 files changed, 12 insertions, 11 deletions
diff --git a/include/tpax/tpax.h b/include/tpax/tpax.h
index 3514858..ac7745a 100644
--- a/include/tpax/tpax.h
+++ b/include/tpax/tpax.h
@@ -172,12 +172,12 @@ tpax_api int tpax_output_error_record (const struct tpax_driver_ctx *, con
tpax_api int tpax_meta_init_ustar_header (const struct tpax_driver_ctx *, const char *, const struct stat *,
const char *, struct tpax_ustar_header *);
-/* low-level api */
-tpax_api int tpax_file_create_memory_snapshot (const struct tpax_driver_ctx *, int, const char *,
- const struct stat *, void *);
+/* low-level interfaces */
+tpax_api int tpax_io_create_memory_snapshot(const struct tpax_driver_ctx *, int, const char *,
+ const struct stat *, void *);
-tpax_api int tpax_file_create_tmpfs_snapshot (const struct tpax_driver_ctx *, int, const char *,
- const struct stat *);
+tpax_api int tpax_io_create_tmpfs_snapshot (const struct tpax_driver_ctx *, int, const char *,
+ const struct stat *);
/* package info */
tpax_api const struct tpax_source_version * tpax_source_version(void);
diff --git a/project/common.mk b/project/common.mk
index 43297fb..a23c2ef 100644
--- a/project/common.mk
+++ b/project/common.mk
@@ -2,10 +2,10 @@ API_SRCS = \
src/driver/tpax_amain.c \
src/driver/tpax_driver_ctx.c \
src/driver/tpax_unit_ctx.c \
+ src/io/tpax_create_memory_snapshot.c \
+ src/io/tpax_create_tmpfs_snapshot.c \
src/logic/tpax_archive_append.c \
src/logic/tpax_archive_write.c \
- src/logic/tpax_file_create_memory_snapshot.c \
- src/logic/tpax_file_create_tmpfs_snapshot.c \
src/logic/tpax_queue_vector.c \
src/meta/tpax_init_ustar_header.c \
src/output/tpax_output_error.c \
diff --git a/project/tree.mk b/project/tree.mk
index 90a5470..affd4ba 100644
--- a/project/tree.mk
+++ b/project/tree.mk
@@ -1,6 +1,7 @@
TREE_DIRS = bin lib src \
src/driver \
src/internal \
+ src/io \
src/logic \
src/meta \
src/output \
diff --git a/src/logic/tpax_file_create_memory_snapshot.c b/src/io/tpax_create_memory_snapshot.c
index 504a4a1..7c3dd7e 100644
--- a/src/logic/tpax_file_create_memory_snapshot.c
+++ b/src/io/tpax_create_memory_snapshot.c
@@ -23,7 +23,7 @@
#define ssizeof(x) (ssize_t)(sizeof(x))
#endif
-int tpax_file_create_memory_snapshot(
+int tpax_io_create_memory_snapshot(
const struct tpax_driver_ctx * dctx,
int fdat,
const char * path,
diff --git a/src/logic/tpax_file_create_tmpfs_snapshot.c b/src/io/tpax_create_tmpfs_snapshot.c
index 2e92211..9891e98 100644
--- a/src/logic/tpax_file_create_tmpfs_snapshot.c
+++ b/src/io/tpax_create_tmpfs_snapshot.c
@@ -24,7 +24,7 @@
#define ssizeof(x) (ssize_t)(sizeof(x))
#endif
-int tpax_file_create_tmpfs_snapshot(
+int tpax_io_create_tmpfs_snapshot(
const struct tpax_driver_ctx * dctx,
int fdat,
const char * path,
diff --git a/src/logic/tpax_archive_write.c b/src/logic/tpax_archive_write.c
index c5109d3..5214787 100644
--- a/src/logic/tpax_archive_write.c
+++ b/src/logic/tpax_archive_write.c
@@ -130,14 +130,14 @@ static int tpax_archive_write_impl(
/* snapshot */
if (membuf) {
- if (tpax_file_create_memory_snapshot(
+ if (tpax_io_create_memory_snapshot(
dctx,fdcwd,path,
uctx->st,membuf) < 0)
return tpax_archive_write_ret(
TPAX_NESTED_ERROR(dctx),
uctx);
} else {
- if ((fdtmp = tpax_file_create_tmpfs_snapshot(
+ if ((fdtmp = tpax_io_create_tmpfs_snapshot(
dctx,fdcwd,path,
uctx->st)) < 0)
return tpax_archive_write_ret(