diff options
author | Simon Josefsson <simon@josefsson.org> | 2005-08-12 13:12:07 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2005-08-12 13:12:07 +0000 |
commit | 41e487f26b3ffb7a61569bfbf4eb8f786a7b8965 (patch) | |
tree | 7f556c67093112286aa2c415ab2a246c53cef6cc /src/asn1Parser.c | |
parent | 4f953fda50a112104f0ba3b1356cdc49ef716b88 (diff) | |
download | libtasn1-41e487f26b3ffb7a61569bfbf4eb8f786a7b8965.tar.gz libtasn1-41e487f26b3ffb7a61569bfbf4eb8f786a7b8965.tar.bz2 libtasn1-41e487f26b3ffb7a61569bfbf4eb8f786a7b8965.zip |
Use getopt gnulib module. Always use getopt_long.
Diffstat (limited to 'src/asn1Parser.c')
-rw-r--r-- | src/asn1Parser.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/asn1Parser.c b/src/asn1Parser.c index c67b104..0acfd35 100644 --- a/src/asn1Parser.c +++ b/src/asn1Parser.c @@ -1,5 +1,5 @@ /*
- * Copyright (C) 2002 Fabio Fiorina
+ * Copyright (C) 2002, 2005 Fabio Fiorina
*
* This file is part of LIBTASN1.
*
@@ -35,10 +35,7 @@ #ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-
-#ifdef HAVE_GETOPT_H
- #include <getopt.h>
-#endif
+#include <getopt.h>
char version_man[] = "asn1Parser (GNU libasn1) " VERSION;
@@ -47,7 +44,6 @@ char help_man[] = "asn1Parser reads files with ASN1 definitions and\n" "\n"
"Usage: asn1Parser [options] file\n"
"\n"
-#ifdef HAVE_GETOPT_LONG
"Operation modes:\n"
" -h, --help shows this message and exit\n"
" -v, --version shows version information and exit.\n"
@@ -56,16 +52,6 @@ char help_man[] = "asn1Parser reads files with ASN1 definitions and\n" "Output:\n"
" -o <file>, --output <file> output file\n"
" -n <name>, --name <name> array name\n";
-#else
- "Operation modes:\n"
- " -h shows this message and exit\n"
- " -v shows version information and exit.\n"
- " -c checks the syntax only.\n"
- "\n"
- "Output:\n"
- " -o <file> output file\n"
- " -n <name> array name\n";
-#endif
/********************************************************/
/* Function : main */
@@ -74,8 +60,6 @@ char help_man[] = "asn1Parser reads files with ASN1 definitions and\n" int
main(int argc,char *argv[])
{
-
-#ifdef HAVE_GETOPT_LONG
static struct option long_options[] =
{
{"help", no_argument, 0, 'h'},
@@ -86,8 +70,6 @@ main(int argc,char *argv[]) {0, 0, 0, 0}
};
int option_index = 0;
-#endif
-
int option_result;
char *outputFileName=NULL;
char *inputFileName=NULL;
@@ -103,11 +85,7 @@ main(int argc,char *argv[]) while(1){
-#ifdef HAVE_GETOPT_LONG
option_result=getopt_long(argc,argv,"hvco:n:",long_options,&option_index);
-#else
- option_result=getopt(argc,argv,"hvco:n:");
-#endif
if(option_result == -1) break;
|