Import OpenSSL 1.1.0f
This commit is contained in:
@@ -10,12 +10,12 @@ BIO_rw_filename - FILE bio
|
||||
|
||||
#include <openssl/bio.h>
|
||||
|
||||
BIO_METHOD * BIO_s_file(void);
|
||||
const BIO_METHOD * BIO_s_file(void);
|
||||
BIO *BIO_new_file(const char *filename, const char *mode);
|
||||
BIO *BIO_new_fp(FILE *stream, int flags);
|
||||
|
||||
BIO_set_fp(BIO *b,FILE *fp, int flags);
|
||||
BIO_get_fp(BIO *b,FILE **fpp);
|
||||
BIO_set_fp(BIO *b, FILE *fp, int flags);
|
||||
BIO_get_fp(BIO *b, FILE **fpp);
|
||||
|
||||
int BIO_read_filename(BIO *b, char *name)
|
||||
int BIO_write_filename(BIO *b, char *name)
|
||||
@@ -92,15 +92,15 @@ Alternative technique:
|
||||
|
||||
BIO *bio_out;
|
||||
bio_out = BIO_new(BIO_s_file());
|
||||
if(bio_out == NULL) /* Error ... */
|
||||
if(!BIO_set_fp(bio_out, stdout, BIO_NOCLOSE)) /* Error ... */
|
||||
if (bio_out == NULL) /* Error ... */
|
||||
if (!BIO_set_fp(bio_out, stdout, BIO_NOCLOSE)) /* Error ... */
|
||||
BIO_printf(bio_out, "Hello World\n");
|
||||
|
||||
Write to a file:
|
||||
|
||||
BIO *out;
|
||||
out = BIO_new_file("filename.txt", "w");
|
||||
if(!out) /* Error occurred */
|
||||
if (!out) /* Error occurred */
|
||||
BIO_printf(out, "Hello World\n");
|
||||
BIO_free(out);
|
||||
|
||||
@@ -108,8 +108,8 @@ Alternative technique:
|
||||
|
||||
BIO *out;
|
||||
out = BIO_new(BIO_s_file());
|
||||
if(out == NULL) /* Error ... */
|
||||
if(!BIO_write_filename(out, "filename.txt")) /* Error ... */
|
||||
if (out == NULL) /* Error ... */
|
||||
if (!BIO_write_filename(out, "filename.txt")) /* Error ... */
|
||||
BIO_printf(out, "Hello World\n");
|
||||
BIO_free(out);
|
||||
|
||||
@@ -128,7 +128,7 @@ BIO_seek() returns the same value as the underlying fseek() function:
|
||||
|
||||
BIO_tell() returns the current file position.
|
||||
|
||||
BIO_read_filename(), BIO_write_filename(), BIO_append_filename() and
|
||||
BIO_read_filename(), BIO_write_filename(), BIO_append_filename() and
|
||||
BIO_rw_filename() return 1 for success or 0 for failure.
|
||||
|
||||
=head1 BUGS
|
||||
@@ -140,9 +140,20 @@ occurred this differs from other types of BIO which will typically return
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<BIO_seek(3)|BIO_seek(3)>, L<BIO_tell(3)|BIO_tell(3)>,
|
||||
L<BIO_reset(3)|BIO_reset(3)>, L<BIO_flush(3)|BIO_flush(3)>,
|
||||
L<BIO_read(3)|BIO_read(3)>,
|
||||
L<BIO_write(3)|BIO_write(3)>, L<BIO_puts(3)|BIO_puts(3)>,
|
||||
L<BIO_gets(3)|BIO_gets(3)>, L<BIO_printf(3)|BIO_printf(3)>,
|
||||
L<BIO_set_close(3)|BIO_set_close(3)>, L<BIO_get_close(3)|BIO_get_close(3)>
|
||||
L<BIO_seek(3)>, L<BIO_tell(3)>,
|
||||
L<BIO_reset(3)>, L<BIO_flush(3)>,
|
||||
L<BIO_read(3)>,
|
||||
L<BIO_write(3)>, L<BIO_puts(3)>,
|
||||
L<BIO_gets(3)>, L<BIO_printf(3)>,
|
||||
L<BIO_set_close(3)>, L<BIO_get_close(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
Licensed under the OpenSSL license (the "License"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
in the file LICENSE in the source distribution or at
|
||||
L<https://www.openssl.org/source/license.html>.
|
||||
|
||||
=cut
|
||||
|
||||
Reference in New Issue
Block a user