DIR *dir;
char dentry[sizeof(struct dirent) + MAXPATHLEN];
struct dirent *entry = (struct dirent *) &dentry;
- struct stat sbuf;
+ php_stat_t sbuf;
char buf[MAXPATHLEN];
time_t now;
int nrdels = 0;
static int ps_files_key_exists(ps_files *data, const char *key TSRMLS_DC)
{
char buf[MAXPATHLEN];
- struct stat sbuf;
+ php_stat_t sbuf;
if (!key || !ps_files_path_create(buf, sizeof(buf), data, key)) {
return FAILURE;
if (argc > 1) {
errno = 0;
- dirdepth = (size_t) strtol(argv[0], NULL, 10);
+ dirdepth = (size_t) ZEND_STRTOI(argv[0], NULL, 10);
if (errno == ERANGE) {
php_error(E_WARNING, "The first parameter in session.save_path is invalid");
return FAILURE;
if (argc > 2) {
errno = 0;
- filemode = strtol(argv[1], NULL, 8);
+ filemode = ZEND_STRTOI(argv[1], NULL, 8);
if (errno == ERANGE || filemode < 0 || filemode > 07777) {
php_error(E_WARNING, "The second parameter in session.save_path is invalid");
return FAILURE;
PS_READ_FUNC(files)
{
- long n;
+ php_int_t n;
struct stat sbuf;
PS_FILES_DATA;
PS_WRITE_FUNC(files)
{
- long n;
+ php_int_t n;
PS_FILES_DATA;
ps_files_open(data, key->val TSRMLS_CC);
zval sid;
smart_str key;
- long update_step;
- long next_update;
+ php_int_t update_step;
+ php_int_t next_update;
double next_update_time;
zend_bool cancel_upload;
zend_bool apply_trans_sid;
char *extern_referer_chk;
char *entropy_file;
char *cache_limiter;
- long entropy_length;
- long cookie_lifetime;
+ php_int_t entropy_length;
+ php_int_t cookie_lifetime;
char *cookie_path;
char *cookie_domain;
zend_bool cookie_secure;
ps_module *default_mod;
void *mod_data;
php_session_status session_status;
- long gc_probability;
- long gc_divisor;
- long gc_maxlifetime;
+ php_int_t gc_probability;
+ php_int_t gc_divisor;
+ php_int_t gc_maxlifetime;
int module_number;
- long cache_expire;
+ php_int_t cache_expire;
union {
zval names[7];
struct {
zend_bool use_trans_sid; /* contains the INI value of whether to use trans-sid */
zend_bool apply_trans_sid; /* whether or not to enable trans-sid for the current request */
- long hash_func;
+ php_int_t hash_func;
#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
php_hash_ops *hash_ops;
#endif
- long hash_bits_per_character;
+ php_int_t hash_bits_per_character;
int send_cookie;
int define_sid;
zend_bool invalid_session_id; /* allows the driver to report about an invalid session id and request id regeneration */
zend_bool rfc1867_cleanup; /* session.upload_progress.cleanup */
char *rfc1867_prefix; /* session.upload_progress.prefix */
char *rfc1867_name; /* session.upload_progress.name */
- long rfc1867_freq; /* session.upload_progress.freq */
+ php_int_t rfc1867_freq; /* session.upload_progress.freq */
double rfc1867_min_freq; /* session.upload_progress.min_freq */
zend_bool use_strict_mode; /* whether or not PHP accepts unknown session ids */
#define PS_ENCODE_VARS \
zend_string *key; \
- ulong num_key; \
+ php_uint_t num_key; \
zval *struc;
#define PS_ENCODE_LOOP(code) do { \
}
/* maximum 15+19+19+10 bytes */
- spprintf(&buf, 0, "%.15s%ld%ld%0.8F", remote_addr ? remote_addr : "", tv.tv_sec, (long int)tv.tv_usec, php_combined_lcg(TSRMLS_C) * 10);
+ spprintf(&buf, 0, "%.15s%ld%ld%0.8F", remote_addr ? remote_addr : "", tv.tv_sec, (php_int_t)tv.tv_usec, php_combined_lcg(TSRMLS_C) * 10);
switch (PS(hash_func)) {
case PS_HASH_FUNC_MD5:
static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
{
- long val;
+ php_int_t val;
char *endptr = NULL;
#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
PS(hash_ops) = NULL;
#endif
- val = strtol(new_value, &endptr, 10);
+ val = ZEND_STRTOI(new_value, &endptr, 10);
if (endptr && (*endptr == '\0')) {
/* Numeric value */
PS(hash_func) = val ? 1 : 0;
static inline void last_modified(TSRMLS_D) /* {{{ */
{
const char *path;
- struct stat sb;
+ php_stat_t sb;
char buf[MAX_STR + 1];
path = SG(request_info).path_translated;
zend_string *func_name;
HashPosition pos;
zend_function *default_mptr, *current_mptr;
- ulong func_index;
+ php_uint_t func_index;
php_shutdown_function_entry shutdown_function_entry;
zend_bool register_shutdown = 1;
array_init(&progress->data);
array_init(&progress->files);
- add_assoc_int_ex(&progress->data, "start_time", sizeof("start_time") - 1, (long)sapi_get_request_time(TSRMLS_C));
+ add_assoc_int_ex(&progress->data, "start_time", sizeof("start_time") - 1, (php_int_t)sapi_get_request_time(TSRMLS_C));
add_assoc_int_ex(&progress->data, "content_length", sizeof("content_length") - 1, progress->content_length);
add_assoc_int_ex(&progress->data, "bytes_processed", sizeof("bytes_processed") - 1, data->post_bytes_processed);
add_assoc_bool_ex(&progress->data, "done", sizeof("done") - 1, 0);
add_assoc_int_ex(&progress->current_file, "error", sizeof("error") - 1, 0);
add_assoc_bool_ex(&progress->current_file, "done", sizeof("done") - 1, 0);
- add_assoc_int_ex(&progress->current_file, "start_time", sizeof("start_time") - 1, (long)time(NULL));
+ add_assoc_int_ex(&progress->current_file, "start_time", sizeof("start_time") - 1, (php_int_t)time(NULL));
add_assoc_int_ex(&progress->current_file, "bytes_processed", sizeof("bytes_processed") - 1, 0);
add_next_index_zval(&progress->files, &progress->current_file);