AC_MSG_NOTICE([Detecting C library capabilities])
AC_HEADER_STDC
-AC_CHECK_HEADERS(getopt.h unistd.h strings.h inttypes.h stdint.h)
-AC_CHECK_FUNCS(getopt_long)
+AC_CHECK_HEADERS(unistd.h strings.h inttypes.h stdint.h)
AC_FUNC_ALLOCA
AC_MSG_NOTICE([Detecting system's parameters])
gl_SOURCE_BASE(gl)
gl_M4_BASE(gl/m4)
-gl_MODULES(memmove)
+gl_MODULES(memmove getopt)
gl_LGPL
gl_INIT
LIBTASN1_LIBS="-L${libdir} -ltasn1 $LIBS"
LIBTASN1_CFLAGS="-I${includedir}"
-
AC_SUBST(LIBTASN1_LIBS)
AC_SUBST(LIBTASN1_CFLAGS)
/*
- * Copyright (C) 2002 Fabio Fiorina
+ * Copyright (C) 2002, 2005 Fabio Fiorina
*
* This file is part of LIBTASN1.
*
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-
-#ifdef HAVE_GETOPT_H
- #include <getopt.h>
-#endif
+#include <getopt.h>
char version_man[] = "asn1Coding (GNU libtasn1) " VERSION;
" <file1> file with ASN1 definitions.\n"
" <file2> file with assignments.\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"
"\n"
"Output:\n"
" -o <file>, --output <file> output file.\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";
-#endif
#define ASSIGNMENT_SUCCESS 1
main(int argc,char *argv[])
{
-#ifdef HAVE_GETOPT_LONG
static struct option long_options[] =
{
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
int option_index=0;
-#endif
-
int option_result;
char *outputFileName=NULL;
char *inputFileAsnName=NULL;
while(1){
-#ifdef HAVE_GETOPT_LONG
option_result=getopt_long(argc,argv,"hvco:",long_options,&option_index);
-#else
- option_result=getopt(argc,argv,"hvco:");
-#endif
if(option_result == -1) break;
/*
- * Copyright (C) 2002 Fabio Fiorina
+ * Copyright (C) 2002, 2005 Fabio Fiorina
*
* This file is part of LIBTASN1.
*
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-
-#ifdef HAVE_GETOPT_H
- #include <getopt.h>
-#endif
+#include <getopt.h>
char version_man[] = "asn1Decoding (GNU libtasn1) " VERSION;
" <file2> file with a DER coding.\n"
" <type> ASN1 type name\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"
" -c, --check checks the syntax only.\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";
-#endif
main(int argc,char *argv[])
{
-#ifdef HAVE_GETOPT_LONG
static struct option long_options[] =
{
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
int option_index = 0;
-#endif
-
int option_result;
char *inputFileAsnName=NULL;
char *inputFileDerName=NULL;
while(1){
-#ifdef HAVE_GETOPT_LONG
option_result=getopt_long(argc,argv,"hvc",long_options,&option_index);
-#else
- option_result=getopt(argc,argv,"hvc");
-#endif
if(option_result == -1) break;
/*\r
- * Copyright (C) 2002 Fabio Fiorina\r
+ * Copyright (C) 2002, 2005 Fabio Fiorina\r
*\r
* This file is part of LIBTASN1.\r
*\r
#ifdef HAVE_UNISTD_H\r
#include <unistd.h>\r
#endif\r
-\r
-#ifdef HAVE_GETOPT_H\r
- #include <getopt.h>\r
-#endif\r
+#include <getopt.h>\r
\r
char version_man[] = "asn1Parser (GNU libasn1) " VERSION;\r
\r
"\n"\r
"Usage: asn1Parser [options] file\n"\r
"\n"\r
-#ifdef HAVE_GETOPT_LONG\r
"Operation modes:\n"\r
" -h, --help shows this message and exit\n"\r
" -v, --version shows version information and exit.\n"\r
"Output:\n"\r
" -o <file>, --output <file> output file\n"\r
" -n <name>, --name <name> array name\n";\r
-#else\r
- "Operation modes:\n"\r
- " -h shows this message and exit\n"\r
- " -v shows version information and exit.\n"\r
- " -c checks the syntax only.\n"\r
- "\n"\r
- "Output:\n"\r
- " -o <file> output file\n"\r
- " -n <name> array name\n";\r
-#endif\r
\r
/********************************************************/\r
/* Function : main */\r
int\r
main(int argc,char *argv[])\r
{\r
-\r
-#ifdef HAVE_GETOPT_LONG\r
static struct option long_options[] =\r
{\r
{"help", no_argument, 0, 'h'},\r
{0, 0, 0, 0}\r
};\r
int option_index = 0;\r
-#endif\r
-\r
int option_result;\r
char *outputFileName=NULL;\r
char *inputFileName=NULL;\r
\r
while(1){\r
\r
-#ifdef HAVE_GETOPT_LONG\r
option_result=getopt_long(argc,argv,"hvco:n:",long_options,&option_index);\r
-#else\r
- option_result=getopt(argc,argv,"hvco:n:");\r
-#endif\r
\r
if(option_result == -1) break;\r
\r