#include <string.h>
#include <sys/types.h>
#ifdef PHP_WIN32
-# include <winsock.h>
+# include <winsock2.h>
# define EWOULDBLOCK WSAEWOULDBLOCK
# define ETIMEDOUT WSAETIMEDOUT
# define bcopy memcpy
# include <netdb.h>
# include <unistd.h>
# include <sys/param.h>
+# include <arpa/inet.h>
#endif
#include <fcntl.h>
#include <errno.h>
switch(hostptr->h_addrtype) {
struct in_addr *ptr1;
- char *ptr;
case AF_INET:
- ptr = hostptr->h_addr_list[0];
- ptr1 = (struct in_addr *) ptr;
+ ptr1 = (struct in_addr *) hostptr->h_addr_list[0];
hostip = inet_ntoa(*ptr1);
break;
default:
switch(hostptr->h_addrtype) {
struct in_addr *ptr1;
- char *ptr;
case AF_INET:
- ptr = hostptr->h_addr_list[0];
- ptr1 = (struct in_addr *) ptr;
+ ptr1 = (struct in_addr *) hostptr->h_addr_list[0];
hostip = inet_ntoa(*ptr1);
break;
default:
switch(hostptr->h_addrtype) {
struct in_addr *ptr1;
- char *ptr;
case AF_INET:
- ptr = hostptr->h_addr_list[0];
- ptr1 = (struct in_addr *) ptr;
+ ptr1 = (struct in_addr *) hostptr->h_addr_list[0];
hostip = inet_ntoa(*ptr1);
break;
default:
#ifdef COMPILE_DL_PCNTL
ZEND_GET_MODULE(pcntl)
#endif
+
+static void pcntl_signal_handler(int);
+static void pcntl_tick_handler();
void php_register_signal_constants(INIT_FUNC_ARGS)
{
PHP_FUNCTION(pcntl_signal);
PHP_FUNCTION(pcntl_exec);
-static void pcntl_signal_handler(int);
-static void pcntl_tick_handler();
-
-
ZEND_BEGIN_MODULE_GLOBALS(pcntl)
HashTable php_signal_table;
zend_llist php_signal_queue;
zend_bool use_system_read;
} php_sockets_globals;
-/* Prototypes */
-static int php_open_listen_sock(php_socket **php_sock, int port, int backlog TSRMLS_DC);
-static int php_accept_connect(php_socket *in_sock, php_socket **new_sock, struct sockaddr *la TSRMLS_DC);
-static int php_read(int bsd_socket, void *buf, size_t maxlen, int flags);
-static char *php_strerror(int error TSRMLS_DC);
-
ZEND_BEGIN_MODULE_GLOBALS(sockets)
int last_error;
char *strerror_buf;
#define PF_INET AF_INET
#endif
+static char *php_strerror(int error TSRMLS_DC);
#define PHP_NORMAL_READ 0x0001
#define PHP_BINARY_READ 0x0002