From c4f93fdfa0d79d01baf0a6879be72bed1678b922 Mon Sep 17 00:00:00 2001 From: midipix Date: Feb 03 2024 17:31:00 +0000 Subject: slbt_ar_output_members_yaml(): refactor, prepare for verbose yaml output. --- 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); } }