#ifndef HEADER_BIO_H
#define HEADER_BIO_H
-#include <stdio.h>
-#include <stdlib.h>
+#ifndef NO_FP_API
+# include <stdio.h>
+#endif
+#include <stdarg.h>
+
#include <openssl/crypto.h>
#ifdef __cplusplus
typedef struct bio_st BIO;
+typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long);
+
#ifndef WIN16
typedef struct bio_method_st
{
long (*ctrl)(BIO *, int, long, void *);
int (*create)(BIO *);
int (*destroy)(BIO *);
- long (*callback_ctrl)(BIO *, int, void (*)(struct bio_st *, int, const char *, int, long, long));
+ long (*callback_ctrl)(BIO *, int, bio_info_cb *);
} BIO_METHOD;
#else
typedef struct bio_method_st
};
DECLARE_STACK_OF(BIO)
-/* This block of defines is updated by a perl script, please do not touch! */
-#ifndef DEBUG_SAFESTACK
- #define sk_BIO_new(a) sk_new((int (*) \
- (const char * const *, const char * const *))(a))
- #define sk_BIO_new_null() sk_new_null()
- #define sk_BIO_free(a) sk_free(a)
- #define sk_BIO_num(a) sk_num(a)
- #define sk_BIO_value(a,b) ((BIO *) \
- sk_value((a),(b)))
- #define sk_BIO_set(a,b,c) ((BIO *) \
- sk_set((a),(b),(char *)(c)))
- #define sk_BIO_zero(a) sk_zero(a)
- #define sk_BIO_push(a,b) sk_push((a),(char *)(b))
- #define sk_BIO_unshift(a,b) sk_unshift((a),(b))
- #define sk_BIO_find(a,b) sk_find((a), (char *)(b))
- #define sk_BIO_delete(a,b) ((BIO *) \
- sk_delete((a),(b)))
- #define sk_BIO_delete_ptr(a,b) ((BIO *) \
- sk_delete_ptr((a),(char *)(b)))
- #define sk_BIO_insert(a,b,c) sk_insert((a),(char *)(b),(c))
- #define sk_BIO_set_cmp_func(a,b) ((int (*) \
- (const BIO * const *,const BIO * const *)) \
- sk_set_cmp_func((a),(int (*) \
- (const char * const *, const char * const *))(b)))
- #define sk_BIO_dup(a) sk_dup(a)
- #define sk_BIO_pop_free(a,b) sk_pop_free((a),(void (*)(void *))(b))
- #define sk_BIO_shift(a) ((BIO *)sk_shift(a))
- #define sk_BIO_pop(a) ((BIO *)sk_pop(a))
- #define sk_BIO_sort(a) sk_sort(a)
-#endif /* !DEBUG_SAFESTACK */
-/* End of perl script block, you may now edit :-) */
typedef struct bio_f_buffer_ctx_struct
{
size_t BIO_ctrl_pending(BIO *b);
size_t BIO_ctrl_wpending(BIO *b);
#define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
-#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,(void (**)())(cbp))
-#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,(void (*)())(cb))
+#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,(bio_info_cb **)(cbp))
+#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,(bio_info_cb *)(cb))
/* For the BIO_f_buffer() type */
#define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)
size_t BIO_ctrl_get_read_request(BIO *b);
int BIO_ctrl_reset_read_request(BIO *b);
-#ifdef NO_STDIO
-#define NO_FP_API
-#endif
-
-
/* These two aren't currently implemented */
/* int BIO_get_ex_num(BIO *bio); */
/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */
unsigned long BIO_number_read(BIO *bio);
unsigned long BIO_number_written(BIO *bio);
+# ifndef NO_FP_API
# if defined(WIN16) && defined(_WINDLL)
BIO_METHOD *BIO_s_file_internal(void);
BIO *BIO_new_file_internal(char *filename, char *mode);
# define BIO_new_file_internal BIO_new_file
# define BIO_new_fp_internal BIO_s_file
# endif /* FP_API */
+# endif
BIO * BIO_new(BIO_METHOD *type);
int BIO_set(BIO *a,BIO_METHOD *type);
int BIO_free(BIO *a);
int BIO_fd_should_retry(int i);
int BIO_fd_non_fatal_error(int error);
int BIO_dump(BIO *b,const char *bytes,int len);
+int BIO_dump_indent(BIO *b,const char *bytes,int len,int indent);
struct hostent *BIO_gethostbyname(const char *name);
/* We might want a thread-safe interface too:
long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);
int BIO_printf(BIO *bio, const char *format, ...);
+int BIO_vprintf(BIO *bio, const char *format, va_list args);
int BIO_snprintf(char *buf, size_t n, const char *format, ...);
+int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args);
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
#define BIO_F_CONN_CTRL 127
#define BIO_F_CONN_STATE 115
#define BIO_F_FILE_CTRL 116
+#define BIO_F_MEM_READ 128
#define BIO_F_MEM_WRITE 117
#define BIO_F_SSL_NEW 118
#define BIO_F_WSASTARTUP 119
#define BIO_R_BAD_HOSTNAME_LOOKUP 102
#define BIO_R_BROKEN_PIPE 124
#define BIO_R_CONNECT_ERROR 103
+#define BIO_R_EOF_ON_MEMORY_BIO 127
#define BIO_R_ERROR_SETTING_NBIO 104
#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105
#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106