summaryrefslogtreecommitdiffhomepage
path: root/src/arbits/output
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-03-22 02:37:12 +0000
committermidipix <writeonce@midipix.org>2024-03-22 03:51:35 +0000
commit73a403268821740b9292030a7a9abaad16577e26 (patch)
tree83b85e41108575aa7c1acfa23ebc0ae8a4e21dcc /src/arbits/output
parent88fa98d8f5fb893eba60d3b5adb51db9fd23b01f (diff)
downloadslibtool-73a403268821740b9292030a7a9abaad16577e26.tar.bz2
slibtool-73a403268821740b9292030a7a9abaad16577e26.tar.xz
slbt_au_output_symbols(): refactor prior to slbt_au_output_symbols_yaml().
Diffstat (limited to 'src/arbits/output')
-rw-r--r--src/arbits/output/slbt_au_output_symbols.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/arbits/output/slbt_au_output_symbols.c b/src/arbits/output/slbt_au_output_symbols.c
index 49d78ae..911af2c 100644
--- a/src/arbits/output/slbt_au_output_symbols.c
+++ b/src/arbits/output/slbt_au_output_symbols.c
@@ -23,9 +23,8 @@
static int slbt_au_output_symbols_posix(
const struct slbt_driver_ctx * dctx,
struct slbt_archive_meta_impl * mctx,
- const struct slbt_fd_ctx * fdctx)
+ int fdout)
{
- int fdout;
bool fsort;
bool fcoff;
const char * dot;
@@ -37,7 +36,6 @@ static int slbt_au_output_symbols_posix(
regmatch_t pmatch[2] = {{0,0},{0,0}};
char strbuf[4096];
- fdout = fdctx->fdout;
fsort = !(dctx->cctx->fmtflags & SLBT_OUTPUT_ARCHIVE_NOSORT);
fcoff = (mctx->ofmtattr & AR_OBJECT_ATTR_COFF);
@@ -83,11 +81,11 @@ static int slbt_au_output_symbols_posix(
static int slbt_au_output_symbols_yaml(
const struct slbt_driver_ctx * dctx,
struct slbt_archive_meta_impl * mctx,
- const struct slbt_fd_ctx * fdctx)
+ int fdout)
{
(void)dctx;
(void)mctx;
- (void)fdctx;
+ (void)fdout;
return 0;
}
@@ -96,13 +94,12 @@ int slbt_au_output_symbols(const struct slbt_archive_meta * meta)
{
struct slbt_archive_meta_impl * mctx;
const struct slbt_driver_ctx * dctx;
- struct slbt_fd_ctx fdctx;
+ int fdout;
mctx = slbt_archive_meta_ictx(meta);
dctx = (slbt_archive_meta_ictx(meta))->dctx;
- if (slbt_lib_get_driver_fdctx(dctx,&fdctx) < 0)
- return SLBT_NESTED_ERROR(dctx);
+ fdout = slbt_driver_fdout(dctx);
if (!meta->a_memberv)
return 0;
@@ -110,14 +107,14 @@ int slbt_au_output_symbols(const struct slbt_archive_meta * meta)
switch (dctx->cctx->fmtflags & SLBT_PRETTY_FLAGS) {
case SLBT_PRETTY_YAML:
return slbt_au_output_symbols_yaml(
- dctx,mctx,&fdctx);
+ dctx,mctx,fdout);
case SLBT_PRETTY_POSIX:
return slbt_au_output_symbols_posix(
- dctx,mctx,&fdctx);
+ dctx,mctx,fdout);
default:
return slbt_au_output_symbols_yaml(
- dctx,mctx,&fdctx);
+ dctx,mctx,fdout);
}
}