192f3ab15Sopenharmony_ciuse libc::*; 292f3ab15Sopenharmony_ci 392f3ab15Sopenharmony_ciuse super::*; 492f3ab15Sopenharmony_ci 592f3ab15Sopenharmony_cipub const BIO_TYPE_NONE: c_int = 0; 692f3ab15Sopenharmony_ci 792f3ab15Sopenharmony_cipub const BIO_CTRL_EOF: c_int = 2; 892f3ab15Sopenharmony_cipub const BIO_CTRL_INFO: c_int = 3; 992f3ab15Sopenharmony_cipub const BIO_CTRL_FLUSH: c_int = 11; 1092f3ab15Sopenharmony_cipub const BIO_CTRL_DGRAM_QUERY_MTU: c_int = 40; 1192f3ab15Sopenharmony_cipub const BIO_C_SET_BUF_MEM_EOF_RETURN: c_int = 130; 1292f3ab15Sopenharmony_ci 1392f3ab15Sopenharmony_cipub unsafe fn BIO_set_retry_read(b: *mut BIO) { 1492f3ab15Sopenharmony_ci BIO_set_flags(b, BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY) 1592f3ab15Sopenharmony_ci} 1692f3ab15Sopenharmony_ci 1792f3ab15Sopenharmony_cipub unsafe fn BIO_set_retry_write(b: *mut BIO) { 1892f3ab15Sopenharmony_ci BIO_set_flags(b, BIO_FLAGS_WRITE | BIO_FLAGS_SHOULD_RETRY) 1992f3ab15Sopenharmony_ci} 2092f3ab15Sopenharmony_ci 2192f3ab15Sopenharmony_cipub unsafe fn BIO_clear_retry_flags(b: *mut BIO) { 2292f3ab15Sopenharmony_ci BIO_clear_flags(b, BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY) 2392f3ab15Sopenharmony_ci} 2492f3ab15Sopenharmony_ci 2592f3ab15Sopenharmony_cipub const BIO_FLAGS_READ: c_int = 0x01; 2692f3ab15Sopenharmony_cipub const BIO_FLAGS_WRITE: c_int = 0x02; 2792f3ab15Sopenharmony_cipub const BIO_FLAGS_IO_SPECIAL: c_int = 0x04; 2892f3ab15Sopenharmony_cipub const BIO_FLAGS_RWS: c_int = BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL; 2992f3ab15Sopenharmony_cipub const BIO_FLAGS_SHOULD_RETRY: c_int = 0x08; 3092f3ab15Sopenharmony_ci 3192f3ab15Sopenharmony_cipub unsafe fn BIO_get_mem_data(b: *mut BIO, pp: *mut *mut c_char) -> c_long { 3292f3ab15Sopenharmony_ci BIO_ctrl(b, BIO_CTRL_INFO, 0, pp as *mut c_void) 3392f3ab15Sopenharmony_ci} 3492f3ab15Sopenharmony_ci 3592f3ab15Sopenharmony_ciextern "C" { 3692f3ab15Sopenharmony_ci #[deprecated(note = "use BIO_meth_set_write__fixed_rust instead")] 3792f3ab15Sopenharmony_ci #[cfg(any(ossl110, libressl273))] 3892f3ab15Sopenharmony_ci pub fn BIO_meth_set_write( 3992f3ab15Sopenharmony_ci biom: *mut BIO_METHOD, 4092f3ab15Sopenharmony_ci write: unsafe extern "C" fn(*mut BIO, *const c_char, c_int) -> c_int, 4192f3ab15Sopenharmony_ci ) -> c_int; 4292f3ab15Sopenharmony_ci #[deprecated(note = "use BIO_meth_set_read__fixed_rust instead")] 4392f3ab15Sopenharmony_ci #[cfg(any(ossl110, libressl273))] 4492f3ab15Sopenharmony_ci pub fn BIO_meth_set_read( 4592f3ab15Sopenharmony_ci biom: *mut BIO_METHOD, 4692f3ab15Sopenharmony_ci read: unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int, 4792f3ab15Sopenharmony_ci ) -> c_int; 4892f3ab15Sopenharmony_ci #[deprecated(note = "use BIO_meth_set_puts__fixed_rust instead")] 4992f3ab15Sopenharmony_ci #[cfg(any(ossl110, libressl273))] 5092f3ab15Sopenharmony_ci pub fn BIO_meth_set_puts( 5192f3ab15Sopenharmony_ci biom: *mut BIO_METHOD, 5292f3ab15Sopenharmony_ci read: unsafe extern "C" fn(*mut BIO, *const c_char) -> c_int, 5392f3ab15Sopenharmony_ci ) -> c_int; 5492f3ab15Sopenharmony_ci #[deprecated(note = "use BIO_meth_set_ctrl__fixed_rust instead")] 5592f3ab15Sopenharmony_ci #[cfg(any(ossl110, libressl273))] 5692f3ab15Sopenharmony_ci pub fn BIO_meth_set_ctrl( 5792f3ab15Sopenharmony_ci biom: *mut BIO_METHOD, 5892f3ab15Sopenharmony_ci read: unsafe extern "C" fn(*mut BIO, c_int, c_long, *mut c_void) -> c_long, 5992f3ab15Sopenharmony_ci ) -> c_int; 6092f3ab15Sopenharmony_ci #[deprecated(note = "use BIO_meth_set_create__fixed_rust instead")] 6192f3ab15Sopenharmony_ci #[cfg(any(ossl110, libressl273))] 6292f3ab15Sopenharmony_ci pub fn BIO_meth_set_create( 6392f3ab15Sopenharmony_ci biom: *mut BIO_METHOD, 6492f3ab15Sopenharmony_ci create: unsafe extern "C" fn(*mut BIO) -> c_int, 6592f3ab15Sopenharmony_ci ) -> c_int; 6692f3ab15Sopenharmony_ci #[deprecated(note = "use BIO_meth_set_destroy__fixed_rust instead")] 6792f3ab15Sopenharmony_ci #[cfg(any(ossl110, libressl273))] 6892f3ab15Sopenharmony_ci pub fn BIO_meth_set_destroy( 6992f3ab15Sopenharmony_ci biom: *mut BIO_METHOD, 7092f3ab15Sopenharmony_ci destroy: unsafe extern "C" fn(*mut BIO) -> c_int, 7192f3ab15Sopenharmony_ci ) -> c_int; 7292f3ab15Sopenharmony_ci} 73