php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_stream_context.h File Reference

Go to the source code of this file.

Data Structures

struct  _php_stream_notifier
 
struct  _php_stream_context
 

Macros

#define PHP_STREAM_NOTIFIER_PROGRESS   1
 
#define php_stream_context_from_zval(zcontext, nocontext)
 
#define php_stream_context_to_zval(context, zval)
 
#define PHP_STREAM_NOTIFY_RESOLVE   1
 
#define PHP_STREAM_NOTIFY_CONNECT   2
 
#define PHP_STREAM_NOTIFY_AUTH_REQUIRED   3
 
#define PHP_STREAM_NOTIFY_MIME_TYPE_IS   4
 
#define PHP_STREAM_NOTIFY_FILE_SIZE_IS   5
 
#define PHP_STREAM_NOTIFY_REDIRECTED   6
 
#define PHP_STREAM_NOTIFY_PROGRESS   7
 
#define PHP_STREAM_NOTIFY_COMPLETED   8
 
#define PHP_STREAM_NOTIFY_FAILURE   9
 
#define PHP_STREAM_NOTIFY_AUTH_RESULT   10
 
#define PHP_STREAM_NOTIFY_SEVERITY_INFO   0
 
#define PHP_STREAM_NOTIFY_SEVERITY_WARN   1
 
#define PHP_STREAM_NOTIFY_SEVERITY_ERR   2
 
#define php_stream_notify_info(context, code, xmsg, xcode)
 
#define php_stream_notify_progress(context, bsofar, bmax)
 
#define php_stream_notify_completed(context)
 
#define php_stream_notify_progress_init(context, sofar, bmax)
 
#define php_stream_notify_progress_increment(context, dsofar, dmax)
 
#define php_stream_notify_file_size(context, file_size, xmsg, xcode)
 
#define php_stream_notify_error(context, code, xmsg, xcode)
 

Typedefs

typedef void(* php_stream_notification_func) (php_stream_context *context, int notifycode, int severity, char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void *ptr)
 
typedef struct _php_stream_notifier php_stream_notifier
 

Functions

PHPAPI void php_stream_context_free (php_stream_context *context)
 
PHPAPI php_stream_contextphp_stream_context_alloc (void)
 
PHPAPI zvalphp_stream_context_get_option (php_stream_context *context, const char *wrappername, const char *optionname)
 
PHPAPI void php_stream_context_set_option (php_stream_context *context, const char *wrappername, const char *optionname, zval *optionvalue)
 
PHPAPI php_stream_notifierphp_stream_notification_alloc (void)
 
PHPAPI void php_stream_notification_free (php_stream_notifier *notifier)
 
PHPAPI void php_stream_notification_notify (php_stream_context *context, int notifycode, int severity, char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void *ptr)
 
PHPAPI php_stream_contextphp_stream_context_set (php_stream *stream, php_stream_context *context)
 

Macro Definition Documentation

◆ php_stream_context_from_zval

#define php_stream_context_from_zval ( zcontext,
nocontext )
Value:
( \
(nocontext) ? NULL : \
FG(default_context) ? FG(default_context) : \
(FG(default_context) = php_stream_context_alloc()) )
PHPAPI int php_le_stream_context(void)
Definition file.c:114
zval * zcontext
#define NULL
Definition gdcache.h:45
PHPAPI php_stream_context * php_stream_context_alloc(void)
Definition streams.c:2383
#define FG(v)
Definition file.h:117
ZEND_API void * zend_fetch_resource_ex(zval *res, const char *resource_type_name, int resource_type)
Definition zend_list.c:132

Definition at line 31 of file php_stream_context.h.

◆ php_stream_context_to_zval

#define php_stream_context_to_zval ( context,
zval )
Value:
zend_string * res
Definition ffi.c:4692
Definition dce.c:49
struct _zval_struct zval
#define GC_ADDREF(p)
Definition zend_types.h:709
#define ZVAL_RES(z, r)

Definition at line 37 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFIER_PROGRESS

#define PHP_STREAM_NOTIFIER_PROGRESS   1

Definition at line 26 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_AUTH_REQUIRED

#define PHP_STREAM_NOTIFY_AUTH_REQUIRED   3

Definition at line 70 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_AUTH_RESULT

#define PHP_STREAM_NOTIFY_AUTH_RESULT   10

Definition at line 77 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_COMPLETED

#define PHP_STREAM_NOTIFY_COMPLETED   8

Definition at line 75 of file php_stream_context.h.

◆ php_stream_notify_completed

#define php_stream_notify_completed ( context)
Value:
do { if ((context) && (context)->notifier) { \
NULL, 0, (context)->notifier->progress, (context)->notifier->progress_max, NULL); } } while(0)
#define PHP_STREAM_NOTIFY_COMPLETED
#define PHP_STREAM_NOTIFY_SEVERITY_INFO

Definition at line 97 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_CONNECT

#define PHP_STREAM_NOTIFY_CONNECT   2

Definition at line 69 of file php_stream_context.h.

◆ php_stream_notify_error

#define php_stream_notify_error ( context,
code,
xmsg,
xcode )
Value:
do { if ((context) && (context)->notifier) {\
php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_ERR, \
(xmsg), (xcode), 0, 0, NULL); } } while(0)
#define PHP_STREAM_NOTIFY_SEVERITY_ERR

Definition at line 116 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_FAILURE

#define PHP_STREAM_NOTIFY_FAILURE   9

Definition at line 76 of file php_stream_context.h.

◆ php_stream_notify_file_size

#define php_stream_notify_file_size ( context,
file_size,
xmsg,
xcode )
Value:
do { if ((context) && (context)->notifier) { \
(xmsg), (xcode), 0, (file_size), NULL); } } while(0)
#define PHP_STREAM_NOTIFY_FILE_SIZE_IS

Definition at line 112 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_FILE_SIZE_IS

#define PHP_STREAM_NOTIFY_FILE_SIZE_IS   5

Definition at line 72 of file php_stream_context.h.

◆ php_stream_notify_info

#define php_stream_notify_info ( context,
code,
xmsg,
xcode )
Value:
do { if ((context) && (context)->notifier) { \
php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_INFO, \
(xmsg), (xcode), 0, 0, NULL); } } while (0)

Definition at line 89 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_MIME_TYPE_IS

#define PHP_STREAM_NOTIFY_MIME_TYPE_IS   4

Definition at line 71 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_PROGRESS

#define PHP_STREAM_NOTIFY_PROGRESS   7

Definition at line 74 of file php_stream_context.h.

◆ php_stream_notify_progress

#define php_stream_notify_progress ( context,
bsofar,
bmax )
Value:
do { if ((context) && (context)->notifier) { \
NULL, 0, (bsofar), (bmax), NULL); } } while(0)
#define PHP_STREAM_NOTIFY_PROGRESS

Definition at line 93 of file php_stream_context.h.

◆ php_stream_notify_progress_increment

#define php_stream_notify_progress_increment ( context,
dsofar,
dmax )
Value:
do { if ((context) && (context)->notifier && ((context)->notifier->mask & PHP_STREAM_NOTIFIER_PROGRESS)) { \
(context)->notifier->progress += (dsofar); \
(context)->notifier->progress_max += (dmax); \
php_stream_notify_progress((context), (context)->notifier->progress, (context)->notifier->progress_max); } } while (0)
#define PHP_STREAM_NOTIFIER_PROGRESS

Definition at line 107 of file php_stream_context.h.

◆ php_stream_notify_progress_init

#define php_stream_notify_progress_init ( context,
sofar,
bmax )
Value:
do { if ((context) && (context)->notifier) { \
(context)->notifier->progress = (sofar); \
(context)->notifier->progress_max = (bmax); \
(context)->notifier->mask |= PHP_STREAM_NOTIFIER_PROGRESS; \
php_stream_notify_progress((context), (sofar), (bmax)); } } while (0)

Definition at line 101 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_REDIRECTED

#define PHP_STREAM_NOTIFY_REDIRECTED   6

Definition at line 73 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_RESOLVE

#define PHP_STREAM_NOTIFY_RESOLVE   1

Definition at line 68 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_SEVERITY_ERR

#define PHP_STREAM_NOTIFY_SEVERITY_ERR   2

Definition at line 81 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_SEVERITY_INFO

#define PHP_STREAM_NOTIFY_SEVERITY_INFO   0

Definition at line 79 of file php_stream_context.h.

◆ PHP_STREAM_NOTIFY_SEVERITY_WARN

#define PHP_STREAM_NOTIFY_SEVERITY_WARN   1

Definition at line 80 of file php_stream_context.h.

Typedef Documentation

◆ php_stream_notification_func

typedef void(* php_stream_notification_func) (php_stream_context *context, int notifycode, int severity, char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void *ptr)

Definition at line 20 of file php_stream_context.h.

◆ php_stream_notifier

Definition at line 39 of file php_stream_context.h.

Function Documentation

◆ php_stream_context_alloc()

PHPAPI php_stream_context * php_stream_context_alloc ( void )

Definition at line 2383 of file streams.c.

◆ php_stream_context_free()

PHPAPI void php_stream_context_free ( php_stream_context * context)

Definition at line 2370 of file streams.c.

◆ php_stream_context_get_option()

PHPAPI zval * php_stream_context_get_option ( php_stream_context * context,
const char * wrappername,
const char * optionname )

Definition at line 2407 of file streams.c.

◆ php_stream_context_set()

PHPAPI php_stream_context * php_stream_context_set ( php_stream * stream,
php_stream_context * context )

Definition at line 2346 of file streams.c.

◆ php_stream_context_set_option()

PHPAPI void php_stream_context_set_option ( php_stream_context * context,
const char * wrappername,
const char * optionname,
zval * optionvalue )

Definition at line 2418 of file streams.c.

◆ php_stream_notification_alloc()

PHPAPI php_stream_notifier * php_stream_notification_alloc ( void )

Definition at line 2394 of file streams.c.

◆ php_stream_notification_free()

PHPAPI void php_stream_notification_free ( php_stream_notifier * notifier)

Definition at line 2399 of file streams.c.

◆ php_stream_notification_notify()

PHPAPI void php_stream_notification_notify ( php_stream_context * context,
int notifycode,
int severity,
char * xmsg,
int xcode,
size_t bytes_sofar,
size_t bytes_max,
void * ptr )

Definition at line 2363 of file streams.c.