mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
fix macros in the 5 basic extensions
This commit is contained in:
parent
f790043e30
commit
cb25136f4e
66 changed files with 1265 additions and 1265 deletions
|
@ -139,7 +139,7 @@ typedef struct php_cli_server_request {
|
|||
size_t content_len;
|
||||
const char *ext;
|
||||
size_t ext_len;
|
||||
struct stat sb;
|
||||
php_stat_t sb;
|
||||
} php_cli_server_request;
|
||||
|
||||
typedef struct php_cli_server_chunk {
|
||||
|
@ -436,7 +436,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
|
|||
static void add_response_header(sapi_header_struct *h, zval *return_value TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
char *s, *p;
|
||||
int len;
|
||||
ptrdiff_t len;
|
||||
ALLOCA_FLAG(use_heap)
|
||||
|
||||
if (h->header_len > 0) {
|
||||
|
@ -539,7 +539,7 @@ static int sapi_cli_server_startup(sapi_module_struct *sapi_module) /* {{{ */
|
|||
return SUCCESS;
|
||||
} /* }}} */
|
||||
|
||||
static int sapi_cli_server_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */
|
||||
static php_size_t sapi_cli_server_ub_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
php_cli_server_client *client = SG(server_context);
|
||||
if (!client) {
|
||||
|
@ -619,7 +619,7 @@ static char *sapi_cli_server_read_cookies(TSRMLS_D) /* {{{ */
|
|||
return val;
|
||||
} /* }}} */
|
||||
|
||||
static int sapi_cli_server_read_post(char *buf, uint count_bytes TSRMLS_DC) /* {{{ */
|
||||
static php_size_t sapi_cli_server_read_post(char *buf, php_size_t count_bytes TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
php_cli_server_client *client = SG(server_context);
|
||||
if (client->request.content) {
|
||||
|
@ -635,7 +635,7 @@ static int sapi_cli_server_read_post(char *buf, uint count_bytes TSRMLS_DC) /* {
|
|||
static void sapi_cli_server_register_variable(zval *track_vars_array, const char *key, const char *val TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
char *new_val = (char *)val;
|
||||
uint new_val_len;
|
||||
php_size_t new_val_len;
|
||||
if (sapi_module.input_filter(PARSE_SERVER, (char*)key, &new_val, strlen(val), &new_val_len TSRMLS_CC)) {
|
||||
php_register_variable_safe((char *)key, new_val, new_val_len, track_vars_array TSRMLS_CC);
|
||||
}
|
||||
|
@ -789,7 +789,7 @@ static int php_cli_server_poller_ctor(php_cli_server_poller *poller) /* {{{ */
|
|||
return SUCCESS;
|
||||
} /* }}} */
|
||||
|
||||
static void php_cli_server_poller_add(php_cli_server_poller *poller, int mode, int fd) /* {{{ */
|
||||
static void php_cli_server_poller_add(php_cli_server_poller *poller, int mode, php_socket_t fd) /* {{{ */
|
||||
{
|
||||
if (mode & POLLIN) {
|
||||
PHP_SAFE_FD_SET(fd, &poller->rfds);
|
||||
|
@ -802,7 +802,7 @@ static void php_cli_server_poller_add(php_cli_server_poller *poller, int mode, i
|
|||
}
|
||||
} /* }}} */
|
||||
|
||||
static void php_cli_server_poller_remove(php_cli_server_poller *poller, int mode, int fd) /* {{{ */
|
||||
static void php_cli_server_poller_remove(php_cli_server_poller *poller, int mode, php_socket_t fd) /* {{{ */
|
||||
{
|
||||
if (mode & POLLIN) {
|
||||
PHP_SAFE_FD_CLR(fd, &poller->rfds);
|
||||
|
@ -830,7 +830,7 @@ static int php_cli_server_poller_poll(php_cli_server_poller *poller, struct time
|
|||
return php_select(poller->max_fd + 1, &poller->active.rfds, &poller->active.wfds, NULL, tv);
|
||||
} /* }}} */
|
||||
|
||||
static int php_cli_server_poller_iter_on_active(php_cli_server_poller *poller, void *opaque, int(*callback)(void *, int fd, int events)) /* {{{ */
|
||||
static int php_cli_server_poller_iter_on_active(php_cli_server_poller *poller, void *opaque, int(*callback)(void *, php_socket_t fd, int events)) /* {{{ */
|
||||
{
|
||||
int retval = SUCCESS;
|
||||
#ifdef PHP_WIN32
|
||||
|
@ -1209,7 +1209,7 @@ static void php_cli_server_logf(const char *format TSRMLS_DC, ...) /* {{{ */
|
|||
|
||||
static int php_network_listen_socket(const char *host, int *port, int socktype, int *af, socklen_t *socklen, zend_string **errstr TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
int retval = SOCK_ERR;
|
||||
php_socket_t retval = SOCK_ERR;
|
||||
int err = 0;
|
||||
struct sockaddr *sa = NULL, **p, **sal;
|
||||
|
||||
|
@ -1377,7 +1377,7 @@ static void php_cli_server_request_dtor(php_cli_server_request *req) /* {{{ */
|
|||
|
||||
static void php_cli_server_request_translate_vpath(php_cli_server_request *request, const char *document_root, size_t document_root_len) /* {{{ */
|
||||
{
|
||||
struct stat sb;
|
||||
php_stat_t sb;
|
||||
static const char *index_files[] = { "index.php", "index.html", NULL };
|
||||
char *buf = safe_pemalloc(1, request->vpath_len, 1 + document_root_len + 1 + sizeof("index.html"), 1);
|
||||
char *p = buf, *prev_path = NULL, *q, *vpath;
|
||||
|
@ -1414,7 +1414,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
|
|||
*p = '\0';
|
||||
q = p;
|
||||
while (q > buf) {
|
||||
if (!stat(buf, &sb)) {
|
||||
if (!php_stat_fn(buf, &sb)) {
|
||||
if (sb.st_mode & S_IFDIR) {
|
||||
const char **file = index_files;
|
||||
if (q[-1] != DEFAULT_SLASH) {
|
||||
|
@ -1423,7 +1423,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
|
|||
while (*file) {
|
||||
size_t l = strlen(*file);
|
||||
memmove(q, *file, l + 1);
|
||||
if (!stat(buf, &sb) && (sb.st_mode & S_IFREG)) {
|
||||
if (!php_stat_fn(buf, &sb) && (sb.st_mode & S_IFREG)) {
|
||||
q += l;
|
||||
break;
|
||||
}
|
||||
|
@ -1785,7 +1785,7 @@ static void destroy_request_info(sapi_request_info *request_info) /* {{{ */
|
|||
{
|
||||
} /* }}} */
|
||||
|
||||
static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_server *server, int client_sock, struct sockaddr *addr, socklen_t addr_len TSRMLS_DC) /* {{{ */
|
||||
static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_server *server, php_socket_t client_sock, struct sockaddr *addr, socklen_t addr_len TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
client->server = server;
|
||||
client->sock = client_sock;
|
||||
|
@ -2361,7 +2361,7 @@ typedef struct php_cli_server_do_event_for_each_fd_callback_params {
|
|||
int(*whandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC);
|
||||
} php_cli_server_do_event_for_each_fd_callback_params;
|
||||
|
||||
static int php_cli_server_do_event_for_each_fd_callback(void *_params, int fd, int event) /* {{{ */
|
||||
static int php_cli_server_do_event_for_each_fd_callback(void *_params, php_socket_t fd, int event) /* {{{ */
|
||||
{
|
||||
php_cli_server_do_event_for_each_fd_callback_params *params = _params;
|
||||
#ifdef ZTS
|
||||
|
@ -2487,9 +2487,9 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */
|
|||
}
|
||||
|
||||
if (document_root) {
|
||||
struct stat sb;
|
||||
php_stat_t sb;
|
||||
|
||||
if (stat(document_root, &sb)) {
|
||||
if (php_stat_fn(document_root, &sb)) {
|
||||
fprintf(stderr, "Directory %s does not exist.\n", document_root);
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue