#endif
#ifndef INADDR_NONE
-#define INADDR_NONE ((unsigned long int) -1)
+#define INADDR_NONE ((php_uint_t) -1)
#endif
#include "zend_globals.h"
#ifdef HAVE_INET_PTON
struct in_addr ip;
#else
- unsigned long int ip;
+ php_uint_t ip;
#endif
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == FAILURE) {
/* "It's a long but it's not, PHP ints are signed */
char *ip;
int ip_len;
- unsigned long n;
+ php_uint_t n;
struct in_addr myaddr;
#ifdef HAVE_INET_PTON
char str[40];
Delay for a number of seconds and nano seconds */
PHP_FUNCTION(time_nanosleep)
{
- long tv_sec, tv_nsec;
+ php_int_t tv_sec, tv_nsec;
struct timespec php_req, php_rem;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &tv_sec, &tv_nsec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ii", &tv_sec, &tv_nsec) == FAILURE) {
return;
}
static unsigned char itoa64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
-static void php_to64(char *s, long v, int n) /* {{{ */
+static void php_to64(char *s, php_int_t v, int n) /* {{{ */
{
while (--n >= 0) {
*s++ = itoa64[v&0x3f];
Change the priority of the current process */
PHP_FUNCTION(proc_nice)
{
- long pri;
+ php_int_t pri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pri) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &pri) == FAILURE) {
RETURN_FALSE;
}
char *dir;
int dir_len;
zval *zcontext = NULL;
- long mode = 0777;
+ php_int_t mode = 0777;
zend_bool recursive = 0;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lbr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ibr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) {
RETURN_FALSE;
}
{
char *pattern, *filename;
int pattern_len, filename_len;
- long flags = 0;
+ php_int_t flags = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|l", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|i", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) {
return;
}
#if IT_WAS_USED
static int php_conv_get_int_prop_ex(const HashTable *ht, int *pretval, char *field_name, size_t field_name_len)
{
- long l;
+ php_int_t l;
php_conv_err_t err;
*pretval = 0;
zend_bool rep = 1;
sapi_header_line ctr = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &ctr.line,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bi", &ctr.line,
&ctr.line_len, &rep, &ctr.response_code) == FAILURE)
return;
PHP_FUNCTION(setcookie)
{
char *name, *value = NULL, *path = NULL, *domain = NULL;
- long expires = 0;
+ php_int_t expires = 0;
zend_bool secure = 0, httponly = 0;
int name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sissbb", &name,
&name_len, &value, &value_len, &expires, &path,
&path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
PHP_FUNCTION(setrawcookie)
{
char *name, *value = NULL, *path = NULL, *domain = NULL;
- long expires = 0;
+ php_int_t expires = 0;
zend_bool secure = 0, httponly = 0;
int name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sissbb", &name,
&name_len, &value, &value_len, &expires, &path,
&path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
Sets a response code, or returns the current HTTP response code */
PHP_FUNCTION(http_response_code)
{
- long response_code = 0;
+ php_int_t response_code = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &response_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &response_code) == FAILURE) {
return;
}
if (response_code)
{
- long old_response_code;
+ php_int_t old_response_code;
old_response_code = SG(sapi_headers).http_response_code;
SG(sapi_headers).http_response_code = response_code;
*/
static inline int process_numeric_entity(const char **buf, unsigned *code_point)
{
- long code_l;
+ php_int_t code_l;
int hexadecimal = (**buf == 'x' || **buf == 'X'); /* TODO: XML apparently disallows "X" */
char *endptr;
return FAILURE;
}
- code_l = strtol(*buf, &endptr, hexadecimal ? 16 : 10);
+ code_l = ZEND_STRTOI(*buf, &endptr, hexadecimal ? 16 : 10);
/* we're guaranteed there were valid digits, so *endptr > buf */
*buf = endptr;
/* many more are invalid, but that depends on whether it's HTML
* (and which version) or XML. */
- if (code_l > 0x10FFFFL)
+ if (code_l > Z_I(0x10FFFF))
return FAILURE;
if (code_point != NULL)
{
char *str;
int str_len;
- long quote_style = ENT_COMPAT;
+ php_int_t quote_style = ENT_COMPAT;
zend_string *replaced;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, "e_style) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|i", &str, &str_len, "e_style) == FAILURE) {
return;
}
Returns the internal translation table used by htmlspecialchars and htmlentities */
PHP_FUNCTION(get_html_translation_table)
{
- long all = HTML_SPECIALCHARS,
+ php_int_t all = HTML_SPECIALCHARS,
flags = ENT_COMPAT;
int doctype;
entity_table_opt entity_table;
* getting the translated table from data structures that are optimized for
* random access, not traversal */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|iis",
&all, &flags, &charset_hint, &charset_hint_len) == FAILURE) {
return;
}
char *prefix = NULL, *arg_sep=NULL;
int arg_sep_len = 0, prefix_len = 0;
smart_str formstr = {0};
- long enc_type = PHP_QUERY_RFC1738;
+ php_int_t enc_type = PHP_QUERY_RFC1738;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ssl", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len, &enc_type) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ssi", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len, &enc_type) != SUCCESS) {
RETURN_FALSE;
}
/* create filter to decode response body */
if (!(options & STREAM_ONLY_GET_HEADERS)) {
- long decode = 1;
+ php_int_t decode = 1;
if (context && (tmpzval = php_stream_context_get_option(context, "http", "auto_decode")) != NULL) {
decode = zend_is_true(tmpzval TSRMLS_CC);
Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype */
PHP_FUNCTION(image_type_to_mime_type)
{
- long p_image_type;
+ php_int_t p_image_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &p_image_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &p_image_type) == FAILURE) {
return;
}
Get file extension for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype */
PHP_FUNCTION(image_type_to_extension)
{
- long image_type;
+ php_int_t image_type;
zend_bool inc_dot=1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|b", &image_type, &inc_dot) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i|b", &image_type, &inc_dot) == FAILURE) {
RETURN_FALSE;
}
Output a page of useful information about PHP and the current request */
PHP_FUNCTION(phpinfo)
{
- long flag = PHP_INFO_ALL;
+ php_int_t flag = PHP_INFO_ALL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &flag) == FAILURE) {
return;
}
Prints the list of people who've contributed to the PHP project */
PHP_FUNCTION(phpcredits)
{
- long flag = PHP_CREDITS_ALL;
+ php_int_t flag = PHP_CREDITS_ALL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|i", &flag) == FAILURE) {
return;
}
{
char *iptcdata, *jpeg_file;
int iptcdata_len, jpeg_file_len;
- long spool = 0;
+ php_int_t spool = 0;
FILE *fp;
unsigned int marker, done = 0;
int inx;
struct stat sb;
zend_bool written = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|i", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
return;
}
if((inx+6) >= str_len) {
break;
}
- len = (((long) buffer[ inx + 2 ]) << 24) + (((long) buffer[ inx + 3 ]) << 16) +
- (((long) buffer[ inx + 4 ]) << 8) + (((long) buffer[ inx + 5 ]));
+ len = (((php_int_t) buffer[ inx + 2 ]) << 24) + (((php_int_t) buffer[ inx + 3 ]) << 16) +
+ (((php_int_t) buffer[ inx + 4 ]) << 8) + (((php_int_t) buffer[ inx + 5 ]));
inx += 6;
} else { /* short tag */
len = (((unsigned short) buffer[ inx ])<<8) | (unsigned short)buffer[ inx+1 ];
char *str1, *str2;
char *callback_name;
int str1_len, str2_len, callback_len;
- long cost_ins, cost_rep, cost_del;
+ php_int_t cost_ins, cost_rep, cost_del;
int distance = -1;
switch (argc) {
break;
case 5: /* more general version: calc cost by ins/rep/del weights */
- if (zend_parse_parameters(5 TSRMLS_CC, "sslll", &str1, &str1_len, &str2, &str2_len, &cost_ins, &cost_rep, &cost_del) == FAILURE) {
+ if (zend_parse_parameters(5 TSRMLS_CC, "ssiii", &str1, &str1_len, &str2, &str2_len, &cost_ins, &cost_rep, &cost_del) == FAILURE) {
return;
}
distance = reference_levdist(str1, str1_len, str2, str2_len, cost_ins, cost_rep, cost_del);
*p = ' '; \
} \
-extern long php_getuid(TSRMLS_D);
+extern php_int_t php_getuid(TSRMLS_D);
/* {{{ proto int ezmlm_hash(string addr)
Calculate EZMLM list hash value. */
switch (algo) {
case PHP_PASSWORD_BCRYPT:
{
- long cost = PHP_PASSWORD_BCRYPT_COST;
- sscanf(hash, "$2y$%ld$", &cost);
+ php_int_t cost = PHP_PASSWORD_BCRYPT_COST;
+ sscanf(hash, "$2y$" ZEND_INT_FMT "$", &cost);
add_assoc_int(&options, "cost", cost);
}
break;
PHP_FUNCTION(password_needs_rehash)
{
- long new_algo = 0;
+ php_int_t new_algo = 0;
php_password_algo algo;
int hash_len;
char *hash;
HashTable *options = 0;
zval *option_buffer;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|H", &hash, &hash_len, &new_algo, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "si|H", &hash, &hash_len, &new_algo, &options) == FAILURE) {
return;
}
switch (algo) {
case PHP_PASSWORD_BCRYPT:
{
- long new_cost = PHP_PASSWORD_BCRYPT_COST, cost = 0;
+ php_int_t new_cost = PHP_PASSWORD_BCRYPT_COST, cost = 0;
if (options && (option_buffer = zend_symtable_str_find(options, "cost", sizeof("cost")-1)) != NULL) {
if (Z_TYPE_P(option_buffer) != IS_INT) {
}
}
- sscanf(hash, "$2y$%ld$", &cost);
+ sscanf(hash, "$2y$" ZEND_INT_FMT "$", &cost);
if (cost != new_cost) {
RETURN_TRUE;
}
PHP_FUNCTION(password_hash)
{
char *hash_format, *hash, *salt, *password;
- long algo = 0;
+ php_int_t algo = 0;
int password_len = 0, hash_len;
size_t salt_len = 0, required_salt_len = 0, hash_format_len;
HashTable *options = 0;
zval *option_buffer;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|H", &password, &password_len, &algo, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "si|H", &password, &password_len, &algo, &options) == FAILURE) {
return;
}
switch (algo) {
case PHP_PASSWORD_BCRYPT:
{
- long cost = PHP_PASSWORD_BCRYPT_COST;
+ php_int_t cost = PHP_PASSWORD_BCRYPT_COST;
if (options && (option_buffer = zend_symtable_str_find(options, "cost", sizeof("cost")-1)) != NULL) {
if (Z_TYPE_P(option_buffer) != IS_INT) {
}
if (cost < 4 || cost > 31) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid bcrypt cost parameter specified: %ld", cost);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid bcrypt cost parameter specified: " ZEND_INT_FMT, cost);
RETURN_NULL();
}
break;
case PHP_PASSWORD_UNKNOWN:
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown password hashing algorithm: %ld", algo);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown password hashing algorithm: " ZEND_INT_FMT, algo);
RETURN_NULL();
}
__dest->len = __nl; \
} while (0)
-static inline char *smart_string_print_long(char *buf, long num) {
+static inline char *smart_string_print_long(char *buf, php_int_t num) {
char *r;
_zend_print_signed_to_buf(buf, num, unsigned long, r);
return r;
}
-static inline char *smart_string_print_unsigned(char *buf, long num) {
+static inline char *smart_string_print_unsigned(char *buf, php_int_t num) {
char *r;
_zend_print_unsigned_to_buf(buf, num, unsigned long, r);
return r;
Creates a pair of connected, indistinguishable socket streams */
PHP_FUNCTION(stream_socket_pair)
{
- long domain, type, protocol;
+ php_int_t domain, type, protocol;
php_stream *s1, *s2;
php_socket_t pair[2];
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "iii",
&domain, &type, &protocol)) {
RETURN_FALSE;
}
char *hashkey = NULL;
php_stream *stream = NULL;
int err;
- long flags = PHP_STREAM_CLIENT_CONNECT;
+ php_int_t flags = PHP_STREAM_CLIENT_CONNECT;
zend_string *errstr = NULL;
php_stream_context *context = NULL;
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/dlr", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/dir", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) {
RETURN_FALSE;
}
zval *zerrno = NULL, *zerrstr = NULL, *zcontext = NULL;
php_stream *stream = NULL;
int err = 0;
- long flags = STREAM_XPORT_BIND | STREAM_XPORT_LISTEN;
+ php_int_t flags = STREAM_XPORT_BIND | STREAM_XPORT_LISTEN;
zend_string *errstr = NULL;
php_stream_context *context = NULL;
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/lr", &host, &host_len, &zerrno, &zerrstr, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/ir", &host, &host_len, &zerrno, &zerrstr, &flags, &zcontext) == FAILURE) {
RETURN_FALSE;
}
{
php_stream *stream;
zval *zstream;
- long flags = 0;
+ php_int_t flags = 0;
char *data, *target_addr = NULL;
int datalen, target_addr_len = 0;
php_sockaddr_storage sa;
socklen_t sl = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|ls", &zstream, &data, &datalen, &flags, &target_addr, &target_addr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|is", &zstream, &data, &datalen, &flags, &target_addr, &target_addr_len) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, zstream);
php_stream *stream;
zval *zstream, *zremote = NULL;
zend_string *remote_addr = NULL;
- long to_read = 0;
+ php_int_t to_read = 0;
zend_string *read_buf;
- long flags = 0;
+ php_int_t flags = 0;
int recvd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|lz/", &zstream, &to_read, &flags, &zremote) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri|iz/", &zstream, &to_read, &flags, &zremote) == FAILURE) {
RETURN_FALSE;
}
{
php_stream *stream;
zval *zsrc;
- long maxlen = PHP_STREAM_COPY_ALL,
+ php_int_t maxlen = PHP_STREAM_COPY_ALL,
desiredpos = -1L;
zend_string *contents;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ll", &zsrc, &maxlen, &desiredpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ii", &zsrc, &maxlen, &desiredpos) == FAILURE) {
RETURN_FALSE;
}
{
php_stream *src, *dest;
zval *zsrc, *zdest;
- long maxlen = PHP_STREAM_COPY_ALL, pos = 0;
+ php_int_t maxlen = PHP_STREAM_COPY_ALL, pos = 0;
size_t len;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|ll", &zsrc, &zdest, &maxlen, &pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|ii", &zsrc, &zdest, &maxlen, &pos) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(dest, zdest);
if (pos > 0 && php_stream_seek(src, pos, SEEK_SET) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %ld in the stream", pos);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_INT_FMT " in the stream", pos);
RETURN_FALSE;
}
fd_set rfds, wfds, efds;
php_socket_t max_fd = 0;
int retval, sets = 0;
- long usec = 0;
+ php_int_t usec = 0;
int set_count, max_set_count = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!a/!a/!z!|i", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE)
return;
FD_ZERO(&rfds);
php_stream *stream;
char *filtername;
int filternamelen;
- long read_write = 0;
+ php_int_t read_write = 0;
zval *filterparams = NULL;
php_stream_filter *filter = NULL;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lz", &zstream,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|iz", &zstream,
&filtername, &filternamelen, &read_write, &filterparams) == FAILURE) {
RETURN_FALSE;
}
{
char *str = NULL;
int str_len = 0;
- long max_length;
+ php_int_t max_length;
zval *zstream;
zend_string *buf;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|s", &zstream, &max_length, &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri|s", &zstream, &max_length, &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
{
zval *arg1;
int block;
- long arg2;
+ php_int_t arg2;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &arg1, &arg2) == FAILURE) {
return;
}
PHP_FUNCTION(stream_set_timeout)
{
zval *socket;
- long seconds, microseconds = 0;
+ php_int_t seconds, microseconds = 0;
struct timeval t;
php_stream *stream;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &socket, &seconds, µseconds) == FAILURE) {
+ if (zend_parse_parameters(argc TSRMLS_CC, "ri|i", &socket, &seconds, µseconds) == FAILURE) {
return;
}
{
zval *arg1;
int ret;
- long arg2;
+ php_int_t arg2;
size_t buff;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &arg1, &arg2) == FAILURE) {
RETURN_FALSE;
}
PHP_FUNCTION(stream_set_chunk_size)
{
int ret;
- long csize;
+ php_int_t csize;
zval *zstream;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zstream, &csize) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &zstream, &csize) == FAILURE) {
RETURN_FALSE;
}
if (csize <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size must be a positive integer, given %ld", csize);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size must be a positive integer, given " ZEND_INT_FMT, csize);
RETURN_FALSE;
}
/* stream.chunk_size is actually a size_t, but php_stream_set_option
ret = php_stream_set_option(stream, PHP_STREAM_OPTION_SET_CHUNK_SIZE, (int)csize, NULL);
- RETURN_INT(ret > 0 ? (long)ret : (long)EOF);
+ RETURN_INT(ret > 0 ? (php_int_t)ret : (php_int_t)EOF);
}
/* }}} */
{
zval *arg1;
int ret;
- long arg2;
+ php_int_t arg2;
size_t buff;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &arg1, &arg2) == FAILURE) {
RETURN_FALSE;
}
Enable or disable a specific kind of crypto on the stream */
PHP_FUNCTION(stream_socket_enable_crypto)
{
- long cryptokind = 0;
+ php_int_t cryptokind = 0;
zval *zstream, *zsessstream = NULL;
php_stream *stream, *sessstream = NULL;
zend_bool enable, cryptokindnull;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb|l!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb|i!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) {
RETURN_FALSE;
}
disallowed. */
PHP_FUNCTION(stream_socket_shutdown)
{
- long how;
+ php_int_t how;
zval *zstream;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zstream, &how) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &zstream, &how) == FAILURE) {
RETURN_FALSE;
}
zval array;
int free_buffer = 0;
char *strtok_buf = NULL;
- long count = 0;
+ php_int_t count = 0;
ZVAL_UNDEF(&array);
switch (arg) {