From cd4ace49776d042189f1066a357d1ca2d9f81332 Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 15 Nov 2016 09:37:28 -0500 Subject: output: renamed pe_output_image_type() --> pe_output_image_category(). --- src/driver/pe_amain.c | 4 +-- src/driver/pe_driver_ctx.c | 4 +-- src/internal/perk_driver_impl.h | 2 +- src/output/pe_output_image_category.c | 50 +++++++++++++++++++++++++++++++++++ src/output/pe_output_image_type.c | 50 ----------------------------------- src/skin/pe_skin_default.c | 2 +- 6 files changed, 56 insertions(+), 56 deletions(-) create mode 100644 src/output/pe_output_image_category.c delete mode 100644 src/output/pe_output_image_type.c (limited to 'src') diff --git a/src/driver/pe_amain.c b/src/driver/pe_amain.c index d23e9fe..3096561 100644 --- a/src/driver/pe_amain.c +++ b/src/driver/pe_amain.c @@ -62,8 +62,8 @@ static void pe_perform_unit_actions( int fpara = 0; uint64_t flags = dctx->cctx->fmtflags; - if (flags & PERK_OUTPUT_IMAGE_TYPE) - pe_output_image_type(dctx,uctx,0); + if (flags & PERK_OUTPUT_IMAGE_CATEGORY) + pe_output_image_category(dctx,uctx,0); if (flags & PERK_OUTPUT_EXPORT_SYMS) { pe_output_export_symbols(dctx,uctx->meta,0); diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c index 8ca3ba6..32faa7d 100644 --- a/src/driver/pe_driver_ctx.c +++ b/src/driver/pe_driver_ctx.c @@ -160,8 +160,8 @@ int pe_get_driver_ctx( pretty = entry->arg; break; - case TAG_IMGTYPE: - cctx.fmtflags |= PERK_OUTPUT_IMAGE_TYPE; + case TAG_CATEGORY: + cctx.fmtflags |= PERK_OUTPUT_IMAGE_CATEGORY; break; case TAG_SECTIONS: diff --git a/src/internal/perk_driver_impl.h b/src/internal/perk_driver_impl.h index 5ca0bc3..f52e328 100644 --- a/src/internal/perk_driver_impl.h +++ b/src/internal/perk_driver_impl.h @@ -16,7 +16,7 @@ enum app_tags { TAG_VERSION, TAG_OUTPUT, TAG_PRETTY, - TAG_IMGTYPE, + TAG_CATEGORY, TAG_SECTIONS, TAG_EXPSYMS, TAG_IMPLIBS, diff --git a/src/output/pe_output_image_category.c b/src/output/pe_output_image_category.c new file mode 100644 index 0000000..2550267 --- /dev/null +++ b/src/output/pe_output_image_category.c @@ -0,0 +1,50 @@ +/***************************************************************/ +/* perk: PE Resource Kit */ +/* Copyright (C) 2015--2016 Z. Gilboa */ +/* Released under GPLv2 and GPLv3; see COPYING.PERK. */ +/***************************************************************/ + +#include + +#include +#include +#include "perk_errinfo_impl.h" + +int pe_output_image_category( + const struct pe_driver_ctx * dctx, + const struct pe_unit_ctx * uctx, + FILE * fout) +{ + struct pe_info_string abi; + struct pe_info_string subtype; + struct pe_info_string subsystem; + struct pe_info_string framework; + const struct pe_image_meta * meta = uctx->meta; + + if (!fout) + fout = stdout; + + pe_get_image_abi (meta,&abi); + pe_get_image_subtype (meta,&subtype); + pe_get_image_subsystem(meta,&subsystem); + pe_get_image_framework(meta,&framework); + + if (dctx->cctx->fmtflags & PERK_PRETTY_YAML) { + if (fprintf(fout,"%s:\n- %s:\n- %s:\n- %s:\n- %s:\n", + *uctx->path, + abi.buffer, + subtype.buffer, + subsystem.buffer, + framework.buffer) < 0) + return PERK_FILE_ERROR(dctx); + } else { + if (fprintf(fout,"%s-%s-%s-%s\n", + abi.buffer, + subtype.buffer, + subsystem.buffer, + framework.buffer) < 0) + return PERK_FILE_ERROR(dctx); + } + + return 0; +} diff --git a/src/output/pe_output_image_type.c b/src/output/pe_output_image_type.c deleted file mode 100644 index 3df5316..0000000 --- a/src/output/pe_output_image_type.c +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************/ -/* perk: PE Resource Kit */ -/* Copyright (C) 2015--2016 Z. Gilboa */ -/* Released under GPLv2 and GPLv3; see COPYING.PERK. */ -/***************************************************************/ - -#include - -#include -#include -#include "perk_errinfo_impl.h" - -int pe_output_image_type( - const struct pe_driver_ctx * dctx, - const struct pe_unit_ctx * uctx, - FILE * fout) -{ - struct pe_info_string abi; - struct pe_info_string subtype; - struct pe_info_string subsystem; - struct pe_info_string framework; - const struct pe_image_meta * meta = uctx->meta; - - if (!fout) - fout = stdout; - - pe_get_image_abi (meta,&abi); - pe_get_image_subtype (meta,&subtype); - pe_get_image_subsystem(meta,&subsystem); - pe_get_image_framework(meta,&framework); - - if (dctx->cctx->fmtflags & PERK_PRETTY_YAML) { - if (fprintf(fout,"%s:\n- %s:\n- %s:\n- %s:\n- %s:\n", - *uctx->path, - abi.buffer, - subtype.buffer, - subsystem.buffer, - framework.buffer) < 0) - return PERK_FILE_ERROR(dctx); - } else { - if (fprintf(fout,"%s-%s-%s-%s\n", - abi.buffer, - subtype.buffer, - subsystem.buffer, - framework.buffer) < 0) - return PERK_FILE_ERROR(dctx); - } - - return 0; -} diff --git a/src/skin/pe_skin_default.c b/src/skin/pe_skin_default.c index 8bf40e1..baafc8a 100644 --- a/src/skin/pe_skin_default.c +++ b/src/skin/pe_skin_default.c @@ -14,7 +14,7 @@ const struct argv_option pe_default_options[] = { {"pretty", 'p',TAG_PRETTY,ARGV_OPTARG_REQUIRED,0,"yaml|dlltool",0, "format output for parsing by %s"}, - {"type", 't',TAG_IMGTYPE,ARGV_OPTARG_NONE,0,0,0, + {"category", 'c',TAG_CATEGORY,ARGV_OPTARG_NONE,0,0,0, "print image type"}, {"sections", 's',TAG_SECTIONS,ARGV_OPTARG_NONE,0,0,0, -- cgit v1.2.3