Skip to content

Commit

Permalink
Merge branch 'main' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechsTech committed Feb 8, 2023
2 parents 6112fe7 + 7d5ef8b commit d05e9d8
Show file tree
Hide file tree
Showing 21 changed files with 243 additions and 627 deletions.
15 changes: 15 additions & 0 deletions headers/stubs/ze_ffi_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ abstract class SOCKET extends int
abstract class php_socket_t extends SOCKET
{
}
abstract class php_socket extends \FFI\CData
{
}
abstract class PHP_SOCKETS extends php_socket_t
{
}
abstract class uint64_t extends int
{
}
Expand Down Expand Up @@ -492,6 +498,15 @@ public function _php_stream_open_wrapper_ex(const_char &$path, const_char $mode,
/** @return ssize_t */
public function _php_stream_printf(php_stream &$stream, const_char &$fmt, ...$arguments);

/** @return int */
public function _php_stream_set_option(php_stream &$stream, int $option, int $value, ?void_ptr &$ptrparam);

/** @return const_char */
public function sockets_strerror(int $error);

/** @return int|php_socket */
public function socket_import_file_descriptor(PHP_SOCKETS $socket, php_socket ...$retsock);

/** @return HashTable */
public function _zend_new_array(uint32_t $size);

Expand Down
37 changes: 3 additions & 34 deletions headers/ze7.h
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,7 @@ ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
php_stream *_php_stream_fopen(const char *filename, const char *mode, zend_string **opened_path, int options, ...);
FILE *_php_stream_open_wrapper_as_file(char *path, char *mode, int options, zend_string **opened_path, ...);
ssize_t _php_stream_printf(php_stream *stream, const char *fmt, ...);
int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam);

typedef long int __fd_mask;
typedef struct
Expand All @@ -1704,40 +1705,6 @@ extern int pselect(int __nfds, fd_set *__restrict __readfds,

extern php_stream_ops php_stream_stdio_ops;
extern php_stream_wrapper php_plain_files_wrapper;
/*
php_stream *_php_stream_fopen_tmpfile(int dummy);
php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode, ...);
int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence);
zend_off_t _php_stream_tell(php_stream *stream);
ssize_t _php_stream_read(php_stream *stream, char *buf, size_t count);
zend_string *php_stream_read_to_str(php_stream *stream, size_t len);
ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
int _php_stream_fill_read_buffer(php_stream *stream, size_t size);
ssize_t _php_stream_printf(php_stream *stream, const char *fmt, ...);
int _php_stream_eof(php_stream *stream);
int _php_stream_getc(php_stream *stream);
int _php_stream_putc(php_stream *stream, int c);
int _php_stream_flush(php_stream *stream, int closing);
char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len);
zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len);
// CAREFUL! this is equivalent to puts NOT fputs!
int _php_stream_puts(php_stream *stream, const char *buf);
int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb);
int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context);
int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context);
int _php_stream_rmdir(const char *path, int options, php_stream_context *context);
php_stream *_php_stream_opendir(const char *path, int options, php_stream_context *context, ...); php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent);
int php_stream_dirent_alphasort(const zend_string **a, const zend_string **b);
int php_stream_dirent_alphasortr(const zend_string **a, const zend_string **b);
int _php_stream_scandir(const char *dirname, zend_string **namelist[], int flags, php_stream_context *context, int (*compare) (const zend_string **a, const zend_string **b));
int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam);
*/

typedef struct _sapi_module_struct sapi_module_struct;
extern sapi_module_struct sapi_module; /* true global */

Expand Down Expand Up @@ -2255,6 +2222,8 @@ extern void (*zend_post_shutdown_cb)(void);
extern void (*zend_execute_ex)(zend_execute_data *execute_data);
extern void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value);

typedef int PHP_SOCKET;

void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
int munmap(void *addr, size_t length);
int mprotect(void *addr, size_t len, int prot);
Expand Down
44 changes: 10 additions & 34 deletions headers/ze7ts.h
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,7 @@ ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
php_stream *_php_stream_fopen(const char *filename, const char *mode, zend_string **opened_path, int options, ...);
FILE *_php_stream_open_wrapper_as_file(char *path, char *mode, int options, zend_string **opened_path, ...);
ssize_t _php_stream_printf(php_stream *stream, const char *fmt, ...);
int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam);

typedef long int __fd_mask;
typedef struct
Expand All @@ -1838,40 +1839,6 @@ extern int pselect(int __nfds, fd_set *__restrict __readfds,

extern php_stream_ops php_stream_stdio_ops;
extern php_stream_wrapper php_plain_files_wrapper;
/*
php_stream *_php_stream_fopen_tmpfile(int dummy);
php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode, ...);
int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence);
zend_off_t _php_stream_tell(php_stream *stream);
ssize_t _php_stream_read(php_stream *stream, char *buf, size_t count);
zend_string *php_stream_read_to_str(php_stream *stream, size_t len);
ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
int _php_stream_fill_read_buffer(php_stream *stream, size_t size);
ssize_t _php_stream_printf(php_stream *stream, const char *fmt, ...);
int _php_stream_eof(php_stream *stream);
int _php_stream_getc(php_stream *stream);
int _php_stream_putc(php_stream *stream, int c);
int _php_stream_flush(php_stream *stream, int closing);
char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len);
zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len);
// CAREFUL! this is equivalent to puts NOT fputs!
int _php_stream_puts(php_stream *stream, const char *buf);
int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb);
int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context);
int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context);
int _php_stream_rmdir(const char *path, int options, php_stream_context *context);
php_stream *_php_stream_opendir(const char *path, int options, php_stream_context *context, ...); php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent);
int php_stream_dirent_alphasort(const zend_string **a, const zend_string **b);
int php_stream_dirent_alphasortr(const zend_string **a, const zend_string **b);
int _php_stream_scandir(const char *dirname, zend_string **namelist[], int flags, php_stream_context *context, int (*compare) (const zend_string **a, const zend_string **b));
int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam);
*/

typedef struct _sapi_module_struct sapi_module_struct;
extern sapi_module_struct sapi_module; /* true global */

Expand Down Expand Up @@ -2452,3 +2419,12 @@ extern void (*zend_post_shutdown_cb)(void);

extern void (*zend_execute_ex)(zend_execute_data *execute_data);
extern void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value);

typedef int PHP_SOCKET;

void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
int munmap(void *addr, size_t length);
int mprotect(void *addr, size_t len, int prot);

// from <unistd.h>
int getpagesize(void);
40 changes: 6 additions & 34 deletions headers/ze8.h
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,7 @@ ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
php_stream *_php_stream_fopen(const char *filename, const char *mode, zend_string **opened_path, int options, ...);
FILE *_php_stream_open_wrapper_as_file(char *path, char *mode, int options, zend_string **opened_path, ...);
ssize_t _php_stream_printf(php_stream *stream, const char *fmt, ...);
int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam);

typedef long int __fd_mask;
typedef struct
Expand All @@ -1624,40 +1625,6 @@ extern int pselect(int __nfds, fd_set *__restrict __readfds,

extern php_stream_ops php_stream_stdio_ops;
extern php_stream_wrapper php_plain_files_wrapper;
/*
php_stream *_php_stream_fopen_tmpfile(int dummy);
php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode, ...);
int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence);
zend_off_t _php_stream_tell(php_stream *stream);
ssize_t _php_stream_read(php_stream *stream, char *buf, size_t count);
zend_string *php_stream_read_to_str(php_stream *stream, size_t len);
ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
int _php_stream_fill_read_buffer(php_stream *stream, size_t size);
ssize_t _php_stream_printf(php_stream *stream, const char *fmt, ...);
int _php_stream_eof(php_stream *stream);
int _php_stream_getc(php_stream *stream);
int _php_stream_putc(php_stream *stream, int c);
int _php_stream_flush(php_stream *stream, int closing);
char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len);
zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len);
// CAREFUL! this is equivalent to puts NOT fputs!
int _php_stream_puts(php_stream *stream, const char *buf);
int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb);
int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context);
int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context);
int _php_stream_rmdir(const char *path, int options, php_stream_context *context);
php_stream *_php_stream_opendir(const char *path, int options, php_stream_context *context, ...); php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent);
int php_stream_dirent_alphasort(const zend_string **a, const zend_string **b);
int php_stream_dirent_alphasortr(const zend_string **a, const zend_string **b);
int _php_stream_scandir(const char *dirname, zend_string **namelist[], int flags, php_stream_context *context, int (*compare) (const zend_string **a, const zend_string **b));
int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam);
*/

typedef struct _sapi_module_struct sapi_module_struct;
extern sapi_module_struct sapi_module; /* true global */

Expand Down Expand Up @@ -2179,6 +2146,11 @@ extern void (*zend_post_shutdown_cb)(void);
extern void (*zend_execute_ex)(zend_execute_data *execute_data);
extern void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value);

extern zend_class_entry *socket_ce;
typedef int PHP_SOCKET;
char *sockets_strerror(int error);
int socket_import_file_descriptor(PHP_SOCKET socket, php_socket *retsock);

void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
int munmap(void *addr, size_t length);
int mprotect(void *addr, size_t len, int prot);
Expand Down
39 changes: 6 additions & 33 deletions headers/ze81.h
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,7 @@ ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
php_stream *_php_stream_fopen(const char *filename, const char *mode, zend_string **opened_path, int options, ...);
FILE *_php_stream_open_wrapper_as_file(char *path, char *mode, int options, zend_string **opened_path, ...);
ssize_t _php_stream_printf(php_stream *stream, const char *fmt, ...);
int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam);

typedef long int __fd_mask;
typedef struct
Expand All @@ -1801,39 +1802,6 @@ extern int pselect(int __nfds, fd_set *__restrict __readfds,

extern php_stream_ops php_stream_stdio_ops;
extern php_stream_wrapper php_plain_files_wrapper;
/*
php_stream *_php_stream_fopen_tmpfile(int dummy);
php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode, ...);
int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence);
zend_off_t _php_stream_tell(php_stream *stream);
ssize_t _php_stream_read(php_stream *stream, char *buf, size_t count);
zend_string *php_stream_read_to_str(php_stream *stream, size_t len);
ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
int _php_stream_fill_read_buffer(php_stream *stream, size_t size);
ssize_t _php_stream_printf(php_stream *stream, const char *fmt, ...);
int _php_stream_eof(php_stream *stream);
int _php_stream_getc(php_stream *stream);
int _php_stream_putc(php_stream *stream, int c);
int _php_stream_flush(php_stream *stream, int closing);
char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len);
zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len);
// CAREFUL! this is equivalent to puts NOT fputs!
int _php_stream_puts(php_stream *stream, const char *buf);
int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb);
int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context);
int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context);
int _php_stream_rmdir(const char *path, int options, php_stream_context *context);
php_stream *_php_stream_opendir(const char *path, int options, php_stream_context *context, ...); php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent);
int php_stream_dirent_alphasort(const zend_string **a, const zend_string **b);
int php_stream_dirent_alphasortr(const zend_string **a, const zend_string **b);
int _php_stream_scandir(const char *dirname, zend_string **namelist[], int flags, php_stream_context *context, int (*compare) (const zend_string **a, const zend_string **b));
int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam);
*/

typedef struct _sapi_module_struct sapi_module_struct;
extern sapi_module_struct sapi_module; /* true global */
Expand Down Expand Up @@ -2332,6 +2300,11 @@ extern void (*zend_post_shutdown_cb)(void);
extern void (*zend_execute_ex)(zend_execute_data *execute_data);
extern void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value);

extern zend_class_entry *socket_ce;
typedef int PHP_SOCKET;
char *sockets_strerror(int error);
int socket_import_file_descriptor(PHP_SOCKET socket, php_socket *retsock);

void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
int munmap(void *addr, size_t length);
int mprotect(void *addr, size_t len, int prot);
Expand Down
39 changes: 6 additions & 33 deletions headers/ze81ts.h
Original file line number Diff line number Diff line change
Expand Up @@ -1915,6 +1915,7 @@ ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
php_stream *_php_stream_fopen(const char *filename, const char *mode, zend_string **opened_path, int options, ...);
FILE *_php_stream_open_wrapper_as_file(char *path, char *mode, int options, zend_string **opened_path, ...);
ssize_t _php_stream_printf(php_stream *stream, const char *fmt, ...);
int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam);

typedef long int __fd_mask;
typedef struct
Expand All @@ -1935,39 +1936,6 @@ extern int pselect(int __nfds, fd_set *__restrict __readfds,

extern php_stream_ops php_stream_stdio_ops;
extern php_stream_wrapper php_plain_files_wrapper;
/*
php_stream *_php_stream_fopen_tmpfile(int dummy);
php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode, ...);
int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence);
zend_off_t _php_stream_tell(php_stream *stream);
ssize_t _php_stream_read(php_stream *stream, char *buf, size_t count);
zend_string *php_stream_read_to_str(php_stream *stream, size_t len);
ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
int _php_stream_fill_read_buffer(php_stream *stream, size_t size);
ssize_t _php_stream_printf(php_stream *stream, const char *fmt, ...);
int _php_stream_eof(php_stream *stream);
int _php_stream_getc(php_stream *stream);
int _php_stream_putc(php_stream *stream, int c);
int _php_stream_flush(php_stream *stream, int closing);
char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len);
zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len);
// CAREFUL! this is equivalent to puts NOT fputs!
int _php_stream_puts(php_stream *stream, const char *buf);
int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb);
int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context);
int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context);
int _php_stream_rmdir(const char *path, int options, php_stream_context *context);
php_stream *_php_stream_opendir(const char *path, int options, php_stream_context *context, ...); php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent);
int php_stream_dirent_alphasort(const zend_string **a, const zend_string **b);
int php_stream_dirent_alphasortr(const zend_string **a, const zend_string **b);
int _php_stream_scandir(const char *dirname, zend_string **namelist[], int flags, php_stream_context *context, int (*compare) (const zend_string **a, const zend_string **b));
int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam);
*/

typedef struct _sapi_module_struct sapi_module_struct;
extern sapi_module_struct sapi_module; /* true global */
Expand Down Expand Up @@ -2533,6 +2501,11 @@ extern int (*zend_preload_autoload)(zend_string *filename);
extern void (*zend_execute_ex)(zend_execute_data *execute_data);
extern void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value);

extern zend_class_entry *socket_ce;
typedef int PHP_SOCKET;
char *sockets_strerror(int error);
int socket_import_file_descriptor(PHP_SOCKET socket, php_socket *retsock);

void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
int munmap(void *addr, size_t length);
int mprotect(void *addr, size_t len, int prot);
Expand Down
Loading

0 comments on commit d05e9d8

Please sign in to comment.