Use util/mklink.pl instead of util/mklink.sh.
[oweals/openssl.git] / crypto / bio / bss_acpt.c
index 872807d8634da863fc748357c97bcd38760c78a6..74e6bd6a05f80a09f0e8bcac5a0c8cb552a1af9f 100644 (file)
@@ -62,9 +62,7 @@
 #include <errno.h>
 #define USE_SOCKETS
 #include "cryptlib.h"
-#include "bio.h"
-
-/*     BIOerr(BIO_F_WSASTARTUP,BIO_R_WSASTARTUP ); */
+#include <openssl/bio.h>
 
 #ifdef WIN16
 #define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
@@ -89,36 +87,17 @@ typedef struct bio_accept_st
        BIO *bio_chain;
        } BIO_ACCEPT;
 
-#ifndef NOPROTO
 static int acpt_write(BIO *h,char *buf,int num);
 static int acpt_read(BIO *h,char *buf,int size);
 static int acpt_puts(BIO *h,char *str);
 static long acpt_ctrl(BIO *h,int cmd,long arg1,char *arg2);
 static int acpt_new(BIO *h);
 static int acpt_free(BIO *data);
-#else
-static int acpt_write();
-static int acpt_read();
-static int acpt_puts();
-static long acpt_ctrl();
-static int acpt_new();
-static int acpt_free();
-#endif
-
-#ifndef NOPROTO
 static int acpt_state(BIO *b, BIO_ACCEPT *c);
 static void acpt_close_socket(BIO *data);
 BIO_ACCEPT *BIO_ACCEPT_new(void );
 void BIO_ACCEPT_free(BIO_ACCEPT *a);
 
-#else
-
-static int acpt_state();
-static void acpt_close_socket();
-BIO_ACCEPT *BIO_ACCEPT_new();
-void BIO_ACCEPT_free();
-#endif
-
 #define ACPT_S_BEFORE                  1
 #define ACPT_S_GET_ACCEPT_SOCKET       2
 #define ACPT_S_OK                      3
@@ -136,13 +115,12 @@ static BIO_METHOD methods_acceptp=
        acpt_free,
        };
 
-BIO_METHOD *BIO_s_accept()
+BIO_METHOD *BIO_s_accept(void)
        {
        return(&methods_acceptp);
        }
 
-static int acpt_new(bi)
-BIO *bi;
+static int acpt_new(BIO *bi)
        {
        BIO_ACCEPT *ba;
 
@@ -157,7 +135,7 @@ BIO *bi;
        return(1);
        }
 
-BIO_ACCEPT *BIO_ACCEPT_new()
+BIO_ACCEPT *BIO_ACCEPT_new(void)
        {
        BIO_ACCEPT *ret;
 
@@ -170,17 +148,18 @@ BIO_ACCEPT *BIO_ACCEPT_new()
        return(ret);
        }
 
-void BIO_ACCEPT_free(a)
-BIO_ACCEPT *a;
+void BIO_ACCEPT_free(BIO_ACCEPT *a)
        {
+       if(a == NULL)
+           return;
+
        if (a->param_addr != NULL) Free(a->param_addr);
        if (a->addr != NULL) Free(a->addr);
        if (a->bio_chain != NULL) BIO_free(a->bio_chain);
        Free(a);
        }
 
-static void acpt_close_socket(bio)
-BIO *bio;
+static void acpt_close_socket(BIO *bio)
        {
        BIO_ACCEPT *c;
 
@@ -194,8 +173,7 @@ BIO *bio;
                }
        }
 
-static int acpt_free(a)
-BIO *a;
+static int acpt_free(BIO *a)
        {
        BIO_ACCEPT *data;
 
@@ -213,9 +191,7 @@ BIO *a;
        return(1);
        }
        
-static int acpt_state(b,c)
-BIO *b;
-BIO_ACCEPT *c;
+static int acpt_state(BIO *b, BIO_ACCEPT *c)
        {
        BIO *bio=NULL,*dbio;
        int s= -1;
@@ -306,10 +282,7 @@ err:
 
        }
 
-static int acpt_read(b,out,outl)
-BIO *b;
-char *out;
-int outl;
+static int acpt_read(BIO *b, char *out, int outl)
        {
        int ret=0;
        BIO_ACCEPT *data;
@@ -328,10 +301,7 @@ int outl;
        return(ret);
        }
 
-static int acpt_write(b,in,inl)
-BIO *b;
-char *in;
-int inl;
+static int acpt_write(BIO *b, char *in, int inl)
        {
        int ret;
        BIO_ACCEPT *data;
@@ -350,11 +320,7 @@ int inl;
        return(ret);
        }
 
-static long acpt_ctrl(b,cmd,num,ptr)
-BIO *b;
-int cmd;
-long num;
-char *ptr;
+static long acpt_ctrl(BIO *b, int cmd, long num, char *ptr)
        {
        BIO *dbio;
        int *ip;
@@ -468,9 +434,7 @@ char *ptr;
        return(ret);
        }
 
-static int acpt_puts(bp,str)
-BIO *bp;
-char *str;
+static int acpt_puts(BIO *bp, char *str)
        {
        int n,ret;
 
@@ -479,8 +443,7 @@ char *str;
        return(ret);
        }
 
-BIO *BIO_new_accept(str)
-char *str;
+BIO *BIO_new_accept(char *str)
        {
        BIO *ret;