diff options
| author | markus <> | 2002-09-05 12:51:50 +0000 |
|---|---|---|
| committer | markus <> | 2002-09-05 12:51:50 +0000 |
| commit | 15b5d84f9da2ce4bfae8580e56e34a859f74ad71 (patch) | |
| tree | bf939e82d7fd73cc8a01cf6959002209972091bc /src/lib/libcrypto/bio/bss_null.c | |
| parent | 027351f729b9e837200dae6e1520cda6577ab930 (diff) | |
| download | openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.gz openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.bz2 openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.zip | |
import openssl-0.9.7-beta1
Diffstat (limited to 'src/lib/libcrypto/bio/bss_null.c')
| -rw-r--r-- | src/lib/libcrypto/bio/bss_null.c | 57 |
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 | 64 | static int null_write(BIO *h, const char *buf, int num); |
| 65 | static int null_write(BIO *h,char *buf,int num); | 65 | static int null_read(BIO *h, char *buf, int size); |
| 66 | static int null_read(BIO *h,char *buf,int size); | 66 | static int null_puts(BIO *h, const char *str); |
| 67 | static int null_puts(BIO *h,char *str); | 67 | static int null_gets(BIO *h, char *str, int size); |
| 68 | static int null_gets(BIO *h,char *str,int size); | 68 | static long null_ctrl(BIO *h, int cmd, long arg1, void *arg2); |
| 69 | static long null_ctrl(BIO *h,int cmd,long arg1,char *arg2); | ||
| 70 | static int null_new(BIO *h); | 69 | static int null_new(BIO *h); |
| 71 | static int null_free(BIO *data); | 70 | static int null_free(BIO *data); |
| 72 | #else | ||
| 73 | static int null_write(); | ||
| 74 | static int null_read(); | ||
| 75 | static int null_puts(); | ||
| 76 | static int null_gets(); | ||
| 77 | static long null_ctrl(); | ||
| 78 | static int null_new(); | ||
| 79 | static int null_free(); | ||
| 80 | #endif | ||
| 81 | |||
| 82 | static BIO_METHOD null_method= | 71 | static 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 | ||
| 95 | BIO_METHOD *BIO_s_null() | 85 | BIO_METHOD *BIO_s_null(void) |
| 96 | { | 86 | { |
| 97 | return(&null_method); | 87 | return(&null_method); |
| 98 | } | 88 | } |
| 99 | 89 | ||
| 100 | static int null_new(bi) | 90 | static int null_new(BIO *bi) |
| 101 | BIO *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 | ||
| 109 | static int null_free(a) | 98 | static int null_free(BIO *a) |
| 110 | BIO *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 | ||
| 116 | static int null_read(b,out,outl) | 104 | static int null_read(BIO *b, char *out, int outl) |
| 117 | BIO *b; | ||
| 118 | char *out; | ||
| 119 | int outl; | ||
| 120 | { | 105 | { |
| 121 | return(0); | 106 | return(0); |
| 122 | } | 107 | } |
| 123 | 108 | ||
| 124 | static int null_write(b,in,inl) | 109 | static int null_write(BIO *b, const char *in, int inl) |
| 125 | BIO *b; | ||
| 126 | char *in; | ||
| 127 | int inl; | ||
| 128 | { | 110 | { |
| 129 | return(inl); | 111 | return(inl); |
| 130 | } | 112 | } |
| 131 | 113 | ||
| 132 | static long null_ctrl(b,cmd,num,ptr) | 114 | static long null_ctrl(BIO *b, int cmd, long num, void *ptr) |
| 133 | BIO *b; | ||
| 134 | int cmd; | ||
| 135 | long num; | ||
| 136 | char *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 | ||
| 162 | static int null_gets(bp,buf,size) | 140 | static int null_gets(BIO *bp, char *buf, int size) |
| 163 | BIO *bp; | ||
| 164 | char *buf; | ||
| 165 | int size; | ||
| 166 | { | 141 | { |
| 167 | return(0); | 142 | return(0); |
| 168 | } | 143 | } |
| 169 | 144 | ||
| 170 | static int null_puts(bp,str) | 145 | static int null_puts(BIO *bp, const char *str) |
| 171 | BIO *bp; | ||
| 172 | char *str; | ||
| 173 | { | 146 | { |
| 174 | if (str == NULL) return(0); | 147 | if (str == NULL) return(0); |
| 175 | return(strlen(str)); | 148 | return(strlen(str)); |
