diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cmds/pe_cmd_ranlib.c | 15 | ||||
-rw-r--r-- | src/driver/pe_amain.c | 4 | ||||
-rw-r--r-- | src/driver/pe_driver_ctx.c | 11 | ||||
-rw-r--r-- | src/internal/perk_driver_impl.h | 1 | ||||
-rw-r--r-- | src/internal/perk_synopsis_impl.h | 8 | ||||
-rw-r--r-- | src/skin/pe_skin_default.c | 2 | ||||
-rw-r--r-- | src/skin/pe_skin_ranlib.c | 13 |
7 files changed, 53 insertions, 1 deletions
diff --git a/src/cmds/pe_cmd_ranlib.c b/src/cmds/pe_cmd_ranlib.c new file mode 100644 index 0000000..5d6f078 --- /dev/null +++ b/src/cmds/pe_cmd_ranlib.c @@ -0,0 +1,15 @@ +/***************************************************************/ +/* perk: PE Resource Kit */ +/* Copyright (C) 2015--2025 SysDeer Technologies, LLC */ +/* Released under GPLv2 and GPLv3; see COPYING.PERK. */ +/***************************************************************/ + +#include <perk/perk.h> +#include "perk_driver_impl.h" + +int pe_cmd_ranlib(const struct pe_driver_ctx * dctx, const char * path) +{ + (void)dctx; + (void)path; + return 0; +} diff --git a/src/driver/pe_amain.c b/src/driver/pe_amain.c index 5b85bef..76c986f 100644 --- a/src/driver/pe_amain.c +++ b/src/driver/pe_amain.c @@ -105,6 +105,10 @@ int pe_main(char ** argv, char ** envp, const struct pe_fd_ctx * fdctx) pe_cmd_common(dctx,pe_cmd_size); break; + case PERK_CMD_RANLIB: + pe_cmd_common(dctx,pe_cmd_ranlib); + break; + case PERK_CMD_AR: arflags = dctx->cctx->drvflags; diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c index 43dc0b3..8e652af 100644 --- a/src/driver/pe_driver_ctx.c +++ b/src/driver/pe_driver_ctx.c @@ -32,6 +32,7 @@ static const char * const perk_cmd_name[PERK_CMD_CAP] = { [PERK_CMD_NM] = "nm", [PERK_CMD_SIZE] = "size", [PERK_CMD_STRIP] = "strip", + [PERK_CMD_RANLIB] = "ranlib", }; /* perk command options */ @@ -42,6 +43,7 @@ static const struct argv_option * perk_cmd_options[PERK_CMD_CAP] = { [PERK_CMD_NM] = pe_nm_options, [PERK_CMD_SIZE] = pe_size_options, [PERK_CMD_STRIP] = pe_strip_options, + [PERK_CMD_RANLIB] = pe_ranlib_options, }; /* default fd context */ @@ -123,6 +125,12 @@ static int pe_driver_usage( cmdname,cmdname,cmdname); break; + case PERK_CMD_RANLIB: + snprintf(header,sizeof(header), + PERK_RANLIB_CMD_SYNOPSIS, + cmdname,cmdname); + break; + case PERK_CMD_PERK: snprintf(header,sizeof(header), PERK_PERK_CMD_SYNOPSIS, @@ -519,6 +527,9 @@ int pe_lib_get_driver_ctx( } else if (cctx.cmd == PERK_CMD_STRIP) { argv_optv_init(pe_strip_options,optv); + + } else if (cctx.cmd == PERK_CMD_RANLIB) { + argv_optv_init(pe_ranlib_options,optv); } /* process the selected tool's command-line arguments */ diff --git a/src/internal/perk_driver_impl.h b/src/internal/perk_driver_impl.h index 44115c7..b1062ac 100644 --- a/src/internal/perk_driver_impl.h +++ b/src/internal/perk_driver_impl.h @@ -18,6 +18,7 @@ extern const struct argv_option pe_ar_options[]; extern const struct argv_option pe_nm_options[]; extern const struct argv_option pe_size_options[]; extern const struct argv_option pe_strip_options[]; +extern const struct argv_option pe_ranlib_options[]; enum app_tags { TAG_HELP, diff --git a/src/internal/perk_synopsis_impl.h b/src/internal/perk_synopsis_impl.h index 2806881..02c7e5d 100644 --- a/src/internal/perk_synopsis_impl.h +++ b/src/internal/perk_synopsis_impl.h @@ -57,6 +57,14 @@ +#define PERK_RANLIB_CMD_SYNOPSIS \ + "%s — PE/COFF Archive Indexer\n\n" \ + "Synopsis:\n" \ + " %s [-V] [-D|-U] [-t] <file> ...\n\n" \ + "Options:\n" + + + #define PERK_AR_CMD_SYNOPSIS \ "%s — the PE/COFF Resource Kit Archiver\n\n" \ "Synopsis:\n" \ diff --git a/src/skin/pe_skin_default.c b/src/skin/pe_skin_default.c index 9c8f0a3..c44ce7c 100644 --- a/src/skin/pe_skin_default.c +++ b/src/skin/pe_skin_default.c @@ -10,7 +10,7 @@ const perk_hidden struct argv_option pe_default_options[] = { "show usage information [listing %s options only]"}, {"cmd", 0,TAG_CMD,ARGV_OPTARG_REQUIRED,0, - "perk|ar|nm|size|strip",0, + "perk|ar|nm|size|strip|ranlib",0, "invoke one of the following perk commands: {%s}"}, {0,0,0,0,0,0,0,0} diff --git a/src/skin/pe_skin_ranlib.c b/src/skin/pe_skin_ranlib.c new file mode 100644 index 0000000..f928983 --- /dev/null +++ b/src/skin/pe_skin_ranlib.c @@ -0,0 +1,13 @@ +#include "perk_driver_impl.h" +#include "perk_visibility_impl.h" +#include "argv/argv.h" + +const perk_hidden struct argv_option pe_ranlib_options[] = { + {"version", 'V',TAG_VERSION,ARGV_OPTARG_NONE,0,0,0, + "show version information"}, + + {"help", 'h',TAG_HELP,ARGV_OPTARG_OPTIONAL,0,"short|long",0, + "show usage information [listing %s options only]"}, + + {0,0,0,0,0,0,0,0} +}; |