From 979507dfb71780d8ac2bd393d4e914e5578900f9 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 19 Jul 2024 01:03:37 +0000 Subject: driver: added the -print-shared-ext and -print-static-ext output commands. --- src/driver/slbt_amain.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/driver/slbt_amain.c') diff --git a/src/driver/slbt_amain.c b/src/driver/slbt_amain.c index e0f4241..a9cc118 100644 --- a/src/driver/slbt_amain.c +++ b/src/driver/slbt_amain.c @@ -67,6 +67,16 @@ static ssize_t slbt_print_m4_dir(int fdout) return slbt_dprintf(fdout,"%s\n",SLBT_PACKAGE_DATADIR); } +static ssize_t slbt_print_shared_ext(int fdout, struct slbt_driver_ctx * dctx) +{ + return slbt_dprintf(fdout,"%s\n",dctx->cctx->settings.dsosuffix); +} + +static ssize_t slbt_print_static_ext(int fdout, struct slbt_driver_ctx * dctx) +{ + return slbt_dprintf(fdout,"%s\n",dctx->cctx->settings.arsuffix); +} + static void slbt_perform_driver_actions(struct slbt_driver_ctx * dctx) { if (dctx->cctx->drvflags & SLBT_DRIVER_INFO) @@ -219,6 +229,18 @@ int slbt_main(char ** argv, char ** envp, const struct slbt_fd_ctx * fdctx) ? slbt_exit(dctx,SLBT_ERROR) : slbt_exit(dctx,SLBT_OK); + /* -print-shared-ext must be the first (and only) action */ + if (dctx->cctx->drvflags & SLBT_DRIVER_OUTPUT_SHARED_EXT) + return (slbt_print_shared_ext(fdout,dctx) < 0) + ? slbt_exit(dctx,SLBT_ERROR) + : slbt_exit(dctx,SLBT_OK); + + /* -print-static-ext must be the first (and only) action */ + if (dctx->cctx->drvflags & SLBT_DRIVER_OUTPUT_STATIC_EXT) + return (slbt_print_static_ext(fdout,dctx) < 0) + ? slbt_exit(dctx,SLBT_ERROR) + : slbt_exit(dctx,SLBT_OK); + /* perform all other actions */ slbt_perform_driver_actions(dctx); -- cgit v1.2.3