summaryrefslogtreecommitdiff
path: root/main/SAPI.h
diff options
context:
space:
mode:
Diffstat (limited to 'main/SAPI.h')
-rw-r--r--main/SAPI.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/main/SAPI.h b/main/SAPI.h
index 928fca95da..79661371d9 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2013 The PHP Group |
+ | Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -21,6 +21,7 @@
#ifndef SAPI_H
#define SAPI_H
+#include "php.h"
#include "zend.h"
#include "zend_API.h"
#include "zend_llist.h"
@@ -30,6 +31,7 @@
#include "win32/php_stdint.h"
#endif
#include <sys/stat.h>
+#include "php.h"
#define SAPI_OPTION_NO_CHDIR 1
#define SAPI_POST_BLOCK_SIZE 0x4000
@@ -80,7 +82,7 @@ typedef struct {
const char *request_method;
char *query_string;
char *cookie_data;
- long content_length;
+ zend_long content_length;
char *path_translated;
char *request_uri;
@@ -123,16 +125,16 @@ typedef struct _sapi_globals_struct {
int64_t read_post_bytes;
unsigned char post_read;
unsigned char headers_sent;
- struct stat global_stat;
+ zend_stat_t global_stat;
char *default_mimetype;
char *default_charset;
HashTable *rfc1867_uploaded_files;
- long post_max_size;
+ zend_long post_max_size;
int options;
zend_bool sapi_started;
double global_request_time;
HashTable known_post_content_types;
- zval *callback_func;
+ zval callback_func;
zend_fcall_info_cache fci_cache;
zend_bool callback_run;
} sapi_globals_struct;
@@ -168,7 +170,7 @@ END_EXTERN_C()
typedef struct {
char *line; /* If you allocated this, you need to free it yourself */
uint line_len;
- long response_code; /* long due to zend_parse_parameters compatibility */
+ zend_long response_code; /* long due to zend_parse_parameters compatibility */
} sapi_header_line;
typedef enum { /* Parameter: */
@@ -196,10 +198,10 @@ SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC);
SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC);
SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D) TSRMLS_DC);
SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC) TSRMLS_DC);
-SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC), unsigned int (*input_filter_init)(TSRMLS_D) TSRMLS_DC);
+SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC), unsigned int (*input_filter_init)(TSRMLS_D) TSRMLS_DC);
SAPI_API int sapi_flush(TSRMLS_D);
-SAPI_API struct stat *sapi_get_stat(TSRMLS_D);
+SAPI_API zend_stat_t *sapi_get_stat(TSRMLS_D);
SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC);
SAPI_API char *sapi_get_default_content_type(TSRMLS_D);
@@ -226,9 +228,9 @@ struct _sapi_module_struct {
int (*activate)(TSRMLS_D);
int (*deactivate)(TSRMLS_D);
- int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC);
- void (*flush)(void *server_context);
- struct stat *(*get_stat)(TSRMLS_D);
+ size_t (*ub_write)(const char *str, size_t str_length TSRMLS_DC);
+ void (*flush)(void *server_context TSRMLS_DC);
+ zend_stat_t *(*get_stat)(TSRMLS_D);
char *(*getenv)(char *name, size_t name_len TSRMLS_DC);
void (*sapi_error)(int type, const char *error_msg, ...);
@@ -237,7 +239,7 @@ struct _sapi_module_struct {
int (*send_headers)(sapi_headers_struct *sapi_headers TSRMLS_DC);
void (*send_header)(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC);
- int (*read_post)(char *buffer, uint count_bytes TSRMLS_DC);
+ size_t (*read_post)(char *buffer, size_t count_bytes TSRMLS_DC);
char *(*read_cookies)(TSRMLS_D);
void (*register_server_variables)(zval *track_vars_array TSRMLS_DC);
@@ -264,7 +266,7 @@ struct _sapi_module_struct {
int (*get_target_uid)(uid_t * TSRMLS_DC);
int (*get_target_gid)(gid_t * TSRMLS_DC);
- unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC);
+ unsigned int (*input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC);
void (*ini_defaults)(HashTable *configuration_hash);
int phpinfo_as_text;
@@ -291,14 +293,14 @@ struct _sapi_post_entry {
#define SAPI_HEADER_SEND_FAILED 3
#define SAPI_DEFAULT_MIMETYPE "text/html"
-#define SAPI_DEFAULT_CHARSET ""
+#define SAPI_DEFAULT_CHARSET PHP_DEFAULT_CHARSET
#define SAPI_PHP_VERSION_HEADER "X-Powered-By: PHP/" PHP_VERSION
#define SAPI_POST_READER_FUNC(post_reader) void post_reader(TSRMLS_D)
#define SAPI_POST_HANDLER_FUNC(post_handler) void post_handler(char *content_type_dup, void *arg TSRMLS_DC)
#define SAPI_TREAT_DATA_FUNC(treat_data) void treat_data(int arg, char *str, zval* destArray TSRMLS_DC)
-#define SAPI_INPUT_FILTER_FUNC(input_filter) unsigned int input_filter(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC)
+#define SAPI_INPUT_FILTER_FUNC(input_filter) unsigned int input_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC)
BEGIN_EXTERN_C()
SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data);