diff options
| -rw-r--r-- | src/bindump.c | 80 |
1 files changed, 22 insertions, 58 deletions
diff --git a/src/bindump.c b/src/bindump.c index c50c694..35a3855 100644 --- a/src/bindump.c +++ b/src/bindump.c | |||
| @@ -74,26 +74,6 @@ | |||
| 74 | 74 | ||
| 75 | /////////////////// | 75 | /////////////////// |
| 76 | // // | 76 | // // |
| 77 | // i18l Support // | ||
| 78 | // // | ||
| 79 | /////////////////// | ||
| 80 | |||
| 81 | #ifdef HAVE_GETTEXT | ||
| 82 | # include <gettext.h> | ||
| 83 | # include <libintl.h> | ||
| 84 | # define _(String) gettext (String) | ||
| 85 | # define gettext_noop(String) String | ||
| 86 | # define N_(String) gettext_noop (String) | ||
| 87 | #else | ||
| 88 | # define _(String) (String) | ||
| 89 | # define N_(String) String | ||
| 90 | # define textdomain(Domain) | ||
| 91 | # define bindtextdomain(Package, Directory) | ||
| 92 | #endif | ||
| 93 | |||
| 94 | |||
| 95 | /////////////////// | ||
| 96 | // // | ||
| 97 | // Definitions // | 77 | // Definitions // |
| 98 | // // | 78 | // // |
| 99 | /////////////////// | 79 | /////////////////// |
| @@ -281,13 +261,11 @@ int main(int argc, char * argv[]) | |||
| 281 | opts = opts & (~MY_OPT_XTERM); | 261 | opts = opts & (~MY_OPT_XTERM); |
| 282 | break; | 262 | break; |
| 283 | case '?': | 263 | case '?': |
| 284 | fprintf(stderr, _("Try `%s --help' for more information.\n"), PROGRAM_NAME); | 264 | fprintf(stderr, "Try `%s --help' for more information.\n", PROGRAM_NAME); |
| 285 | return(1); | 265 | return(1); |
| 286 | default: | 266 | default: |
| 287 | fprintf(stderr, _("%s: unrecognized option `--%c'\n" | 267 | fprintf(stderr, "%s: unrecognized option `--%c'\n", PROGRAM_NAME, c); |
| 288 | "Try `%s --help' for more information.\n" | 268 | fprintf(stderr, "Try `%s --help' for more information.\n", PROGRAM_NAME); |
| 289 | ), PROGRAM_NAME, c, PROGRAM_NAME | ||
| 290 | ); | ||
| 291 | return(1); | 269 | return(1); |
| 292 | }; | 270 | }; |
| 293 | }; | 271 | }; |
| @@ -304,10 +282,8 @@ int main(int argc, char * argv[]) | |||
| 304 | file1.filename = "-"; | 282 | file1.filename = "-"; |
| 305 | break; | 283 | break; |
| 306 | default: | 284 | default: |
| 307 | fprintf(stderr, _("%s: missing required argument\n" | 285 | fprintf(stderr, "%s: missing required argument\n", PROGRAM_NAME); |
| 308 | "Try `%s --help' for more information.\n" | 286 | fprintf(stderr, "Try `%s --help' for more information.\n", PROGRAM_NAME); |
| 309 | ), PROGRAM_NAME, PROGRAM_NAME | ||
| 310 | ); | ||
| 311 | return(1); | 287 | return(1); |
| 312 | }; | 288 | }; |
| 313 | if ((file1.filename) && (file2.filename)) | 289 | if ((file1.filename) && (file2.filename)) |
| @@ -750,23 +726,17 @@ ssize_t my_read(BinDumpFile * file, size_t offset, size_t len, unsigned verbose) | |||
| 750 | /// displays usage information | 726 | /// displays usage information |
| 751 | void my_usage() | 727 | void my_usage() |
| 752 | { | 728 | { |
| 753 | // TRANSLATORS: The following strings provide usage for command. These | 729 | printf("Usage: %s [options] file\n", PROGRAM_NAME); |
| 754 | // strings are displayed if the program is passed `--help' on the command | 730 | printf(" -d print only differing data\n"); |
| 755 | // line. The two strings referenced are: PROGRAM_NAME, and | 731 | printf(" -h, --help print this help and exit\n"); |
| 756 | // PACKAGE_BUGREPORT | 732 | printf(" -l bytes length of data to display\n"); |
| 757 | printf(_("Usage: %s [options] file\n" | 733 | printf(" -o bytes offset to start reading data\n"); |
| 758 | " -d print only differing data\n" | 734 | printf(" -r display in reverse bit order\n"); |
| 759 | " -h, --help print this help and exit\n" | 735 | printf(" -V, --version print verbose messages\n"); |
| 760 | " -l bytes length of data to display\n" | 736 | printf(" -v, --verbose print version number and exit\n"); |
| 761 | " -o bytes offset to start reading data\n" | 737 | printf(" -x disables Xterm output\n"); |
| 762 | " -r display in reverse bit order\n" | 738 | printf("\n"); |
| 763 | " -V, --version print verbose messages\n" | 739 | printf("Report bugs to <%s>.\n", PACKAGE_BUGREPORT); |
| 764 | " -v, --verbose print version number and exit\n" | ||
| 765 | " -x disables Xterm output\n" | ||
| 766 | "\n" | ||
| 767 | "Report bugs to <%s>.\n" | ||
| 768 | ), PROGRAM_NAME, PACKAGE_BUGREPORT | ||
| 769 | ); | ||
| 770 | return; | 740 | return; |
| 771 | } | 741 | } |
| 772 | 742 | ||
| @@ -774,18 +744,12 @@ void my_usage() | |||
| 774 | /// displays version information | 744 | /// displays version information |
| 775 | void my_version(void) | 745 | void my_version(void) |
| 776 | { | 746 | { |
| 777 | // TRANSLATORS: The following strings provide version and copyright | 747 | printf("%s (%s) %s\n", PROGRAM_NAME, PACKAGE_NAME, PACKAGE_VERSION); |
| 778 | // information if the program is passed --version on the command line. | 748 | printf("Written by David M. Syzdek.\n"); |
| 779 | // The three strings referenced are: PROGRAM_NAME, PACKAGE_NAME, | 749 | printf("\n"); |
| 780 | // PACKAGE_VERSION. | 750 | printf("%s\n", PACKAGE_COPYRIGHT); |
| 781 | printf(_("%s (%s) %s\n" | 751 | printf("This is free software; see the source for copying conditions. There is NO\n"); |
| 782 | "Written by David M. Syzdek.\n" | 752 | printf("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); |
| 783 | "\n" | ||
| 784 | "%s\n" | ||
| 785 | "This is free software; see the source for copying conditions. There is NO\n" | ||
| 786 | "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" | ||
| 787 | ), PROGRAM_NAME, PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_COPYRIGHT | ||
| 788 | ); | ||
| 789 | return; | 753 | return; |
| 790 | } | 754 | } |
| 791 | 755 | ||
