Change functions to ANSI C.
[openssl.git] / apps / version.c
index a84943329ca78936a85bfbd2f680dadf7da694e6..fd46e17688db91da0a956a5e6aeb1e5356c3941a 100644 (file)
@@ -1,5 +1,5 @@
 /* apps/version.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
 #undef PROG
 #define PROG   version_main
 
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
        {
        int i,ret=0;
-       int cflags=0,version=0,date=0,options=0;
+       int cflags=0,version=0,date=0,options=0,platform=0;
 
        apps_startup();
 
        if (bio_err == NULL)
                if ((bio_err=BIO_new(BIO_s_file())) != NULL)
-                       BIO_set_fp(bio_err,stderr,BIO_NOCLOSE);
+                       BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
 
        if (argc == 1) version=1;
        for (i=1; i<argc; i++)
@@ -90,11 +88,13 @@ char **argv;
                        cflags=1;
                else if (strcmp(argv[i],"-o") == 0)
                        options=1;
+               else if (strcmp(argv[i],"-p") == 0)
+                       platform=1;
                else if (strcmp(argv[i],"-a") == 0)
-                       date=version=cflags=options=1;
+                       date=version=cflags=options=platform=1;
                else
                        {
-                       BIO_printf(bio_err,"usage:version [-a] [-v] [-b] [-o] [-f]\n");
+                       BIO_printf(bio_err,"usage:version -[avbofp]\n");
                        ret=1;
                        goto end;
                        }
@@ -102,9 +102,10 @@ char **argv;
 
        if (version) printf("%s\n",SSLeay_version(SSLEAY_VERSION));
        if (date)    printf("%s\n",SSLeay_version(SSLEAY_BUILT_ON));
+       if (platform) printf("%s\n",SSLeay_version(SSLEAY_PLATFORM));
        if (options) 
                {
-               printf("options:");
+               printf("options:  ");
                printf("%s ",BN_options());
 #ifndef NO_MD2
                printf("%s ",MD2_options());
@@ -121,6 +122,7 @@ char **argv;
 #ifndef NO_BLOWFISH
                printf("%s ",BF_options());
 #endif
+               printf("\n");
                }
        if (cflags)  printf("%s\n",SSLeay_version(SSLEAY_CFLAGS));
 end: