Remove "dummy" BIO create and destroy functions
[openssl.git] / crypto / bio / bss_null.c
index 90c9ee161805b8b3b155135d2ada6ec0add6eeba..48164d4f90f2fd393ecf13408666ea8384af0b6c 100644 (file)
@@ -17,11 +17,11 @@ static int null_read(BIO *h, char *buf, int size);
 static int null_puts(BIO *h, const char *str);
 static int null_gets(BIO *h, char *str, int size);
 static long null_ctrl(BIO *h, int cmd, long arg1, void *arg2);
-static int null_new(BIO *h);
-static int null_free(BIO *data);
 static const BIO_METHOD null_method = {
     BIO_TYPE_NULL,
     "NULL",
+    /* TODO: Convert to new style write function */
+    bwrite_conv,
     null_write,
     /* TODO: Convert to new style read function */
     bread_conv,
@@ -29,39 +29,24 @@ static const BIO_METHOD null_method = {
     null_puts,
     null_gets,
     null_ctrl,
-    null_new,
-    null_free,
     NULL,
+    NULL,
+    NULL,                     /* null_callback_ctrl */
 };
 
 const BIO_METHOD *BIO_s_null(void)
 {
-    return (&null_method);
-}
-
-static int null_new(BIO *bi)
-{
-    bi->init = 1;
-    bi->num = 0;
-    bi->ptr = (NULL);
-    return (1);
-}
-
-static int null_free(BIO *a)
-{
-    if (a == NULL)
-        return (0);
-    return (1);
+    return &null_method;
 }
 
 static int null_read(BIO *b, char *out, int outl)
 {
-    return (0);
+    return 0;
 }
 
 static int null_write(BIO *b, const char *in, int inl)
 {
-    return (inl);
+    return inl;
 }
 
 static long null_ctrl(BIO *b, int cmd, long num, void *ptr)
@@ -86,17 +71,17 @@ static long null_ctrl(BIO *b, int cmd, long num, void *ptr)
         ret = 0;
         break;
     }
-    return (ret);
+    return ret;
 }
 
 static int null_gets(BIO *bp, char *buf, int size)
 {
-    return (0);
+    return 0;
 }
 
 static int null_puts(BIO *bp, const char *str)
 {
     if (str == NULL)
-        return (0);
-    return (strlen(str));
+        return 0;
+    return strlen(str);
 }