summaryrefslogtreecommitdiff
path: root/src/helper/slbt_archive_import.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-19 01:54:51 +0000
committermidipix <writeonce@midipix.org>2024-02-19 02:59:31 +0000
commit8dc63ddc326ec54709c580a400536fcc4ef62622 (patch)
tree2a019207f3ea1ae39273fa8246c0cae7e6341ca4 /src/helper/slbt_archive_import.c
parent51c276fbf1686c340588660a754ea04e6099cd37 (diff)
downloadslibtool-8dc63ddc326ec54709c580a400536fcc4ef62622.tar.bz2
slibtool-8dc63ddc326ec54709c580a400536fcc4ef62622.tar.xz
library api's: _util_ (utility helper interfaces) namespace overhaul.
Diffstat (limited to 'src/helper/slbt_archive_import.c')
-rw-r--r--src/helper/slbt_archive_import.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/src/helper/slbt_archive_import.c b/src/helper/slbt_archive_import.c
deleted file mode 100644
index d339f78..0000000
--- a/src/helper/slbt_archive_import.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************/
-/* slibtool: a skinny libtool implementation, written in C */
-/* Copyright (C) 2016--2024 SysDeer Technologies, LLC */
-/* Released under the Standard MIT License; see COPYING.SLIBTOOL. */
-/*******************************************************************/
-
-#include <slibtool/slibtool.h>
-#include "slibtool_driver_impl.h"
-#include "slibtool_symlink_impl.h"
-#include "slibtool_errinfo_impl.h"
-
-/* legacy fallback, no longer in use */
-extern int slbt_archive_import_mri(
- const struct slbt_driver_ctx * dctx,
- struct slbt_exec_ctx * ectx,
- char * dstarchive,
- char * srcarchive);
-
-/* use slibtool's in-memory archive merging facility */
-static int slbt_archive_import_impl(
- const struct slbt_driver_ctx * dctx,
- struct slbt_exec_ctx * ectx,
- char * dstarchive,
- char * srcarchive)
-{
- int ret;
- struct slbt_archive_ctx * arctxv[3] = {0,0,0};
- struct slbt_archive_ctx * arctx;
-
- (void)ectx;
-
- if (slbt_ar_get_archive_ctx(dctx,dstarchive,&arctxv[0]) < 0)
- return SLBT_NESTED_ERROR(dctx);
-
- if (slbt_ar_get_archive_ctx(dctx,srcarchive,&arctxv[1]) < 0) {
- slbt_ar_free_archive_ctx(arctxv[0]);
- return SLBT_NESTED_ERROR(dctx);
- }
-
- ret = slbt_ar_merge_archives(arctxv,&arctx);
-
- slbt_ar_free_archive_ctx(arctxv[0]);
- slbt_ar_free_archive_ctx(arctxv[1]);
-
- if (ret == 0) {
- ret = slbt_ar_store_archive(arctx,dstarchive,0644);
- slbt_ar_free_archive_ctx(arctx);
- }
-
- return (ret < 0) ? SLBT_NESTED_ERROR(dctx) : 0;
-}
-
-
-int slbt_archive_import(
- const struct slbt_driver_ctx * dctx,
- struct slbt_exec_ctx * ectx,
- char * dstarchive,
- char * srcarchive)
-{
- if (slbt_symlink_is_a_placeholder(
- slbt_driver_fdcwd(dctx),
- srcarchive))
- return 0;
-
- return slbt_archive_import_impl(
- dctx,ectx,
- dstarchive,
- srcarchive);
-}