summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2006-10-19 14:16:13 +0000
committerSimon Josefsson <simon@josefsson.org>2006-10-19 14:16:13 +0000
commit4301db6c6941673be002cde6619f58efa8c685af (patch)
treefb6ec108007d9dde3ca2fd2f602dd4b4132e35df /src
parent3fce48bb23497a0541f5da5a132f5065c185b088 (diff)
downloadlibtasn1-4301db6c6941673be002cde6619f58efa8c685af.tar.gz
libtasn1-4301db6c6941673be002cde6619f58efa8c685af.tar.bz2
libtasn1-4301db6c6941673be002cde6619f58efa8c685af.zip
Use progname and version-etc-fsf modules.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/asn1Coding.c11
-rw-r--r--src/asn1Decoding.c17
-rw-r--r--src/asn1Parser.c11
4 files changed, 22 insertions, 19 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 6a774bf..1c0d171 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,7 +21,7 @@ INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_builddir)/gl
EXTRA_DIST = pkix.asn pkix_asn1_tab.c asn1Coding_test.asn asn1Coding_test.asg
-LDADD = ../lib/libtasn1.la
+LDADD = ../lib/libtasn1.la ../gl/libgnu.la
bin_PROGRAMS = asn1Parser asn1Coding asn1Decoding
noinst_PROGRAMS = CertificateExample CrlExample
diff --git a/src/asn1Coding.c b/src/asn1Coding.c
index 5b004c6..4edcbc7 100644
--- a/src/asn1Coding.c
+++ b/src/asn1Coding.c
@@ -35,6 +35,9 @@
#include <stdlib.h>
#include <unistd.h>
+#include <progname.h>
+#include <version-etc.h>
+
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
@@ -157,9 +160,9 @@ main(int argc,char *argv[])
int der_len;
int k;
- opterr=0; /* disable error messages from getopt */
+ set_program_name (argv[0]);
- printf("\n");
+ opterr=0; /* disable error messages from getopt */
while(1){
@@ -179,8 +182,8 @@ main(int argc,char *argv[])
exit(0);
break;
case 'v': /* VERSION */
- printf("%s\n",version_man);
-
+ version_etc (stdout, program_name, PACKAGE, VERSION,
+ "Fabio Fiorina", NULL);
if(outputFileName) free(outputFileName);
exit(0);
break;
diff --git a/src/asn1Decoding.c b/src/asn1Decoding.c
index 1df53fb..8e48fec 100644
--- a/src/asn1Decoding.c
+++ b/src/asn1Decoding.c
@@ -35,6 +35,9 @@
#include <stdlib.h>
#include <unistd.h>
+#include <progname.h>
+#include <version-etc.h>
+
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
@@ -99,9 +102,9 @@ main(int argc,char *argv[])
int der_len=0;
/* FILE *outputFile; */
- opterr=0; /* disable error messages from getopt */
+ set_program_name (argv[0]);
- printf("\n");
+ opterr=0; /* disable error messages from getopt */
while(1){
@@ -119,7 +122,8 @@ main(int argc,char *argv[])
exit(0);
break;
case 'v': /* VERSION */
- printf("%s\n",version_man);
+ version_etc (stdout, program_name, PACKAGE, VERSION,
+ "Fabio Fiorina", NULL);
exit(0);
break;
case 'c': /* CHECK SYNTAX */
@@ -280,10 +284,3 @@ main(int argc,char *argv[])
exit(0);
}
-
-
-
-
-
-
-
diff --git a/src/asn1Parser.c b/src/asn1Parser.c
index 918b3bf..4909d93 100644
--- a/src/asn1Parser.c
+++ b/src/asn1Parser.c
@@ -35,6 +35,9 @@
#include <stdlib.h>
#include <unistd.h>
+#include <progname.h>
+#include <version-etc.h>
+
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
@@ -100,9 +103,9 @@ main(int argc,char *argv[])
char errorDescription[MAX_ERROR_DESCRIPTION_SIZE];
int parse_result=ASN1_SUCCESS;
- opterr=0; /* disable error messages from getopt */
+ set_program_name (argv[0]);
- printf("\n");
+ opterr=0; /* disable error messages from getopt */
while(1){
@@ -130,8 +133,8 @@ main(int argc,char *argv[])
exit(0);
break;
case 'v': /* VERSION */
- printf("%s\n",version_man);
-
+ version_etc (stdout, program_name, PACKAGE, VERSION,
+ "Fabio Fiorina", NULL);
if(outputFileName) free(outputFileName);
if(vectorName) free(vectorName);
exit(0);