diff options
author | midipix <writeonce@midipix.org> | 2024-02-03 17:31:00 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-02-03 17:31:00 +0000 |
commit | c4f93fdfa0d79d01baf0a6879be72bed1678b922 (patch) | |
tree | c948871f5c6f7d7beeecaf5b8e15d43184381bc1 /src/arbits | |
parent | 11d50e798beffc0e353a5a146c70eca348b306d9 (diff) | |
download | slibtool-c4f93fdfa0d79d01baf0a6879be72bed1678b922.tar.bz2 slibtool-c4f93fdfa0d79d01baf0a6879be72bed1678b922.tar.xz |
slbt_ar_output_members_yaml(): refactor, prepare for verbose yaml output.
Diffstat (limited to 'src/arbits')
-rw-r--r-- | src/arbits/output/slbt_ar_output_members.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/arbits/output/slbt_ar_output_members.c b/src/arbits/output/slbt_ar_output_members.c index 2a63c73..f6db544 100644 --- a/src/arbits/output/slbt_ar_output_members.c +++ b/src/arbits/output/slbt_ar_output_members.c @@ -147,13 +147,25 @@ static int slbt_ar_output_members_posix( return 0; } +static int slbt_ar_output_one_member_yaml( + int fdout, + struct ar_meta_member_info * memberp) +{ + return slbt_dprintf( + fdout, + " - [ member: %s ]\n", + memberp->ar_file_header.ar_member_name); +} + static int slbt_ar_output_members_yaml( const struct slbt_driver_ctx * dctx, const struct slbt_archive_meta * meta, const struct slbt_fd_ctx * fdctx) { struct ar_meta_member_info ** memberp; - const char * name; + int fdout; + + fdout = fdctx->fdout; if (slbt_dprintf(fdctx->fdout," - Members:\n") < 0) return SLBT_SYSTEM_ERROR(dctx,0); @@ -166,12 +178,8 @@ static int slbt_ar_output_members_yaml( break; default: - name = (*memberp)->ar_file_header.ar_member_name; - - if (slbt_dprintf( - fdctx->fdout, - " - [ member: %s ]\n", - name) < 0) + if (slbt_ar_output_one_member_yaml( + fdout,*memberp) < 0) return SLBT_SYSTEM_ERROR(dctx,0); } } |