Change functions to ANSI C.
[openssl.git] / apps / s_time.c
index 7571c208d4b7b1082f74ac92e256ee9097d8bf7d..1e335ef4b260c226f01fecc49ed777a91f969fd5 100644 (file)
@@ -59,7 +59,7 @@
 #define NO_SHUTDOWN
 
 /*-----------------------------------------
-   cntime - SSL client connection timer program
+   s_time - SSL client connection timer program
    Written and donated by Larry Streepy <streepy@healthcare.com>
   -----------------------------------------*/
 
@@ -111,7 +111,8 @@ struct tms {
 #include <sys/select.h>
 #endif
 
-#ifdef sun
+#if defined(sun) || defined(__ultrix)
+#define _POSIX_SOURCE
 #include <limits.h>
 #include <sys/param.h>
 #endif
@@ -189,7 +190,7 @@ static int t_nbio=0;
 static int exitNow = 0;                /* Set when it's time to exit main */
 #endif
 
-static void s_time_init()
+static void s_time_init(void)
        {
        host=SSL_CONNECT_NAME;
        t_cert_file=NULL;
@@ -217,19 +218,19 @@ static void s_time_init()
 /***********************************************************************
  * usage - display usage message
  */
-static void s_time_usage()
+static void s_time_usage(void)
 {
        static char umsg[] = "\
 -time arg     - max number of seconds to collect data, default %d\n\
 -verify arg   - turn on peer certificate verification, arg == depth\n\
 -cert arg     - certificate file to use, PEM format assumed\n\
--key arg      - RSA file to use, PEM format assumed, in cert file if\n\
-                not specified but cert fill is.\n\
+-key arg      - RSA file to use, PEM format assumed, key is in cert file\n\
+                file if not specified by this option\n\
 -CApath arg   - PEM format directory of CA's\n\
 -CAfile arg   - PEM format file of CA's\n\
--cipher       - prefered cipher to use, play with 'ssleay ciphers'\n\n";
+-cipher       - prefered cipher to use, play with 'openssl ciphers'\n\n";
 
-       printf( "usage: client <args>\n\n" );
+       printf( "usage: s_time <args>\n\n" );
 
        printf("-connect host:port - host:port to connect to (default is %s)\n",SSL_CONNECT_NAME);
 #ifdef FIONBIO
@@ -249,9 +250,7 @@ static void s_time_usage()
  *
  * Returns 0 if ok, -1 on bad args
  */
-static int parseArgs(argc,argv)
-int argc;
-char **argv;
+static int parseArgs(int argc, char **argv)
 {
     int badop = 0;
 
@@ -376,8 +375,7 @@ bad:
 #define START  0
 #define STOP   1
 
-static double tm_Time_F(s)
-int s;
+static double tm_Time_F(int s)
        {
        static double ret;
 #ifdef TIMES
@@ -411,10 +409,7 @@ int s;
  * MAIN - main processing area for client
  *                     real name depends on MONOLITH
  */
-int
-MAIN(argc,argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
        {
        double totalTime = 0.0;
        int nConn = 0;
@@ -638,9 +633,7 @@ end:
  * Returns:
  *             SSL *   = the connection pointer.
  */
-static SSL *
-doConnection(scon)
-SSL *scon;
+static SSL *doConnection(SSL *scon)
        {
        BIO *conn;
        SSL *serverCon;