summaryrefslogtreecommitdiff
path: root/src/asn1Parser.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2005-08-12 13:35:03 +0000
committerSimon Josefsson <simon@josefsson.org>2005-08-12 13:35:03 +0000
commit9c84977588b6e2e8f5388a06a4f0b9c0dd8c5850 (patch)
tree251317eec7da629b507844cd459919f6dfc85610 /src/asn1Parser.c
parent9971a73f46125ca59ddbe4119343923883bc16df (diff)
downloadlibtasn1-9c84977588b6e2e8f5388a06a4f0b9c0dd8c5850.tar.gz
libtasn1-9c84977588b6e2e8f5388a06a4f0b9c0dd8c5850.tar.bz2
libtasn1-9c84977588b6e2e8f5388a06a4f0b9c0dd8c5850.zip
Revert.
Diffstat (limited to 'src/asn1Parser.c')
-rw-r--r--src/asn1Parser.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/asn1Parser.c b/src/asn1Parser.c
index 0acfd35..c67b104 100644
--- a/src/asn1Parser.c
+++ b/src/asn1Parser.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2002, 2005 Fabio Fiorina
+ * Copyright (C) 2002 Fabio Fiorina
*
* This file is part of LIBTASN1.
*
@@ -35,7 +35,10 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <getopt.h>
+
+#ifdef HAVE_GETOPT_H
+ #include <getopt.h>
+#endif
char version_man[] = "asn1Parser (GNU libasn1) " VERSION;
@@ -44,6 +47,7 @@ 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"
@@ -52,6 +56,16 @@ 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 */
@@ -60,6 +74,8 @@ 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'},
@@ -70,6 +86,8 @@ main(int argc,char *argv[])
{0, 0, 0, 0}
};
int option_index = 0;
+#endif
+
int option_result;
char *outputFileName=NULL;
char *inputFileName=NULL;
@@ -85,7 +103,11 @@ 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;