summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bss_null.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/bss_null.c')
-rw-r--r--src/lib/libcrypto/bio/bss_null.c57
1 files changed, 15 insertions, 42 deletions
diff --git a/src/lib/libcrypto/bio/bss_null.c b/src/lib/libcrypto/bio/bss_null.c
index 0791a2471a..46b73339df 100644
--- a/src/lib/libcrypto/bio/bss_null.c
+++ b/src/lib/libcrypto/bio/bss_null.c
@@ -59,26 +59,15 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <errno.h> 60#include <errno.h>
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include "bio.h" 62#include <openssl/bio.h>
63 63
64#ifndef NOPROTO 64static int null_write(BIO *h, const char *buf, int num);
65static int null_write(BIO *h,char *buf,int num); 65static int null_read(BIO *h, char *buf, int size);
66static int null_read(BIO *h,char *buf,int size); 66static int null_puts(BIO *h, const char *str);
67static int null_puts(BIO *h,char *str); 67static int null_gets(BIO *h, char *str, int size);
68static int null_gets(BIO *h,char *str,int size); 68static long null_ctrl(BIO *h, int cmd, long arg1, void *arg2);
69static long null_ctrl(BIO *h,int cmd,long arg1,char *arg2);
70static int null_new(BIO *h); 69static int null_new(BIO *h);
71static int null_free(BIO *data); 70static int null_free(BIO *data);
72#else
73static int null_write();
74static int null_read();
75static int null_puts();
76static int null_gets();
77static long null_ctrl();
78static int null_new();
79static int null_free();
80#endif
81
82static BIO_METHOD null_method= 71static BIO_METHOD null_method=
83 { 72 {
84 BIO_TYPE_NULL, 73 BIO_TYPE_NULL,
@@ -90,15 +79,15 @@ static BIO_METHOD null_method=
90 null_ctrl, 79 null_ctrl,
91 null_new, 80 null_new,
92 null_free, 81 null_free,
82 NULL,
93 }; 83 };
94 84
95BIO_METHOD *BIO_s_null() 85BIO_METHOD *BIO_s_null(void)
96 { 86 {
97 return(&null_method); 87 return(&null_method);
98 } 88 }
99 89
100static int null_new(bi) 90static int null_new(BIO *bi)
101BIO *bi;
102 { 91 {
103 bi->init=1; 92 bi->init=1;
104 bi->num=0; 93 bi->num=0;
@@ -106,34 +95,23 @@ BIO *bi;
106 return(1); 95 return(1);
107 } 96 }
108 97
109static int null_free(a) 98static int null_free(BIO *a)
110BIO *a;
111 { 99 {
112 if (a == NULL) return(0); 100 if (a == NULL) return(0);
113 return(1); 101 return(1);
114 } 102 }
115 103
116static int null_read(b,out,outl) 104static int null_read(BIO *b, char *out, int outl)
117BIO *b;
118char *out;
119int outl;
120 { 105 {
121 return(0); 106 return(0);
122 } 107 }
123 108
124static int null_write(b,in,inl) 109static int null_write(BIO *b, const char *in, int inl)
125BIO *b;
126char *in;
127int inl;
128 { 110 {
129 return(inl); 111 return(inl);
130 } 112 }
131 113
132static long null_ctrl(b,cmd,num,ptr) 114static long null_ctrl(BIO *b, int cmd, long num, void *ptr)
133BIO *b;
134int cmd;
135long num;
136char *ptr;
137 { 115 {
138 long ret=1; 116 long ret=1;
139 117
@@ -159,17 +137,12 @@ char *ptr;
159 return(ret); 137 return(ret);
160 } 138 }
161 139
162static int null_gets(bp,buf,size) 140static int null_gets(BIO *bp, char *buf, int size)
163BIO *bp;
164char *buf;
165int size;
166 { 141 {
167 return(0); 142 return(0);
168 } 143 }
169 144
170static int null_puts(bp,str) 145static int null_puts(BIO *bp, const char *str)
171BIO *bp;
172char *str;
173 { 146 {
174 if (str == NULL) return(0); 147 if (str == NULL) return(0);
175 return(strlen(str)); 148 return(strlen(str));