diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2014-04-15 16:37:23 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2014-04-15 16:37:23 +0000 |
commit | 6e256012fe4391e070084a3630379479c37c7aba (patch) | |
tree | bfc39ffc97c9cd96266492b216ed7800c34c9d8d /lib/libcrypto/bio/bf_null.c | |
parent | fcd74ba7aa271885eb12554ad9070defd36a05c9 (diff) |
First pass at applying KNF to the OpenSSL code, which almost makes it
readable. This pass is whitespace only and can readily be verified using
tr and md5.
Diffstat (limited to 'lib/libcrypto/bio/bf_null.c')
-rw-r--r-- | lib/libcrypto/bio/bf_null.c | 167 |
1 files changed, 90 insertions, 77 deletions
diff --git a/lib/libcrypto/bio/bf_null.c b/lib/libcrypto/bio/bf_null.c index c1bf39a904f..354731c0c74 100644 --- a/lib/libcrypto/bio/bf_null.c +++ b/lib/libcrypto/bio/bf_null.c @@ -72,8 +72,8 @@ static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2); static int nullf_new(BIO *h); static int nullf_free(BIO *data); static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); -static BIO_METHOD methods_nullf= - { + +static BIO_METHOD methods_nullf = { BIO_TYPE_NULL_FILTER, "NULL filter", nullf_write, @@ -84,100 +84,113 @@ static BIO_METHOD methods_nullf= nullf_new, nullf_free, nullf_callback_ctrl, - }; - -BIO_METHOD *BIO_f_null(void) - { - return(&methods_nullf); - } - -static int nullf_new(BIO *bi) - { - bi->init=1; - bi->ptr=NULL; - bi->flags=0; - return(1); - } - -static int nullf_free(BIO *a) - { - if (a == NULL) return(0); +}; + +BIO_METHOD +*BIO_f_null(void) +{ + return (&methods_nullf); +} + +static int +nullf_new(BIO *bi) +{ + bi->init = 1; + bi->ptr = NULL; + bi->flags = 0; + return (1); +} + +static int +nullf_free(BIO *a) +{ + if (a == NULL) + return (0); /* a->ptr=NULL; a->init=0; a->flags=0;*/ - return(1); - } - -static int nullf_read(BIO *b, char *out, int outl) - { - int ret=0; - - if (out == NULL) return(0); - if (b->next_bio == NULL) return(0); - ret=BIO_read(b->next_bio,out,outl); + return (1); +} + +static int +nullf_read(BIO *b, char *out, int outl) +{ + int ret = 0; + + if (out == NULL) + return (0); + if (b->next_bio == NULL) + return (0); + ret = BIO_read(b->next_bio, out, outl); BIO_clear_retry_flags(b); BIO_copy_next_retry(b); - return(ret); - } - -static int nullf_write(BIO *b, const char *in, int inl) - { - int ret=0; - - if ((in == NULL) || (inl <= 0)) return(0); - if (b->next_bio == NULL) return(0); - ret=BIO_write(b->next_bio,in,inl); + return (ret); +} + +static int +nullf_write(BIO *b, const char *in, int inl) +{ + int ret = 0; + + if ((in == NULL) || (inl <= 0)) + return (0); + if (b->next_bio == NULL) + return (0); + ret = BIO_write(b->next_bio, in, inl); BIO_clear_retry_flags(b); BIO_copy_next_retry(b); - return(ret); - } + return (ret); +} -static long nullf_ctrl(BIO *b, int cmd, long num, void *ptr) - { +static long +nullf_ctrl(BIO *b, int cmd, long num, void *ptr) +{ long ret; - if (b->next_bio == NULL) return(0); - switch(cmd) - { - case BIO_C_DO_STATE_MACHINE: + if (b->next_bio == NULL) + return (0); + switch (cmd) { + case BIO_C_DO_STATE_MACHINE: BIO_clear_retry_flags(b); - ret=BIO_ctrl(b->next_bio,cmd,num,ptr); + ret = BIO_ctrl(b->next_bio, cmd, num, ptr); BIO_copy_next_retry(b); break; case BIO_CTRL_DUP: - ret=0L; + ret = 0L; break; default: - ret=BIO_ctrl(b->next_bio,cmd,num,ptr); - } - return(ret); + ret = BIO_ctrl(b->next_bio, cmd, num, ptr); } + return (ret); +} -static long nullf_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) - { - long ret=1; +static long +nullf_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) +{ + long ret = 1; - if (b->next_bio == NULL) return(0); - switch (cmd) - { + if (b->next_bio == NULL) + return (0); + switch (cmd) { default: - ret=BIO_callback_ctrl(b->next_bio,cmd,fp); + ret = BIO_callback_ctrl(b->next_bio, cmd, fp); break; - } - return(ret); } - -static int nullf_gets(BIO *bp, char *buf, int size) - { - if (bp->next_bio == NULL) return(0); - return(BIO_gets(bp->next_bio,buf,size)); - } - - -static int nullf_puts(BIO *bp, const char *str) - { - if (bp->next_bio == NULL) return(0); - return(BIO_puts(bp->next_bio,str)); - } - - + return (ret); +} + +static int +nullf_gets(BIO *bp, char *buf, int size) +{ + if (bp->next_bio == NULL) + return (0); + return (BIO_gets(bp->next_bio, buf, size)); +} + +static int +nullf_puts(BIO *bp, const char *str) +{ + if (bp->next_bio == NULL) + return (0); + return (BIO_puts(bp->next_bio, str)); +} |