Browse Source

fix ws, cs & folding

PHAR_1_2
Antony Dovgal 19 years ago
parent
commit
b608bd654d
  1. 19
      ext/ereg/ereg.c
  2. 3
      ext/standard/exec.c
  3. 16
      ext/standard/file.c
  4. 3
      ext/standard/filestat.c
  5. 8
      ext/standard/flock_compat.c
  6. 1
      ext/standard/fsock.c
  7. 15
      ext/standard/ftp_fopen_wrapper.c
  8. 9
      ext/standard/head.c
  9. 7
      ext/standard/html.c
  10. 15
      ext/standard/http_fopen_wrapper.c
  11. 19
      ext/standard/incomplete_class.c
  12. 45
      ext/standard/info.c
  13. 12
      ext/standard/lcg.c
  14. 2
      ext/standard/math.c
  15. 6
      ext/standard/md5.c
  16. 9
      ext/standard/metaphone.c
  17. 3
      ext/standard/microtime.c
  18. 6
      ext/standard/pageinfo.c
  19. 32
      ext/standard/php_fopen_wrapper.c
  20. 7
      ext/standard/quot_print.c
  21. 19
      ext/standard/reg.c
  22. 5
      ext/standard/sha1.c
  23. 2
      ext/standard/streamsfuncs.c
  24. 10
      ext/standard/syslog.c
  25. 6
      ext/standard/url.c
  26. 7
      ext/standard/url_scanner.c
  27. 30
      ext/standard/user_filters.c
  28. 2
      ext/standard/versioning.c

19
ext/ereg/ereg.c

@ -92,33 +92,37 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)
}
/* }}} */
static void _free_reg_cache(reg_cache *rc)
static void _free_reg_cache(reg_cache *rc) /* {{{ */
{
regfree(&rc->preg);
}
/* }}} */
#undef regfree
#define regfree(a);
#undef regcomp
#define regcomp(a, b, c) _php_regcomp(a, b, c)
static void php_reg_init_globals(zend_reg_globals *reg_globals TSRMLS_DC)
static void php_reg_init_globals(zend_reg_globals *reg_globals TSRMLS_DC) /* {{{ */
{
zend_hash_init(&reg_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1);
}
/* }}} */
static void php_reg_destroy_globals(zend_reg_globals *reg_globals TSRMLS_DC)
static void php_reg_destroy_globals(zend_reg_globals *reg_globals TSRMLS_DC) /* {{{ */
{
zend_hash_destroy(&reg_globals->ht_rc);
}
/* }}} */
PHP_MINIT_FUNCTION(regex)
PHP_MINIT_FUNCTION(regex) /* {{{ */
{
ZEND_INIT_MODULE_GLOBALS(reg, php_reg_init_globals, php_reg_destroy_globals);
return SUCCESS;
}
/* }}} */
PHP_MSHUTDOWN_FUNCTION(regex)
PHP_MSHUTDOWN_FUNCTION(regex) /* {{{ */
{
#ifndef ZTS
php_reg_destroy_globals(&reg_globals TSRMLS_CC);
@ -126,8 +130,9 @@ PHP_MSHUTDOWN_FUNCTION(regex)
return SUCCESS;
}
/* }}} */
PHP_MINFO_FUNCTION(regex)
PHP_MINFO_FUNCTION(regex) /* {{{ */
{
#if HSREGEX
php_info_print_table_row(2, "Regex Library", "Bundled library enabled");
@ -135,7 +140,7 @@ PHP_MINFO_FUNCTION(regex)
php_info_print_table_row(2, "Regex Library", "System library enabled");
#endif
}
/* }}} */
/* {{{ php_reg_eprint
* php_reg_eprint - convert error number to name

3
ext/standard/exec.c

@ -165,7 +165,7 @@ err:
}
/* }}} */
static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode)
static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
{
char *cmd;
int cmd_len;
@ -211,6 +211,7 @@ static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode)
efree(cmd);
}
}
/* }}} */
/* {{{ proto string exec(string command [, array &output [, int &return_value]]) U
Execute an external program */

16
ext/standard/file.c

@ -145,6 +145,7 @@ PHPAPI int php_le_stream_context(void)
}
/* }}} */
/* {{{ Module-Stuff */
static ZEND_RSRC_DTOR_FUNC(file_context_dtor)
@ -303,15 +304,14 @@ PHP_MINIT_FUNCTION(file)
/* }}} */
PHP_MSHUTDOWN_FUNCTION(file)
PHP_MSHUTDOWN_FUNCTION(file) /* {{{ */
{
#ifndef ZTS
file_globals_dtor(&file_globals TSRMLS_CC);
#endif
return SUCCESS;
}
/* }}} */
/* {{{ proto bool flock(resource fp, int operation [, int &wouldblock]) U
Portable file locking */
@ -1876,10 +1876,11 @@ PHP_FUNCTION(copy)
}
/* }}} */
PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC) /* {{{ */
{
return php_copy_file_ex(src, dest, 0 TSRMLS_CC);
}
/* }}} */
/* {{{ php_copy_file
*/
@ -2515,12 +2516,7 @@ post_enc:
#define PHP_FGETCSV_UNI_CHECK(p, e, m, mlen) ((p) < (e) && (((mlen) == 1 && *(p) == *(m)) || ((mlen) > 1 && (((e) - (p)) >= (mlen)) && memcmp((p), (m), UBYTES(mlen)) == 0)))
/* Unicode mode fgetcsv */
PHPAPI void php_u_fgetcsv(php_stream *stream,
UChar *delimiter, int delimiter_len,
UChar *enclosure, int enclosure_len,
UChar *escape, int escape_len,
UChar *buffer, int buffer_len,
zval *return_value TSRMLS_DC)
PHPAPI void php_u_fgetcsv(php_stream *stream, UChar *delimiter, int delimiter_len, UChar *enclosure, int enclosure_len, UChar *escape, int escape_len, UChar *buffer, int buffer_len, zval *return_value TSRMLS_DC) /* {{{ */
{
php_fgetcsv_state state = PHP_FGETCSV_READY;
UChar *p = buffer, *e = buffer + buffer_len, *field_start = NULL, *field_end = NULL;

3
ext/standard/filestat.c

@ -1038,6 +1038,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
/* }}} */
/* another quickie macro to make defining similar functions easier */
/* {{{ FileFunction(name, funcnum) */
#define FileFunction(name, funcnum) \
void name(INTERNAL_FUNCTION_PARAMETERS) { \
char *filename; \
@ -1061,6 +1062,8 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \
} \
}
/* }}} */
/* {{{ proto int fileperms(string filename) U
Get file permissions */
FileFunction(PHP_FN(fileperms), FS_PERMS)

8
ext/standard/flock_compat.c

@ -43,8 +43,8 @@ PHPAPI int flock(int fd, int operation)
}
#endif /* !defined(HAVE_FLOCK) */
PHPAPI int php_flock(int fd, int operation)
#if HAVE_STRUCT_FLOCK
PHPAPI int php_flock(int fd, int operation)
#if HAVE_STRUCT_FLOCK /* {{{ */
{
struct flock flck;
int ret;
@ -73,7 +73,8 @@ PHPAPI int php_flock(int fd, int operation)
return ret;
}
#elif defined(PHP_WIN32)
/* }}} */
#elif defined(PHP_WIN32) /* {{{ */
/*
* Program: Unix compatibility routines
*
@ -152,6 +153,7 @@ PHPAPI int php_flock(int fd, int operation)
#endif
return -1;
}
/* }}} */
#else
#warning no proper flock support for your site
{

1
ext/standard/fsock.c

@ -123,6 +123,7 @@ PHP_FUNCTION(fsockopen)
php_fsockopen_stream(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/* {{{ proto resource pfsockopen(string hostname, int port [, int errno [, string errstr [, float timeout]]]) U
Open persistent Internet or Unix domain socket connection */
PHP_FUNCTION(pfsockopen)

15
ext/standard/ftp_fopen_wrapper.c

@ -69,31 +69,27 @@
#include "php_fopen_wrappers.h"
static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size TSRMLS_DC)
static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size TSRMLS_DC) /* {{{ */
{
while (php_stream_gets(stream, ZSTR(buffer), buffer_size-1) &&
!(isdigit((int) buffer[0]) && isdigit((int) buffer[1]) &&
isdigit((int) buffer[2]) && buffer[3] == ' '));
return strtol(buffer, NULL, 10);
}
/* }}} */
#define GET_FTP_RESULT(stream) get_ftp_result((stream), tmp_line, sizeof(tmp_line) TSRMLS_CC)
#define FTPS_ENCRYPT_DATA 1
static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper,
php_stream *stream,
php_stream_statbuf *ssb
TSRMLS_DC)
static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
{
/* For now, we return with a failure code to prevent the underlying
* file's details from being used instead. */
return -1;
}
/* }}} */
static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper,
php_stream *stream
TSRMLS_DC)
static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC) /* {{{ */
{
php_stream *controlstream = (php_stream *)stream->wrapperdata;
@ -104,6 +100,7 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper,
}
return 0;
}
/* }}} */
/* {{{ php_ftp_fopen_connect
*/

9
ext/standard/head.c

@ -50,7 +50,7 @@ PHP_FUNCTION(header)
}
/* }}} */
PHPAPI int php_header(TSRMLS_D)
PHPAPI int php_header(TSRMLS_D) /* {{{ */
{
if (sapi_send_headers(TSRMLS_C)==FAILURE || SG(request_info).headers_only) {
return 0; /* don't allow output */
@ -58,9 +58,10 @@ PHPAPI int php_header(TSRMLS_D)
return 1; /* allow output */
}
}
/* }}} */
PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC)
PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC) /* {{{ */
{
char *cookie, *encoded_value = NULL;
int len=sizeof("Set-Cookie: ");
@ -143,7 +144,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
efree(cookie);
return result;
}
/* }}} */
/* php_set_cookie(name, value, expires, path, domain, secure) */
/* {{{ proto bool setcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure[, bool httponly]]]]]]) U
@ -196,7 +197,6 @@ PHP_FUNCTION(setrawcookie)
}
/* }}} */
/* {{{ proto bool headers_sent([string &$file [, int &$line]]) U
Returns true if headers have already been sent, false otherwise */
PHP_FUNCTION(headers_sent)
@ -256,6 +256,7 @@ static void php_head_apply_header_list_to_hash(void *data, void *arg TSRMLS_DC)
add_next_index_ascii_string((zval *)arg, (char *)(sapi_header->header), 1);
}
}
/* }}} */
/* {{{ proto array headers_list(void) U
Return list of headers to be sent / already sent */

7
ext/standard/html.c

@ -1087,9 +1087,6 @@ empty_source:
}
/* }}} */
/* {{{ php_escape_html_entities
*/
PHPAPI char *php_escape_html_entities_ex(unsigned char *old, int oldlen, int *newlen, int all, int quote_style, char *hint_charset, zend_bool double_encode TSRMLS_DC)
@ -1219,10 +1216,11 @@ encode_amp:
}
/* }}} */
PHPAPI char *php_escape_html_entities(char *old, int oldlen, int *newlen, int all, int quote_style, char *hint_charset TSRMLS_DC)
PHPAPI char *php_escape_html_entities(char *old, int oldlen, int *newlen, int all, int quote_style, char *hint_charset TSRMLS_DC) /* {{{ */
{
return php_escape_html_entities_ex((unsigned char*)old, oldlen, newlen, all, quote_style, hint_charset, 1 TSRMLS_CC);
}
/* }}} */
/* {{{ php_html_entities
*/
@ -1410,7 +1408,6 @@ PHP_FUNCTION(html_entity_decode)
}
/* }}} */
/* {{{ proto string htmlentities(string string [, int quote_style[, string charset[, bool double_encode]]])
Convert all applicable characters to HTML entities */
PHP_FUNCTION(htmlentities)

15
ext/standard/http_fopen_wrapper.c

@ -81,7 +81,7 @@
#define HTTP_HEADER_CONTENT_LENGTH 16
#define HTTP_HEADER_TYPE 32
static inline char *php_http_detect_charset(char *http_header_line)
static inline char *php_http_detect_charset(char *http_header_line) /* {{{ */
{
char *s;
@ -121,8 +121,9 @@ static inline char *php_http_detect_charset(char *http_header_line)
return NULL;
}
/* }}} */
php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int header_init STREAMS_DC TSRMLS_DC)
php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int header_init STREAMS_DC TSRMLS_DC) /* {{{ */
{
php_stream *stream = NULL;
php_url *resource = NULL;
@ -763,22 +764,22 @@ out:
return stream;
}
/* }}} */
php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
{
return php_stream_url_wrap_http_ex(wrapper, path, mode, options, opened_path, context, PHP_URL_REDIRECT_MAX, 1 STREAMS_CC TSRMLS_CC);
}
/* }}} */
static int php_stream_http_stream_stat(php_stream_wrapper *wrapper,
php_stream *stream,
php_stream_statbuf *ssb
TSRMLS_DC)
static int php_stream_http_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
{
/* one day, we could fill in the details based on Date: and Content-Length:
* headers. For now, we return with a failure code to prevent the underlying
* file's details from being used instead. */
return -1;
}
/* }}} */
static php_stream_wrapper_ops http_stream_wops = {
php_stream_url_wrap_http,

19
ext/standard/incomplete_class.c

@ -57,7 +57,7 @@ static void incomplete_class_message(zval *object, int error_type TSRMLS_DC)
}
/* }}} */
static zval *incomplete_class_get_property(zval *object, zval *member, int type TSRMLS_DC)
static zval *incomplete_class_get_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */
{
incomplete_class_message(object, E_NOTICE TSRMLS_CC);
if(type == BP_VAR_W || type == BP_VAR_RW) {
@ -66,33 +66,40 @@ static zval *incomplete_class_get_property(zval *object, zval *member, int type
return EG(uninitialized_zval_ptr);
}
}
/* }}} */
static void incomplete_class_write_property(zval *object, zval *member, zval *value TSRMLS_DC)
static void incomplete_class_write_property(zval *object, zval *member, zval *value TSRMLS_DC) /* {{{ */
{
incomplete_class_message(object, E_NOTICE TSRMLS_CC);
}
/* }}} */
static zval **incomplete_class_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC)
static zval **incomplete_class_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) /* {{{ */
{
incomplete_class_message(object, E_NOTICE TSRMLS_CC);
return &EG(error_zval_ptr);
}
/* }}} */
static void incomplete_class_unset_property(zval *object, zval *member TSRMLS_DC)
static void incomplete_class_unset_property(zval *object, zval *member TSRMLS_DC) /* {{{ */
{
incomplete_class_message(object, E_NOTICE TSRMLS_CC);
}
/* }}} */
static int incomplete_class_has_property(zval *object, zval *member, int check_empty TSRMLS_DC)
static int incomplete_class_has_property(zval *object, zval *member, int check_empty TSRMLS_DC) /* {{{ */
{
incomplete_class_message(object, E_NOTICE TSRMLS_CC);
return 0;
}
/* }}} */
static union _zend_function *incomplete_class_get_method(zval **object, zstr method, int method_len TSRMLS_DC) {
static union _zend_function *incomplete_class_get_method(zval **object, zstr method, int method_len TSRMLS_DC) /* {{{ */
{
incomplete_class_message(*object, E_ERROR TSRMLS_CC);
return NULL;
}
/* }}} */
/* {{{ php_create_incomplete_class
*/

45
ext/standard/info.c

@ -61,7 +61,7 @@ ZEND_EXTERN_MODULE_GLOBALS(iconv)
PHPAPI extern char *php_ini_opened_path;
PHPAPI extern char *php_ini_scanned_files;
static int php_info_print_html_esc(const char *str, int len)
static int php_info_print_html_esc(const char *str, int len) /* {{{ */
{
int new_len, written;
char *new_str;
@ -72,8 +72,9 @@ static int php_info_print_html_esc(const char *str, int len)
efree(new_str);
return written;
}
/* }}} */
static int php_info_uprint_html_esc(const UChar *str, int len)
static int php_info_uprint_html_esc(const UChar *str, int len) /* {{{ */
{
UErrorCode status = U_ZERO_ERROR;
char *new_str = NULL;
@ -88,8 +89,9 @@ static int php_info_uprint_html_esc(const UChar *str, int len)
efree(new_str);
return written;
}
/* }}} */
static int php_info_printf(const char *fmt, ...)
static int php_info_printf(const char *fmt, ...) /* {{{ */
{
char *buf;
int len, written;
@ -104,28 +106,31 @@ static int php_info_printf(const char *fmt, ...)
efree(buf);
return written;
}
/* }}} */
static void php_info_print_request_uri(TSRMLS_D)
static void php_info_print_request_uri(TSRMLS_D) /* {{{ */
{
if (SG(request_info).request_uri) {
php_info_print_html_esc(SG(request_info).request_uri, strlen(SG(request_info).request_uri));
}
}
/* }}} */
static int php_info_print(const char *str)
static int php_info_print(const char *str) /* {{{ */
{
TSRMLS_FETCH();
return php_output_write_utf8(str, strlen(str) TSRMLS_CC);
}
/* }}} */
static int php_info_uprint(const UChar *str, int len)
static int php_info_uprint(const UChar *str, int len) /* {{{ */
{
TSRMLS_FETCH();
return php_output_write_unicode(str, len TSRMLS_CC);
}
/* }}} */
static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC)
static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC) /* {{{ */
{
zstr key;
uint len;
@ -173,6 +178,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
php_info_print_table_row(2, name, "disabled");
}
}
/* }}} */
PHPAPI void php_info_print_module(zend_module_entry *module TSRMLS_DC) /* {{{ */
{
@ -321,7 +327,6 @@ void php_info_print_style(TSRMLS_D)
}
/* }}} */
/* {{{ php_info_html_esc
*/
PHPAPI char *php_info_html_esc(char *string TSRMLS_DC)
@ -331,7 +336,6 @@ PHPAPI char *php_info_html_esc(char *string TSRMLS_DC)
}
/* }}} */
/* {{{ php_get_uname
*/
PHPAPI char *php_get_uname(char mode)
@ -446,7 +450,6 @@ PHPAPI char *php_get_uname(char mode)
}
/* }}} */
/* {{{ php_print_info_htmlhead
*/
PHPAPI void php_print_info_htmlhead(TSRMLS_D)
@ -725,8 +728,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
}
/* }}} */
PHPAPI void php_info_print_table_start()
PHPAPI void php_info_print_table_start() /* {{{ */
{
if (!sapi_module.phpinfo_as_text) {
php_info_print("<table border=\"0\" cellpadding=\"3\" width=\"600\">\n");
@ -734,16 +736,18 @@ PHPAPI void php_info_print_table_start()
php_info_print("\n");
}
}
/* }}} */
PHPAPI void php_info_print_table_end()
PHPAPI void php_info_print_table_end() /* {{{ */
{
if (!sapi_module.phpinfo_as_text) {
php_info_print("</table><br />\n");
}
}
/* }}} */
PHPAPI void php_info_print_box_start(int flag)
PHPAPI void php_info_print_box_start(int flag) /* {{{ */
{
php_info_print_table_start();
if (flag) {
@ -758,16 +762,18 @@ PHPAPI void php_info_print_box_start(int flag)
}
}
}
/* }}} */
PHPAPI void php_info_print_box_end()
PHPAPI void php_info_print_box_end() /* {{{ */
{
if (!sapi_module.phpinfo_as_text) {
php_info_print("</td></tr>\n");
}
php_info_print_table_end();
}
/* }}} */
PHPAPI void php_info_print_hr()
PHPAPI void php_info_print_hr() /* {{{ */
{
if (!sapi_module.phpinfo_as_text) {
php_info_print("<hr />\n");
@ -775,8 +781,9 @@ PHPAPI void php_info_print_hr()
php_info_print("\n\n _______________________________________________________________________\n\n");
}
}
/* }}} */
PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header)
PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header) /* {{{ */
{
int spaces;
@ -787,6 +794,7 @@ PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header)
php_info_printf("%*s%s%*s\n", (int)(spaces/2), " ", header, (int)(spaces/2), " ");
}
}
/* }}} */
/* {{{ php_info_print_table_header
*/
@ -989,7 +997,6 @@ PHP_FUNCTION(phpcredits)
}
/* }}} */
/* {{{ php_logo_guid
*/
PHPAPI char *php_logo_guid()

12
ext/standard/lcg.c

@ -53,7 +53,7 @@ static php_lcg_globals lcg_globals;
static void lcg_seed(TSRMLS_D);
PHPAPI double php_combined_lcg(TSRMLS_D)
PHPAPI double php_combined_lcg(TSRMLS_D) /* {{{ */
{
php_int32 q;
php_int32 z;
@ -72,8 +72,9 @@ PHPAPI double php_combined_lcg(TSRMLS_D)
return z * 4.656613e-10;
}
/* }}} */
static void lcg_seed(TSRMLS_D)
static void lcg_seed(TSRMLS_D) /* {{{ */
{
struct timeval tv;
@ -90,13 +91,15 @@ static void lcg_seed(TSRMLS_D)
LCG(seeded) = 1;
}
/* }}} */
static void lcg_init_globals(php_lcg_globals *lcg_globals_p TSRMLS_DC)
static void lcg_init_globals(php_lcg_globals *lcg_globals_p TSRMLS_DC) /* {{{ */
{
LCG(seeded) = 0;
}
/* }}} */
PHP_MINIT_FUNCTION(lcg)
PHP_MINIT_FUNCTION(lcg) /* {{{ */
{
#ifdef ZTS
ts_allocate_id(&lcg_globals_id, sizeof(php_lcg_globals), (ts_allocate_ctor) lcg_init_globals, NULL);
@ -105,6 +108,7 @@ PHP_MINIT_FUNCTION(lcg)
#endif
return SUCCESS;
}
/* }}} */
/* {{{ proto float lcg_value() U
Returns a value from the combined linear congruential generator */

2
ext/standard/math.c

@ -1065,8 +1065,6 @@ PHP_FUNCTION(fmod)
}
/* }}} */
/*
* Local variables:
* tab-width: 4

6
ext/standard/md5.c

@ -27,12 +27,13 @@
#include "md5.h"
#include "ext/standard/file.h"
PHPAPI void make_digest(char *md5str, unsigned char *digest)
PHPAPI void make_digest(char *md5str, unsigned char *digest) /* {{{ */
{
make_digest_ex(md5str, digest, 16);
}
/* }}} */
PHPAPI void make_digest_ex(char *md5str, unsigned char *digest, int len)
PHPAPI void make_digest_ex(char *md5str, unsigned char *digest, int len) /* {{{ */
{
static const char hexits[17] = "0123456789abcdef";
int i;
@ -43,6 +44,7 @@ PHPAPI void make_digest_ex(char *md5str, unsigned char *digest, int len)
}
md5str[len * 2] = '\0';
}
/* }}} */
/* {{{ proto string md5(string str, [ bool raw_output]) U
Calculate the md5 hash of a string */

9
ext/standard/metaphone.c

@ -124,7 +124,8 @@ char _codes[26] =
/* Allows us to safely look ahead an arbitrary # of letters */
/* I probably could have just used strlen... */
static char Lookahead(char *word, int how_far)
static char Lookahead(char *word, int how_far) /* {{{ */
{
char letter_ahead = '\0'; /* null by default */
int idx;
@ -136,7 +137,7 @@ static char Lookahead(char *word, int how_far)
*/
return letter_ahead;
}
/* }}} */
/* phonize one letter
* We don't know the buffers size in advance. On way to solve this is to just
@ -157,9 +158,7 @@ static char Lookahead(char *word, int how_far)
/* Note is a letter is a 'break' in the word */
#define Isbreak(c) (!isalpha(c))
/* {{{ metaphone
*/
static int metaphone(unsigned char *word, int word_len, long max_phonemes, char **phoned_word, int traditional)
static int metaphone(unsigned char *word, int word_len, long max_phonemes, char **phoned_word, int traditional) /* {{{ */
{
int w_idx = 0; /* point in the phonization we're at. */
int p_idx = 0; /* end of the phoned phrase */

3
ext/standard/microtime.c

@ -50,7 +50,7 @@
#define SEC_IN_MIN 60
#ifdef HAVE_GETTIMEOFDAY
static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode)
static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
{
zend_bool get_as_float = 0;
struct timeval tp = {0};
@ -88,6 +88,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode)
RETURN_ASCII_STRING(ret, ZSTR_DUPLICATE);
}
}
/* }}} */
/* {{{ proto mixed microtime([bool get_as_float]) U
Returns either a string or a float containing the current time in seconds and microseconds */

6
ext/standard/pageinfo.c

@ -92,13 +92,14 @@ long php_getuid(void)
}
/* }}} */
long php_getgid(void)
long php_getgid(void) /* {{{ */
{
TSRMLS_FETCH();
php_statpage(TSRMLS_C);
return (BG(page_gid));
}
/* }}} */
/* {{{ proto int getmyuid(void) U
Get PHP script owner's UID */
@ -158,11 +159,12 @@ PHP_FUNCTION(getmyinode)
}
/* }}} */
PHPAPI time_t php_getlastmod(TSRMLS_D)
PHPAPI time_t php_getlastmod(TSRMLS_D) /* {{{ */
{
php_statpage(TSRMLS_C);
return BG(page_mtime);
}
/* }}} */
/* {{{ proto int getlastmod(void) U
Get time of last page modification */

32
ext/standard/php_fopen_wrapper.c

@ -31,28 +31,32 @@
#include "php_fopen_wrappers.h"
#include "SAPI.h"
static size_t php_stream_output_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
static size_t php_stream_output_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
{
PHPWRITE(buf, count);
return count;
}
/* }}} */
static size_t php_stream_output_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
static size_t php_stream_output_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
{
stream->eof = 1;
return 0;
}
/* }}} */
static int php_stream_output_close(php_stream *stream, int close_handle TSRMLS_DC)
static int php_stream_output_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
{
return 0;
}
/* }}} */
static int php_stream_output_flush(php_stream *stream TSRMLS_DC)
static int php_stream_output_flush(php_stream *stream TSRMLS_DC) /* {{{ */
{
sapi_flush(TSRMLS_C);
return 0;
}
/* }}} */
php_stream_ops php_stream_output_ops = {
php_stream_output_write,
@ -66,12 +70,13 @@ php_stream_ops php_stream_output_ops = {
NULL /* set_option */
};
static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
{
return -1;
}
/* }}} */
static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
{
off_t *position = (off_t*)stream->abstract;
size_t read_bytes = 0;
@ -102,18 +107,21 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count
SG(read_post_bytes) += read_bytes;
return read_bytes;
}
/* }}} */
static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC)
static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
{
efree(stream->abstract);
return 0;
}
/* }}} */
static int php_stream_input_flush(php_stream *stream TSRMLS_DC)
static int php_stream_input_flush(php_stream *stream TSRMLS_DC) /* {{{ */
{
return -1;
}
/* }}} */
php_stream_ops php_stream_input_ops = {
php_stream_input_write,
@ -127,7 +135,8 @@ php_stream_ops php_stream_input_ops = {
NULL /* set_option */
};
static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain TSRMLS_DC) {
static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain TSRMLS_DC) /* {{{ */
{
char *p, *token;
php_stream_filter *temp_filter;
@ -150,9 +159,9 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i
p = php_strtok_r(NULL, "|", &token);
}
}
/* }}} */
php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
{
int fd = -1;
int mode_rw = 0;
@ -303,6 +312,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
return stream;
}
/* }}} */
static php_stream_wrapper_ops php_stdio_wops = {
php_stream_url_wrap_php,

7
ext/standard/quot_print.c

@ -34,7 +34,7 @@
/*
* Converting HEX char to INT value
*/
static char php_hex2int(int c)
static char php_hex2int(int c) /* {{{ */
{
if (isdigit(c)) {
return c - '0';
@ -49,8 +49,9 @@ static char php_hex2int(int c)
return -1;
}
}
/* }}} */
PHPAPI unsigned char *php_quot_print_decode(const unsigned char *str, size_t length, size_t *ret_length, int replace_us_by_ws)
PHPAPI unsigned char *php_quot_print_decode(const unsigned char *str, size_t length, size_t *ret_length, int replace_us_by_ws) /* {{{ */
{
register unsigned int i;
register unsigned const char *p1;
@ -140,7 +141,7 @@ PHPAPI unsigned char *php_quot_print_decode(const unsigned char *str, size_t len
*ret_length = decoded_len;
return retval;
}
/* }}} */
/*
*

19
ext/standard/reg.c

@ -92,33 +92,37 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)
}
/* }}} */
static void _free_reg_cache(reg_cache *rc)
static void _free_reg_cache(reg_cache *rc) /* {{{ */
{
regfree(&rc->preg);
}
/* }}} */
#undef regfree
#define regfree(a);
#undef regcomp
#define regcomp(a, b, c) _php_regcomp(a, b, c)
static void php_reg_init_globals(zend_reg_globals *reg_globals TSRMLS_DC)
static void php_reg_init_globals(zend_reg_globals *reg_globals TSRMLS_DC) /* {{{ */
{
zend_hash_init(&reg_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1);
}
/* }}} */
static void php_reg_destroy_globals(zend_reg_globals *reg_globals TSRMLS_DC)
static void php_reg_destroy_globals(zend_reg_globals *reg_globals TSRMLS_DC) /* {{{ */
{
zend_hash_destroy(&reg_globals->ht_rc);
}
/* }}} */
PHP_MINIT_FUNCTION(regex)
PHP_MINIT_FUNCTION(regex) /* {{{ */
{
ZEND_INIT_MODULE_GLOBALS(reg, php_reg_init_globals, php_reg_destroy_globals);
return SUCCESS;
}
/* }}} */
PHP_MSHUTDOWN_FUNCTION(regex)
PHP_MSHUTDOWN_FUNCTION(regex) /* {{{ */
{
#ifndef ZTS
php_reg_destroy_globals(&reg_globals TSRMLS_CC);
@ -126,8 +130,9 @@ PHP_MSHUTDOWN_FUNCTION(regex)
return SUCCESS;
}
/* }}} */
PHP_MINFO_FUNCTION(regex)
PHP_MINFO_FUNCTION(regex) /* {{{ */
{
#if HSREGEX
php_info_print_table_row(2, "Regex Library", "Bundled library enabled");
@ -135,7 +140,7 @@ PHP_MINFO_FUNCTION(regex)
php_info_print_table_row(2, "Regex Library", "System library enabled");
#endif
}
/* }}} */
/* {{{ php_reg_eprint
* php_reg_eprint - convert error number to name

5
ext/standard/sha1.c

@ -26,10 +26,11 @@
#include "sha1.h"
#include "md5.h"
PHPAPI void make_sha1_digest(char *sha1str, unsigned char *digest)
PHPAPI void make_sha1_digest(char *sha1str, unsigned char *digest) /* {{{ */
{
make_digest_ex(sha1str, digest, 20);
}
/* }}} */
/* {{{ proto string sha1(string str [, bool raw_output]) U
Calculate the sha1 hash of a string */
@ -73,7 +74,6 @@ PHP_FUNCTION(sha1)
/* }}} */
/* {{{ proto string sha1_file(string filename [, bool raw_output]) U
Calculate the sha1 hash of given filename */
PHP_FUNCTION(sha1_file)
@ -130,7 +130,6 @@ PHP_FUNCTION(sha1_file)
}
/* }}} */
static void SHA1Transform(php_uint32[5], const unsigned char[64]);
static void SHA1Encode(unsigned char *, php_uint32 *, unsigned int);
static void SHA1Decode(php_uint32 *, const unsigned char *, unsigned int);

2
ext/standard/streamsfuncs.c

@ -1502,7 +1502,6 @@ PHP_FUNCTION(stream_socket_enable_crypto)
}
/* }}} */
/* {{{ proto bool stream_default_encoding(string encoding) U
Convenience wrapper for ini_set('unicode.stream_encoding', $encoding) */
PHP_FUNCTION(stream_default_encoding)
@ -1519,7 +1518,6 @@ PHP_FUNCTION(stream_default_encoding)
}
/* }}} */
/* {{{ proto void stream_encoding(resource stream[, string encoding]) U
Set character set for stream encoding
UTODO: Return current encoding charset

10
ext/standard/syslog.c

@ -103,7 +103,7 @@ PHP_MINIT_FUNCTION(syslog)
}
/* }}} */
PHP_RINIT_FUNCTION(syslog)
PHP_RINIT_FUNCTION(syslog) /* {{{ */
{
if (INI_INT("define_syslog_variables")) {
start_syslog(TSRMLS_C);
@ -112,23 +112,25 @@ PHP_RINIT_FUNCTION(syslog)
}
return SUCCESS;
}
/* }}} */
#ifdef PHP_WIN32
PHP_RSHUTDOWN_FUNCTION(syslog)
PHP_RSHUTDOWN_FUNCTION(syslog) /* {{{ */
{
closelog();
return SUCCESS;
}
/* }}} */
#endif
PHP_MSHUTDOWN_FUNCTION(syslog)
PHP_MSHUTDOWN_FUNCTION(syslog) /* {{{ */
{
if (BG(syslog_device)) {
free(BG(syslog_device));
}
return SUCCESS;
}
/* }}} */
/* {{{ start_syslog
*/

6
ext/standard/url.c

@ -136,15 +136,17 @@ PHPAPI char *php_replace_controlchars_ex(char *str, int len)
}
/* }}} */
PHPAPI char *php_replace_controlchars(char *str)
PHPAPI char *php_replace_controlchars(char *str) /* {{{ */
{
return php_replace_controlchars_ex(str, strlen(str));
}
/* }}} */
PHPAPI php_url *php_url_parse(char const *str)
PHPAPI php_url *php_url_parse(char const *str) /* {{{ */
{
return php_url_parse_ex(str, strlen(str));
}
/* }}} */
/* {{{ php_url_parse
*/

7
ext/standard/url_scanner.c

@ -32,18 +32,19 @@
#define BUFSIZE 256
#endif
int php_url_scanner_activate(TSRMLS_D)
int php_url_scanner_activate(TSRMLS_D) /* {{{ */
{
url_adapt(NULL,0,NULL,NULL);
return SUCCESS;
}
/* }}} */
int php_url_scanner_deactivate(TSRMLS_D)
int php_url_scanner_deactivate(TSRMLS_D) /* {{{ */
{
url_adapt(NULL,0,NULL,NULL);
return SUCCESS;
}
/* }}} */
/* {{{ url_attr_addon
*/

30
ext/standard/user_filters.c

@ -84,7 +84,7 @@ static zend_function_entry user_filter_class_funcs[] = {
static zend_class_entry user_filter_class_entry;
static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor) /* {{{ */
{
php_stream_bucket *bucket = (php_stream_bucket *)rsrc->ptr;
if (bucket) {
@ -92,8 +92,9 @@ static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
bucket = NULL;
}
}
/* }}} */
PHP_MINIT_FUNCTION(user_filters)
PHP_MINIT_FUNCTION(user_filters) /* {{{ */
{
zend_class_entry *php_user_filter;
/* init the filter class ancestor */
@ -131,8 +132,9 @@ PHP_MINIT_FUNCTION(user_filters)
return SUCCESS;
}
/* }}} */
PHP_RSHUTDOWN_FUNCTION(user_filters)
PHP_RSHUTDOWN_FUNCTION(user_filters) /* {{{ */
{
if (BG(user_filter_map)) {
zend_hash_destroy(BG(user_filter_map));
@ -142,8 +144,9 @@ PHP_RSHUTDOWN_FUNCTION(user_filters)
return SUCCESS;
}
/* }}} */
static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC)
static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC) /* {{{ */
{
zval *obj = (zval*)thisfilter->abstract;
zval func_name;
@ -170,15 +173,9 @@ static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC)
/* kill the object */
zval_ptr_dtor(&obj);
}
/* }}} */
php_stream_filter_status_t userfilter_filter(
php_stream *stream,
php_stream_filter *thisfilter,
php_stream_bucket_brigade *buckets_in,
php_stream_bucket_brigade *buckets_out,
size_t *consumed,
int flags
TSRMLS_DC)
php_stream_filter_status_t userfilter_filter( php_stream *stream, php_stream_filter *thisfilter, php_stream_bucket_brigade *buckets_in, php_stream_bucket_brigade *buckets_out, size_t *consumed, int flags TSRMLS_DC) /* {{{ */
{
int ret = PSFS_ERR_FATAL;
zval *obj = (zval*)thisfilter->abstract;
@ -244,6 +241,7 @@ php_stream_filter_status_t userfilter_filter(
return ret;
}
/* }}} */
static php_stream_filter_ops userfilter_ops = {
userfilter_filter,
@ -252,8 +250,7 @@ static php_stream_filter_ops userfilter_ops = {
PSFO_FLAG_OUTPUTS_SAME
};
static php_stream_filter *user_filter_factory_create(const char *filtername,
zval *filterparams, int persistent TSRMLS_DC)
static php_stream_filter *user_filter_factory_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) /* {{{ */
{
struct php_user_filter_data *fdat = NULL;
php_stream_filter *filter;
@ -378,15 +375,17 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
return filter;
}
/* }}} */
static php_stream_filter_factory user_filter_factory = {
user_filter_factory_create
};
static void filter_item_dtor(struct php_user_filter_data *fdat)
static void filter_item_dtor(struct php_user_filter_data *fdat) /* {{{ */
{
efree(fdat->classname.v);
}
/* }}} */
/* {{{ proto object stream_bucket_make_writeable(resource brigade) U
Return a bucket object from the brigade for operating on */
@ -633,7 +632,6 @@ PHP_FUNCTION(stream_filter_register)
}
/* }}} */
/*
* Local variables:
* tab-width: 4

2
ext/standard/versioning.c

@ -79,6 +79,7 @@ php_canonicalize_version(const char *version)
}
/* }}} */
/* {{{ compare_special_version_forms() */
typedef struct {
@ -120,6 +121,7 @@ compare_special_version_forms(char *form1, char *form2)
}
/* }}} */
/* {{{ php_version_compare() */
PHPAPI int

Loading…
Cancel
Save