DSO_load() should also work when it is passed a NULL - a new DSO is created
[oweals/openssl.git] / crypto / bio / bss_file.c
index 52c0c39df045a0b303c33967fa43ae32b33527cc..1f770b390f8f5f08efe710b30f9a329b7d9331ec 100644 (file)
 
 #if !defined(NO_STDIO)
 
-static int MS_CALLBACK file_write(BIO *h,char *buf,int num);
-static int MS_CALLBACK file_read(BIO *h,char *buf,int size);
-static int MS_CALLBACK file_puts(BIO *h,char *str);
-static int MS_CALLBACK file_gets(BIO *h,char *str,int size);
-static long MS_CALLBACK file_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int MS_CALLBACK file_write(BIO *h, const char *buf, int num);
+static int MS_CALLBACK file_read(BIO *h, char *buf, int size);
+static int MS_CALLBACK file_puts(BIO *h, const char *str);
+static int MS_CALLBACK file_gets(BIO *h, char *str, int size);
+static long MS_CALLBACK file_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int MS_CALLBACK file_new(BIO *h);
 static int MS_CALLBACK file_free(BIO *data);
 static BIO_METHOD methods_filep=
@@ -91,6 +91,7 @@ static BIO_METHOD methods_filep=
        file_ctrl,
        file_new,
        file_free,
+       NULL,
        };
 
 BIO *BIO_new_file(const char *filename, const char *mode)
@@ -162,7 +163,7 @@ static int MS_CALLBACK file_read(BIO *b, char *out, int outl)
        return(ret);
        }
 
-static int MS_CALLBACK file_write(BIO *b, char *in, int inl)
+static int MS_CALLBACK file_write(BIO *b, const char *in, int inl)
        {
        int ret=0;
 
@@ -171,14 +172,14 @@ static int MS_CALLBACK file_write(BIO *b, char *in, int inl)
                if (fwrite(in,(int)inl,1,(FILE *)b->ptr))
                        ret=inl;
                /* ret=fwrite(in,1,(int)inl,(FILE *)b->ptr); */
-               /* acording to Tim Hudson <tjh@cryptsoft.com>, the commented
+               /* according to Tim Hudson <tjh@cryptsoft.com>, the commented
                 * out version above can cause 'inl' write calls under
                 * some stupid stdio implementations (VMS) */
                }
        return(ret);
        }
 
-static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        long ret=1;
        FILE *fp=(FILE *)b->ptr;
@@ -293,7 +294,7 @@ static int MS_CALLBACK file_gets(BIO *bp, char *buf, int size)
        return(ret);
        }
 
-static int MS_CALLBACK file_puts(BIO *bp, char *str)
+static int MS_CALLBACK file_puts(BIO *bp, const char *str)
        {
        int n,ret;