php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
transports.c File Reference
#include "php.h"
#include "php_streams_int.h"
#include "ext/standard/file.h"

Go to the source code of this file.

Macros

#define ERR_REPORT(out_err, fmt, arg)
 
#define ERR_RETURN(out_err, local_err, fmt)
 

Functions

PHPAPI HashTablephp_stream_xport_get_hash (void)
 
PHPAPI int php_stream_xport_register (const char *protocol, php_stream_transport_factory factory)
 
PHPAPI int php_stream_xport_unregister (const char *protocol)
 
PHPAPI php_stream_php_stream_xport_create (const char *name, size_t namelen, int options, int flags, const char *persistent_id, struct timeval *timeout, php_stream_context *context, zend_string **error_string, int *error_code STREAMS_DC)
 
PHPAPI int php_stream_xport_bind (php_stream *stream, const char *name, size_t namelen, zend_string **error_text)
 
PHPAPI int php_stream_xport_connect (php_stream *stream, const char *name, size_t namelen, int asynchronous, struct timeval *timeout, zend_string **error_text, int *error_code)
 
PHPAPI int php_stream_xport_listen (php_stream *stream, int backlog, zend_string **error_text)
 
PHPAPI int php_stream_xport_accept (php_stream *stream, php_stream **client, zend_string **textaddr, void **addr, socklen_t *addrlen, struct timeval *timeout, zend_string **error_text)
 
PHPAPI int php_stream_xport_get_name (php_stream *stream, int want_peer, zend_string **textaddr, void **addr, socklen_t *addrlen)
 
PHPAPI int php_stream_xport_crypto_setup (php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream)
 
PHPAPI int php_stream_xport_crypto_enable (php_stream *stream, int activate)
 
PHPAPI int php_stream_xport_recvfrom (php_stream *stream, char *buf, size_t buflen, int flags, void **addr, socklen_t *addrlen, zend_string **textaddr)
 
PHPAPI int php_stream_xport_sendto (php_stream *stream, const char *buf, size_t buflen, int flags, void *addr, socklen_t addrlen)
 
PHPAPI int php_stream_xport_shutdown (php_stream *stream, stream_shutdown_t how)
 

Macro Definition Documentation

◆ ERR_REPORT

#define ERR_REPORT ( out_err,
fmt,
arg )
Value:
if (out_err) { *out_err = strpprintf(0, fmt, arg); } \
else { php_error_docref(NULL, E_WARNING, fmt, arg); }
zval * arg
Definition ffi.c:3975
#define NULL
Definition gdcache.h:45
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
Definition main.c:1173
#define strpprintf
Definition spprintf.h:30
#define E_WARNING
Definition zend_errors.h:24

Definition at line 42 of file transports.c.

◆ ERR_RETURN

#define ERR_RETURN ( out_err,
local_err,
fmt )
Value:
if (out_err) { *out_err = local_err; } \
else { php_error_docref(NULL, E_WARNING, fmt, local_err ? ZSTR_VAL(local_err) : "Unspecified error"); \
if (local_err) { zend_string_release_ex(local_err, 0); local_err = NULL; } \
}
zend_string_release_ex(func->internal_function.function_name, 0)
#define ZSTR_VAL(zstr)
Definition zend_string.h:68

Definition at line 46 of file transports.c.

Function Documentation

◆ _php_stream_xport_create()

PHPAPI php_stream * _php_stream_xport_create ( const char * name,
size_t namelen,
int options,
int flags,
const char * persistent_id,
struct timeval * timeout,
php_stream_context * context,
zend_string ** error_string,
int *error_code STREAMS_DC )

Definition at line 52 of file transports.c.

◆ php_stream_xport_accept()

PHPAPI int php_stream_xport_accept ( php_stream * stream,
php_stream ** client,
zend_string ** textaddr,
void ** addr,
socklen_t * addrlen,
struct timeval * timeout,
zend_string ** error_text )

Definition at line 289 of file transports.c.

◆ php_stream_xport_bind()

PHPAPI int php_stream_xport_bind ( php_stream * stream,
const char * name,
size_t namelen,
zend_string ** error_text )

Definition at line 201 of file transports.c.

◆ php_stream_xport_connect()

PHPAPI int php_stream_xport_connect ( php_stream * stream,
const char * name,
size_t namelen,
int asynchronous,
struct timeval * timeout,
zend_string ** error_text,
int * error_code )

Definition at line 229 of file transports.c.

◆ php_stream_xport_crypto_enable()

PHPAPI int php_stream_xport_crypto_enable ( php_stream * stream,
int activate )

Definition at line 378 of file transports.c.

◆ php_stream_xport_crypto_setup()

PHPAPI int php_stream_xport_crypto_setup ( php_stream * stream,
php_stream_xport_crypt_method_t crypto_method,
php_stream * session_stream )

Definition at line 357 of file transports.c.

◆ php_stream_xport_get_hash()

PHPAPI HashTable * php_stream_xport_get_hash ( void )

Definition at line 23 of file transports.c.

◆ php_stream_xport_get_name()

PHPAPI int php_stream_xport_get_name ( php_stream * stream,
int want_peer,
zend_string ** textaddr,
void ** addr,
socklen_t * addrlen )

Definition at line 327 of file transports.c.

◆ php_stream_xport_listen()

PHPAPI int php_stream_xport_listen ( php_stream * stream,
int backlog,
zend_string ** error_text )

Definition at line 265 of file transports.c.

◆ php_stream_xport_recvfrom()

PHPAPI int php_stream_xport_recvfrom ( php_stream * stream,
char * buf,
size_t buflen,
int flags,
void ** addr,
socklen_t * addrlen,
zend_string ** textaddr )

Definition at line 400 of file transports.c.

◆ php_stream_xport_register()

PHPAPI int php_stream_xport_register ( const char * protocol,
php_stream_transport_factory factory )

Definition at line 28 of file transports.c.

◆ php_stream_xport_sendto()

PHPAPI int php_stream_xport_sendto ( php_stream * stream,
const char * buf,
size_t buflen,
int flags,
void * addr,
socklen_t addrlen )

Definition at line 469 of file transports.c.

◆ php_stream_xport_shutdown()

PHPAPI int php_stream_xport_shutdown ( php_stream * stream,
stream_shutdown_t how )

Definition at line 509 of file transports.c.

◆ php_stream_xport_unregister()

PHPAPI int php_stream_xport_unregister ( const char * protocol)

Definition at line 37 of file transports.c.