vim-6 does folding - clean up a bunch of missing folding tags plus

some misguided RINIT and RSHUTDOWN calls in a few fringe extensions
This commit is contained in:
Rasmus Lerdorf 2001-06-05 13:12:10 +00:00
parent 4efe6f7e6b
commit 25c3a3a39d
125 changed files with 1769 additions and 570 deletions

View file

@ -171,11 +171,10 @@ PHP_FUNCTION(abs)
/* }}} */ /* }}} */
The {{{ symbols are the default folding symbols for the folding mode in The {{{ symbols are the default folding symbols for the folding mode in
Emacs. vim will soon have support for folding as well. Folding is very Emacs and vim (set fdm=marker). Folding is very useful when dealing with
useful when dealing with large files because you can scroll through the large files because you can scroll through the file quickly and just unfold
file quickly and just unfold the function you wish to work on. The }}} the function you wish to work on. The }}} at the end of each function marks
at the end of each function marks the end of the fold, and should be on the end of the fold, and should be on a separate line.
a separate line.
The "proto" keyword there is just a helper for the doc/genfuncsummary script The "proto" keyword there is just a helper for the doc/genfuncsummary script
which generates a full function summary. Having this keyword in front of the which generates a full function summary. Having this keyword in front of the

View file

@ -37,6 +37,8 @@
#include <aspell-c.h> #include <aspell-c.h>
#include "ext/standard/info.h" #include "ext/standard/info.h"
/* {{{ aspell_functions[]
*/
function_entry aspell_functions[] = { function_entry aspell_functions[] = {
PHP_FE(aspell_new, NULL) PHP_FE(aspell_new, NULL)
PHP_FE(aspell_check, NULL) PHP_FE(aspell_check, NULL)
@ -44,6 +46,7 @@ function_entry aspell_functions[] = {
PHP_FE(aspell_suggest, NULL) PHP_FE(aspell_suggest, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
static int le_aspell; static int le_aspell;
@ -51,24 +54,27 @@ zend_module_entry aspell_module_entry = {
"aspell", aspell_functions, PHP_MINIT(aspell), NULL, NULL, NULL, PHP_MINFO(aspell), STANDARD_MODULE_PROPERTIES "aspell", aspell_functions, PHP_MINIT(aspell), NULL, NULL, NULL, PHP_MINFO(aspell), STANDARD_MODULE_PROPERTIES
}; };
#ifdef COMPILE_DL_ASPELL #ifdef COMPILE_DL_ASPELL
ZEND_GET_MODULE(aspell) ZEND_GET_MODULE(aspell)
#endif #endif
/* {{{ php_aspell_close
*/
static void php_aspell_close(zend_rsrc_list_entry *rsrc) static void php_aspell_close(zend_rsrc_list_entry *rsrc)
{ {
aspell *sc = (aspell *)rsrc->ptr; aspell *sc = (aspell *)rsrc->ptr;
aspell_free(sc); aspell_free(sc);
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(aspell) PHP_MINIT_FUNCTION(aspell)
{ {
le_aspell = zend_register_list_destructors_ex(php_aspell_close, NULL, "aspell", module_number); le_aspell = zend_register_list_destructors_ex(php_aspell_close, NULL, "aspell", module_number);
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ proto int aspell_new(string master [, string personal]) /* {{{ proto int aspell_new(string master [, string personal])
Load a dictionary */ Load a dictionary */
@ -97,7 +103,6 @@ PHP_FUNCTION(aspell_new)
} }
/* }}} */ /* }}} */
/* {{{ proto array aspell_suggest(aspell int, string word) /* {{{ proto array aspell_suggest(aspell int, string word)
Return array of Suggestions */ Return array of Suggestions */
PHP_FUNCTION(aspell_suggest) PHP_FUNCTION(aspell_suggest)
@ -199,11 +204,22 @@ PHP_FUNCTION(aspell_check_raw)
} }
/* }}} */ /* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(aspell) PHP_MINFO_FUNCTION(aspell)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "ASpell Support", "enabled"); php_info_print_table_row(2, "ASpell Support", "enabled");
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -259,4 +259,5 @@ ZEND_FUNCTION(crack_getlastmessage)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -41,8 +41,9 @@ ZEND_DECLARE_MODULE_GLOBALS(ctype)
/* True global resources - no need for thread safety here */ /* True global resources - no need for thread safety here */
static int le_ctype; static int le_ctype;
/* Every user visible function must have an entry in ctype_functions[]. /* {{{ ctype_functions[]
*/ * Every user visible function must have an entry in ctype_functions[].
*/
function_entry ctype_functions[] = { function_entry ctype_functions[] = {
PHP_FE(ctype_alnum, NULL) PHP_FE(ctype_alnum, NULL)
PHP_FE(ctype_alpha, NULL) PHP_FE(ctype_alpha, NULL)
@ -57,7 +58,10 @@ function_entry ctype_functions[] = {
PHP_FE(ctype_xdigit, NULL) PHP_FE(ctype_xdigit, NULL)
{NULL, NULL, NULL} /* Must be the last line in ctype_functions[] */ {NULL, NULL, NULL} /* Must be the last line in ctype_functions[] */
}; };
/* }}} */
/* {{{ ctype_mpodule_entry
*/
zend_module_entry ctype_module_entry = { zend_module_entry ctype_module_entry = {
"ctype", "ctype",
ctype_functions, ctype_functions,
@ -68,6 +72,7 @@ zend_module_entry ctype_module_entry = {
PHP_MINFO(ctype), PHP_MINFO(ctype),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_CTYPE #ifdef COMPILE_DL_CTYPE
ZEND_GET_MODULE(ctype) ZEND_GET_MODULE(ctype)
@ -77,7 +82,8 @@ ZEND_GET_MODULE(ctype)
#define PHP_EXPERIMENTAL(x,y) #define PHP_EXPERIMENTAL(x,y)
#endif #endif
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(ctype) PHP_MINFO_FUNCTION(ctype)
{ {
ELS_FETCH(); ELS_FETCH();
@ -87,8 +93,10 @@ PHP_MINFO_FUNCTION(ctype)
php_info_print_table_row(2, "ctype functions", "enabled (experimental)"); php_info_print_table_row(2, "ctype functions", "enabled (experimental)");
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ ctype
*/
static int ctype(int (*iswhat)(int),zval **c) static int ctype(int (*iswhat)(int),zval **c)
{ {
switch ((*c)->type) { switch ((*c)->type) {
@ -111,6 +119,7 @@ static int ctype(int (*iswhat)(int),zval **c)
} }
return 0; return 0;
} }
/* }}} */
/* {{{ proto bool isalnum(mixed c) /* {{{ proto bool isalnum(mixed c)
Check for alphanumeric character(s) */ Check for alphanumeric character(s) */
@ -310,13 +319,12 @@ PHP_FUNCTION(ctype_xdigit)
} }
/* }}} */ /* }}} */
#endif /* HAVE_CTYPE */ #endif /* HAVE_CTYPE */
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -48,6 +48,8 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc);
#define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err; #define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err;
/* {{{ curl_functions[]
*/
function_entry curl_functions[] = { function_entry curl_functions[] = {
PHP_FE(curl_init, NULL) PHP_FE(curl_init, NULL)
PHP_FE(curl_version, NULL) PHP_FE(curl_version, NULL)
@ -59,7 +61,10 @@ function_entry curl_functions[] = {
PHP_FE(curl_close, NULL) PHP_FE(curl_close, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
/* {{{ curl_module_entry
*/
zend_module_entry curl_module_entry = { zend_module_entry curl_module_entry = {
"curl", "curl",
curl_functions, curl_functions,
@ -70,11 +75,14 @@ zend_module_entry curl_module_entry = {
PHP_MINFO(curl), PHP_MINFO(curl),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_CURL #ifdef COMPILE_DL_CURL
ZEND_GET_MODULE (curl) ZEND_GET_MODULE (curl)
#endif #endif
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(curl) PHP_MINFO_FUNCTION(curl)
{ {
php_info_print_table_start(); php_info_print_table_start();
@ -82,9 +90,12 @@ PHP_MINFO_FUNCTION(curl)
php_info_print_table_row(2, "CURL Information", curl_version()); php_info_print_table_row(2, "CURL Information", curl_version());
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
#define REGISTER_CURL_CONSTANT(name, value) REGISTER_LONG_CONSTANT(name, value, CONST_CS | CONST_PERSISTENT) #define REGISTER_CURL_CONSTANT(name, value) REGISTER_LONG_CONSTANT(name, value, CONST_CS | CONST_PERSISTENT)
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(curl) PHP_MINIT_FUNCTION(curl)
{ {
le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number); le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number);
@ -230,6 +241,7 @@ PHP_MINIT_FUNCTION(curl)
return SUCCESS; return SUCCESS;
} }
/* }}} */
#define PHP_CURL_STDOUT 0 #define PHP_CURL_STDOUT 0
#define PHP_CURL_FILE 1 #define PHP_CURL_FILE 1
@ -239,6 +251,8 @@ PHP_MINIT_FUNCTION(curl)
#define PHP_CURL_ASCII 5 #define PHP_CURL_ASCII 5
#define PHP_CURL_BINARY 6 #define PHP_CURL_BINARY 6
/* {{{ curl_write
*/
static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx) static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
{ {
php_curl *ch = (php_curl *) ctx; php_curl *ch = (php_curl *) ctx;
@ -290,7 +304,10 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
return length; return length;
} }
/* }}} */
/* {{{ curl_read
*/
static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx) static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
{ {
php_curl *ch = (php_curl *) ctx; php_curl *ch = (php_curl *) ctx;
@ -341,7 +358,10 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
return length; return length;
} }
/* }}} */
/* {{{ _php_curl_write_header
*/
static size_t _php_curl_write_header(char *data, size_t size, size_t nmemb, void *ctx) static size_t _php_curl_write_header(char *data, size_t size, size_t nmemb, void *ctx)
{ {
php_curl *ch = (php_curl *) ctx; php_curl *ch = (php_curl *) ctx;
@ -377,7 +397,10 @@ static size_t _php_curl_write_header(char *data, size_t size, size_t nmemb, void
return length; return length;
} }
/* }}} */
/* {{{ _php_curl_passwd
*/
static size_t _php_curl_passwd(void *ctx, char *prompt, char *buf, int buflen) static size_t _php_curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
{ {
php_curl *ch = (php_curl *) ctx; php_curl *ch = (php_curl *) ctx;
@ -419,23 +442,31 @@ static size_t _php_curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
return 0; return 0;
} }
/* }}} */
/* {{{ curl_free_string
*/
static void curl_free_string(void **string) static void curl_free_string(void **string)
{ {
efree(*string); efree(*string);
} }
/* }}} */
/* {{{ curl_free_post
*/
static void curl_free_post(void **post) static void curl_free_post(void **post)
{ {
curl_formfree((struct HttpPost *) *post); curl_formfree((struct HttpPost *) *post);
} }
/* }}} */
/* {{{ curl_free_slist
*/
static void curl_free_slist(void **slist) static void curl_free_slist(void **slist)
{ {
curl_slist_free_all((struct curl_slist *) *slist); curl_slist_free_all((struct curl_slist *) *slist);
} }
/* }}} */
/* {{{ proto string curl_version(void) /* {{{ proto string curl_version(void)
Return the CURL version string. */ Return the CURL version string. */
@ -445,6 +476,8 @@ PHP_FUNCTION(curl_version)
} }
/* }}} */ /* }}} */
/* {{{ alloc_curl_handle
*/
static void alloc_curl_handle(php_curl **ch) static void alloc_curl_handle(php_curl **ch)
{ {
*ch = emalloc(sizeof(php_curl)); *ch = emalloc(sizeof(php_curl));
@ -459,6 +492,7 @@ static void alloc_curl_handle(php_curl **ch)
zend_llist_init(&(*ch)->to_free.post, sizeof(struct HttpPost), zend_llist_init(&(*ch)->to_free.post, sizeof(struct HttpPost),
(void(*)(void *)) curl_free_post, 0); (void(*)(void *)) curl_free_post, 0);
} }
/* }}} */
/* {{{ proto int curl_init([string url]) /* {{{ proto int curl_init([string url])
Initialize a CURL session */ Initialize a CURL session */
@ -939,3 +973,11 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc)
/* }}} */ /* }}} */
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -28,6 +28,8 @@
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
/* $Id$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@ -40,6 +42,8 @@
#include "mckcrypt.h" #include "mckcrypt.h"
#include "base64.h" #include "base64.h"
/* {{{ cybercash_functions[]
*/
function_entry cybercash_functions[] = { function_entry cybercash_functions[] = {
PHP_FE(cybercash_encr, NULL) PHP_FE(cybercash_encr, NULL)
PHP_FE(cybercash_decr, NULL) PHP_FE(cybercash_decr, NULL)
@ -47,7 +51,10 @@ function_entry cybercash_functions[] = {
PHP_FE(cybercash_base64_decode, NULL) PHP_FE(cybercash_base64_decode, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
/* {{{ cybercash_module_entry
*/
zend_module_entry cybercash_module_entry = { zend_module_entry cybercash_module_entry = {
"cybercash", "cybercash",
cybercash_functions, cybercash_functions,
@ -58,18 +65,24 @@ zend_module_entry cybercash_module_entry = {
PHP_MINFO(cybercash), PHP_MINFO(cybercash),
STANDARD_MODULE_PROPERTIES, STANDARD_MODULE_PROPERTIES,
}; };
/* }}} */
#ifdef COMPILE_DL_CYBERCASH #ifdef COMPILE_DL_CYBERCASH
ZEND_GET_MODULE(cybercash) ZEND_GET_MODULE(cybercash)
#endif #endif
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(cybercash) PHP_MINFO_FUNCTION(cybercash)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "Cybercash Support", "enabled"); php_info_print_table_row(2, "Cybercash Support", "enabled");
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ proto cybercash_encr(string wmk, string sk, string data)
Cybercash encrypt */
PHP_FUNCTION(cybercash_encr) PHP_FUNCTION(cybercash_encr)
{ {
zval **wmk, **sk, **inbuff; zval **wmk, **sk, **inbuff;
@ -116,7 +129,10 @@ PHP_FUNCTION(cybercash_encr)
efree(macbuff); efree(macbuff);
} }
} }
/* }}} */
/* {{{ proto array cybercash_decr(string wmp, string sk, string data)
Cybercash decrypt */
PHP_FUNCTION(cybercash_decr) PHP_FUNCTION(cybercash_decr)
{ {
zval **wmk,**sk,**inbuff; zval **wmk,**sk,**inbuff;
@ -164,7 +180,10 @@ PHP_FUNCTION(cybercash_decr)
efree(macbuff); efree(macbuff);
} }
} }
/* }}} */
/* {{{ proto string cybercash_base64_encode(string data)
base64 encode data for cybercash */
PHP_FUNCTION(cybercash_base64_encode) PHP_FUNCTION(cybercash_base64_encode)
{ {
zval **inbuff; zval **inbuff;
@ -185,7 +204,10 @@ PHP_FUNCTION(cybercash_base64_encode)
RETURN_STRINGL(outbuff, ret_length, 0); RETURN_STRINGL(outbuff, ret_length, 0);
} }
/* }}} */
/* {{{ proto string cybercash_base64_decode(string data)
base64 decode data for cybercash */
PHP_FUNCTION(cybercash_base64_decode) PHP_FUNCTION(cybercash_base64_decode)
{ {
zval **inbuff; zval **inbuff;
@ -204,4 +226,13 @@ PHP_FUNCTION(cybercash_base64_decode)
RETURN_STRINGL(outbuff, ret_length, 0); RETURN_STRINGL(outbuff, ret_length, 0);
} }
/* }}} */
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -13,10 +13,11 @@
| license@php.net so we can mail you a copy immediately. | | license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
| Authors: Sylvain PAGES <spages@free.fr> | | Authors: Sylvain PAGES <spages@free.fr> |
| |
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
/* $Id$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@ -34,103 +35,53 @@ ZEND_DECLARE_MODULE_GLOBALS(cybermut)
/* True global resources - no need for thread safety here */ /* True global resources - no need for thread safety here */
static int le_cybermut; static int le_cybermut;
/* Every user visible function must have an entry in cybermut_functions[]. /* {{{ cybermut_functions[]
*/ */
function_entry cybermut_functions[] = { function_entry cybermut_functions[] = {
PHP_FE(confirm_cybermut_compiled, NULL) /* For testing, remove later. */
PHP_FE(cybermut_creerformulairecm, NULL) PHP_FE(cybermut_creerformulairecm, NULL)
PHP_FE(cybermut_testmac, NULL) PHP_FE(cybermut_testmac, NULL)
PHP_FE(cybermut_creerreponsecm, NULL) PHP_FE(cybermut_creerreponsecm, NULL)
{NULL, NULL, NULL} /* Must be the last line in cybermut_functions[] */ {NULL, NULL, NULL} /* Must be the last line in cybermut_functions[] */
}; };
/* }}} */
/* {{{ cybermut_module_entry
*/
zend_module_entry cybermut_module_entry = { zend_module_entry cybermut_module_entry = {
"cybermut", "cybermut",
cybermut_functions, cybermut_functions,
PHP_MINIT(cybermut), PHP_MINIT(cybermut),
PHP_MSHUTDOWN(cybermut), PHP_MSHUTDOWN(cybermut),
PHP_RINIT(cybermut), /* Replace with NULL if there's nothing to do at request start */ NULL,
PHP_RSHUTDOWN(cybermut), /* Replace with NULL if there's nothing to do at request end */ NULL,
PHP_MINFO(cybermut), PHP_MINFO(cybermut),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_CYBERMUT #ifdef COMPILE_DL_CYBERMUT
ZEND_GET_MODULE(cybermut) ZEND_GET_MODULE(cybermut)
#endif #endif
/* Remove comments and fill if you need to have entries in php.ini
PHP_INI_BEGIN()
PHP_INI_END()
*/
PHP_MINIT_FUNCTION(cybermut) PHP_MINIT_FUNCTION(cybermut)
{ {
/* Remove comments if you have entries in php.ini
REGISTER_INI_ENTRIES();
*/
return SUCCESS; return SUCCESS;
} }
PHP_MSHUTDOWN_FUNCTION(cybermut) PHP_MSHUTDOWN_FUNCTION(cybermut)
{
/* Remove comments if you have entries in php.ini
UNREGISTER_INI_ENTRIES();
*/
return SUCCESS;
}
/* Remove if there's nothing to do at request start */
PHP_RINIT_FUNCTION(cybermut)
{
return SUCCESS;
}
/* Remove if there's nothing to do at request end */
PHP_RSHUTDOWN_FUNCTION(cybermut)
{ {
return SUCCESS; return SUCCESS;
} }
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(cybermut) PHP_MINFO_FUNCTION(cybermut)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_header(2, "cybermut support", "enabled"); php_info_print_table_header(2, "cybermut support", "enabled");
php_info_print_table_end(); php_info_print_table_end();
/* Remove comments if you have entries in php.ini
DISPLAY_INI_ENTRIES();
*/
}
/* Remove the following function when you have succesfully modified config.m4
so that your module can be compiled into PHP, it exists only for testing
purposes. */
/* Every user-visible function in PHP should document itself in the source */
/* {{{ proto string confirm_cybermut_compiled(string arg)
Return a string to confirm that the module is compiled in */
PHP_FUNCTION(confirm_cybermut_compiled)
{
zval **arg;
int len;
char string[256];
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(arg);
len = sprintf(string, "Congratulations, you have successfully modified ext/cybermut/config.m4, module %s is compiled into PHP", Z_STRVAL_PP(arg));
RETURN_STRINGL(string, len, 1);
} }
/* }}} */ /* }}} */
/* The previous line is meant for emacs, so it can correctly fold and unfold
functions in source code. See the corresponding marks just before function
definition, where the functions purpose is also documented. Please follow
this convention for the convenience of others editing your code.
*/
/* {{{ proto string cybermut_creerformulairecm(string url_CM, string version, string TPE, string montant, string ref_commande, string texte_libre, string url_retour, string url_retour_ok, string url_retour_err, string langue, string code_societe, string texte_bouton) /* {{{ proto string cybermut_creerformulairecm(string url_CM, string version, string TPE, string montant, string ref_commande, string texte_libre, string url_retour, string url_retour_ok, string url_retour_err, string langue, string code_societe, string texte_bouton)
Return a string containing source HTML of the form of request for payment. Return a string containing source HTML of the form of request for payment.
@ -222,11 +173,10 @@ PHP_FUNCTION(cybermut_creerreponsecm)
} }
/* }}} */ /* }}} */
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -103,6 +103,8 @@
#define DBM_FIRSTKEY(dbf) dbm_firstkey(dbf) #define DBM_FIRSTKEY(dbf) dbm_firstkey(dbf)
#define DBM_NEXTKEY(dbf, key) dbm_nextkey(dbf) #define DBM_NEXTKEY(dbf, key) dbm_nextkey(dbf)
/* {{{ php_dbm_key_exists
*/
static int php_dbm_key_exists(DBM *dbf, datum key_datum) { static int php_dbm_key_exists(DBM *dbf, datum key_datum) {
datum value_datum; datum value_datum;
int ret; int ret;
@ -114,6 +116,7 @@ static int php_dbm_key_exists(DBM *dbf, datum key_datum) {
ret = 0; ret = 0;
return ret; return ret;
} }
/* }}} */
#endif #endif
#if !NDBM && !GDBM #if !NDBM && !GDBM
@ -163,6 +166,8 @@ static int numthreads=0;
/*needed for blocking calls in windows*/ /*needed for blocking calls in windows*/
void *dbm_mutex; void *dbm_mutex;
/* {{{ php_find_dbm
*/
dbm_info *php_find_dbm(pval *id) dbm_info *php_find_dbm(pval *id)
{ {
list_entry *le; list_entry *le;
@ -193,7 +198,10 @@ dbm_info *php_find_dbm(pval *id)
return NULL; return NULL;
return info; return info;
} }
/* }}} */
/* {{{ php_get_info_db
*/
static char *php_get_info_db(void) static char *php_get_info_db(void)
{ {
static char temp1[128]; static char temp1[128];
@ -228,8 +236,10 @@ static char *php_get_info_db(void)
return temp; return temp;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(db) PHP_MINFO_FUNCTION(db)
{ {
/* this isn't pretty ... should break out the info a bit more (cmv) */ /* this isn't pretty ... should break out the info a bit more (cmv) */
@ -237,6 +247,7 @@ PHP_MINFO_FUNCTION(db)
php_printf(php_get_info_db()); php_printf(php_get_info_db());
php_info_print_box_end(); php_info_print_box_end();
} }
/* }}} */
/* {{{ proto string dblist(void) /* {{{ proto string dblist(void)
Describes the dbm-compatible library being used */ Describes the dbm-compatible library being used */
@ -271,7 +282,8 @@ PHP_FUNCTION(dbmopen) {
} }
/* }}} */ /* }}} */
/* {{{ php_dbm_open
*/
dbm_info *php_dbm_open(char *filename, char *mode) { dbm_info *php_dbm_open(char *filename, char *mode) {
dbm_info *info; dbm_info *info;
int ret, lock=0; int ret, lock=0;
@ -408,6 +420,7 @@ dbm_info *php_dbm_open(char *filename, char *mode) {
return NULL; return NULL;
} }
/* }}} */
/* {{{ proto bool dbmclose(int dbm_identifier) /* {{{ proto bool dbmclose(int dbm_identifier)
Closes a dbm database */ Closes a dbm database */
@ -427,6 +440,8 @@ PHP_FUNCTION(dbmclose) {
} }
/* }}} */ /* }}} */
/* {{{ php_dbm_close
*/
int php_dbm_close(zend_rsrc_list_entry *rsrc) { int php_dbm_close(zend_rsrc_list_entry *rsrc) {
int ret = 0; int ret = 0;
dbm_info *info = (dbm_info *)rsrc->ptr; dbm_info *info = (dbm_info *)rsrc->ptr;
@ -454,7 +469,8 @@ int php_dbm_close(zend_rsrc_list_entry *rsrc) {
efree(info); efree(info);
return(ret); return(ret);
} }
/* }}} */
/* /*
* ret = -1 means that database was opened for read-only * ret = -1 means that database was opened for read-only
@ -487,7 +503,8 @@ PHP_FUNCTION(dbminsert)
/* }}} */ /* }}} */
/* {{{ php_dbm_insert
*/
int php_dbm_insert(dbm_info *info, char *key, char *value) { int php_dbm_insert(dbm_info *info, char *key, char *value) {
datum key_datum, value_datum; datum key_datum, value_datum;
int ret; int ret;
@ -517,7 +534,8 @@ int php_dbm_insert(dbm_info *info, char *key, char *value) {
efree(key_datum.dptr); efree(value_datum.dptr); efree(key_datum.dptr); efree(value_datum.dptr);
return(ret); return(ret);
} }
/* }}} */
/* {{{ proto int dbmreplace(int dbm_identifier, string key, string value) /* {{{ proto int dbmreplace(int dbm_identifier, string key, string value)
Replaces the value for a key in a dbm database */ Replaces the value for a key in a dbm database */
@ -544,6 +562,8 @@ PHP_FUNCTION(dbmreplace)
} }
/* }}} */ /* }}} */
/* {{{ php_dbm_replace
*/
int php_dbm_replace(dbm_info *info, char *key, char *value) { int php_dbm_replace(dbm_info *info, char *key, char *value) {
DBM_TYPE dbf; DBM_TYPE dbf;
int ret; int ret;
@ -576,7 +596,8 @@ int php_dbm_replace(dbm_info *info, char *key, char *value) {
efree(key_datum.dptr); efree(value_datum.dptr); efree(key_datum.dptr); efree(value_datum.dptr);
return(ret); return(ret);
} }
/* }}} */
/* {{{ proto string dbmfetch(int dbm_identifier, string key) /* {{{ proto string dbmfetch(int dbm_identifier, string key)
Fetches a value for a key from a dbm database */ Fetches a value for a key from a dbm database */
@ -606,6 +627,8 @@ PHP_FUNCTION(dbmfetch)
} }
/* }}} */ /* }}} */
/* {{{ php_dbm_fetch
*/
char *php_dbm_fetch(dbm_info *info, char *key) { char *php_dbm_fetch(dbm_info *info, char *key) {
datum key_datum, value_datum; datum key_datum, value_datum;
char *ret; char *ret;
@ -650,6 +673,7 @@ char *php_dbm_fetch(dbm_info *info, char *key) {
} }
return(ret); return(ret);
} }
/* }}} */
/* {{{ proto int dbmexists(int dbm_identifier, string key) /* {{{ proto int dbmexists(int dbm_identifier, string key)
Tells if a value exists for a key in a dbm database */ Tells if a value exists for a key in a dbm database */
@ -675,6 +699,8 @@ PHP_FUNCTION(dbmexists)
} }
/* }}} */ /* }}} */
/* {{{ php_dbm_exists
*/
int php_dbm_exists(dbm_info *info, char *key) { int php_dbm_exists(dbm_info *info, char *key) {
datum key_datum; datum key_datum;
int ret; int ret;
@ -696,6 +722,7 @@ int php_dbm_exists(dbm_info *info, char *key) {
return(ret); return(ret);
} }
/* }}} */
/* {{{ proto int dbmdelete(int dbm_identifier, string key) /* {{{ proto int dbmdelete(int dbm_identifier, string key)
Deletes the value for a key from a dbm database */ Deletes the value for a key from a dbm database */
@ -721,6 +748,8 @@ PHP_FUNCTION(dbmdelete)
} }
/* }}} */ /* }}} */
/* {{{ php_dbm_delete
*/
int php_dbm_delete(dbm_info *info, char *key) { int php_dbm_delete(dbm_info *info, char *key) {
datum key_datum; datum key_datum;
int ret; int ret;
@ -741,6 +770,7 @@ int php_dbm_delete(dbm_info *info, char *key) {
ret = DBM_DELETE(dbf, key_datum); ret = DBM_DELETE(dbf, key_datum);
return(ret); return(ret);
} }
/* }}} */
/* {{{ proto string dbmfirstkey(int dbm_identifier) /* {{{ proto string dbmfirstkey(int dbm_identifier)
Retrieves the first key from a dbm database */ Retrieves the first key from a dbm database */
@ -769,6 +799,8 @@ PHP_FUNCTION(dbmfirstkey)
} }
/* }}} */ /* }}} */
/* {{{ php_dbm_first_key
*/
char *php_dbm_first_key(dbm_info *info) { char *php_dbm_first_key(dbm_info *info) {
datum ret_datum; datum ret_datum;
char *ret; char *ret;
@ -799,6 +831,7 @@ char *php_dbm_first_key(dbm_info *info) {
return (ret); return (ret);
} }
/* }}} */
/* {{{ proto string dbmnextkey(int dbm_identifier, string key) /* {{{ proto string dbmnextkey(int dbm_identifier, string key)
Retrieves the next key from a dbm database */ Retrieves the next key from a dbm database */
@ -828,7 +861,8 @@ PHP_FUNCTION(dbmnextkey)
} }
/* }}} */ /* }}} */
/* {{{ php_dbm_nextkey
*/
char *php_dbm_nextkey(dbm_info *info, char *key) { char *php_dbm_nextkey(dbm_info *info, char *key) {
datum key_datum, ret_datum; datum key_datum, ret_datum;
char *ret; char *ret;
@ -873,11 +907,12 @@ char *php_dbm_nextkey(dbm_info *info, char *key) {
} }
return(ret); return(ret);
} }
/* }}} */
#if !GDBM && !NDBM #if !GDBM && !NDBM
static long CurrentFlatFilePos = 0L; static long CurrentFlatFilePos = 0L;
/* {{{ flatfile_store
*/
int flatfile_store(FILE *dbf, datum key_datum, datum value_datum, int mode) { int flatfile_store(FILE *dbf, datum key_datum, datum value_datum, int mode) {
int ret; int ret;
@ -905,7 +940,10 @@ int flatfile_store(FILE *dbf, datum key_datum, datum value_datum, int mode) {
ret=0; ret=0;
return ret; return ret;
} }
/* }}} */
/* {{{ flatfile_fetch
*/
datum flatfile_fetch(FILE *dbf, datum key_datum) { datum flatfile_fetch(FILE *dbf, datum key_datum) {
datum value_datum = {NULL, 0}; datum value_datum = {NULL, 0};
int num=0, buf_size=1024; int num=0, buf_size=1024;
@ -926,7 +964,10 @@ datum flatfile_fetch(FILE *dbf, datum key_datum) {
} }
return value_datum; return value_datum;
} }
/* }}} */
/* {{{ flatfile_delete
*/
int flatfile_delete(FILE *dbf, datum key_datum) { int flatfile_delete(FILE *dbf, datum key_datum) {
char *key = key_datum.dptr; char *key = key_datum.dptr;
int size = key_datum.dsize; int size = key_datum.dsize;
@ -981,7 +1022,10 @@ int flatfile_delete(FILE *dbf, datum key_datum) {
if (buf) efree(buf); if (buf) efree(buf);
return FAILURE; return FAILURE;
} }
/* }}} */
/* {{{ flatfile_findkey
*/
int flatfile_findkey(FILE *dbf, datum key_datum) { int flatfile_findkey(FILE *dbf, datum key_datum) {
char *buf = NULL; char *buf = NULL;
int num; int num;
@ -1023,8 +1067,11 @@ int flatfile_findkey(FILE *dbf, datum key_datum) {
} }
if (buf) efree(buf); if (buf) efree(buf);
return(ret); return(ret);
} }
/* }}} */
/* {{{ flatfile_firstkey
*/
datum flatfile_firstkey(FILE *dbf) { datum flatfile_firstkey(FILE *dbf) {
datum buf; datum buf;
int num; int num;
@ -1060,8 +1107,11 @@ datum flatfile_firstkey(FILE *dbf) {
if (buf.dptr) efree(buf.dptr); if (buf.dptr) efree(buf.dptr);
buf.dptr = NULL; buf.dptr = NULL;
return(buf); return(buf);
} }
/* }}} */
/* {{{ latfile_nextkey
*/
datum flatfile_nextkey(FILE *dbf) { datum flatfile_nextkey(FILE *dbf) {
datum buf; datum buf;
int num; int num;
@ -1098,9 +1148,11 @@ datum flatfile_nextkey(FILE *dbf) {
buf.dptr = NULL; buf.dptr = NULL;
return(buf); return(buf);
} }
/* }}} */
#endif #endif
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(db) PHP_MINIT_FUNCTION(db)
{ {
#if defined(THREAD_SAFE) #if defined(THREAD_SAFE)
@ -1125,7 +1177,10 @@ PHP_MINIT_FUNCTION(db)
le_db = zend_register_list_destructors_ex(php_dbm_close, NULL, "dbm", module_number); le_db = zend_register_list_destructors_ex(php_dbm_close, NULL, "dbm", module_number);
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
static PHP_MSHUTDOWN_FUNCTION(db) static PHP_MSHUTDOWN_FUNCTION(db)
{ {
#ifdef THREAD_SAFE #ifdef THREAD_SAFE
@ -1142,7 +1197,10 @@ static PHP_MSHUTDOWN_FUNCTION(db)
#endif #endif
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_RINIT_FUNCTION
*/
PHP_RINIT_FUNCTION(db) PHP_RINIT_FUNCTION(db)
{ {
#if !GDBM && !NDBM #if !GDBM && !NDBM
@ -1150,8 +1208,10 @@ PHP_RINIT_FUNCTION(db)
#endif #endif
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ dbm_functions[]
*/
function_entry dbm_functions[] = { function_entry dbm_functions[] = {
PHP_FE(dblist, NULL) PHP_FE(dblist, NULL)
PHP_FE(dbmopen, NULL) PHP_FE(dbmopen, NULL)
@ -1165,6 +1225,7 @@ function_entry dbm_functions[] = {
PHP_FE(dbmnextkey, NULL) PHP_FE(dbmnextkey, NULL)
{NULL,NULL,NULL} {NULL,NULL,NULL}
}; };
/* }}} */
zend_module_entry dbm_module_entry = { zend_module_entry dbm_module_entry = {
"db", dbm_functions, PHP_MINIT(db), PHP_MSHUTDOWN(db), PHP_RINIT(db), NULL, PHP_MINFO(db), STANDARD_MODULE_PROPERTIES "db", dbm_functions, PHP_MINIT(db), PHP_MSHUTDOWN(db), PHP_RINIT(db), NULL, PHP_MINFO(db), STANDARD_MODULE_PROPERTIES
@ -1181,4 +1242,5 @@ ZEND_GET_MODULE(dbm)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -47,6 +47,8 @@
#include "php_db2.h" #include "php_db2.h"
#include "php_db3.h" #include "php_db3.h"
/* {{{ dba_functions[]
*/
function_entry dba_functions[] = { function_entry dba_functions[] = {
PHP_FE(dba_open, NULL) PHP_FE(dba_open, NULL)
PHP_FE(dba_popen, NULL) PHP_FE(dba_popen, NULL)
@ -62,6 +64,7 @@ function_entry dba_functions[] = {
PHP_FE(dba_sync, NULL) PHP_FE(dba_sync, NULL)
{NULL,NULL,NULL} {NULL,NULL,NULL}
}; };
/* }}} */
static PHP_MINIT_FUNCTION(dba); static PHP_MINIT_FUNCTION(dba);
static PHP_MSHUTDOWN_FUNCTION(dba); static PHP_MSHUTDOWN_FUNCTION(dba);
@ -179,9 +182,8 @@ static int le_pdb;
static HashTable ht_keys; static HashTable ht_keys;
/* }}} */ /* }}} */
/* {{{ helper routines */ /* {{{ dba_close
/* {{{ dba_close */ */
static void dba_close(dba_info *info) static void dba_close(dba_info *info)
{ {
if(info->hnd) info->hnd->close(info); if(info->hnd) info->hnd->close(info);
@ -190,12 +192,17 @@ static void dba_close(dba_info *info)
} }
/* }}} */ /* }}} */
/* {{{ dba_close_rsrc
*/
static void dba_close_rsrc(zend_rsrc_list_entry *rsrc) static void dba_close_rsrc(zend_rsrc_list_entry *rsrc)
{ {
dba_info *info = (dba_info *)rsrc->ptr; dba_info *info = (dba_info *)rsrc->ptr;
dba_close(info); dba_close(info);
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
static PHP_MINIT_FUNCTION(dba) static PHP_MINIT_FUNCTION(dba)
{ {
zend_hash_init(&ht_keys, 0, NULL, NULL, 1); zend_hash_init(&ht_keys, 0, NULL, NULL, 1);
@ -203,15 +210,21 @@ static PHP_MINIT_FUNCTION(dba)
GLOBAL(le_pdb) = zend_register_list_destructors_ex(NULL, dba_close_rsrc, "dba persistent", module_number); GLOBAL(le_pdb) = zend_register_list_destructors_ex(NULL, dba_close_rsrc, "dba persistent", module_number);
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
static PHP_MSHUTDOWN_FUNCTION(dba) static PHP_MSHUTDOWN_FUNCTION(dba)
{ {
zend_hash_destroy(&ht_keys); zend_hash_destroy(&ht_keys);
return SUCCESS; return SUCCESS;
} }
/* }}} */
#include "ext/standard/php_smart_str.h" #include "ext/standard/php_smart_str.h"
/* {{{ PHP_MINFO_FUNCTION
*/
static PHP_MINFO_FUNCTION(dba) static PHP_MINFO_FUNCTION(dba)
{ {
dba_handler *hptr; dba_handler *hptr;
@ -233,8 +246,10 @@ static PHP_MINFO_FUNCTION(dba)
} }
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ php_dba_update
*/
static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
{ {
DBA_ID_PARS; DBA_ID_PARS;
@ -253,9 +268,12 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
RETURN_TRUE; RETURN_TRUE;
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */
#define FREENOW if(args) efree(args); if(key) efree(key) #define FREENOW if(args) efree(args); if(key) efree(key)
/* {{{ php_dba_open
*/
static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{ {
pval ***args = (pval ***) NULL; pval ***args = (pval ***) NULL;
@ -355,9 +373,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
FREENOW; FREENOW;
RETURN_LONG(listid); RETURN_LONG(listid);
} }
/* }}} */
#undef FREENOW #undef FREENOW
/* }}} */
/* }}} */
/* {{{ proto int dba_popen(string path, string mode, string handlername [, string ...]) /* {{{ proto int dba_popen(string path, string mode, string handlername [, string ...])
Opens path using the specified handler in mode persistently */ Opens path using the specified handler in mode persistently */
@ -501,3 +518,11 @@ PHP_FUNCTION(dba_sync)
/* }}} */ /* }}} */
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -218,3 +218,11 @@ DBA_SYNC_FUNC(cdb)
} }
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -199,3 +199,11 @@ DBA_SYNC_FUNC(db2)
} }
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -206,3 +206,11 @@ DBA_SYNC_FUNC(db3)
} }
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -184,3 +184,11 @@ DBA_SYNC_FUNC(dbm)
} }
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -187,3 +187,11 @@ DBA_SYNC_FUNC(gdbm)
return SUCCESS; return SUCCESS;
} }
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -164,3 +164,11 @@ DBA_SYNC_FUNC(ndbm)
return SUCCESS; return SUCCESS;
} }
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -16,6 +16,8 @@
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
/* $Id$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@ -731,6 +733,8 @@ PHP_FUNCTION(dbase_create) {
} }
/* }}} */ /* }}} */
/* {{{ dbase_functions[]
*/
function_entry dbase_functions[] = { function_entry dbase_functions[] = {
PHP_FE(dbase_open, NULL) PHP_FE(dbase_open, NULL)
PHP_FE(dbase_create, NULL) PHP_FE(dbase_create, NULL)
@ -745,6 +749,7 @@ function_entry dbase_functions[] = {
PHP_FE(dbase_pack, NULL) PHP_FE(dbase_pack, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
zend_module_entry dbase_module_entry = { zend_module_entry dbase_module_entry = {
"dbase", dbase_functions, PHP_MINIT(dbase), PHP_MSHUTDOWN(dbase), NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES "dbase", dbase_functions, PHP_MINIT(dbase), PHP_MSHUTDOWN(dbase), NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES
@ -768,9 +773,11 @@ BOOL WINAPI DllMain(HANDLE hModule,
#endif #endif
#endif #endif
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -609,7 +609,6 @@ PHP_FUNCTION(spliti)
/* }}} */ /* }}} */
/* {{{ proto string sql_regcase(string string) /* {{{ proto string sql_regcase(string string)
Make regular expression for case insensitive match */ Make regular expression for case insensitive match */
PHPAPI PHP_FUNCTION(sql_regcase) PHPAPI PHP_FUNCTION(sql_regcase)
@ -646,11 +645,10 @@ PHPAPI PHP_FUNCTION(sql_regcase)
} }
/* }}} */ /* }}} */
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -57,7 +57,8 @@ typedef unsigned char uchar;
#define FALSE 0 #define FALSE 0
#endif #endif
/*
/* {{{ structs
This structure stores Exif header image elements in a simple manner This structure stores Exif header image elements in a simple manner
Used to store camera data as extracted from the various ways that it can be Used to store camera data as extracted from the various ways that it can be
stored in a nexif header stored in a nexif header
@ -108,17 +109,23 @@ typedef struct {
int Type; int Type;
unsigned Size; unsigned Size;
} Section_t; } Section_t;
/* }}} */
#define EXIT_FAILURE 1 #define EXIT_FAILURE 1
#define EXIT_SUCCESS 0 #define EXIT_SUCCESS 0
/* {{{ exif_functions[]
*/
function_entry exif_functions[] = { function_entry exif_functions[] = {
PHP_FE(read_exif_data, NULL) PHP_FE(read_exif_data, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
PHP_MINFO_FUNCTION(exif); PHP_MINFO_FUNCTION(exif);
/* {{{ exif_module_entry
*/
zend_module_entry exif_module_entry = { zend_module_entry exif_module_entry = {
"exif", "exif",
exif_functions, exif_functions,
@ -127,18 +134,22 @@ zend_module_entry exif_module_entry = {
PHP_MINFO(exif), PHP_MINFO(exif),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_EXIF #ifdef COMPILE_DL_EXIF
ZEND_GET_MODULE(exif) ZEND_GET_MODULE(exif)
#endif #endif
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(exif) { PHP_MINFO_FUNCTION(exif) {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "EXIF Support", "enabled" ); php_info_print_table_row(2, "EXIF Support", "enabled" );
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* /* {{{ Markers
JPEG markers consist of one or more 0xFF bytes, followed by a marker JPEG markers consist of one or more 0xFF bytes, followed by a marker
code byte (which is not an FF). Here are the marker codes of interest code byte (which is not an FF). Here are the marker codes of interest
in this program. (See jdmarker.c for a more complete list.) in this program. (See jdmarker.c for a more complete list.)
@ -166,16 +177,18 @@ PHP_MINFO_FUNCTION(exif) {
#define PSEUDO_IMAGE_MARKER 0x123; /* Extra value. */ #define PSEUDO_IMAGE_MARKER 0x123; /* Extra value. */
/* /* }}} */
/* {{{ Get16m
Get 16 bits motorola order (always) for jpeg header stuff. Get 16 bits motorola order (always) for jpeg header stuff.
*/ */
static int Get16m(void *Short) static int Get16m(void *Short)
{ {
return (((uchar *)Short)[0] << 8) | ((uchar *)Short)[1]; return (((uchar *)Short)[0] << 8) | ((uchar *)Short)[1];
} }
/* }}} */
/* {{{ process_COM
/*
Process a COM marker. Process a COM marker.
We want to print out the marker contents as legible text; We want to print out the marker contents as legible text;
we must guard against random junk and varying newline representations. we must guard against random junk and varying newline representations.
@ -213,9 +226,10 @@ static void process_COM (ImageInfoType *ImageInfo, uchar *Data, int length)
strcpy(ImageInfo->Comments,Comment); strcpy(ImageInfo->Comments,Comment);
} }
/* }}} */
/* Process a SOFn marker. This is useful for the image dimensions */ /* {{{ process_SOFn
* Process a SOFn marker. This is useful for the image dimensions */
static void process_SOFn (ImageInfoType *ImageInfo, uchar *Data, int marker) static void process_SOFn (ImageInfoType *ImageInfo, uchar *Data, int marker)
{ {
int data_precision, num_components; int data_precision, num_components;
@ -249,8 +263,9 @@ static void process_SOFn (ImageInfoType *ImageInfo, uchar *Data, int marker)
default: process = "Unknown"; break; default: process = "Unknown"; break;
} }
} }
/* }}} */
/* /* {{{ format description defines
Describes format descriptor Describes format descriptor
*/ */
static int ExifBytesPerFormat[] = {0,1,1,2,4,8,1,1,2,4,8,4,8}; static int ExifBytesPerFormat[] = {0,1,1,2,4,8,1,1,2,4,8,4,8};
@ -318,7 +333,10 @@ static int ExifBytesPerFormat[] = {0,1,1,2,4,8,1,1,2,4,8,4,8};
#define TAG_FOCALPLANEXRES 0xa20E #define TAG_FOCALPLANEXRES 0xa20E
#define TAG_FOCALPLANEUNITS 0xa210 #define TAG_FOCALPLANEUNITS 0xa210
#define TAG_IMAGEWIDTH 0xA002 #define TAG_IMAGEWIDTH 0xA002
/* }}} */
/* {{{ TabTable[]
*/
static const struct { static const struct {
unsigned short Tag; unsigned short Tag;
char *Desc; char *Desc;
@ -408,10 +426,10 @@ static const struct {
{ 0xA301, "SceneType"}, { 0xA301, "SceneType"},
{ 0, NULL} { 0, NULL}
} ; } ;
/* }}} */
/* {{{ Get16u
* Convert a 16 bit unsigned value from file's native byte order */
/* Convert a 16 bit unsigned value from file's native byte order */
static int Get16u(void *Short, int MotorolaOrder) static int Get16u(void *Short, int MotorolaOrder)
{ {
if (MotorolaOrder) { if (MotorolaOrder) {
@ -420,8 +438,10 @@ static int Get16u(void *Short, int MotorolaOrder)
return (((uchar *)Short)[1] << 8) | ((uchar *)Short)[0]; return (((uchar *)Short)[1] << 8) | ((uchar *)Short)[0];
} }
} }
/* }}} */
/* Convert a 32 bit signed value from file's native byte order */ /* {{{ Get32s
* Convert a 32 bit signed value from file's native byte order */
static int Get32s(void *Long, int MotorolaOrder) static int Get32s(void *Long, int MotorolaOrder)
{ {
if (MotorolaOrder) { if (MotorolaOrder) {
@ -432,14 +452,18 @@ static int Get32s(void *Long, int MotorolaOrder)
| (((uchar *)Long)[1] << 8 ) | (((uchar *)Long)[0] << 0 ); | (((uchar *)Long)[1] << 8 ) | (((uchar *)Long)[0] << 0 );
} }
} }
/* }}} */
/* Convert a 32 bit unsigned value from file's native byte order */ /* {{{ Get32u
* Convert a 32 bit unsigned value from file's native byte order */
static unsigned Get32u(void *Long, int MotorolaOrder) static unsigned Get32u(void *Long, int MotorolaOrder)
{ {
return (unsigned)Get32s(Long, MotorolaOrder) & 0xffffffff; return (unsigned)Get32s(Long, MotorolaOrder) & 0xffffffff;
} }
/* }}} */
/* Evaluate number, be it int, rational, or float from directory. */ /* {{{ ConvertAnyFormat
* Evaluate number, be it int, rational, or float from directory. */
static double ConvertAnyFormat(void *ValuePtr, int Format, int MotorolaOrder) static double ConvertAnyFormat(void *ValuePtr, int Format, int MotorolaOrder)
{ {
double Value; double Value;
@ -475,8 +499,10 @@ static double ConvertAnyFormat(void *ValuePtr, int Format, int MotorolaOrder)
} }
return Value; return Value;
} }
/* }}} */
/* Grab the thumbnail - by Matt Bonneau */ /* {{{ ExtractThumbnail
* Grab the thumbnail - by Matt Bonneau */
static void ExtractThumbnail(ImageInfoType *ImageInfo, char *OffsetBase, unsigned ExifLength) { static void ExtractThumbnail(ImageInfoType *ImageInfo, char *OffsetBase, unsigned ExifLength) {
/* according to exif2.1, the thumbnail is not supposed to be greater than 64K */ /* according to exif2.1, the thumbnail is not supposed to be greater than 64K */
if (ImageInfo->ThumbnailSize > 65536) { if (ImageInfo->ThumbnailSize > 65536) {
@ -495,8 +521,10 @@ static void ExtractThumbnail(ImageInfoType *ImageInfo, char *OffsetBase, unsigne
} }
} }
} }
/* }}} */
/* Process one of the nested EXIF directories. */ /* {{{ ProcessExifDir
* Process one of the nested EXIF directories. */
static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *OffsetBase, unsigned ExifLength, char *LastExifRefd) static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *OffsetBase, unsigned ExifLength, char *LastExifRefd)
{ {
int de; int de;
@ -767,8 +795,9 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse
ProcessExifDir(ImageInfo, OffsetBase + NextDirOffset, OffsetBase, ExifLength, LastExifRefd); ProcessExifDir(ImageInfo, OffsetBase + NextDirOffset, OffsetBase, ExifLength, LastExifRefd);
} }
} }
/* }}} */
/* /* {{{ process_EXIF
Process an EXIF marker Process an EXIF marker
Describes all the drivel that most digital cameras include... Describes all the drivel that most digital cameras include...
*/ */
@ -821,8 +850,10 @@ static void process_EXIF (ImageInfoType *ImageInfo, char *CharBuf, unsigned int
ImageInfo->CCDWidth = (float)(ImageInfo->ExifImageWidth * ImageInfo->FocalplaneUnits / ImageInfo->FocalplaneXRes); ImageInfo->CCDWidth = (float)(ImageInfo->ExifImageWidth * ImageInfo->FocalplaneUnits / ImageInfo->FocalplaneXRes);
} }
} }
/* }}} */
/* Parse the marker stream until SOS or EOI is seen; */
/* {{{ scan_JPEG_header
* Parse the marker stream until SOS or EOI is seen; */
static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t *Sections, int *SectionsRead, int ReadAll, char *LastExifRefd) static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t *Sections, int *SectionsRead, int ReadAll, char *LastExifRefd)
{ {
int a; int a;
@ -953,8 +984,9 @@ static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t *
} }
return TRUE; return TRUE;
} }
/* }}} */
/* /* {{{ DiscardData
Discard read data. Discard read data.
*/ */
void DiscardData(Section_t *Sections, int *SectionsRead) void DiscardData(Section_t *Sections, int *SectionsRead)
@ -965,8 +997,9 @@ void DiscardData(Section_t *Sections, int *SectionsRead)
} }
*SectionsRead = 0; *SectionsRead = 0;
} }
/* }}} */
/* /* {{{ ReadJpegFile
Read image data. Read image data.
*/ */
int ReadJpegFile(ImageInfoType *ImageInfo, Section_t *Sections, int ReadJpegFile(ImageInfoType *ImageInfo, Section_t *Sections,
@ -1024,7 +1057,10 @@ int ReadJpegFile(ImageInfoType *ImageInfo, Section_t *Sections,
return ret; return ret;
} }
/* }}} */
/* {{{ php_read_jpeg_exif
*/
int php_read_jpeg_exif(ImageInfoType *ImageInfo, char *FileName, int ReadAll) int php_read_jpeg_exif(ImageInfoType *ImageInfo, char *FileName, int ReadAll)
{ {
Section_t Sections[20]; Section_t Sections[20];
@ -1057,6 +1093,7 @@ int php_read_jpeg_exif(ImageInfoType *ImageInfo, char *FileName, int ReadAll)
} }
return(ret); return(ret);
} }
/* }}} */
/* {{{ proto string read_exif_data(string filename) /* {{{ proto string read_exif_data(string filename)
Reads the EXIF header data from a JPEG file */ Reads the EXIF header data from a JPEG file */
@ -1181,6 +1218,7 @@ PHP_FUNCTION(read_exif_data) {
add_assoc_string(return_value,"CameraId",ImageInfo.CameraId,1); add_assoc_string(return_value,"CameraId",ImageInfo.CameraId,1);
} }
} }
/* }}} */
#endif #endif

View file

@ -42,6 +42,8 @@ static int le_fdf;
SAPI_POST_HANDLER_FUNC(fdf_post_handler); SAPI_POST_HANDLER_FUNC(fdf_post_handler);
/* {{{ fdf_functions[]
*/
function_entry fdf_functions[] = { function_entry fdf_functions[] = {
PHP_FE(fdf_open, NULL) PHP_FE(fdf_open, NULL)
PHP_FE(fdf_create, NULL) PHP_FE(fdf_create, NULL)
@ -62,6 +64,7 @@ function_entry fdf_functions[] = {
PHP_FE(fdf_set_javascript_action, NULL) PHP_FE(fdf_set_javascript_action, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
zend_module_entry fdf_module_entry = { zend_module_entry fdf_module_entry = {
"fdf", "fdf",
@ -95,7 +98,8 @@ static sapi_post_entry php_fdf_post_entry = {
fdf_post_handler fdf_post_handler
}; };
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(fdf) PHP_MINIT_FUNCTION(fdf)
{ {
FDFErc err; FDFErc err;
@ -140,7 +144,10 @@ PHP_MINIT_FUNCTION(fdf)
if((err = FDFInitialize()) == FDFErcOK) return SUCCESS; if((err = FDFInitialize()) == FDFErcOK) return SUCCESS;
return FAILURE; return FAILURE;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(fdf) PHP_MINFO_FUNCTION(fdf)
{ {
/* need to use a PHPAPI function here because it is external module in windows */ /* need to use a PHPAPI function here because it is external module in windows */
@ -149,7 +156,10 @@ PHP_MINFO_FUNCTION(fdf)
php_info_print_table_row(2, "FdfTk Version", FDFGetVersion() ); php_info_print_table_row(2, "FdfTk Version", FDFGetVersion() );
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(fdf) PHP_MSHUTDOWN_FUNCTION(fdf)
{ {
FDFErc err; FDFErc err;
@ -163,7 +173,7 @@ PHP_MSHUTDOWN_FUNCTION(fdf)
if((err = FDFFinalize()) == FDFErcOK) return SUCCESS; if((err = FDFFinalize()) == FDFErcOK) return SUCCESS;
return FAILURE; return FAILURE;
} }
/* }}} */
/* {{{ proto int fdf_open(string filename) /* {{{ proto int fdf_open(string filename)
Opens a new FDF document */ Opens a new FDF document */
@ -190,7 +200,6 @@ PHP_FUNCTION(fdf_open)
} }
/* }}} */ /* }}} */
/* {{{ proto int fdf_create(void) /* {{{ proto int fdf_create(void)
Creates a new FDF document */ Creates a new FDF document */
PHP_FUNCTION(fdf_create) PHP_FUNCTION(fdf_create)
@ -209,7 +218,6 @@ PHP_FUNCTION(fdf_create)
} }
/* }}} */ /* }}} */
/* {{{ proto bool fdf_close(int fdfdoc) /* {{{ proto bool fdf_close(int fdfdoc)
Closes the FDF document */ Closes the FDF document */
PHP_FUNCTION(fdf_close) PHP_FUNCTION(fdf_close)
@ -226,7 +234,6 @@ PHP_FUNCTION(fdf_close)
} }
/* }}} */ /* }}} */
/* {{{ proto string fdf_get_value(int fdfdoc, string fieldname) /* {{{ proto string fdf_get_value(int fdfdoc, string fieldname)
Gets the value of a field as string */ Gets the value of a field as string */
PHP_FUNCTION(fdf_get_value) PHP_FUNCTION(fdf_get_value)
@ -263,7 +270,6 @@ PHP_FUNCTION(fdf_get_value)
} }
/* }}} */ /* }}} */
/* {{{ proto bool fdf_set_value(int fdfdoc, string fieldname, string value, int isname) /* {{{ proto bool fdf_set_value(int fdfdoc, string fieldname, string value, int isname)
Sets the value of a field */ Sets the value of a field */
PHP_FUNCTION(fdf_set_value) PHP_FUNCTION(fdf_set_value)
@ -291,7 +297,6 @@ PHP_FUNCTION(fdf_set_value)
} }
/* }}} */ /* }}} */
/* {{{ proto string fdf_next_field_name(int fdfdoc [, string fieldname]) /* {{{ proto string fdf_next_field_name(int fdfdoc [, string fieldname])
Gets the name of the next field name or the first field name */ Gets the name of the next field name or the first field name */
PHP_FUNCTION(fdf_next_field_name) PHP_FUNCTION(fdf_next_field_name)
@ -333,7 +338,6 @@ PHP_FUNCTION(fdf_next_field_name)
} }
/* }}} */ /* }}} */
/* {{{ proto bool fdf_set_ap(int fdfdoc, string fieldname, int face, string filename, int pagenr) /* {{{ proto bool fdf_set_ap(int fdfdoc, string fieldname, int face, string filename, int pagenr)
Sets the appearence of a field */ Sets the appearence of a field */
PHP_FUNCTION(fdf_set_ap) PHP_FUNCTION(fdf_set_ap)
@ -383,7 +387,6 @@ PHP_FUNCTION(fdf_set_ap)
} }
/* }}} */ /* }}} */
/* {{{ proto bool fdf_set_status(int fdfdoc, string status) /* {{{ proto bool fdf_set_status(int fdfdoc, string status)
Sets the value of /Status key */ Sets the value of /Status key */
PHP_FUNCTION(fdf_set_status) PHP_FUNCTION(fdf_set_status)
@ -410,7 +413,6 @@ PHP_FUNCTION(fdf_set_status)
} }
/* }}} */ /* }}} */
/* {{{ proto string fdf_get_status(int fdfdoc) /* {{{ proto string fdf_get_status(int fdfdoc)
Gets the value of /Status key */ Gets the value of /Status key */
PHP_FUNCTION(fdf_get_status) PHP_FUNCTION(fdf_get_status)
@ -446,7 +448,6 @@ PHP_FUNCTION(fdf_get_status)
} }
/* }}} */ /* }}} */
/* {{{ proto bool fdf_set_file(int fdfdoc, string filename) /* {{{ proto bool fdf_set_file(int fdfdoc, string filename)
Sets the value of /F key */ Sets the value of /F key */
PHP_FUNCTION(fdf_set_file) PHP_FUNCTION(fdf_set_file)
@ -473,7 +474,6 @@ PHP_FUNCTION(fdf_set_file)
} }
/* }}} */ /* }}} */
/* {{{ proto string fdf_get_file(int fdfdoc) /* {{{ proto string fdf_get_file(int fdfdoc)
Gets the value of /F key */ Gets the value of /F key */
PHP_FUNCTION(fdf_get_file) PHP_FUNCTION(fdf_get_file)
@ -509,7 +509,6 @@ PHP_FUNCTION(fdf_get_file)
} }
/* }}} */ /* }}} */
/* {{{ proto bool fdf_save(int fdfdoc, string filename) /* {{{ proto bool fdf_save(int fdfdoc, string filename)
Writes out the FDF file */ Writes out the FDF file */
PHP_FUNCTION(fdf_save) PHP_FUNCTION(fdf_save)
@ -536,7 +535,6 @@ PHP_FUNCTION(fdf_save)
} }
/* }}} */ /* }}} */
/* {{{ proto bool fdf_add_template(int fdfdoc, int newpage, string filename, string template, int rename) /* {{{ proto bool fdf_add_template(int fdfdoc, int newpage, string filename, string template, int rename)
Adds a template into the FDF document */ Adds a template into the FDF document */
PHP_FUNCTION(fdf_add_template) PHP_FUNCTION(fdf_add_template)
@ -576,7 +574,6 @@ PHP_FUNCTION(fdf_add_template)
} }
/* }}} */ /* }}} */
/* {{{ proto bool fdf_set_flags(int fdfdoc, string fieldname, int whichflags, int newflags) /* {{{ proto bool fdf_set_flags(int fdfdoc, string fieldname, int whichflags, int newflags)
Sets flags for a field in the FDF document */ Sets flags for a field in the FDF document */
PHP_FUNCTION(fdf_set_flags) PHP_FUNCTION(fdf_set_flags)
@ -605,7 +602,6 @@ PHP_FUNCTION(fdf_set_flags)
} }
/* }}} */ /* }}} */
/* {{{ proto bool fdf_set_opt(int fdfdoc, string fieldname, int element, string value, string name) /* {{{ proto bool fdf_set_opt(int fdfdoc, string fieldname, int element, string value, string name)
Sets a value in the opt array for a field */ Sets a value in the opt array for a field */
PHP_FUNCTION(fdf_set_opt) PHP_FUNCTION(fdf_set_opt)
@ -634,7 +630,6 @@ PHP_FUNCTION(fdf_set_opt)
} }
/* }}} */ /* }}} */
/* {{{ proto bool fdf_set_submit_form_action(int fdfdoc, string fieldname, int whichtrigger, string url, int flags) /* {{{ proto bool fdf_set_submit_form_action(int fdfdoc, string fieldname, int whichtrigger, string url, int flags)
Sets the submit form action for a field */ Sets the submit form action for a field */
PHP_FUNCTION(fdf_set_submit_form_action) PHP_FUNCTION(fdf_set_submit_form_action)
@ -663,7 +658,6 @@ PHP_FUNCTION(fdf_set_submit_form_action)
} }
/* }}} */ /* }}} */
/* {{{ proto bool fdf_set_javascript_action(int fdfdoc, string fieldname, int whichtrigger, string script) /* {{{ proto bool fdf_set_javascript_action(int fdfdoc, string fieldname, int whichtrigger, string script)
Sets the javascript action for a field */ Sets the javascript action for a field */
PHP_FUNCTION(fdf_set_javascript_action) PHP_FUNCTION(fdf_set_javascript_action)
@ -691,7 +685,8 @@ PHP_FUNCTION(fdf_set_javascript_action)
} }
/* }}} */ /* }}} */
/* SAPI post handler for FDF forms */ /* {{{ SAPI_POST_HANDLER_FUNC
* SAPI post handler for FDF forms */
SAPI_POST_HANDLER_FUNC(fdf_post_handler) SAPI_POST_HANDLER_FUNC(fdf_post_handler)
{ {
FILE *fp; FILE *fp;
@ -760,6 +755,7 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler)
if(lastfieldname) efree(lastfieldname); if(lastfieldname) efree(lastfieldname);
} }
} }
/* }}} */
#endif #endif
@ -768,4 +764,5 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -78,7 +78,8 @@ static signed int fp_keysize = -1; /* Size of key records */
static FP_FIELD *fp_fieldlist = NULL; /* List of fields */ static FP_FIELD *fp_fieldlist = NULL; /* List of fields */
#endif #endif
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(filepro) PHP_MINIT_FUNCTION(filepro)
{ {
#ifdef THREAD_SAFE #ifdef THREAD_SAFE
@ -104,7 +105,10 @@ PHP_MINIT_FUNCTION(filepro)
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(filepro) PHP_MSHUTDOWN_FUNCTION(filepro)
{ {
#ifdef THREAD_SAFE #ifdef THREAD_SAFE
@ -125,7 +129,7 @@ PHP_MSHUTDOWN_FUNCTION(filepro)
#endif #endif
return SUCCESS; return SUCCESS;
} }
/* }}} */
function_entry filepro_functions[] = { function_entry filepro_functions[] = {
PHP_FE(filepro, NULL) PHP_FE(filepro, NULL)
@ -568,4 +572,5 @@ PHP_FUNCTION(filepro_retrieve)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -13,10 +13,11 @@
| license@php.net so we can mail you a copy immediately. | | license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
| Authors: | | Authors: |
| |
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
/* $Id$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@ -41,7 +42,7 @@ ZEND_DECLARE_MODULE_GLOBALS(fribidi)
/* Every user visible function must have an entry in fribidi_functions[]. /* Every user visible function must have an entry in fribidi_functions[].
*/ */
function_entry fribidi_functions[] = { function_entry fribidi_functions[] = {
ZEND_FE(fribidi_log2vis, NULL) PHP_FE(fribidi_log2vis, NULL)
{NULL, NULL, NULL} /* Must be the last line in fribidi_functions[] */ {NULL, NULL, NULL} /* Must be the last line in fribidi_functions[] */
}; };
@ -50,8 +51,8 @@ zend_module_entry fribidi_module_entry = {
fribidi_functions, fribidi_functions,
PHP_MINIT(fribidi), PHP_MINIT(fribidi),
PHP_MSHUTDOWN(fribidi), PHP_MSHUTDOWN(fribidi),
PHP_RINIT(fribidi), /* Replace with NULL if there's nothing to do at request start */ NULL,
PHP_RSHUTDOWN(fribidi), /* Replace with NULL if there's nothing to do at request end */ NULL,
PHP_MINFO(fribidi), PHP_MINFO(fribidi),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
@ -60,17 +61,10 @@ zend_module_entry fribidi_module_entry = {
ZEND_GET_MODULE(fribidi) ZEND_GET_MODULE(fribidi)
#endif #endif
/* Remove comments and fill if you need to have entries in php.ini /* {{{ PHP_MINIT_FUNCTION
PHP_INI_BEGIN() */
PHP_INI_END()
*/
PHP_MINIT_FUNCTION(fribidi) PHP_MINIT_FUNCTION(fribidi)
{ {
/* Remove comments if you have entries in php.ini
REGISTER_INI_ENTRIES();
*/
REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_UTF8",FRIBIDI_CHARSET_UTF8, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_UTF8",FRIBIDI_CHARSET_UTF8, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_6",FRIBIDI_CHARSET_8859_6, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_6",FRIBIDI_CHARSET_8859_6, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_8",FRIBIDI_CHARSET_8859_8, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_8",FRIBIDI_CHARSET_8859_8, CONST_CS | CONST_PERSISTENT);
@ -80,38 +74,25 @@ PHP_MINIT_FUNCTION(fribidi)
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(fribidi) PHP_MSHUTDOWN_FUNCTION(fribidi)
{
/* Remove comments if you have entries in php.ini
UNREGISTER_INI_ENTRIES();
*/
return SUCCESS;
}
/* Remove if there's nothing to do at request start */
PHP_RINIT_FUNCTION(fribidi)
{
return SUCCESS;
}
/* Remove if there's nothing to do at request end */
PHP_RSHUTDOWN_FUNCTION(fribidi)
{ {
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(fribidi) PHP_MINFO_FUNCTION(fribidi)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_header(2, "fribidi support", "enabled"); php_info_print_table_header(2, "fribidi support", "enabled");
php_info_print_table_end(); php_info_print_table_end();
/* Remove comments if you have entries in php.ini
DISPLAY_INI_ENTRIES();
*/
} }
/* }}} */
/*--------------------------------------------------------------*/ /*--------------------------------------------------------------*/
/* Name: fribidi_log2vis */ /* Name: fribidi_log2vis */
@ -138,7 +119,7 @@ PHP_MINFO_FUNCTION(fribidi)
/* {{{ proto string fribidi_log2vis(string str, string direction, int charset) /* {{{ proto string fribidi_log2vis(string str, string direction, int charset)
Convert a logical string to a visual one */ Convert a logical string to a visual one */
ZEND_FUNCTION(fribidi_log2vis) PHP_FUNCTION(fribidi_log2vis)
{ {
zval **parameter1,**parameter2, **parameter3; zval **parameter1,**parameter2, **parameter3;
@ -264,10 +245,10 @@ ZEND_FUNCTION(fribidi_log2vis)
#endif /* HAVE_FRIBIDI */ #endif /* HAVE_FRIBIDI */
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -23,8 +23,7 @@
| If you did not, or have any questions about PHP licensing, please | | If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. | | contact core@php.net. |
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
| Authors: | | Authors: Andrew Skalski <askalski@chek.com> |
| Andrew Skalski <askalski@chek.com> |
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
@ -108,7 +107,8 @@ union ipbox {
unsigned char c[8]; unsigned char c[8];
}; };
/* {{{ ftp_open
*/
ftpbuf_t* ftpbuf_t*
ftp_open(const char *host, short port) ftp_open(const char *host, short port)
{ {
@ -172,8 +172,10 @@ bail:
free(ftp); free(ftp);
return NULL; return NULL;
} }
/* }}} */
/* {{{ ftp_close
*/
ftpbuf_t* ftpbuf_t*
ftp_close(ftpbuf_t *ftp) ftp_close(ftpbuf_t *ftp)
{ {
@ -185,8 +187,10 @@ ftp_close(ftpbuf_t *ftp)
free(ftp); free(ftp);
return NULL; return NULL;
} }
/* }}} */
/* {{{ ftp_gc
*/
void void
ftp_gc(ftpbuf_t *ftp) ftp_gc(ftpbuf_t *ftp)
{ {
@ -198,8 +202,10 @@ ftp_gc(ftpbuf_t *ftp)
free(ftp->syst); free(ftp->syst);
ftp->syst = NULL; ftp->syst = NULL;
} }
/* }}} */
/* {{{ ftp_quit
*/
int int
ftp_quit(ftpbuf_t *ftp) ftp_quit(ftpbuf_t *ftp)
{ {
@ -216,8 +222,10 @@ ftp_quit(ftpbuf_t *ftp)
return 1; return 1;
} }
/* }}} */
/* {{{ ftp_login
*/
int int
ftp_login(ftpbuf_t *ftp, const char *user, const char *pass) ftp_login(ftpbuf_t *ftp, const char *user, const char *pass)
{ {
@ -238,8 +246,10 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass)
return 0; return 0;
return (ftp->resp == 230); return (ftp->resp == 230);
} }
/* }}} */
/* {{{ ftp_reinit
*/
int int
ftp_reinit(ftpbuf_t *ftp) ftp_reinit(ftpbuf_t *ftp)
{ {
@ -255,8 +265,10 @@ ftp_reinit(ftpbuf_t *ftp)
return 1; return 1;
} }
/* }}} */
/* {{{ ftp_syst
*/
const char* const char*
ftp_syst(ftpbuf_t *ftp) ftp_syst(ftpbuf_t *ftp)
{ {
@ -283,8 +295,10 @@ ftp_syst(ftpbuf_t *ftp)
return ftp->syst; return ftp->syst;
} }
/* }}} */
/* {{{ ftp_pwd
*/
const char* const char*
ftp_pwd(ftpbuf_t *ftp) ftp_pwd(ftpbuf_t *ftp)
{ {
@ -312,8 +326,10 @@ ftp_pwd(ftpbuf_t *ftp)
return ftp->pwd; return ftp->pwd;
} }
/* }}} */
/* {{{ ftp_exec
*/
int int
ftp_exec(ftpbuf_t *ftp, const char *cmd) ftp_exec(ftpbuf_t *ftp, const char *cmd)
{ {
@ -326,8 +342,10 @@ ftp_exec(ftpbuf_t *ftp, const char *cmd)
return 1; return 1;
} }
/* }}} */
/* {{{ ftp_chdir
*/
int int
ftp_chdir(ftpbuf_t *ftp, const char *dir) ftp_chdir(ftpbuf_t *ftp, const char *dir)
{ {
@ -344,8 +362,10 @@ ftp_chdir(ftpbuf_t *ftp, const char *dir)
return 1; return 1;
} }
/* }}} */
/* {{{ ftp_cdup
*/
int int
ftp_cdup(ftpbuf_t *ftp) ftp_cdup(ftpbuf_t *ftp)
{ {
@ -362,8 +382,10 @@ ftp_cdup(ftpbuf_t *ftp)
return 1; return 1;
} }
/* }}} */
/* {{{ ftp_mkdir
*/
char* char*
ftp_mkdir(ftpbuf_t *ftp, const char *dir) ftp_mkdir(ftpbuf_t *ftp, const char *dir)
{ {
@ -390,8 +412,10 @@ ftp_mkdir(ftpbuf_t *ftp, const char *dir)
return mkd; return mkd;
} }
/* }}} */
/* {{{ ftp_rmdir
*/
int int
ftp_rmdir(ftpbuf_t *ftp, const char *dir) ftp_rmdir(ftpbuf_t *ftp, const char *dir)
{ {
@ -405,22 +429,28 @@ ftp_rmdir(ftpbuf_t *ftp, const char *dir)
return 1; return 1;
} }
/* }}} */
/* {{{ ftp_nlist
*/
char** char**
ftp_nlist(ftpbuf_t *ftp, const char *path) ftp_nlist(ftpbuf_t *ftp, const char *path)
{ {
return ftp_genlist(ftp, "NLST", path); return ftp_genlist(ftp, "NLST", path);
} }
/* }}} */
/* {{{ ftp_list
*/
char** char**
ftp_list(ftpbuf_t *ftp, const char *path) ftp_list(ftpbuf_t *ftp, const char *path)
{ {
return ftp_genlist(ftp, "LIST", path); return ftp_genlist(ftp, "LIST", path);
} }
/* }}} */
/* {{{ ftp_type
*/
int int
ftp_type(ftpbuf_t *ftp, ftptype_t type) ftp_type(ftpbuf_t *ftp, ftptype_t type)
{ {
@ -448,8 +478,10 @@ ftp_type(ftpbuf_t *ftp, ftptype_t type)
return 1; return 1;
} }
/* }}} */
/* {{{ ftp_pasv
*/
int int
ftp_pasv(ftpbuf_t *ftp, int pasv) ftp_pasv(ftpbuf_t *ftp, int pasv)
{ {
@ -492,8 +524,10 @@ ftp_pasv(ftpbuf_t *ftp, int pasv)
return 1; return 1;
} }
/* }}} */
/* {{{ ftp_get
*/
int int
ftp_get(ftpbuf_t *ftp, FILE *outfp, const char *path, ftptype_t type) ftp_get(ftpbuf_t *ftp, FILE *outfp, const char *path, ftptype_t type)
{ {
@ -554,8 +588,10 @@ bail:
data_close(data); data_close(data);
return 0; return 0;
} }
/* }}} */
/* {{{ ftp_put
*/
int int
ftp_put(ftpbuf_t *ftp, const char *path, FILE *infp, ftptype_t type) ftp_put(ftpbuf_t *ftp, const char *path, FILE *infp, ftptype_t type)
{ {
@ -617,8 +653,10 @@ bail:
data_close(data); data_close(data);
return 0; return 0;
} }
/* }}} */
/* {{{ ftp_size
*/
int int
ftp_size(ftpbuf_t *ftp, const char *path) ftp_size(ftpbuf_t *ftp, const char *path)
{ {
@ -632,8 +670,10 @@ ftp_size(ftpbuf_t *ftp, const char *path)
return atoi(ftp->inbuf); return atoi(ftp->inbuf);
} }
/* }}} */
/* {{{ ftp_mdtm
*/
time_t time_t
ftp_mdtm(ftpbuf_t *ftp, const char *path) ftp_mdtm(ftpbuf_t *ftp, const char *path)
{ {
@ -675,8 +715,10 @@ ftp_mdtm(ftpbuf_t *ftp, const char *path)
return stamp; return stamp;
} }
/* }}} */
/* {{{ ftp_delete
*/
int int
ftp_delete(ftpbuf_t *ftp, const char *path) ftp_delete(ftpbuf_t *ftp, const char *path)
{ {
@ -690,8 +732,10 @@ ftp_delete(ftpbuf_t *ftp, const char *path)
return 1; return 1;
} }
/* }}} */
/* {{{ ftp_rename
*/
int int
ftp_rename(ftpbuf_t *ftp, const char *src, const char *dest) ftp_rename(ftpbuf_t *ftp, const char *src, const char *dest)
{ {
@ -710,8 +754,10 @@ ftp_rename(ftpbuf_t *ftp, const char *src, const char *dest)
return 1; return 1;
} }
/* }}} */
/* {{{ ftp_site
*/
int int
ftp_site(ftpbuf_t *ftp, const char *cmd) ftp_site(ftpbuf_t *ftp, const char *cmd)
{ {
@ -725,9 +771,12 @@ ftp_site(ftpbuf_t *ftp, const char *cmd)
return 1; return 1;
} }
/* }}} */
/* static functions */ /* static functions */
/* {{{ ftp_putcmd
*/
int int
ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args) ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args)
{ {
@ -754,8 +803,10 @@ ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args)
return 1; return 1;
} }
/* }}} */
/* {{{ ftp_readline
*/
int int
ftp_readline(ftpbuf_t *ftp) ftp_readline(ftpbuf_t *ftp)
{ {
@ -802,8 +853,10 @@ ftp_readline(ftpbuf_t *ftp)
return 0; return 0;
} }
/* }}} */
/* {{{ ftp_getresp
*/
int int
ftp_getresp(ftpbuf_t *ftp) ftp_getresp(ftpbuf_t *ftp)
{ {
@ -844,8 +897,10 @@ ftp_getresp(ftpbuf_t *ftp)
return 1; return 1;
} }
/* }}} */
/* {{{ my_send
*/
int int
my_send(int s, void *buf, size_t len) my_send(int s, void *buf, size_t len)
{ {
@ -879,8 +934,10 @@ my_send(int s, void *buf, size_t len)
return len; return len;
} }
/* }}} */
/* {{{ my_recv
*/
int int
my_recv(int s, void *buf, size_t len) my_recv(int s, void *buf, size_t len)
{ {
@ -904,8 +961,10 @@ my_recv(int s, void *buf, size_t len)
return recv(s, buf, len, 0); return recv(s, buf, len, 0);
} }
/* }}} */
/* {{{ my_connect
*/
int int
my_connect(int s, const struct sockaddr *addr, int addrlen) my_connect(int s, const struct sockaddr *addr, int addrlen)
#ifndef PHP_WIN32 #ifndef PHP_WIN32
@ -957,7 +1016,10 @@ my_connect(int s, const struct sockaddr *addr, int addrlen)
return connect(s, addr, addrlen); return connect(s, addr, addrlen);
} }
#endif #endif
/* }}} */
/* {{{ my_accept
*/
int int
my_accept(int s, struct sockaddr *addr, int *addrlen) my_accept(int s, struct sockaddr *addr, int *addrlen)
{ {
@ -981,8 +1043,10 @@ my_accept(int s, struct sockaddr *addr, int *addrlen)
return accept(s, addr, addrlen); return accept(s, addr, addrlen);
} }
/* }}} */
/* {{{ ftp_getdata
*/
databuf_t* databuf_t*
ftp_getdata(ftpbuf_t *ftp) ftp_getdata(ftpbuf_t *ftp)
{ {
@ -1081,8 +1145,10 @@ bail:
free(data); free(data);
return NULL; return NULL;
} }
/* }}} */
/* {{{ data_accept
*/
databuf_t* databuf_t*
data_accept(databuf_t *data) data_accept(databuf_t *data)
{ {
@ -1104,8 +1170,10 @@ data_accept(databuf_t *data)
return data; return data;
} }
/* }}} */
/* {{{ data_close
*/
databuf_t* databuf_t*
data_close(databuf_t *data) data_close(databuf_t *data)
{ {
@ -1118,8 +1186,10 @@ data_close(databuf_t *data)
free(data); free(data);
return NULL; return NULL;
} }
/* }}} */
/* {{{ ftp_genlist
*/
char** char**
ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path) ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path)
{ {
@ -1219,5 +1289,14 @@ bail:
free(ret); free(ret);
return NULL; return NULL;
} }
/* }}} */
#endif /* HAVE_FTP */ #endif /* HAVE_FTP */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -101,6 +101,8 @@ static int _php_image_type ( char data[8] );
static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type); static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type);
static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold); static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold);
/* {{{ gd_functions[]
*/
function_entry gd_functions[] = { function_entry gd_functions[] = {
PHP_FE(imagearc, NULL) PHP_FE(imagearc, NULL)
PHP_FE(imagechar, NULL) PHP_FE(imagechar, NULL)
@ -196,6 +198,7 @@ function_entry gd_functions[] = {
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
zend_module_entry gd_module_entry = { zend_module_entry gd_module_entry = {
"gd", gd_functions, PHP_MINIT(gd), NULL, NULL, NULL, PHP_MINFO(gd), STANDARD_MODULE_PROPERTIES "gd", gd_functions, PHP_MINIT(gd), NULL, NULL, NULL, PHP_MINFO(gd), STANDARD_MODULE_PROPERTIES
@ -205,13 +208,16 @@ zend_module_entry gd_module_entry = {
ZEND_GET_MODULE(gd) ZEND_GET_MODULE(gd)
#endif #endif
/* {{{ php_free_gd_image
*/
static void php_free_gd_image(zend_rsrc_list_entry *rsrc) static void php_free_gd_image(zend_rsrc_list_entry *rsrc)
{ {
gdImageDestroy((gdImagePtr)rsrc->ptr); gdImageDestroy((gdImagePtr)rsrc->ptr);
} }
/* }}} */
/* {{{ php_free_gd_font
*/
static void php_free_gd_font(zend_rsrc_list_entry *rsrc) static void php_free_gd_font(zend_rsrc_list_entry *rsrc)
{ {
gdFontPtr fp = (gdFontPtr)rsrc->ptr; gdFontPtr fp = (gdFontPtr)rsrc->ptr;
@ -220,8 +226,10 @@ static void php_free_gd_font(zend_rsrc_list_entry *rsrc)
} }
efree(fp); efree(fp);
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(gd) PHP_MINIT_FUNCTION(gd)
{ {
le_gd = zend_register_list_destructors_ex(php_free_gd_image, NULL, "gd", module_number); le_gd = zend_register_list_destructors_ex(php_free_gd_image, NULL, "gd", module_number);
@ -256,7 +264,10 @@ PHP_MINIT_FUNCTION(gd)
#endif #endif
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(gd) PHP_MINFO_FUNCTION(gd)
{ {
php_info_print_table_start(); php_info_print_table_start();
@ -308,6 +319,7 @@ PHP_MINFO_FUNCTION(gd)
#endif #endif
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* Need this for cpdf. See also comment in file.c php3i_get_le_fp() */ /* Need this for cpdf. See also comment in file.c php3i_get_le_fp() */
PHP_GD_API int phpi_get_le_gd(void) PHP_GD_API int phpi_get_le_gd(void)
@ -317,6 +329,8 @@ PHP_GD_API int phpi_get_le_gd(void)
#ifndef HAVE_GDIMAGECOLORRESOLVE #ifndef HAVE_GDIMAGECOLORRESOLVE
/* {{{ gdImageColorResolve
*/
/********************************************************************/ /********************************************************************/
/* gdImageColorResolve is a replacement for the old fragment: */ /* gdImageColorResolve is a replacement for the old fragment: */
/* */ /* */
@ -366,6 +380,7 @@ gdImageColorResolve(gdImagePtr im, int r, int g, int b)
im->open [op] = 0; im->open [op] = 0;
return op; /* Return newly allocated color */ return op; /* Return newly allocated color */
} }
/* }}} */
#endif #endif
@ -508,7 +523,6 @@ PHP_FUNCTION(imagesetstyle)
} }
/* }}} */ /* }}} */
/* {{{ proto int imagecreatetruecolor(int x_size, int y_size) /* {{{ proto int imagecreatetruecolor(int x_size, int y_size)
Create a new true color image */ Create a new true color image */
PHP_FUNCTION(imagecreatetruecolor) PHP_FUNCTION(imagecreatetruecolor)
@ -886,7 +900,6 @@ PHP_FUNCTION(imagesetbrush)
} }
/* }}} */ /* }}} */
/* {{{ proto int imagecreate(int x_size, int y_size) /* {{{ proto int imagecreate(int x_size, int y_size)
Create a new image */ Create a new image */
PHP_FUNCTION(imagecreate) PHP_FUNCTION(imagecreate)
@ -929,7 +942,10 @@ PHP_FUNCTION(imagetypes)
#endif #endif
RETURN_LONG(ret); RETURN_LONG(ret);
} }
/* }}} */
/* {{{ _php_image_type
*/
static int _php_image_type (char data[8]) static int _php_image_type (char data[8])
{ {
#ifdef HAVE_LIBGD15 #ifdef HAVE_LIBGD15
@ -962,7 +978,10 @@ static int _php_image_type (char data[8])
return -1; return -1;
#endif #endif
} }
/* }}} */
/* {{{ _php_image_create_from_string
*/
gdImagePtr _php_image_create_from_string (zval **data, char *tn, gdImagePtr (*ioctx_func_p)()) gdImagePtr _php_image_create_from_string (zval **data, char *tn, gdImagePtr (*ioctx_func_p)())
{ {
#ifdef HAVE_LIBGD15 #ifdef HAVE_LIBGD15
@ -986,6 +1005,7 @@ gdImagePtr _php_image_create_from_string (zval **data, char *tn, gdImagePtr (*io
return NULL; return NULL;
#endif #endif
} }
/* }}} */
/* {{{ proto int imagecreatefromstring(string image) /* {{{ proto int imagecreatefromstring(string image)
Create a new image from the image stream in the string */ Create a new image from the image stream in the string */
@ -1062,6 +1082,9 @@ PHP_FUNCTION (imagecreatefromstring)
/* }}} */ /* }}} */
size_t php_fread_all(char **buf, int socket, FILE *fp, int issock); size_t php_fread_all(char **buf, int socket, FILE *fp, int issock);
/* {{{ _php_image_create_from
*/
static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)()) static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)())
{ {
zval **file, **srcx, **srcy, **width, **height; zval **file, **srcx, **srcy, **width, **height;
@ -1152,6 +1175,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
ZEND_REGISTER_RESOURCE(return_value, im, le_gd); ZEND_REGISTER_RESOURCE(return_value, im, le_gd);
} }
/* }}} */
/* {{{ proto int imagecreatefromgif(string filename) /* {{{ proto int imagecreatefromgif(string filename)
Create a new image from GIF file or URL */ Create a new image from GIF file or URL */
@ -1269,6 +1293,8 @@ PHP_FUNCTION(imagecreatefromgd2part)
} }
/* }}} */ /* }}} */
/* {{{ _php_image_output
*/
static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()) static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)())
{ {
zval **imgind, **file, **quality; zval **imgind, **file, **quality;
@ -1377,6 +1403,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
} }
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto int imagegif(int im [, string filename]) /* {{{ proto int imagegif(int im [, string filename])
Output GIF image to browser or file */ Output GIF image to browser or file */
@ -2075,7 +2102,8 @@ PHP_FUNCTION(imageinterlace)
} }
/* }}} */ /* }}} */
/* arg = 0 normal polygon /* {{{ php_imagepolygon
arg = 0 normal polygon
arg = 1 filled polygon */ arg = 1 filled polygon */
/* im, points, num_points, col */ /* im, points, num_points, col */
static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) { static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) {
@ -2138,7 +2166,7 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) {
efree(points); efree(points);
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto int imagepolygon(int im, array point, int num_points, int col) /* {{{ proto int imagepolygon(int im, array point, int num_points, int col)
Draw a polygon */ Draw a polygon */
@ -2156,7 +2184,8 @@ PHP_FUNCTION(imagefilledpolygon)
} }
/* }}} */ /* }}} */
/* {{{ php_find_gd_font
*/
static gdFontPtr php_find_gd_font(int size) static gdFontPtr php_find_gd_font(int size)
{ {
gdFontPtr font; gdFontPtr font;
@ -2192,9 +2221,9 @@ static gdFontPtr php_find_gd_font(int size)
return font; return font;
} }
/* }}} */
/* {{{ php_imagefontsize
/*
* arg = 0 ImageFontWidth * arg = 0 ImageFontWidth
* arg = 1 ImageFontHeight * arg = 1 ImageFontHeight
*/ */
@ -2213,7 +2242,7 @@ static void php_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg)
font = php_find_gd_font(Z_LVAL_PP(SIZE)); font = php_find_gd_font(Z_LVAL_PP(SIZE));
RETURN_LONG(arg ? font->h : font->w); RETURN_LONG(arg ? font->h : font->w);
} }
/* }}} */
/* {{{ proto int imagefontwidth(int font) /* {{{ proto int imagefontwidth(int font)
Get font width */ Get font width */
@ -2231,8 +2260,8 @@ PHP_FUNCTION(imagefontheight)
} }
/* }}} */ /* }}} */
/* {{{ php_gdimagecharup
/* workaround for a bug in gd 1.2 */ * workaround for a bug in gd 1.2 */
void php_gdimagecharup(gdImagePtr im, gdFontPtr f, int x, int y, int c, void php_gdimagecharup(gdImagePtr im, gdFontPtr f, int x, int y, int c,
int color) int color)
{ {
@ -2254,8 +2283,9 @@ void php_gdimagecharup(gdImagePtr im, gdFontPtr f, int x, int y, int c,
cx++; cx++;
} }
} }
/* }}} */
/* /* {{{ php_imagechar
* arg = 0 ImageChar * arg = 0 ImageChar
* arg = 1 ImageCharUp * arg = 1 ImageCharUp
* arg = 2 ImageString * arg = 2 ImageString
@ -2324,7 +2354,8 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
efree(str); efree(str);
} }
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto int imagechar(int im, int font, int x, int y, string c, int col) /* {{{ proto int imagechar(int im, int font, int x, int y, string c, int col)
Draw a character */ Draw a character */
@ -2480,8 +2511,6 @@ PHP_FUNCTION(imagecopymergegray)
} }
/* }}} */ /* }}} */
/* {{{ proto int imagecopyresized(int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) /* {{{ proto int imagecopyresized(int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h)
Copy and resize part of an image */ Copy and resize part of an image */
PHP_FUNCTION(imagecopyresized) PHP_FUNCTION(imagecopyresized)
@ -2588,6 +2617,8 @@ PHP_FUNCTION(imagettftext)
/* }}} */ /* }}} */
#ifdef ENABLE_GD_TTF #ifdef ENABLE_GD_TTF
/* {{{ php_imagettftext_common
*/
static static
void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode) void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode)
{ {
@ -2657,22 +2688,29 @@ void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode)
add_next_index_long(return_value, brect[i]); add_next_index_long(return_value, brect[i]);
} }
} }
/* }}} */
#endif /* ENABLE_GD_TTF */ #endif /* ENABLE_GD_TTF */
#if HAVE_LIBT1 #if HAVE_LIBT1
/* {{{ php_free_ps_font
*/
void php_free_ps_font(zend_rsrc_list_entry *rsrc) void php_free_ps_font(zend_rsrc_list_entry *rsrc)
{ {
int *font = (int *)rsrc->ptr; int *font = (int *)rsrc->ptr;
T1_DeleteFont(*font); T1_DeleteFont(*font);
efree(font); efree(font);
} }
/* }}} */
/* {{{ php_free_ps_enc
*/
void php_free_ps_enc(zend_rsrc_list_entry *rsrc) void php_free_ps_enc(zend_rsrc_list_entry *rsrc)
{ {
char **enc = (char **)rsrc->ptr; char **enc = (char **)rsrc->ptr;
T1_DeleteEncoding(enc); T1_DeleteEncoding(enc);
} }
/* }}} */
#endif #endif
@ -3159,7 +3197,6 @@ PHP_FUNCTION(imagepsbbox)
} }
/* }}} */ /* }}} */
/* {{{ proto int image2wbmp(int im [, string filename [, int threshold]]) /* {{{ proto int image2wbmp(int im [, string filename [, int threshold]])
Output WBMP image to browser or file */ Output WBMP image to browser or file */
PHP_FUNCTION(image2wbmp) PHP_FUNCTION(image2wbmp)
@ -3171,7 +3208,7 @@ PHP_FUNCTION(image2wbmp)
RETURN_FALSE; RETURN_FALSE;
#endif /* HAVE_GD_WBMP */ #endif /* HAVE_GD_WBMP */
} }
/* }}} */
/* {{{ proto void jpeg2wbmp (string f_org, string f_dest, int d_height, int d_width) /* {{{ proto void jpeg2wbmp (string f_org, string f_dest, int d_height, int d_width)
Convert JPEG image to WBMP image */ Convert JPEG image to WBMP image */
@ -3209,10 +3246,9 @@ PHP_FUNCTION(png2wbmp)
} }
/* }}} */ /* }}} */
#ifdef HAVE_GD_WBMP #ifdef HAVE_GD_WBMP
/* It converts a gd Image to bw using a threshold value */ /* {{{ _php_image_bw_convert
* It converts a gd Image to bw using a threshold value */
static void _php_image_bw_convert( gdImagePtr im_org, gdIOCtx *out, int threshold) static void _php_image_bw_convert( gdImagePtr im_org, gdIOCtx *out, int threshold)
{ {
gdImagePtr im_dest; gdImagePtr im_dest;
@ -3259,8 +3295,10 @@ static void _php_image_bw_convert( gdImagePtr im_org, gdIOCtx *out, int threshol
#endif #endif
} }
/* }}} */
/* _php_image_convert converts jpeg/png images to wbmp and resizes them as needed */ /* {{{ _php_image_convert
* _php_image_convert converts jpeg/png images to wbmp and resizes them as needed */
static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) { static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) {
zval **f_org, **f_dest, **height, **width, **threshold; zval **f_org, **f_dest, **height, **width, **threshold;
gdImagePtr im_org, im_dest, im_tmp; gdImagePtr im_org, im_dest, im_tmp;
@ -3451,9 +3489,9 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) {
} }
WRONG_PARAM_COUNT; WRONG_PARAM_COUNT;
} }
/* }}} */
#endif /* HAVE_GD_WBMP */ #endif /* HAVE_GD_WBMP */
#endif /* HAVE_LIBGD */ #endif /* HAVE_LIBGD */
/* /*
@ -3461,4 +3499,5 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) {
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -37,6 +37,8 @@ static int le_gmp;
static unsigned char first_of_two_force_ref[] = { 2, BYREF_FORCE, BYREF_NONE }; static unsigned char first_of_two_force_ref[] = { 2, BYREF_FORCE, BYREF_NONE };
/* {{{ gmp_functions[]
*/
function_entry gmp_functions[] = { function_entry gmp_functions[] = {
ZEND_FE(gmp_init, NULL) ZEND_FE(gmp_init, NULL)
ZEND_FE(gmp_intval, NULL) ZEND_FE(gmp_intval, NULL)
@ -79,7 +81,10 @@ function_entry gmp_functions[] = {
ZEND_FE(gmp_hamdist, NULL) ZEND_FE(gmp_hamdist, NULL)
{NULL, NULL, NULL} /* Must be the last line in gmp_functions[] */ {NULL, NULL, NULL} /* Must be the last line in gmp_functions[] */
}; };
/* }}} */
/* {{{ gmp_module_entry
*/
zend_module_entry gmp_module_entry = { zend_module_entry gmp_module_entry = {
"gmp", "gmp",
gmp_functions, gmp_functions,
@ -90,6 +95,7 @@ zend_module_entry gmp_module_entry = {
ZEND_MINFO(gmp), ZEND_MINFO(gmp),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_GMP #ifdef COMPILE_DL_GMP
ZEND_GET_MODULE(gmp) ZEND_GET_MODULE(gmp)
@ -103,22 +109,33 @@ static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc);
#define GMP_ROUND_PLUSINF 1 #define GMP_ROUND_PLUSINF 1
#define GMP_ROUND_MINUSINF 2 #define GMP_ROUND_MINUSINF 2
/* {{{ gmp_emalloc
*/
static void *gmp_emalloc(size_t size) static void *gmp_emalloc(size_t size)
{ {
return emalloc(size); return emalloc(size);
} }
/* }}} */
/* {{{ gmp_erealloc
*/
static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size) static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size)
{ {
return erealloc(ptr, new_size); return erealloc(ptr, new_size);
} }
/* }}} */
/* {{{ gmp_efree
*/
static void gmp_efree(void *ptr, size_t size) static void gmp_efree(void *ptr, size_t size)
{ {
efree(ptr); efree(ptr);
} }
/* }}} */
ZEND_MINIT_FUNCTION(gmp) /* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(gmp)
{ {
/* Remove comments if you have entries in php.ini /* Remove comments if you have entries in php.ini
REGISTER_INI_ENTRIES(); REGISTER_INI_ENTRIES();
@ -134,16 +151,22 @@ ZEND_MINIT_FUNCTION(gmp)
return SUCCESS; return SUCCESS;
} }
/* }}} */
ZEND_MSHUTDOWN_FUNCTION(gmp) /* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(gmp)
{ {
/* Remove comments if you have entries in php.ini /* Remove comments if you have entries in php.ini
UNREGISTER_INI_ENTRIES(); UNREGISTER_INI_ENTRIES();
*/ */
return SUCCESS; return SUCCESS;
} }
/* }}} */
ZEND_MINFO_FUNCTION(gmp) /* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(gmp)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_header(2, "gmp support", "enabled"); php_info_print_table_header(2, "gmp support", "enabled");
@ -153,6 +176,7 @@ ZEND_MINFO_FUNCTION(gmp)
DISPLAY_INI_ENTRIES(); DISPLAY_INI_ENTRIES();
*/ */
} }
/* }}} */
/* Fetch zval to be GMP number. /* Fetch zval to be GMP number.
Initially, zval can be also number or string */ Initially, zval can be also number or string */
@ -170,7 +194,8 @@ if(Z_TYPE_PP(zval) == IS_RESOURCE) { \
#define INIT_GMP_NUM(gmpnumber) { gmpnumber=emalloc(sizeof(mpz_t)); mpz_init(*gmpnumber); } #define INIT_GMP_NUM(gmpnumber) { gmpnumber=emalloc(sizeof(mpz_t)); mpz_init(*gmpnumber); }
#define FREE_GMP_NUM(gmpnumber) { mpz_clear(*gmpnumber); efree(gmpnumber); } #define FREE_GMP_NUM(gmpnumber) { mpz_clear(*gmpnumber); efree(gmpnumber); }
/* Convert zval to be gmp number */ /* {{{ convert_to_gmp
* Convert zval to be gmp number */
static int convert_to_gmp(mpz_t * *gmpnumber, zval **val) static int convert_to_gmp(mpz_t * *gmpnumber, zval **val)
{ {
int ret = 0; int ret = 0;
@ -203,7 +228,10 @@ static int convert_to_gmp(mpz_t * *gmpnumber, zval **val)
return ret?FAILURE:SUCCESS; return ret?FAILURE:SUCCESS;
} }
/* }}} */
/* {{{ typedefs
*/
typedef void (*gmp_unary_op_t)(mpz_ptr, mpz_srcptr); typedef void (*gmp_unary_op_t)(mpz_ptr, mpz_srcptr);
typedef int (*gmp_unary_opl_t)(mpz_srcptr); typedef int (*gmp_unary_opl_t)(mpz_srcptr);
@ -215,6 +243,8 @@ typedef int (*gmp_binary_opl_t)(mpz_srcptr, mpz_srcptr);
typedef unsigned long (*gmp_binary_ui_op_t)(mpz_ptr, mpz_srcptr, unsigned long); typedef unsigned long (*gmp_binary_ui_op_t)(mpz_ptr, mpz_srcptr, unsigned long);
typedef void (*gmp_binary_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr); typedef void (*gmp_binary_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
typedef unsigned long (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long); typedef unsigned long (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long);
/* }}} */
#define gmp_zval_binary_ui_op(r,a,b,o,u) gmp_zval_binary_ui_op_ex(r,a,b,o,u,0) #define gmp_zval_binary_ui_op(r,a,b,o,u) gmp_zval_binary_ui_op_ex(r,a,b,o,u,0)
#define gmp_zval_binary_ui_op2(r,a,b,o,u) gmp_zval_binary_ui_op2_ex(r,a,b,o,u,0) #define gmp_zval_binary_ui_op2(r,a,b,o,u) gmp_zval_binary_ui_op2_ex(r,a,b,o,u,0)
@ -227,7 +257,7 @@ typedef unsigned long (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, unsig
#define gmp_unary_opl(op) _gmp_unary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) #define gmp_unary_opl(op) _gmp_unary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op)
#define gmp_unary_ui_op(op) _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) #define gmp_unary_ui_op(op) _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op)
/* /* {{{ gmp_zval_binary_ui_op_ex
Execute GMP binary operation. Execute GMP binary operation.
May return GMP resource or long if operation allows this May return GMP resource or long if operation allows this
*/ */
@ -261,8 +291,9 @@ static inline void gmp_zval_binary_ui_op_ex(zval *return_value, zval **a_arg, zv
ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp);
} }
} }
/* }}} */
/* /* {{{ gmp_zval_binary_ui_op2_ex
Execute GMP binary operation which returns 2 values. Execute GMP binary operation which returns 2 values.
May return GMP resources or longs if operation allows this. May return GMP resources or longs if operation allows this.
*/ */
@ -304,8 +335,10 @@ static inline void gmp_zval_binary_ui_op2_ex(zval *return_value, zval **a_arg, z
add_index_resource(return_value, 1, Z_LVAL(r)); add_index_resource(return_value, 1, Z_LVAL(r));
} }
} }
/* }}} */
/* {{{ _gmp_binary_ui_op
*/
static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op) { static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op) {
zval **a_arg, **b_arg; zval **a_arg, **b_arg;
@ -315,9 +348,12 @@ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op
gmp_zval_binary_ui_op(return_value,a_arg,b_arg,gmp_op,gmp_ui_op); gmp_zval_binary_ui_op(return_value,a_arg,b_arg,gmp_op,gmp_ui_op);
} }
/* }}} */
/* Unary operations */ /* Unary operations */
/* {{{ gmp_zval_unary_op
*/
static inline void gmp_zval_unary_op(zval *return_value, zval **a_arg, gmp_unary_op_t gmp_op) { static inline void gmp_zval_unary_op(zval *return_value, zval **a_arg, gmp_unary_op_t gmp_op) {
mpz_t *gmpnum_a, *gmpnum_result; mpz_t *gmpnum_a, *gmpnum_result;
@ -328,7 +364,10 @@ static inline void gmp_zval_unary_op(zval *return_value, zval **a_arg, gmp_unary
ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp);
} }
/* }}} */
/* {{{ gmp_zval_unary_ui_op
*/
static inline void gmp_zval_unary_ui_op(zval *return_value, zval **a_arg, gmp_unary_ui_op_t gmp_op) { static inline void gmp_zval_unary_ui_op(zval *return_value, zval **a_arg, gmp_unary_ui_op_t gmp_op) {
mpz_t *gmpnum_result; mpz_t *gmpnum_result;
@ -339,8 +378,9 @@ static inline void gmp_zval_unary_ui_op(zval *return_value, zval **a_arg, gmp_un
ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp);
} }
/* }}} */
/* /* {{{ _gmp_unary_ui_op
Execute GMP unary operation. Execute GMP unary operation.
*/ */
static inline void _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_ui_op_t gmp_op) { static inline void _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_ui_op_t gmp_op) {
@ -352,7 +392,10 @@ static inline void _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_ui_o
gmp_zval_unary_ui_op(return_value,a_arg,gmp_op); gmp_zval_unary_ui_op(return_value,a_arg,gmp_op);
} }
/* }}} */
/* {{{ _gmp_unary_op
*/
static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gmp_op) { static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gmp_op) {
zval **a_arg; zval **a_arg;
@ -362,7 +405,10 @@ static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gm
gmp_zval_unary_op(return_value,a_arg,gmp_op); gmp_zval_unary_op(return_value,a_arg,gmp_op);
} }
/* }}} */
/* {{{ _gmp_unary_opl
*/
static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t gmp_op) { static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t gmp_op) {
zval **a_arg; zval **a_arg;
mpz_t *gmpnum_a; mpz_t *gmpnum_a;
@ -375,7 +421,10 @@ static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t
RETURN_LONG(gmp_op(*gmpnum_a)); RETURN_LONG(gmp_op(*gmpnum_a));
} }
/* }}} */
/* {{{ _gmp_binary_opl
*/
static inline void _gmp_binary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_opl_t gmp_op) { static inline void _gmp_binary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_opl_t gmp_op) {
zval **a_arg, **b_arg; zval **a_arg, **b_arg;
mpz_t *gmpnum_a, *gmpnum_b; mpz_t *gmpnum_a, *gmpnum_b;
@ -389,7 +438,7 @@ static inline void _gmp_binary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_opl_
RETURN_LONG(gmp_op(*gmpnum_a, *gmpnum_b)); RETURN_LONG(gmp_op(*gmpnum_a, *gmpnum_b));
} }
/* }}} */
/* Remove the following function when you have succesfully modified config.m4 /* Remove the following function when you have succesfully modified config.m4
so that your module can be compiled into PHP, it exists only for testing so that your module can be compiled into PHP, it exists only for testing
@ -853,7 +902,6 @@ ZEND_FUNCTION(gmp_gcdext)
} }
/* }}} */ /* }}} */
/* {{{ proto resource gmp_invert(resource a, resource b) /* {{{ proto resource gmp_invert(resource a, resource b)
Computes the inverse of a modulo b */ Computes the inverse of a modulo b */
ZEND_FUNCTION(gmp_invert) ZEND_FUNCTION(gmp_invert)
@ -1151,19 +1199,21 @@ ZEND_FUNCTION(gmp_scan1)
} }
/* }}} */ /* }}} */
/* {{{ _php_gmpnum_free
*/
static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc) static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc)
{ {
mpz_t *gmpnum = (mpz_t *)rsrc->ptr; mpz_t *gmpnum = (mpz_t *)rsrc->ptr;
FREE_GMP_NUM(gmpnum); FREE_GMP_NUM(gmpnum);
} }
/* }}} */
#endif /* HAVE_GMP */ #endif /* HAVE_GMP */
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -17,6 +17,8 @@
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
/* $Id$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@ -46,8 +48,8 @@
#endif #endif
/* Every user visible function must have an entry in iconv_functions[]. /* {{{ iconv_functions[]
*/ */
function_entry iconv_functions[] = { function_entry iconv_functions[] = {
PHP_FE(iconv, NULL) PHP_FE(iconv, NULL)
PHP_FE(ob_iconv_handler, NULL) PHP_FE(ob_iconv_handler, NULL)
@ -55,7 +57,10 @@ function_entry iconv_functions[] = {
PHP_FE(iconv_set_encoding, NULL) PHP_FE(iconv_set_encoding, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
/* {{{ iconv_module_entry
*/
zend_module_entry iconv_module_entry = { zend_module_entry iconv_module_entry = {
"iconv", "iconv",
iconv_functions, iconv_functions,
@ -66,6 +71,7 @@ zend_module_entry iconv_module_entry = {
PHP_MINFO(miconv), PHP_MINFO(miconv),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
ZEND_DECLARE_MODULE_GLOBALS(iconv) ZEND_DECLARE_MODULE_GLOBALS(iconv)
@ -75,11 +81,14 @@ ZEND_GET_MODULE(iconv)
int php_iconv_string(char *, char **, char *, char *); int php_iconv_string(char *, char **, char *, char *);
/* {{{ PHP_INI
*/
PHP_INI_BEGIN() PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("iconv.input_encoding", ICONV_INPUT_ENCODING, PHP_INI_ALL, OnUpdateString, input_encoding, zend_iconv_globals, iconv_globals) STD_PHP_INI_ENTRY("iconv.input_encoding", ICONV_INPUT_ENCODING, PHP_INI_ALL, OnUpdateString, input_encoding, zend_iconv_globals, iconv_globals)
STD_PHP_INI_ENTRY("iconv.output_encoding", ICONV_OUTPUT_ENCODING, PHP_INI_ALL, OnUpdateString, output_encoding, zend_iconv_globals, iconv_globals) STD_PHP_INI_ENTRY("iconv.output_encoding", ICONV_OUTPUT_ENCODING, PHP_INI_ALL, OnUpdateString, output_encoding, zend_iconv_globals, iconv_globals)
STD_PHP_INI_ENTRY("iconv.internal_encoding", ICONV_INTERNAL_ENCODING, PHP_INI_ALL, OnUpdateString, internal_encoding, zend_iconv_globals, iconv_globals) STD_PHP_INI_ENTRY("iconv.internal_encoding", ICONV_INTERNAL_ENCODING, PHP_INI_ALL, OnUpdateString, internal_encoding, zend_iconv_globals, iconv_globals)
PHP_INI_END() PHP_INI_END()
/* }}} */
static void static void
php_iconv_init_globals(zend_iconv_globals *iconv_globals) php_iconv_init_globals(zend_iconv_globals *iconv_globals)
@ -111,6 +120,8 @@ PHP_MINFO_FUNCTION(miconv)
DISPLAY_INI_ENTRIES(); DISPLAY_INI_ENTRIES();
} }
/* {{{ php_iconv_string
*/
int php_iconv_string(char *in_p, char **out, char *in_charset, char *out_charset) int php_iconv_string(char *in_p, char **out, char *in_charset, char *out_charset)
{ {
unsigned int in_size, out_size; unsigned int in_size, out_size;
@ -147,7 +158,7 @@ int php_iconv_string(char *in_p, char **out, char *in_charset, char *out_charset
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ proto string iconv(string in_charset, string out_charset, string str) /* {{{ proto string iconv(string in_charset, string out_charset, string str)
Returns str converted to the out_charset character set */ Returns str converted to the out_charset character set */
@ -277,13 +288,12 @@ PHP_FUNCTION(iconv_get_encoding)
} }
/* }}} */ /* }}} */
#endif #endif
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -81,7 +81,9 @@ void mail_close_it (zend_rsrc_list_entry *rsrc);
void mail_userlogout_it(zend_rsrc_list_entry *rsrc); void mail_userlogout_it(zend_rsrc_list_entry *rsrc);
void mail_nuke_chain(zend_rsrc_list_entry *rsrc); void mail_nuke_chain(zend_rsrc_list_entry *rsrc);
#endif #endif
/* {{{ imap_functions[]
*/
function_entry imap_functions[] = { function_entry imap_functions[] = {
PHP_FE(imap_open, NULL) PHP_FE(imap_open, NULL)
PHP_FE(imap_popen, NULL) PHP_FE(imap_popen, NULL)
@ -157,6 +159,7 @@ function_entry imap_functions[] = {
PHP_FE(imap_thread, NULL) PHP_FE(imap_thread, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
#ifdef OP_RELOGIN #ifdef OP_RELOGIN
#define IS_STREAM(ind_type) ((ind_type)==le_imap || (ind_type)==le_pimap) #define IS_STREAM(ind_type) ((ind_type)==le_imap || (ind_type)==le_pimap)
@ -424,7 +427,8 @@ static void php_imap_init_globals(zend_imap_globals *imap_globals)
imap_globals->folderlist_style = FLIST_ARRAY; imap_globals->folderlist_style = FLIST_ARRAY;
} }
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(imap) PHP_MINIT_FUNCTION(imap)
{ {
unsigned long sa_all = SA_MESSAGES | SA_RECENT | SA_UNSEEN | unsigned long sa_all = SA_MESSAGES | SA_RECENT | SA_UNSEEN |
@ -634,7 +638,10 @@ PHP_MINIT_FUNCTION(imap)
#endif #endif
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ imap_do_open
*/
void imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) void imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{ {
zval **mailbox, **user, **passwd, **options; zval **mailbox, **user, **passwd, **options;
@ -836,6 +843,7 @@ void imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
RETURN_LONG(ind); RETURN_LONG(ind);
} }
/* }}} */
/* {{{ proto int imap_open(string mailbox, string user, string password [, int options]) /* {{{ proto int imap_open(string mailbox, string user, string password [, int options])
Open an IMAP stream to a mailbox */ Open an IMAP stream to a mailbox */
@ -4454,4 +4462,5 @@ PHP_FUNCTION (imap_thread)
mail_free_threadnode(&top); mail_free_threadnode(&top);
} }
/* }}} */ /* }}} */
/* end IMAP_THREAD functionality */ /* end IMAP_THREAD functionality */

View file

@ -22,7 +22,6 @@
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
/* $Id$ */ /* $Id$ */
#define IS_EXT_MODULE #define IS_EXT_MODULE
@ -63,7 +62,8 @@ static int le_link, le_result, le_result_entry, le_ber_entry;
This is just a small subset of the functionality provided by the LDAP library. All the This is just a small subset of the functionality provided by the LDAP library. All the
operations are synchronous. Referrals are not handled automatically. operations are synchronous. Referrals are not handled automatically.
*/ */
/* {{{ ldap_functions[]
*/
function_entry ldap_functions[] = { function_entry ldap_functions[] = {
PHP_FE(ldap_connect, NULL) PHP_FE(ldap_connect, NULL)
PHP_FALIAS(ldap_close, ldap_unbind, NULL) PHP_FALIAS(ldap_close, ldap_unbind, NULL)
@ -117,7 +117,7 @@ function_entry ldap_functions[] = {
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
zend_module_entry ldap_module_entry = { zend_module_entry ldap_module_entry = {
"ldap", "ldap",
@ -152,19 +152,24 @@ static void _free_ldap_result(zend_rsrc_list_entry *rsrc)
ldap_msgfree(result); ldap_msgfree(result);
} }
/* {{{ PHP_INI_BEGIN
*/
PHP_INI_BEGIN() PHP_INI_BEGIN()
STD_PHP_INI_ENTRY_EX("ldap.max_links", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_links, zend_ldap_globals, ldap_globals, display_link_numbers) STD_PHP_INI_ENTRY_EX("ldap.max_links", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_links, zend_ldap_globals, ldap_globals, display_link_numbers)
STD_PHP_INI_ENTRY("ldap.base_dn", NULL, PHP_INI_ALL, OnUpdateString, base_dn, zend_ldap_globals, ldap_globals) STD_PHP_INI_ENTRY("ldap.base_dn", NULL, PHP_INI_ALL, OnUpdateString, base_dn, zend_ldap_globals, ldap_globals)
PHP_INI_END() PHP_INI_END()
/* }}} */
/* {{{ php_ldap_init_globals
*/
static void php_ldap_init_globals(zend_ldap_globals *ldap_globals) static void php_ldap_init_globals(zend_ldap_globals *ldap_globals)
{ {
ldap_globals->num_links = 0; ldap_globals->num_links = 0;
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(ldap) PHP_MINIT_FUNCTION(ldap)
{ {
ZEND_INIT_MODULE_GLOBALS(ldap, php_ldap_init_globals, NULL); ZEND_INIT_MODULE_GLOBALS(ldap, php_ldap_init_globals, NULL);
@ -209,14 +214,18 @@ PHP_MINIT_FUNCTION(ldap)
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(ldap) PHP_MSHUTDOWN_FUNCTION(ldap)
{ {
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(ldap) PHP_MINFO_FUNCTION(ldap)
{ {
char maxl[32]; char maxl[32];
@ -278,7 +287,7 @@ PHP_MINFO_FUNCTION(ldap)
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ proto int ldap_connect([string host [, int port]]) /* {{{ proto int ldap_connect([string host [, int port]])
Connect to an LDAP server */ Connect to an LDAP server */
@ -406,7 +415,8 @@ PHP_FUNCTION(ldap_connect)
} }
/* }}} */ /* }}} */
/* {{{ _get_lderrno
*/
static int _get_lderrno(LDAP *ldap) static int _get_lderrno(LDAP *ldap)
{ {
#if !HAVE_NSLDAP #if !HAVE_NSLDAP
@ -423,7 +433,7 @@ static int _get_lderrno(LDAP *ldap)
return ldap_get_lderrno(ldap,NULL,NULL); return ldap_get_lderrno(ldap,NULL,NULL);
#endif #endif
} }
/* }}} */
/* {{{ proto int ldap_bind(int link [, string dn, string password]) /* {{{ proto int ldap_bind(int link [, string dn, string password])
Bind to LDAP directory */ Bind to LDAP directory */
@ -473,7 +483,6 @@ PHP_FUNCTION(ldap_bind)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_unbind(int link) /* {{{ proto int ldap_unbind(int link)
Unbind from LDAP directory */ Unbind from LDAP directory */
PHP_FUNCTION(ldap_unbind) PHP_FUNCTION(ldap_unbind)
@ -492,7 +501,8 @@ PHP_FUNCTION(ldap_unbind)
} }
/* }}} */ /* }}} */
/* {{{ hp_set_opts
*/
static void php_set_opts(LDAP *ldap, int sizelimit, int timelimit, int deref) static void php_set_opts(LDAP *ldap, int sizelimit, int timelimit, int deref)
{ {
/* sizelimit */ /* sizelimit */
@ -522,8 +532,10 @@ static void php_set_opts(LDAP *ldap, int sizelimit, int timelimit, int deref)
#endif #endif
} }
} }
/* }}} */
/* {{{ php_ldap_do_search
*/
static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope) static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
{ {
pval **link, **base_dn, **filter, **attrs, **attr, **attrsonly, **sizelimit, **timelimit, **deref; pval **link, **base_dn, **filter, **attrs, **attr, **attrsonly, **sizelimit, **timelimit, **deref;
@ -759,7 +771,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
ZEND_REGISTER_RESOURCE(return_value, ldap_res, le_result); ZEND_REGISTER_RESOURCE(return_value, ldap_res, le_result);
} }
} }
/* }}} */
/* {{{ proto int ldap_read(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]]) /* {{{ proto int ldap_read(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]])
Read an entry */ Read an entry */
@ -769,7 +781,6 @@ PHP_FUNCTION(ldap_read)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_list(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]]) /* {{{ proto int ldap_list(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]])
Single-level search */ Single-level search */
PHP_FUNCTION(ldap_list) PHP_FUNCTION(ldap_list)
@ -778,7 +789,6 @@ PHP_FUNCTION(ldap_list)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_search(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]]) /* {{{ proto int ldap_search(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]])
Search LDAP tree under base_dn */ Search LDAP tree under base_dn */
PHP_FUNCTION(ldap_search) PHP_FUNCTION(ldap_search)
@ -787,7 +797,6 @@ PHP_FUNCTION(ldap_search)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_free_result(int result) /* {{{ proto int ldap_free_result(int result)
Free result memory */ Free result memory */
PHP_FUNCTION(ldap_free_result) PHP_FUNCTION(ldap_free_result)
@ -811,7 +820,6 @@ PHP_FUNCTION(ldap_free_result)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_count_entries(int link, int result) /* {{{ proto int ldap_count_entries(int link, int result)
Count the number of entries in a search result */ Count the number of entries in a search result */
PHP_FUNCTION(ldap_count_entries) PHP_FUNCTION(ldap_count_entries)
@ -831,7 +839,6 @@ PHP_FUNCTION(ldap_count_entries)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_first_entry(int link, int result) /* {{{ proto int ldap_first_entry(int link, int result)
Return first result id */ Return first result id */
PHP_FUNCTION(ldap_first_entry) PHP_FUNCTION(ldap_first_entry)
@ -856,7 +863,6 @@ PHP_FUNCTION(ldap_first_entry)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_next_entry(int link, int entry) /* {{{ proto int ldap_next_entry(int link, int entry)
Get next result entry */ Get next result entry */
PHP_FUNCTION(ldap_next_entry) PHP_FUNCTION(ldap_next_entry)
@ -881,7 +887,6 @@ PHP_FUNCTION(ldap_next_entry)
} }
/* }}} */ /* }}} */
/* {{{ proto array ldap_get_entries(int link, int result) /* {{{ proto array ldap_get_entries(int link, int result)
Get all result entries */ Get all result entries */
PHP_FUNCTION(ldap_get_entries) PHP_FUNCTION(ldap_get_entries)
@ -958,7 +963,6 @@ PHP_FUNCTION(ldap_get_entries)
} }
/* }}} */ /* }}} */
/* {{{ proto string ldap_first_attribute(int link, int result, int ber) /* {{{ proto string ldap_first_attribute(int link, int result, int ber)
Return first attribute */ Return first attribute */
PHP_FUNCTION(ldap_first_attribute) PHP_FUNCTION(ldap_first_attribute)
@ -990,7 +994,6 @@ PHP_FUNCTION(ldap_first_attribute)
} }
/* }}} */ /* }}} */
/* {{{ proto string ldap_next_attribute(int link, int result, int ber) /* {{{ proto string ldap_next_attribute(int link, int result, int ber)
Get the next attribute in result */ Get the next attribute in result */
PHP_FUNCTION(ldap_next_attribute) PHP_FUNCTION(ldap_next_attribute)
@ -1022,7 +1025,6 @@ PHP_FUNCTION(ldap_next_attribute)
} }
/* }}} */ /* }}} */
/* {{{ proto array ldap_get_attributes(int link, int result) /* {{{ proto array ldap_get_attributes(int link, int result)
Get attributes from a search result entry */ Get attributes from a search result entry */
PHP_FUNCTION(ldap_get_attributes) PHP_FUNCTION(ldap_get_attributes)
@ -1070,7 +1072,6 @@ PHP_FUNCTION(ldap_get_attributes)
} }
/* }}} */ /* }}} */
/* {{{ proto array ldap_get_values(int link, int result, string attribute) /* {{{ proto array ldap_get_values(int link, int result, string attribute)
Get all values from a result entry */ Get all values from a result entry */
PHP_FUNCTION(ldap_get_values) PHP_FUNCTION(ldap_get_values)
@ -1113,7 +1114,6 @@ PHP_FUNCTION(ldap_get_values)
} }
/* }}} */ /* }}} */
/* {{{ proto array ldap_get_values_len(int link, int result, string attribute) /* {{{ proto array ldap_get_values_len(int link, int result, string attribute)
Get all values with lengths from a result entry */ Get all values with lengths from a result entry */
PHP_FUNCTION(ldap_get_values_len) PHP_FUNCTION(ldap_get_values_len)
@ -1155,7 +1155,6 @@ PHP_FUNCTION(ldap_get_values_len)
} }
/* }}} */ /* }}} */
/* {{{ proto string ldap_get_dn(int link, int result) /* {{{ proto string ldap_get_dn(int link, int result)
Get the DN of a result entry */ Get the DN of a result entry */
@ -1185,7 +1184,6 @@ PHP_FUNCTION(ldap_get_dn)
} }
/* }}} */ /* }}} */
/* {{{ proto array ldap_explode_dn(string dn, int with_attrib) /* {{{ proto array ldap_explode_dn(string dn, int with_attrib)
Splits DN into its component parts */ Splits DN into its component parts */
PHP_FUNCTION(ldap_explode_dn) PHP_FUNCTION(ldap_explode_dn)
@ -1220,7 +1218,6 @@ PHP_FUNCTION(ldap_explode_dn)
} }
/* }}} */ /* }}} */
/* {{{ proto string ldap_dn2ufn(string dn) /* {{{ proto string ldap_dn2ufn(string dn)
Convert DN to User Friendly Naming format */ Convert DN to User Friendly Naming format */
PHP_FUNCTION(ldap_dn2ufn) PHP_FUNCTION(ldap_dn2ufn)
@ -1250,6 +1247,8 @@ PHP_FUNCTION(ldap_dn2ufn)
/* added to fix use of ldap_modify_add for doing an ldap_add, gerrit thomson. */ /* added to fix use of ldap_modify_add for doing an ldap_add, gerrit thomson. */
#define PHP_LD_FULL_ADD 0xff #define PHP_LD_FULL_ADD 0xff
/* {{{ php_ldap_do_modify
*/
static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper) static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
{ {
pval **link, **dn, **entry, **value, **ivalue; pval **link, **dn, **entry, **value, **ivalue;
@ -1365,7 +1364,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
return; return;
} }
/* }}} */
/* {{{ proto int ldap_add(int link, string dn, array entry) /* {{{ proto int ldap_add(int link, string dn, array entry)
Add entries to LDAP directory */ Add entries to LDAP directory */
@ -1377,7 +1376,6 @@ PHP_FUNCTION(ldap_add)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_modify(int link, string dn, array entry) /* {{{ proto int ldap_modify(int link, string dn, array entry)
Modify an LDAP entry */ Modify an LDAP entry */
PHP_FUNCTION(ldap_modify) PHP_FUNCTION(ldap_modify)
@ -1397,7 +1395,6 @@ PHP_FUNCTION(ldap_mod_replace)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_mod_add(int link, string dn, array entry) /* {{{ proto int ldap_mod_add(int link, string dn, array entry)
Add attribute values to current */ Add attribute values to current */
PHP_FUNCTION(ldap_mod_add) PHP_FUNCTION(ldap_mod_add)
@ -1406,7 +1403,6 @@ PHP_FUNCTION(ldap_mod_add)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_mod_del(int link, string dn, array entry) /* {{{ proto int ldap_mod_del(int link, string dn, array entry)
Delete attribute values */ Delete attribute values */
PHP_FUNCTION(ldap_mod_del) PHP_FUNCTION(ldap_mod_del)
@ -1444,7 +1440,6 @@ PHP_FUNCTION(ldap_delete)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_errno(int link) /* {{{ proto int ldap_errno(int link)
Get the current ldap error number */ Get the current ldap error number */
PHP_FUNCTION(ldap_errno) PHP_FUNCTION(ldap_errno)
@ -1466,7 +1461,6 @@ PHP_FUNCTION(ldap_errno)
} }
/* }}} */ /* }}} */
/* {{{ proto string ldap_err2str(int errno) /* {{{ proto string ldap_err2str(int errno)
Convert error number to error string */ Convert error number to error string */
PHP_FUNCTION(ldap_err2str) PHP_FUNCTION(ldap_err2str)
@ -1482,7 +1476,6 @@ PHP_FUNCTION(ldap_err2str)
} }
/* }}} */ /* }}} */
/* {{{ proto string ldap_error(int link) /* {{{ proto string ldap_error(int link)
Get the current ldap error string */ Get the current ldap error string */
PHP_FUNCTION(ldap_error) PHP_FUNCTION(ldap_error)
@ -1503,7 +1496,6 @@ PHP_FUNCTION(ldap_error)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_compare(int link, string dn, string attr, string value) /* {{{ proto int ldap_compare(int link, string dn, string attr, string value)
Determine if an entry has a specific value for one of its attributes */ Determine if an entry has a specific value for one of its attributes */
PHP_FUNCTION(ldap_compare) PHP_FUNCTION(ldap_compare)
@ -1612,7 +1604,6 @@ PHP_FUNCTION(ldap_get_option)
} }
/* }}} */ /* }}} */
/* {{{ proto boolean ldap_set_option(int link, int option, mixed newval) /* {{{ proto boolean ldap_set_option(int link, int option, mixed newval)
Set the value of various session-wide parameters */ Set the value of various session-wide parameters */
PHP_FUNCTION(ldap_set_option) PHP_FUNCTION(ldap_set_option)
@ -1742,7 +1733,6 @@ PHP_FUNCTION(ldap_set_option)
} }
/* }}} */ /* }}} */
/* {{{ proto boolean ldap_parse_result(int link, int result, int errcode, string matcheddn, string errmsg, array referrals) /* {{{ proto boolean ldap_parse_result(int link, int result, int errcode, string matcheddn, string errmsg, array referrals)
Extract information from result */ Extract information from result */
PHP_FUNCTION(ldap_parse_result) PHP_FUNCTION(ldap_parse_result)
@ -1815,7 +1805,6 @@ PHP_FUNCTION(ldap_parse_result)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_first_reference(int link, int result) /* {{{ proto int ldap_first_reference(int link, int result)
Return first reference */ Return first reference */
PHP_FUNCTION(ldap_first_reference) PHP_FUNCTION(ldap_first_reference)
@ -1841,7 +1830,6 @@ PHP_FUNCTION(ldap_first_reference)
} }
/* }}} */ /* }}} */
/* {{{ proto int ldap_next_reference(int link, int entry) /* {{{ proto int ldap_next_reference(int link, int entry)
Get next reference */ Get next reference */
PHP_FUNCTION(ldap_next_reference) PHP_FUNCTION(ldap_next_reference)
@ -1866,7 +1854,6 @@ PHP_FUNCTION(ldap_next_reference)
} }
/* }}} */ /* }}} */
/* {{{ proto boolean ldap_parse_reference(int link, int entry, array referrals) /* {{{ proto boolean ldap_parse_reference(int link, int entry, array referrals)
Extract information from reference entry */ Extract information from reference entry */
PHP_FUNCTION(ldap_parse_reference) PHP_FUNCTION(ldap_parse_reference)
@ -1905,7 +1892,6 @@ PHP_FUNCTION(ldap_parse_reference)
} }
/* }}} */ /* }}} */
/* {{{ proto boolean ldap_rename(int link, string dn, string newrdn, string newparent, boolean deleteoldrdn); /* {{{ proto boolean ldap_rename(int link, string dn, string newrdn, string newparent, boolean deleteoldrdn);
Modify the name of an entry */ Modify the name of an entry */
PHP_FUNCTION(ldap_rename) PHP_FUNCTION(ldap_rename)
@ -1946,6 +1932,8 @@ PHP_FUNCTION(ldap_rename)
#ifdef STR_TRANSLATION #ifdef STR_TRANSLATION
/* {{{ php_ldap_do_translate
*/
static void php_ldap_do_translate(INTERNAL_FUNCTION_PARAMETERS, int way) static void php_ldap_do_translate(INTERNAL_FUNCTION_PARAMETERS, int way)
{ {
zval **value; zval **value;
@ -1981,7 +1969,7 @@ static void php_ldap_do_translate(INTERNAL_FUNCTION_PARAMETERS, int way)
return; return;
} }
/* }}} */
/* {{{ proto string ldap_t61_to_8859(string value) /* {{{ proto string ldap_t61_to_8859(string value)
Translate t61 characters to 8859 characters */ Translate t61 characters to 8859 characters */
@ -1990,7 +1978,6 @@ PHP_FUNCTION(ldap_t61_to_8859) {
} }
/* }}} */ /* }}} */
/* {{{ proto string ldap_8859_to_t61(string value) /* {{{ proto string ldap_8859_to_t61(string value)
Translate 8859 characters to t61 characters */ Translate 8859 characters to t61 characters */
PHP_FUNCTION(ldap_8859_to_t61) { PHP_FUNCTION(ldap_8859_to_t61) {
@ -1998,3 +1985,11 @@ PHP_FUNCTION(ldap_8859_to_t61) {
} }
/* }}} */ /* }}} */
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -44,7 +44,8 @@ static php_msql_globals msql_globals;
#define MSQL_NUM 1<<1 #define MSQL_NUM 1<<1
#define MSQL_BOTH (MSQL_ASSOC|MSQL_NUM) #define MSQL_BOTH (MSQL_ASSOC|MSQL_NUM)
/* {{{ msql_functions[]
*/
function_entry msql_functions[] = { function_entry msql_functions[] = {
PHP_FE(msql_connect, NULL) PHP_FE(msql_connect, NULL)
PHP_FE(msql_pconnect, NULL) PHP_FE(msql_pconnect, NULL)
@ -99,7 +100,7 @@ function_entry msql_functions[] = {
PHP_FALIAS(msql_tablename, msql_result, NULL) PHP_FALIAS(msql_tablename, msql_result, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
zend_module_entry msql_module_entry = { zend_module_entry msql_module_entry = {
"msql", msql_functions, PHP_MINIT(msql), NULL, PHP_RINIT(msql), NULL, "msql", msql_functions, PHP_MINIT(msql), NULL, PHP_RINIT(msql), NULL,
@ -154,6 +155,8 @@ static void _close_msql_plink(zend_rsrc_list_entry *rsrc)
msql_globals.num_links--; msql_globals.num_links--;
} }
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(msql) PHP_MINIT_FUNCTION(msql)
{ {
if (cfg_get_long("msql.allow_persistent",&msql_globals.allow_persistent)==FAILURE) { if (cfg_get_long("msql.allow_persistent",&msql_globals.allow_persistent)==FAILURE) {
@ -178,7 +181,10 @@ PHP_MINIT_FUNCTION(msql)
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_RINIT_FUNCTION
*/
PHP_RINIT_FUNCTION(msql) PHP_RINIT_FUNCTION(msql)
{ {
msql_globals.default_link=-1; msql_globals.default_link=-1;
@ -186,7 +192,10 @@ PHP_RINIT_FUNCTION(msql)
msqlErrMsg[0]=0; msqlErrMsg[0]=0;
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(msql) PHP_MINFO_FUNCTION(msql)
{ {
char maxp[32],maxl[32]; char maxp[32],maxl[32];
@ -213,8 +222,10 @@ PHP_MINFO_FUNCTION(msql)
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ php_msql_do_connect
*/
static void php_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) static void php_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
{ {
char *host; char *host;
@ -353,8 +364,10 @@ static void php_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
efree(hashed_details); efree(hashed_details);
msql_globals.default_link=return_value->value.lval; msql_globals.default_link=return_value->value.lval;
} }
/* }}} */
/* {{{ php_msql_get_default_link
*/
static int php_msql_get_default_link(INTERNAL_FUNCTION_PARAMETERS) static int php_msql_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
{ {
if (msql_globals.default_link==-1) { /* no link opened yet, implicitly open one */ if (msql_globals.default_link==-1) { /* no link opened yet, implicitly open one */
@ -363,7 +376,7 @@ static int php_msql_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
} }
return msql_globals.default_link; return msql_globals.default_link;
} }
/* }}} */
/* {{{ proto int msql_connect([string hostname[:port]] [, string username] [, string password]) /* {{{ proto int msql_connect([string hostname[:port]] [, string username] [, string password])
Open a connection to an mSQL Server */ Open a connection to an mSQL Server */
@ -373,7 +386,6 @@ PHP_FUNCTION(msql_connect)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_pconnect([string hostname[:port]] [, string username] [, string password]) /* {{{ proto int msql_pconnect([string hostname[:port]] [, string username] [, string password])
Open a persistent connection to an mSQL Server */ Open a persistent connection to an mSQL Server */
PHP_FUNCTION(msql_pconnect) PHP_FUNCTION(msql_pconnect)
@ -382,7 +394,6 @@ PHP_FUNCTION(msql_pconnect)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_close([int link_identifier]) /* {{{ proto int msql_close([int link_identifier])
Close an mSQL connection */ Close an mSQL connection */
PHP_FUNCTION(msql_close) PHP_FUNCTION(msql_close)
@ -422,7 +433,6 @@ PHP_FUNCTION(msql_close)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_select_db(string database_name [, int link_identifier]) /* {{{ proto int msql_select_db(string database_name [, int link_identifier])
Select an mSQL database */ Select an mSQL database */
PHP_FUNCTION(msql_select_db) PHP_FUNCTION(msql_select_db)
@ -462,7 +472,6 @@ PHP_FUNCTION(msql_select_db)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_create_db(string database_name [, int link_identifier]) /* {{{ proto int msql_create_db(string database_name [, int link_identifier])
Create an mSQL database */ Create an mSQL database */
PHP_FUNCTION(msql_create_db) PHP_FUNCTION(msql_create_db)
@ -500,7 +509,6 @@ PHP_FUNCTION(msql_create_db)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_drop_db(string database_name [, int link_identifier]) /* {{{ proto int msql_drop_db(string database_name [, int link_identifier])
Drop (delete) an mSQL database */ Drop (delete) an mSQL database */
PHP_FUNCTION(msql_drop_db) PHP_FUNCTION(msql_drop_db)
@ -538,7 +546,6 @@ PHP_FUNCTION(msql_drop_db)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_query(string query [, int link_identifier]) /* {{{ proto int msql_query(string query [, int link_identifier])
Send an SQL query to mSQL */ Send an SQL query to mSQL */
PHP_FUNCTION(msql_query) PHP_FUNCTION(msql_query)
@ -576,7 +583,6 @@ PHP_FUNCTION(msql_query)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_db_query(string database_name, string query [, int link_identifier]) /* {{{ proto int msql_db_query(string database_name, string query [, int link_identifier])
Send an SQL query to mSQL */ Send an SQL query to mSQL */
PHP_FUNCTION(msql_db_query) PHP_FUNCTION(msql_db_query)
@ -619,7 +625,6 @@ PHP_FUNCTION(msql_db_query)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_list_dbs([int link_identifier]) /* {{{ proto int msql_list_dbs([int link_identifier])
List databases available on an mSQL server */ List databases available on an mSQL server */
PHP_FUNCTION(msql_list_dbs) PHP_FUNCTION(msql_list_dbs)
@ -654,7 +659,6 @@ PHP_FUNCTION(msql_list_dbs)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_list_tables(string database_name [, int link_identifier]) /* {{{ proto int msql_list_tables(string database_name [, int link_identifier])
List tables in an mSQL database */ List tables in an mSQL database */
PHP_FUNCTION(msql_list_tables) PHP_FUNCTION(msql_list_tables)
@ -696,7 +700,6 @@ PHP_FUNCTION(msql_list_tables)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_list_fields(string database_name, string table_name [, int link_identifier]) /* {{{ proto int msql_list_fields(string database_name, string table_name [, int link_identifier])
List mSQL result fields */ List mSQL result fields */
PHP_FUNCTION(msql_list_fields) PHP_FUNCTION(msql_list_fields)
@ -739,7 +742,6 @@ PHP_FUNCTION(msql_list_fields)
} }
/* }}} */ /* }}} */
/* {{{ proto string msql_error([int link_identifier]) /* {{{ proto string msql_error([int link_identifier])
Returns the text of the error message from previous mSQL operation */ Returns the text of the error message from previous mSQL operation */
PHP_FUNCTION(msql_error) PHP_FUNCTION(msql_error)
@ -854,7 +856,6 @@ PHP_FUNCTION(msql_result)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_num_rows(int query) /* {{{ proto int msql_num_rows(int query)
Get number of rows in a result */ Get number of rows in a result */
PHP_FUNCTION(msql_num_rows) PHP_FUNCTION(msql_num_rows)
@ -872,7 +873,6 @@ PHP_FUNCTION(msql_num_rows)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_num_fields(int query) /* {{{ proto int msql_num_fields(int query)
Get number of fields in a result */ Get number of fields in a result */
PHP_FUNCTION(msql_num_fields) PHP_FUNCTION(msql_num_fields)
@ -890,7 +890,8 @@ PHP_FUNCTION(msql_num_fields)
} }
/* }}} */ /* }}} */
/* {{{ php_msql_fetch_hash
*/
static void php_msql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) static void php_msql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
{ {
pval *result, *arg2; pval *result, *arg2;
@ -965,7 +966,7 @@ static void php_msql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
} }
} }
} }
/* }}} */
/* {{{ proto array msql_fetch_row(int query) /* {{{ proto array msql_fetch_row(int query)
Get a result row as an enumerated array */ Get a result row as an enumerated array */
@ -975,7 +976,6 @@ PHP_FUNCTION(msql_fetch_row)
} }
/* }}} */ /* }}} */
/* {{{ proto object msql_fetch_object(int query [, int result_type]) /* {{{ proto object msql_fetch_object(int query [, int result_type])
Fetch a result row as an object */ Fetch a result row as an object */
PHP_FUNCTION(msql_fetch_object) PHP_FUNCTION(msql_fetch_object)
@ -1022,6 +1022,8 @@ PHP_FUNCTION(msql_data_seek)
} }
/* }}} */ /* }}} */
/* {{{ php_msql_get_field_name
*/
static char *php_msql_get_field_name(int field_type) static char *php_msql_get_field_name(int field_type)
{ {
switch (field_type) { switch (field_type) {
@ -1059,6 +1061,7 @@ static char *php_msql_get_field_name(int field_type)
break; break;
} }
} }
/* }}} */
/* {{{ proto object msql_fetch_field(int query [, int field_offset]) /* {{{ proto object msql_fetch_field(int query [, int field_offset])
Get column information from a result and return as an object */ Get column information from a result and return as an object */
@ -1145,7 +1148,9 @@ PHP_FUNCTION(msql_field_seek)
#define PHP_MSQL_FIELD_LEN 3 #define PHP_MSQL_FIELD_LEN 3
#define PHP_MSQL_FIELD_TYPE 4 #define PHP_MSQL_FIELD_TYPE 4
#define PHP_MSQL_FIELD_FLAGS 5 #define PHP_MSQL_FIELD_FLAGS 5
/* {{{ php_msql_field_info
*/
static void php_msql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) static void php_msql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
{ {
pval *result, *field; pval *result, *field;
@ -1230,6 +1235,7 @@ static void php_msql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
RETURN_FALSE; RETURN_FALSE;
} }
} }
/* }}} */
/* {{{ proto string msql_field_name(int query, int field_index) /* {{{ proto string msql_field_name(int query, int field_index)
Get the name of the specified field in a result */ Get the name of the specified field in a result */
@ -1271,7 +1277,6 @@ PHP_FUNCTION(msql_field_flags)
} }
/* }}} */ /* }}} */
/* {{{ proto int msql_free_result(int query) /* {{{ proto int msql_free_result(int query)
Free result memory */ Free result memory */
PHP_FUNCTION(msql_free_result) PHP_FUNCTION(msql_free_result)
@ -1308,11 +1313,10 @@ PHP_FUNCTION(msql_affected_rows)
#endif #endif
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -110,6 +110,8 @@ typedef struct _php_mysql_conn {
} php_mysql_conn; } php_mysql_conn;
/* {{{ mysql_functions[]
*/
function_entry mysql_functions[] = { function_entry mysql_functions[] = {
PHP_FE(mysql_connect, NULL) PHP_FE(mysql_connect, NULL)
PHP_FE(mysql_pconnect, NULL) PHP_FE(mysql_pconnect, NULL)
@ -175,12 +177,15 @@ function_entry mysql_functions[] = {
PHP_FALIAS(mysql_tablename, mysql_result, NULL) PHP_FALIAS(mysql_tablename, mysql_result, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
/* {{{ mysql_module_entry
*/
zend_module_entry mysql_module_entry = { zend_module_entry mysql_module_entry = {
"mysql", mysql_functions, PHP_MINIT(mysql), PHP_MSHUTDOWN(mysql), PHP_RINIT(mysql), PHP_RSHUTDOWN(mysql), "mysql", mysql_functions, PHP_MINIT(mysql), PHP_MSHUTDOWN(mysql), PHP_RINIT(mysql), PHP_RSHUTDOWN(mysql),
PHP_MINFO(mysql), STANDARD_MODULE_PROPERTIES PHP_MINFO(mysql), STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
ZEND_DECLARE_MODULE_GLOBALS(mysql) ZEND_DECLARE_MODULE_GLOBALS(mysql)
@ -192,7 +197,7 @@ void timeout(int sig);
#define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING, "MySQL: A link to the server could not be established"); RETURN_FALSE; } } #define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING, "MySQL: A link to the server could not be established"); RETURN_FALSE; } }
/* /* {{{ _free_mysql_result
* This wrapper is required since mysql_free_result() returns an integer, and * This wrapper is required since mysql_free_result() returns an integer, and
* thus, cannot be used directly * thus, cannot be used directly
*/ */
@ -202,8 +207,10 @@ static void _free_mysql_result(zend_rsrc_list_entry *rsrc)
mysql_free_result(mysql_result); mysql_free_result(mysql_result);
} }
/* }}} */
/* {{{ php_mysql_set_default_link
*/
static void php_mysql_set_default_link(int id) static void php_mysql_set_default_link(int id)
{ {
MySLS_FETCH(); MySLS_FETCH();
@ -214,8 +221,10 @@ static void php_mysql_set_default_link(int id)
MySG(default_link) = id; MySG(default_link) = id;
zend_list_addref(id); zend_list_addref(id);
} }
/* }}} */
/* {{{ _close_mysql_link
*/
static void _close_mysql_link(zend_rsrc_list_entry *rsrc) static void _close_mysql_link(zend_rsrc_list_entry *rsrc)
{ {
php_mysql_conn *link = (php_mysql_conn *)rsrc->ptr; php_mysql_conn *link = (php_mysql_conn *)rsrc->ptr;
@ -228,7 +237,10 @@ static void _close_mysql_link(zend_rsrc_list_entry *rsrc)
efree(link); efree(link);
MySG(num_links)--; MySG(num_links)--;
} }
/* }}} */
/* {{{ _close_mysql_plink
*/
static void _close_mysql_plink(zend_rsrc_list_entry *rsrc) static void _close_mysql_plink(zend_rsrc_list_entry *rsrc)
{ {
php_mysql_conn *link = (php_mysql_conn *)rsrc->ptr; php_mysql_conn *link = (php_mysql_conn *)rsrc->ptr;
@ -243,8 +255,10 @@ static void _close_mysql_plink(zend_rsrc_list_entry *rsrc)
MySG(num_persistent)--; MySG(num_persistent)--;
MySG(num_links)--; MySG(num_links)--;
} }
/* }}} */
/* {{{ PHP_INI_MH
*/
static PHP_INI_MH(OnMySQLPort) static PHP_INI_MH(OnMySQLPort)
{ {
MySLS_FETCH(); MySLS_FETCH();
@ -269,8 +283,9 @@ static PHP_INI_MH(OnMySQLPort)
} }
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_INI
PHP_INI_BEGIN() PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("mysql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateInt, allow_persistent, zend_mysql_globals, mysql_globals) STD_PHP_INI_BOOLEAN("mysql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateInt, allow_persistent, zend_mysql_globals, mysql_globals)
STD_PHP_INI_ENTRY_EX("mysql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_persistent, zend_mysql_globals, mysql_globals, display_link_numbers) STD_PHP_INI_ENTRY_EX("mysql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_persistent, zend_mysql_globals, mysql_globals, display_link_numbers)
@ -281,8 +296,10 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY("mysql.default_port", NULL, PHP_INI_ALL, OnMySQLPort) PHP_INI_ENTRY("mysql.default_port", NULL, PHP_INI_ALL, OnMySQLPort)
STD_PHP_INI_ENTRY("mysql.default_socket", NULL, PHP_INI_ALL, OnUpdateStringUnempty, default_socket, zend_mysql_globals, mysql_globals) STD_PHP_INI_ENTRY("mysql.default_socket", NULL, PHP_INI_ALL, OnUpdateStringUnempty, default_socket, zend_mysql_globals, mysql_globals)
PHP_INI_END() PHP_INI_END()
/* }}} */
/* {{{ php_mysql_init_globals
*/
static void php_mysql_init_globals(zend_mysql_globals *mysql_globals) static void php_mysql_init_globals(zend_mysql_globals *mysql_globals)
{ {
mysql_globals->num_persistent = 0; mysql_globals->num_persistent = 0;
@ -293,8 +310,10 @@ static void php_mysql_init_globals(zend_mysql_globals *mysql_globals)
mysql_globals->connect_errno = 0; mysql_globals->connect_errno = 0;
mysql_globals->connect_error = NULL; mysql_globals->connect_error = NULL;
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(mysql) PHP_MINIT_FUNCTION(mysql)
{ {
ZEND_INIT_MODULE_GLOBALS(mysql, php_mysql_init_globals, NULL); ZEND_INIT_MODULE_GLOBALS(mysql, php_mysql_init_globals, NULL);
@ -313,15 +332,19 @@ PHP_MINIT_FUNCTION(mysql)
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(mysql) PHP_MSHUTDOWN_FUNCTION(mysql)
{ {
UNREGISTER_INI_ENTRIES(); UNREGISTER_INI_ENTRIES();
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_RINIT_FUNCTION
*/
PHP_RINIT_FUNCTION(mysql) PHP_RINIT_FUNCTION(mysql)
{ {
MySLS_FETCH(); MySLS_FETCH();
@ -333,8 +356,10 @@ PHP_RINIT_FUNCTION(mysql)
MySG(connect_errno)=0; MySG(connect_errno)=0;
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_RSHUTDOWN_FUNCTION
*/
PHP_RSHUTDOWN_FUNCTION(mysql) PHP_RSHUTDOWN_FUNCTION(mysql)
{ {
MySLS_FETCH(); MySLS_FETCH();
@ -343,8 +368,10 @@ PHP_RSHUTDOWN_FUNCTION(mysql)
} }
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(mysql) PHP_MINFO_FUNCTION(mysql)
{ {
char buf[32]; char buf[32];
@ -368,8 +395,10 @@ PHP_MINFO_FUNCTION(mysql)
DISPLAY_INI_ENTRIES(); DISPLAY_INI_ENTRIES();
} }
/* }}} */
/* {{{ php_mysql_do_connect
*/
#define MYSQL_DO_CONNECT_CLEANUP() \ #define MYSQL_DO_CONNECT_CLEANUP() \
if (free_host) { \ if (free_host) { \
efree(host); \ efree(host); \
@ -634,8 +663,10 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
php_mysql_set_default_link(return_value->value.lval); php_mysql_set_default_link(return_value->value.lval);
MYSQL_DO_CONNECT_CLEANUP(); MYSQL_DO_CONNECT_CLEANUP();
} }
/* }}} */
/* {{{ php_mysql_get_default_link
*/
static int php_mysql_get_default_link(INTERNAL_FUNCTION_PARAMETERS MySLS_DC) static int php_mysql_get_default_link(INTERNAL_FUNCTION_PARAMETERS MySLS_DC)
{ {
if (MySG(default_link)==-1) { /* no link opened yet, implicitly open one */ if (MySG(default_link)==-1) { /* no link opened yet, implicitly open one */
@ -644,7 +675,7 @@ static int php_mysql_get_default_link(INTERNAL_FUNCTION_PARAMETERS MySLS_DC)
} }
return MySG(default_link); return MySG(default_link);
} }
/* }}} */
/* {{{ proto int mysql_connect([string hostname[:port][:/path/to/socket]] [, string username] [, string password]) /* {{{ proto int mysql_connect([string hostname[:port][:/path/to/socket]] [, string username] [, string password])
Open a connection to a MySQL Server */ Open a connection to a MySQL Server */
@ -654,7 +685,6 @@ PHP_FUNCTION(mysql_connect)
} }
/* }}} */ /* }}} */
/* {{{ proto int mysql_pconnect([string hostname[:port][:/path/to/socket]] [, string username] [, string password]) /* {{{ proto int mysql_pconnect([string hostname[:port][:/path/to/socket]] [, string username] [, string password])
Open a persistent connection to a MySQL Server */ Open a persistent connection to a MySQL Server */
PHP_FUNCTION(mysql_pconnect) PHP_FUNCTION(mysql_pconnect)
@ -663,7 +693,6 @@ PHP_FUNCTION(mysql_pconnect)
} }
/* }}} */ /* }}} */
/* {{{ proto int mysql_close([int link_identifier]) /* {{{ proto int mysql_close([int link_identifier])
Close a MySQL connection */ Close a MySQL connection */
PHP_FUNCTION(mysql_close) PHP_FUNCTION(mysql_close)
@ -704,7 +733,6 @@ PHP_FUNCTION(mysql_close)
} }
/* }}} */ /* }}} */
/* {{{ proto int mysql_select_db(string database_name [, int link_identifier]) /* {{{ proto int mysql_select_db(string database_name [, int link_identifier])
Select a MySQL database */ Select a MySQL database */
PHP_FUNCTION(mysql_select_db) PHP_FUNCTION(mysql_select_db)
@ -894,7 +922,6 @@ PHP_FUNCTION(mysql_create_db)
} }
/* }}} */ /* }}} */
/* {{{ proto int mysql_drop_db(string database_name [, int link_identifier]) /* {{{ proto int mysql_drop_db(string database_name [, int link_identifier])
Drop (delete) a MySQL database */ Drop (delete) a MySQL database */
PHP_FUNCTION(mysql_drop_db) PHP_FUNCTION(mysql_drop_db)
@ -935,7 +962,8 @@ PHP_FUNCTION(mysql_drop_db)
} }
/* }}} */ /* }}} */
/* {{{ php_mysql_do_query_general
*/
static void php_mysql_do_query_general(zval **query, zval **mysql_link, int link_id, zval **db, int use_store, zval *return_value) static void php_mysql_do_query_general(zval **query, zval **mysql_link, int link_id, zval **db, int use_store, zval *return_value)
{ {
php_mysql_conn *mysql; php_mysql_conn *mysql;
@ -995,8 +1023,10 @@ static void php_mysql_do_query_general(zval **query, zval **mysql_link, int link
mysql->active_result_id = Z_LVAL_P(return_value); mysql->active_result_id = Z_LVAL_P(return_value);
} }
} }
/* }}} */
/* {{{ php_mysql_do_query
*/
static void php_mysql_do_query(INTERNAL_FUNCTION_PARAMETERS, int use_store) static void php_mysql_do_query(INTERNAL_FUNCTION_PARAMETERS, int use_store)
{ {
zval **query, **mysql_link; zval **query, **mysql_link;
@ -1023,7 +1053,7 @@ static void php_mysql_do_query(INTERNAL_FUNCTION_PARAMETERS, int use_store)
} }
php_mysql_do_query_general(query, mysql_link, id, NULL, use_store, return_value); php_mysql_do_query_general(query, mysql_link, id, NULL, use_store, return_value);
} }
/* }}} */
/* {{{ proto int mysql_query(string query [, int link_identifier] [, int result_mode]) /* {{{ proto int mysql_query(string query [, int link_identifier] [, int result_mode])
Send an SQL query to MySQL */ Send an SQL query to MySQL */
@ -1511,7 +1541,8 @@ PHP_FUNCTION(mysql_num_fields)
} }
/* }}} */ /* }}} */
/* {{{ php_mysql_fetch_hash
*/
static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int expected_args) static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int expected_args)
{ {
zval **result, **arg2; zval **result, **arg2;
@ -1594,7 +1625,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
} }
} }
} }
/* }}} */
/* {{{ proto array mysql_fetch_row(int result) /* {{{ proto array mysql_fetch_row(int result)
Get a result row as an enumerated array */ Get a result row as an enumerated array */
@ -1691,7 +1722,8 @@ PHP_FUNCTION(mysql_fetch_lengths)
} }
/* }}} */ /* }}} */
/* {{{ php_mysql_get_field_name
*/
static char *php_mysql_get_field_name(int field_type) static char *php_mysql_get_field_name(int field_type)
{ {
switch(field_type) { switch(field_type) {
@ -1744,7 +1776,7 @@ static char *php_mysql_get_field_name(int field_type)
break; break;
} }
} }
/* }}} */
/* {{{ proto object mysql_fetch_field(int result [, int field_offset]) /* {{{ proto object mysql_fetch_field(int result [, int field_offset])
Get column information from a result and return as an object */ Get column information from a result and return as an object */
@ -1833,7 +1865,8 @@ PHP_FUNCTION(mysql_field_seek)
#define PHP_MYSQL_FIELD_TYPE 4 #define PHP_MYSQL_FIELD_TYPE 4
#define PHP_MYSQL_FIELD_FLAGS 5 #define PHP_MYSQL_FIELD_FLAGS 5
/* {{{ php_mysql_field_info
*/
static void php_mysql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) static void php_mysql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
{ {
zval **result, **field; zval **result, **field;
@ -1952,7 +1985,7 @@ static void php_mysql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
RETURN_FALSE; RETURN_FALSE;
} }
} }
/* }}} */
/* {{{ proto string mysql_field_name(int result, int field_index) /* {{{ proto string mysql_field_name(int result, int field_index)
Get the name of the specified field in a result */ Get the name of the specified field in a result */
@ -2029,5 +2062,3 @@ PHP_FUNCTION(mysql_free_result)
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
*/ */

View file

@ -770,11 +770,14 @@ _oci_conn_list_dtor(oci_connection *connection)
/* }}} */ /* }}} */
/* {{{ php_oci_free_conn_list
*/
static void php_oci_free_conn_list(zend_rsrc_list_entry *rsrc) static void php_oci_free_conn_list(zend_rsrc_list_entry *rsrc)
{ {
oci_connection *conn = (oci_connection *)rsrc->ptr; oci_connection *conn = (oci_connection *)rsrc->ptr;
_oci_conn_list_dtor(conn); _oci_conn_list_dtor(conn);
} }
/* }}} */
#ifdef WITH_COLLECTIONS #ifdef WITH_COLLECTIONS
@ -796,7 +799,7 @@ _oci_coll_list_dtor(zend_rsrc_list_entry *rsrc)
efree(coll); efree(coll);
} }
/* }}} */
#endif #endif
/* {{{ _oci_descriptor_list_dtor() /* {{{ _oci_descriptor_list_dtor()
@ -847,6 +850,8 @@ _oci_session_list_dtor(zend_rsrc_list_entry *rsrc)
/* }}} */ /* }}} */
/* {{{ oci_handle_error
*/
static ub4 static ub4
oci_handle_error(oci_connection *connection, ub4 errcode) oci_handle_error(oci_connection *connection, ub4 errcode)
{ {
@ -862,6 +867,7 @@ oci_handle_error(oci_connection *connection, ub4 errcode)
return 0; /* no fatal error */ return 0; /* no fatal error */
} }
/* }}} */
/* {{{ oci_error() */ /* {{{ oci_error() */
@ -3320,7 +3326,6 @@ PHP_FUNCTION(ocicloselob)
} }
/* }}} */ /* }}} */
#endif #endif
/* {{{ proto string ocinewdescriptor(int connection [, int type]) /* {{{ proto string ocinewdescriptor(int connection [, int type])
@ -3637,7 +3642,6 @@ PHP_FUNCTION(ocicolumnisnull)
/* }}} */ /* }}} */
/* {{{ proto void ociinternaldebug(int onoff) /* {{{ proto void ociinternaldebug(int onoff)
Toggle internal debugging output for the OCI extension */ Toggle internal debugging output for the OCI extension */
/* Disables or enables the internal debug output. /* Disables or enables the internal debug output.
@ -4140,7 +4144,6 @@ PHP_FUNCTION(ociresult)
/* }}} */ /* }}} */
/* {{{ proto string ociserverversion(int conn) /* {{{ proto string ociserverversion(int conn)
Return a string containing server version information */ Return a string containing server version information */

View file

@ -71,6 +71,8 @@ static int le_result, le_conn, le_pconn;
static unsigned char a3_arg3_and_3_force_ref[] = { 3, BYREF_NONE, BYREF_FORCE, BYREF_FORCE }; static unsigned char a3_arg3_and_3_force_ref[] = { 3, BYREF_NONE, BYREF_FORCE, BYREF_FORCE };
/* {{{ odbc_functions[]
*/
function_entry odbc_functions[] = { function_entry odbc_functions[] = {
PHP_FE(odbc_error, NULL) PHP_FE(odbc_error, NULL)
PHP_FE(odbc_errormsg, NULL) PHP_FE(odbc_errormsg, NULL)
@ -126,7 +128,10 @@ function_entry odbc_functions[] = {
PHP_FALIAS(odbc_field_precision, odbc_field_len, NULL) PHP_FALIAS(odbc_field_precision, odbc_field_len, NULL)
{ NULL, NULL, NULL } { NULL, NULL, NULL }
}; };
/* }}} */
/* {{{ odbc_module_entry
*/
zend_module_entry odbc_module_entry = { zend_module_entry odbc_module_entry = {
"odbc", "odbc",
odbc_functions, odbc_functions,
@ -137,6 +142,7 @@ zend_module_entry odbc_module_entry = {
PHP_MINFO(odbc), PHP_MINFO(odbc),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef ZTS #ifdef ZTS
int odbc_globals_id; int odbc_globals_id;
@ -148,6 +154,8 @@ ZEND_API php_odbc_globals odbc_globals;
ZEND_GET_MODULE(odbc) ZEND_GET_MODULE(odbc)
#endif #endif
/* {{{ _free_odbc_result
*/
static void _free_odbc_result(zend_rsrc_list_entry *rsrc) static void _free_odbc_result(zend_rsrc_list_entry *rsrc)
{ {
odbc_result *res = (odbc_result *)rsrc->ptr; odbc_result *res = (odbc_result *)rsrc->ptr;
@ -176,11 +184,11 @@ static void _free_odbc_result(zend_rsrc_list_entry *rsrc)
efree(res); efree(res);
} }
} }
/* }}} */
/* /* {{{ safe_odbc_disconnect
* disconnect, and if it fails, then issue a rollback for any pending transaction (lurcher) * disconnect, and if it fails, then issue a rollback for any pending transaction (lurcher)
*/ */
static void safe_odbc_disconnect( void *handle ) static void safe_odbc_disconnect( void *handle )
{ {
int ret; int ret;
@ -192,7 +200,10 @@ static void safe_odbc_disconnect( void *handle )
SQLDisconnect( handle ); SQLDisconnect( handle );
} }
} }
/* }}} */
/* {{{ _close_odbc_conn
*/
static void _close_odbc_conn(zend_rsrc_list_entry *rsrc) static void _close_odbc_conn(zend_rsrc_list_entry *rsrc)
{ {
odbc_connection *conn = (odbc_connection *)rsrc->ptr; odbc_connection *conn = (odbc_connection *)rsrc->ptr;
@ -205,6 +216,7 @@ static void _close_odbc_conn(zend_rsrc_list_entry *rsrc)
efree(conn); efree(conn);
ODBCG(num_links)--; ODBCG(num_links)--;
} }
/* }}} */
static void _close_odbc_pconn(zend_rsrc_list_entry *rsrc) static void _close_odbc_pconn(zend_rsrc_list_entry *rsrc)
{ {
@ -3507,4 +3519,5 @@ PHP_FUNCTION(odbc_tableprivileges)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -46,6 +46,8 @@ static unsigned char arg2of4_force_ref[] =
static unsigned char arg2and3of4_force_ref[] = static unsigned char arg2and3of4_force_ref[] =
{ 4, BYREF_NONE, BYREF_FORCE, BYREF_FORCE, BYREF_NONE }; { 4, BYREF_NONE, BYREF_FORCE, BYREF_FORCE, BYREF_NONE };
/* {{{ openssl_functions[]
*/
function_entry openssl_functions[] = { function_entry openssl_functions[] = {
PHP_FE(openssl_get_privatekey, NULL) PHP_FE(openssl_get_privatekey, NULL)
PHP_FE(openssl_get_publickey, NULL) PHP_FE(openssl_get_publickey, NULL)
@ -75,7 +77,10 @@ function_entry openssl_functions[] = {
PHP_FE(openssl_error_string, NULL) PHP_FE(openssl_error_string, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
/* {{{ openssl_module_entry
*/
zend_module_entry openssl_module_entry = { zend_module_entry openssl_module_entry = {
"openssl", "openssl",
openssl_functions, openssl_functions,
@ -86,6 +91,7 @@ zend_module_entry openssl_module_entry = {
PHP_MINFO(openssl), PHP_MINFO(openssl),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_OPENSSL #ifdef COMPILE_DL_OPENSSL
ZEND_GET_MODULE(openssl) ZEND_GET_MODULE(openssl)
@ -102,7 +108,8 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char *
static X509_STORE * setup_verify(zval * calist); static X509_STORE * setup_verify(zval * calist);
static STACK_OF(X509) * load_all_certs_from_file(char *certfile); static STACK_OF(X509) * load_all_certs_from_file(char *certfile);
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(openssl) PHP_MINIT_FUNCTION(openssl)
{ {
le_key = zend_register_list_destructors_ex(_php_pkey_free, NULL, "OpenSSL key", module_number); le_key = zend_register_list_destructors_ex(_php_pkey_free, NULL, "OpenSSL key", module_number);
@ -152,7 +159,10 @@ PHP_MINIT_FUNCTION(openssl)
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(openssl) PHP_MINFO_FUNCTION(openssl)
{ {
php_info_print_table_start(); php_info_print_table_start();
@ -160,15 +170,18 @@ PHP_MINFO_FUNCTION(openssl)
php_info_print_table_row(2, "OpenSSL Version", OPENSSL_VERSION_TEXT); php_info_print_table_row(2, "OpenSSL Version", OPENSSL_VERSION_TEXT);
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(openssl) PHP_MSHUTDOWN_FUNCTION(openssl)
{ {
EVP_cleanup(); EVP_cleanup();
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ php_openssl_x509_from_zval
/*
Given a zval, coerce it into an X509 object. Given a zval, coerce it into an X509 object.
The zval can be: The zval can be:
. X509 resource created using openssl_read_x509() . X509 resource created using openssl_read_x509()
@ -236,10 +249,10 @@ static X509 * php_openssl_x509_from_zval(zval ** val, int makeresource, long * r
} }
return cert; return cert;
} }
/* }}} */
/* {{{ php_openssl_evp_from_zval
Given a zval, coerce it into a EVP_PKEY object.
/* Given a zval, coerce it into a EVP_PKEY object.
It can be: It can be:
1. private key resource from openssl_get_privatekey() 1. private key resource from openssl_get_privatekey()
2. X509 resource -> public key will be extracted from it 2. X509 resource -> public key will be extracted from it
@ -353,6 +366,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char *
} }
return key; return key;
} }
/* }}} */
/* {{{ proto bool openssl_private_encrypt(string data, string crypted, mixed key [, int padding]) /* {{{ proto bool openssl_private_encrypt(string data, string crypted, mixed key [, int padding])
Encrypt data with private key */ Encrypt data with private key */
@ -652,7 +666,6 @@ PHP_FUNCTION(openssl_public_decrypt)
} }
/* }}} */ /* }}} */
/* {{{ proto int openssl_get_privatekey(string key [, string passphrase]) /* {{{ proto int openssl_get_privatekey(string key [, string passphrase])
Get private key */ Get private key */
PHP_FUNCTION(openssl_get_privatekey) PHP_FUNCTION(openssl_get_privatekey)
@ -681,7 +694,6 @@ PHP_FUNCTION(openssl_get_privatekey)
} }
/* }}} */ /* }}} */
/* {{{ openssl -> PHP "bridging" */ /* {{{ openssl -> PHP "bridging" */
static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname) static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname)
@ -998,7 +1010,6 @@ clean_exit:
} }
/* }}} */ /* }}} */
/* {{{ proto int openssl_get_publickey(mixed cert) /* {{{ proto int openssl_get_publickey(mixed cert)
Get public key from X.509 certificate */ Get public key from X.509 certificate */
PHP_FUNCTION(openssl_get_publickey) PHP_FUNCTION(openssl_get_publickey)
@ -1020,8 +1031,6 @@ PHP_FUNCTION(openssl_get_publickey)
} }
/* }}} */ /* }}} */
/* {{{ proto void openssl_free_key(int key) /* {{{ proto void openssl_free_key(int key)
Free key */ Free key */
PHP_FUNCTION(openssl_free_key) PHP_FUNCTION(openssl_free_key)
@ -1077,7 +1086,7 @@ PHP_FUNCTION(openssl_x509_free)
} }
/* }}} */ /* }}} */
/* /* {{{ setup_verify
* calist is an array containing file and directory names. create a * calist is an array containing file and directory names. create a
* certificate store and add those certs to it for use in verification. * certificate store and add those certs to it for use in verification.
*/ */
@ -1139,6 +1148,7 @@ static X509_STORE * setup_verify(zval * calist)
} }
return store; return store;
} }
/* }}} */
/* {{{ proto mixed openssl_error_string() /* {{{ proto mixed openssl_error_string()
returns a description of the last error, and alters the index of the error messages. returns false when the are no more messages. */ returns a description of the last error, and alters the index of the error messages. returns false when the are no more messages. */
@ -1864,5 +1874,5 @@ static void _php_x509_free(zend_rsrc_list_entry *rsrc)
* tab-width: 8 * tab-width: 8
* c-basic-offset: 8 * c-basic-offset: 8
* End: * End:
* vim: sw=4 ts=4 tw=78 * vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -93,7 +93,6 @@ PHP_MINFO_FUNCTION(pcre)
} }
/* }}} */ /* }}} */
/* {{{ PHP_MINIT_FUNCTION(pcre) */ /* {{{ PHP_MINIT_FUNCTION(pcre) */
static PHP_MINIT_FUNCTION(pcre) static PHP_MINIT_FUNCTION(pcre)
{ {
@ -114,7 +113,6 @@ static PHP_MINIT_FUNCTION(pcre)
} }
/* }}} */ /* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION(pcre) */ /* {{{ PHP_MSHUTDOWN_FUNCTION(pcre) */
static PHP_MSHUTDOWN_FUNCTION(pcre) static PHP_MSHUTDOWN_FUNCTION(pcre)
{ {
@ -127,7 +125,6 @@ static PHP_MSHUTDOWN_FUNCTION(pcre)
} }
/* }}} */ /* }}} */
/* {{{ PHP_RINIT_FUNCTION(pcre) */ /* {{{ PHP_RINIT_FUNCTION(pcre) */
static PHP_RINIT_FUNCTION(pcre) static PHP_RINIT_FUNCTION(pcre)
{ {
@ -138,7 +135,8 @@ static PHP_RINIT_FUNCTION(pcre)
} }
/* }}} */ /* }}} */
/* {{{ pcre_get_compiled_regex
*/
static pcre* pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_options) { static pcre* pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_options) {
pcre *re = NULL; pcre *re = NULL;
int coptions = 0; int coptions = 0;
@ -320,8 +318,10 @@ static pcre* pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_o
return re; return re;
} }
/* }}} */
/* {{{ php_pcre_match
*/
static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
{ {
zval **regex, /* Regular expression */ zval **regex, /* Regular expression */
@ -521,7 +521,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
RETVAL_LONG(matched); RETVAL_LONG(matched);
} }
/* }}} */
/* {{{ proto int preg_match(string pattern, string subject [, array subpatterns]) /* {{{ proto int preg_match(string pattern, string subject [, array subpatterns])
Perform a Perl-style regular expression match */ Perform a Perl-style regular expression match */
@ -531,7 +531,6 @@ PHP_FUNCTION(preg_match)
} }
/* }}} */ /* }}} */
/* {{{ proto int preg_match_all(string pattern, string subject, array subpatterns [, int order]) /* {{{ proto int preg_match_all(string pattern, string subject, array subpatterns [, int order])
Perform a Perl-style global regular expression match */ Perform a Perl-style global regular expression match */
PHP_FUNCTION(preg_match_all) PHP_FUNCTION(preg_match_all)
@ -540,7 +539,8 @@ PHP_FUNCTION(preg_match_all)
} }
/* }}} */ /* }}} */
/* {{{ preg_get_backref
*/
static inline int preg_get_backref(const char *walk, int *backref) static inline int preg_get_backref(const char *walk, int *backref)
{ {
if (*walk && *walk >= '0' && *walk <= '9') if (*walk && *walk >= '0' && *walk <= '9')
@ -553,7 +553,10 @@ static inline int preg_get_backref(const char *walk, int *backref)
return 1; return 1;
} }
/* }}} */
/* {{{ preg_do_repl_func
*/
static int preg_do_repl_func(zval *function, char *subject, int *offsets, int count, char **result) static int preg_do_repl_func(zval *function, char *subject, int *offsets, int count, char **result)
{ {
zval *retval_ptr; /* Function return value */ zval *retval_ptr; /* Function return value */
@ -584,7 +587,10 @@ static int preg_do_repl_func(zval *function, char *subject, int *offsets, int co
return result_len; return result_len;
} }
/* }}} */
/* {{{ preg_do_eval
*/
static int preg_do_eval(char *eval_str, int eval_str_len, char *subject, static int preg_do_eval(char *eval_str, int eval_str_len, char *subject,
int *offsets, int count, char **result) int *offsets, int count, char **result)
{ {
@ -674,8 +680,10 @@ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject,
return result_len; return result_len;
} }
/* }}} */
/* {{{ php_pcre_replace
*/
char *php_pcre_replace(char *regex, int regex_len, char *php_pcre_replace(char *regex, int regex_len,
char *subject, int subject_len, char *subject, int subject_len,
zval *replace_val, int is_callable_replace, zval *replace_val, int is_callable_replace,
@ -883,8 +891,10 @@ char *php_pcre_replace(char *regex, int regex_len,
return result; return result;
} }
/* }}} */
/* {{{ php_replace_in_subject
*/
static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject, int *result_len, int limit, zend_bool is_callable_replace) static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject, int *result_len, int limit, zend_bool is_callable_replace)
{ {
zval **regex_entry, zval **regex_entry,
@ -960,8 +970,10 @@ static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject,
return result; return result;
} }
} }
/* }}} */
/* {{{ preg_replace_impl
*/
static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callable_replace) static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callable_replace)
{ {
zval **regex, zval **regex,
@ -1039,7 +1051,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
} }
} }
} }
/* }}} */
/* {{{ proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit]) /* {{{ proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit])
Perform Perl-style regular expression replacement. */ Perform Perl-style regular expression replacement. */
@ -1049,7 +1061,6 @@ PHP_FUNCTION(preg_replace)
} }
/* }}} */ /* }}} */
/* {{{ proto string preg_replace_callback(mixed regex, mixed callback, mixed subject [, int limit]) /* {{{ proto string preg_replace_callback(mixed regex, mixed callback, mixed subject [, int limit])
Perform Perl-style regular expression replacement using replacement callback. */ Perform Perl-style regular expression replacement using replacement callback. */
PHP_FUNCTION(preg_replace_callback) PHP_FUNCTION(preg_replace_callback)
@ -1058,7 +1069,6 @@ PHP_FUNCTION(preg_replace_callback)
} }
/* }}} */ /* }}} */
/* {{{ proto array preg_split(string pattern, string subject [, int limit [, int flags]]) /* {{{ proto array preg_split(string pattern, string subject [, int limit [, int flags]])
Split string into an array using a perl-style regular expression as a delimiter */ Split string into an array using a perl-style regular expression as a delimiter */
PHP_FUNCTION(preg_split) PHP_FUNCTION(preg_split)
@ -1193,7 +1203,6 @@ PHP_FUNCTION(preg_split)
} }
/* }}} */ /* }}} */
/* {{{ proto string preg_quote(string str, string delim_char) /* {{{ proto string preg_quote(string str, string delim_char)
Quote regular expression characters plus an optional character */ Quote regular expression characters plus an optional character */
PHP_FUNCTION(preg_quote) PHP_FUNCTION(preg_quote)
@ -1278,7 +1287,6 @@ PHP_FUNCTION(preg_quote)
} }
/* }}} */ /* }}} */
/* {{{ proto array preg_grep(string regex, array input) /* {{{ proto array preg_grep(string regex, array input)
Searches array and returns entries which match regex */ Searches array and returns entries which match regex */
PHP_FUNCTION(preg_grep) PHP_FUNCTION(preg_grep)
@ -1367,7 +1375,6 @@ PHP_FUNCTION(preg_grep)
} }
/* }}} */ /* }}} */
/* {{{ module definition structures */ /* {{{ module definition structures */
unsigned char third_arg_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; unsigned char third_arg_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
@ -1399,7 +1406,6 @@ ZEND_GET_MODULE(pcre)
/* }}} */ /* }}} */
#endif /* HAVE_PCRE || HAVE_BUNDLED_PCRE */ #endif /* HAVE_PCRE || HAVE_BUNDLED_PCRE */
/* /*
@ -1407,4 +1413,5 @@ ZEND_GET_MODULE(pcre)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -24,6 +24,8 @@
Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */ Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */
/* Note that there is no code from the pdflib package in this file */ /* Note that there is no code from the pdflib package in this file */
/* {{{ includes
*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@ -49,6 +51,7 @@ static int le_gd;
# include <io.h> # include <io.h>
# include <fcntl.h> # include <fcntl.h>
#endif #endif
/* }}} */
#if HAVE_PDFLIB #if HAVE_PDFLIB
@ -56,6 +59,7 @@ static int le_gd;
static int le_pdf; static int le_pdf;
/* {{{ constants
/* /*
* to adopt the php way of error handling to PDFlib * to adopt the php way of error handling to PDFlib
* The image related functions in PDFlib return -1 on error * The image related functions in PDFlib return -1 on error
@ -67,7 +71,10 @@ static int le_pdf;
#define PDFLIB_PDI_OFFSET 1 #define PDFLIB_PDI_OFFSET 1
#define PDFLIB_PATTERN_OFFSET 1 #define PDFLIB_PATTERN_OFFSET 1
#define PDFLIB_SPOT_OFFSET 1 #define PDFLIB_SPOT_OFFSET 1
/* }}} */
/* {{{ pdf_functions[]
*/
function_entry pdf_functions[] = { function_entry pdf_functions[] = {
/* sorry for sorting this stuff like the pdflib manual, /* sorry for sorting this stuff like the pdflib manual,
but this helps me to see what is done :) RJS but this helps me to see what is done :) RJS
@ -229,7 +236,10 @@ function_entry pdf_functions[] = {
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
/* {{{ pdf_module_entry
*/
zend_module_entry pdf_module_entry = { zend_module_entry pdf_module_entry = {
"pdf", "pdf",
pdf_functions, pdf_functions,
@ -240,11 +250,14 @@ zend_module_entry pdf_module_entry = {
PHP_MINFO(pdf), PHP_MINFO(pdf),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_PDF #ifdef COMPILE_DL_PDF
ZEND_GET_MODULE(pdf) ZEND_GET_MODULE(pdf)
#endif #endif
/* {{{ _free_pdf_doc
*/
static void _free_pdf_doc(zend_rsrc_list_entry *rsrc) static void _free_pdf_doc(zend_rsrc_list_entry *rsrc)
{ {
/* RJS: TODO: /* RJS: TODO:
@ -254,7 +267,10 @@ static void _free_pdf_doc(zend_rsrc_list_entry *rsrc)
/* PDF_delete(pdf); /* PDF_delete(pdf);
*/ */
} }
/* }}} */
/* {{{ custom_errorhandler
*/
static void custom_errorhandler(PDF *p, int type, const char *shortmsg) static void custom_errorhandler(PDF *p, int type, const char *shortmsg)
{ {
switch (type){ switch (type){
@ -284,28 +300,43 @@ static void custom_errorhandler(PDF *p, int type, const char *shortmsg)
php_error(E_ERROR,"PDFlib error: %s", shortmsg); php_error(E_ERROR,"PDFlib error: %s", shortmsg);
} }
} }
/* }}} */
/* {{{ pdf_emalloc
*/
static void *pdf_emalloc(PDF *p, size_t size, const char *caller) static void *pdf_emalloc(PDF *p, size_t size, const char *caller)
{ {
return(emalloc(size)); return(emalloc(size));
} }
/* }}} */
/* {{{ pdf_realloc
*/
static void *pdf_realloc(PDF *p, void *mem, size_t size, const char *caller) static void *pdf_realloc(PDF *p, void *mem, size_t size, const char *caller)
{ {
return(erealloc(mem, size)); return(erealloc(mem, size));
} }
/* }}} */
/* {{{ pdf_efree
*/
static void pdf_efree(PDF *p, void *mem) static void pdf_efree(PDF *p, void *mem)
{ {
efree(mem); efree(mem);
} }
/* }}} */
/* {{{ pdf_flushwrite
*/
static size_t pdf_flushwrite(PDF *p, void *data, size_t size) static size_t pdf_flushwrite(PDF *p, void *data, size_t size)
{ {
return(php_write(data, size)); return(php_write(data, size));
return 0; return 0;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(pdf) PHP_MINFO_FUNCTION(pdf)
{ {
char tmp[32]; char tmp[32];
@ -324,7 +355,10 @@ PHP_MINFO_FUNCTION(pdf)
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(pdf) PHP_MINIT_FUNCTION(pdf)
{ {
if ((PDF_get_majorversion() != PDFLIB_MAJORVERSION) || if ((PDF_get_majorversion() != PDFLIB_MAJORVERSION) ||
@ -337,14 +371,19 @@ PHP_MINIT_FUNCTION(pdf)
PDF_boot(); PDF_boot();
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(pdf) PHP_MSHUTDOWN_FUNCTION(pdf)
{ {
PDF_shutdown(); PDF_shutdown();
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ _php_pdf_set_info
*/
static void _php_pdf_set_info(INTERNAL_FUNCTION_PARAMETERS, char *field) static void _php_pdf_set_info(INTERNAL_FUNCTION_PARAMETERS, char *field)
{ {
zval **arg1, **arg2; zval **arg1, **arg2;
@ -361,6 +400,7 @@ static void _php_pdf_set_info(INTERNAL_FUNCTION_PARAMETERS, char *field)
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto bool pdf_set_info(int pdfdoc, string fieldname, string value) /* {{{ proto bool pdf_set_info(int pdfdoc, string fieldname, string value)
Fills an info field of the document */ Fills an info field of the document */
@ -422,7 +462,6 @@ PHP_FUNCTION(pdf_set_info_keywords) {
} }
/* }}} */ /* }}} */
/* {{{ proto int pdf_open([int filedesc]) /* {{{ proto int pdf_open([int filedesc])
Opens a new pdf document. If filedesc is NULL, document is created in memory. This is the old interface, only for compatibility use pdf_new + pdf_open_file instead */ Opens a new pdf document. If filedesc is NULL, document is created in memory. This is the old interface, only for compatibility use pdf_new + pdf_open_file instead */
PHP_FUNCTION(pdf_open) PHP_FUNCTION(pdf_open)
@ -640,7 +679,8 @@ PHP_FUNCTION(pdf_set_font)
} }
/* }}} */ /* }}} */
/* {{{ _php_pdf_set_value
*/
static void _php_pdf_set_value(INTERNAL_FUNCTION_PARAMETERS, char *field) static void _php_pdf_set_value(INTERNAL_FUNCTION_PARAMETERS, char *field)
{ {
zval **arg1, **arg2; zval **arg1, **arg2;
@ -657,6 +697,7 @@ static void _php_pdf_set_value(INTERNAL_FUNCTION_PARAMETERS, char *field)
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto void pdf_set_value(int pdfdoc, string key, double value) /* {{{ proto void pdf_set_value(int pdfdoc, string key, double value)
Sets arbitrary value */ Sets arbitrary value */
@ -1776,6 +1817,8 @@ PHP_FUNCTION(pdf_set_duration)
} }
/* }}} */ /* }}} */
/* {{{ _php_pdf_open_image
*/
static void _php_pdf_open_image(INTERNAL_FUNCTION_PARAMETERS, char *type) static void _php_pdf_open_image(INTERNAL_FUNCTION_PARAMETERS, char *type)
{ {
zval **arg1, **arg2; zval **arg1, **arg2;
@ -1801,6 +1844,7 @@ static void _php_pdf_open_image(INTERNAL_FUNCTION_PARAMETERS, char *type)
RETURN_LONG(pdf_image+PDFLIB_IMAGE_OFFSET); RETURN_LONG(pdf_image+PDFLIB_IMAGE_OFFSET);
} }
/* }}} */
/* {{{ proto int pdf_open_gif(int pdf, string giffile) /* {{{ proto int pdf_open_gif(int pdf, string giffile)
Opens a GIF file and returns an image for placement in a pdf object */ Opens a GIF file and returns an image for placement in a pdf object */
@ -2670,6 +2714,7 @@ PHP_FUNCTION(pdf_open_pdi) {
RETURN_LONG(pdi_handle+PDFLIB_PDI_OFFSET); RETURN_LONG(pdi_handle+PDFLIB_PDI_OFFSET);
} }
/* }}} */
/* {{{ proto void pdf_close_pdi(int pdf, int doc); /* {{{ proto void pdf_close_pdi(int pdf, int doc);
* Close all open page handles, and close the input PDF document. */ * Close all open page handles, and close the input PDF document. */
@ -2690,6 +2735,7 @@ PHP_FUNCTION(pdf_close_pdi) {
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto int pdf_open_pdi_page(int pdf, int doc, int page, string label); /* {{{ proto int pdf_open_pdi_page(int pdf, int doc, int page, string label);
* Prepare a page for later use with PDF_place_image(). */ * Prepare a page for later use with PDF_place_image(). */
@ -2715,6 +2761,7 @@ PHP_FUNCTION(pdf_open_pdi_page) {
RETURN_LONG(pdi_image+PDFLIB_IMAGE_OFFSET); RETURN_LONG(pdi_image+PDFLIB_IMAGE_OFFSET);
} }
/* }}} */
/* {{{ proto void pdf_place_pdi_page(int pdf, int page, double x, double y, double sx, double sy) /* {{{ proto void pdf_place_pdi_page(int pdf, int page, double x, double y, double sx, double sy)
* Place a PDF page with the lower left corner at (x, y), and scale it. */ * Place a PDF page with the lower left corner at (x, y), and scale it. */
@ -2743,6 +2790,7 @@ PHP_FUNCTION(pdf_place_pdi_page) {
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto void pdf_close_pdi_page(int pdf, int page); /* {{{ proto void pdf_close_pdi_page(int pdf, int page);
* Close the page handle, and free all page-related resources. */ * Close the page handle, and free all page-related resources. */
@ -2763,6 +2811,7 @@ PHP_FUNCTION(pdf_close_pdi_page) {
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto string pdf_get_pdi_parameter(int pdf, string key, int doc, int page, int index); /* {{{ proto string pdf_get_pdi_parameter(int pdf, string key, int doc, int page, int index);
* Get the contents of some PDI document parameter with string type. */ * Get the contents of some PDI document parameter with string type. */
@ -2792,6 +2841,7 @@ PHP_FUNCTION(pdf_get_pdi_parameter) {
RETURN_STRINGL((char *)buffer, size, 1); RETURN_STRINGL((char *)buffer, size, 1);
} }
/* }}} */
/* {{{ proto double pdf_get_pdi_value(int pdf, string key, int doc, int page, int index); /* {{{ proto double pdf_get_pdi_value(int pdf, string key, int doc, int page, int index);
* Get the contents of some PDI document parameter with numerical type. */ * Get the contents of some PDI document parameter with numerical type. */
@ -2819,6 +2869,7 @@ PHP_FUNCTION(pdf_get_pdi_value) {
RETURN_DOUBLE(value); RETURN_DOUBLE(value);
} }
/* }}} */
/* {{{ proto int pdf_begin_pattern(int pdf, double width, double height, double xstep, double ystep, int painttype); /* {{{ proto int pdf_begin_pattern(int pdf, double width, double height, double xstep, double ystep, int painttype);
* Start a new pattern definition. */ * Start a new pattern definition. */
@ -2848,6 +2899,7 @@ PHP_FUNCTION(pdf_begin_pattern) {
RETURN_LONG(pattern_image+PDFLIB_PATTERN_OFFSET); RETURN_LONG(pattern_image+PDFLIB_PATTERN_OFFSET);
} }
/* }}} */
/* {{{ proto void pdf_end_pattern(int pdf); /* {{{ proto void pdf_end_pattern(int pdf);
* Finish the pattern definition. */ * Finish the pattern definition. */
@ -2865,6 +2917,7 @@ PHP_FUNCTION(pdf_end_pattern) {
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto int pdf_begin_template(int pdf, double width, double height); /* {{{ proto int pdf_begin_template(int pdf, double width, double height);
* Start a new template definition. */ * Start a new template definition. */
@ -2888,6 +2941,7 @@ PHP_FUNCTION(pdf_begin_template) {
RETURN_LONG(tmpl_image+PDFLIB_IMAGE_OFFSET); RETURN_LONG(tmpl_image+PDFLIB_IMAGE_OFFSET);
} }
/* }}} */
/* {{{ proto void pdf_end_template(int pdf); /* {{{ proto void pdf_end_template(int pdf);
* Finish the template definition. */ * Finish the template definition. */
@ -2906,6 +2960,7 @@ PHP_FUNCTION(pdf_end_template) {
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto void pdf_setcolor(int pdf, string type, string colorspace, double c1 [, double c2 [, double c3 [, double c4]]]); /* {{{ proto void pdf_setcolor(int pdf, string type, string colorspace, double c1 [, double c2 [, double c3 [, double c4]]]);
* Set the current color space and color. */ * Set the current color space and color. */
@ -2968,6 +3023,7 @@ PHP_FUNCTION(pdf_setcolor) {
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto int pdf_makespotcolor(int pdf, string spotname); /* {{{ proto int pdf_makespotcolor(int pdf, string spotname);
* Make a named spot color from the current color. */ * Make a named spot color from the current color. */
@ -2990,6 +3046,7 @@ PHP_FUNCTION(pdf_makespotcolor) {
RETURN_LONG(spotcolor+PDFLIB_SPOT_OFFSET); RETURN_LONG(spotcolor+PDFLIB_SPOT_OFFSET);
} }
/* }}} */
/* {{{ proto void pdf_arcn(int pdf, double x, double y, double r, double alpha, double beta); /* {{{ proto void pdf_arcn(int pdf, double x, double y, double r, double alpha, double beta);
* Draw a clockwise circular arc from alpha to beta degrees. */ * Draw a clockwise circular arc from alpha to beta degrees. */
@ -3018,6 +3075,7 @@ PHP_FUNCTION(pdf_arcn) {
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto void pdf_initgraphics(int pdf); /* {{{ proto void pdf_initgraphics(int pdf);
* Reset all implicit color and graphics state parameters to their defaults. */ * Reset all implicit color and graphics state parameters to their defaults. */
@ -3035,6 +3093,7 @@ PHP_FUNCTION(pdf_initgraphics) {
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto void pdf_add_thumbnail(int pdf, int image); /* {{{ proto void pdf_add_thumbnail(int pdf, int image);
* Add an existing image as thumbnail for the current page. */ * Add an existing image as thumbnail for the current page. */
@ -3055,6 +3114,7 @@ PHP_FUNCTION(pdf_add_thumbnail) {
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto void pdf_setmatrix(int pdf, double a, double b, double c, double d, double e, double f) /* {{{ proto void pdf_setmatrix(int pdf, double a, double b, double c, double d, double e, double f)
Explicitly set the current transformation matrix. */ Explicitly set the current transformation matrix. */
@ -3085,7 +3145,7 @@ PHP_FUNCTION(pdf_setmatrix) {
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
#endif /* PDFlib >= V4 */ #endif /* PDFlib >= V4 */
#endif #endif

View file

@ -599,4 +599,5 @@ PHP_FUNCTION(pfpro_process)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -45,6 +45,8 @@
#define CHECK_DEFAULT_LINK(x) if (x == -1) { php_error(E_WARNING, "%s: no PostgreSQL link opened yet", get_active_function_name()); } #define CHECK_DEFAULT_LINK(x) if (x == -1) { php_error(E_WARNING, "%s: no PostgreSQL link opened yet", get_active_function_name()); }
/* {{{ pgsql_functions[]
*/
function_entry pgsql_functions[] = { function_entry pgsql_functions[] = {
PHP_FE(pg_connect, NULL) PHP_FE(pg_connect, NULL)
PHP_FE(pg_pconnect, NULL) PHP_FE(pg_pconnect, NULL)
@ -94,7 +96,10 @@ function_entry pgsql_functions[] = {
#endif #endif
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
/* {{{ pgsql_module_entry
*/
zend_module_entry pgsql_module_entry = { zend_module_entry pgsql_module_entry = {
"pgsql", "pgsql",
pgsql_functions, pgsql_functions,
@ -105,6 +110,7 @@ zend_module_entry pgsql_module_entry = {
PHP_MINFO(pgsql), PHP_MINFO(pgsql),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_PGSQL #ifdef COMPILE_DL_PGSQL
ZEND_GET_MODULE(pgsql) ZEND_GET_MODULE(pgsql)
@ -118,6 +124,8 @@ int pgsql_globals_id;
PHP_PGSQL_API php_pgsql_globals pgsql_globals; PHP_PGSQL_API php_pgsql_globals pgsql_globals;
#endif #endif
/* {{{ php_pgsql_set_default_link
*/
static void php_pgsql_set_default_link(int id) static void php_pgsql_set_default_link(int id)
{ {
PGLS_FETCH(); PGLS_FETCH();
@ -130,8 +138,10 @@ static void php_pgsql_set_default_link(int id)
PGG(default_link) = id; PGG(default_link) = id;
} }
/* }}} */
/* {{{ _close_pgsql_link
*/
static void _close_pgsql_link(zend_rsrc_list_entry *rsrc) static void _close_pgsql_link(zend_rsrc_list_entry *rsrc)
{ {
PGconn *link = (PGconn *)rsrc->ptr; PGconn *link = (PGconn *)rsrc->ptr;
@ -140,8 +150,10 @@ static void _close_pgsql_link(zend_rsrc_list_entry *rsrc)
PQfinish(link); PQfinish(link);
PGG(num_links)--; PGG(num_links)--;
} }
/* }}} */
/* {{{ _close_pgsql_plink
*/
static void _close_pgsql_plink(zend_rsrc_list_entry *rsrc) static void _close_pgsql_plink(zend_rsrc_list_entry *rsrc)
{ {
PGconn *link = (PGconn *)rsrc->ptr; PGconn *link = (PGconn *)rsrc->ptr;
@ -154,8 +166,10 @@ static void _close_pgsql_plink(zend_rsrc_list_entry *rsrc)
efree(PGG(last_notice)); efree(PGG(last_notice));
} }
} }
/* }}} */
/* {{{ _notice_handler
*/
static void static void
_notice_handler(void *arg, const char *message) _notice_handler(void *arg, const char *message)
{ {
@ -169,7 +183,10 @@ _notice_handler(void *arg, const char *message)
PGG(last_notice) = estrdup(message); PGG(last_notice) = estrdup(message);
} }
} }
/* }}} */
/* {{{ _rollback_transactions
*/
static int _rollback_transactions(zend_rsrc_list_entry *rsrc) static int _rollback_transactions(zend_rsrc_list_entry *rsrc)
{ {
PGconn *link; PGconn *link;
@ -186,36 +203,48 @@ static int _rollback_transactions(zend_rsrc_list_entry *rsrc)
return 0; return 0;
} }
/* }}} */
/* {{{ _free_ptr
*/
static void _free_ptr(zend_rsrc_list_entry *rsrc) static void _free_ptr(zend_rsrc_list_entry *rsrc)
{ {
pgLofp *lofp = (pgLofp *)rsrc->ptr; pgLofp *lofp = (pgLofp *)rsrc->ptr;
efree(lofp); efree(lofp);
} }
/* }}} */
/* {{{ _free_result
*/
static void _free_result(zend_rsrc_list_entry *rsrc) static void _free_result(zend_rsrc_list_entry *rsrc)
{ {
pgsql_result_handle *pg_result = (pgsql_result_handle *)rsrc->ptr; pgsql_result_handle *pg_result = (pgsql_result_handle *)rsrc->ptr;
PQclear(pg_result->result); PQclear(pg_result->result);
efree(pg_result); efree(pg_result);
} }
/* }}} */
/* {{{ PHP_INI
*/
PHP_INI_BEGIN() PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("pgsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateInt, allow_persistent, php_pgsql_globals, pgsql_globals) STD_PHP_INI_BOOLEAN("pgsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateInt, allow_persistent, php_pgsql_globals, pgsql_globals)
STD_PHP_INI_ENTRY_EX("pgsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_persistent, php_pgsql_globals, pgsql_globals, display_link_numbers) STD_PHP_INI_ENTRY_EX("pgsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_persistent, php_pgsql_globals, pgsql_globals, display_link_numbers)
STD_PHP_INI_ENTRY_EX("pgsql.max_links", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_links, php_pgsql_globals, pgsql_globals, display_link_numbers) STD_PHP_INI_ENTRY_EX("pgsql.max_links", "-1", PHP_INI_SYSTEM, OnUpdateInt, max_links, php_pgsql_globals, pgsql_globals, display_link_numbers)
PHP_INI_END() PHP_INI_END()
/* }}} */
/* {{{ php_pgsql_init_globals
*/
static void php_pgsql_init_globals(PGLS_D) static void php_pgsql_init_globals(PGLS_D)
{ {
PGG(num_persistent) = 0; PGG(num_persistent) = 0;
PGG(ignore_notices) = 0; PGG(ignore_notices) = 0;
PGG(last_notice) = NULL; PGG(last_notice) = NULL;
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(pgsql) PHP_MINIT_FUNCTION(pgsql)
{ {
#ifdef ZTS #ifdef ZTS
@ -239,15 +268,19 @@ PHP_MINIT_FUNCTION(pgsql)
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(pgsql) PHP_MSHUTDOWN_FUNCTION(pgsql)
{ {
UNREGISTER_INI_ENTRIES(); UNREGISTER_INI_ENTRIES();
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_RINIT_FUNCTION
*/
PHP_RINIT_FUNCTION(pgsql) PHP_RINIT_FUNCTION(pgsql)
{ {
PGLS_FETCH(); PGLS_FETCH();
@ -256,16 +289,20 @@ PHP_RINIT_FUNCTION(pgsql)
PGG(num_links) = PGG(num_persistent); PGG(num_links) = PGG(num_persistent);
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_RSHUTDOWN_FUNCTION
*/
PHP_RSHUTDOWN_FUNCTION(pgsql) PHP_RSHUTDOWN_FUNCTION(pgsql)
{ {
ELS_FETCH(); ELS_FETCH();
zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions); zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions);
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(pgsql) PHP_MINFO_FUNCTION(pgsql)
{ {
char buf[32]; char buf[32];
@ -282,8 +319,11 @@ PHP_MINFO_FUNCTION(pgsql)
DISPLAY_INI_ENTRIES(); DISPLAY_INI_ENTRIES();
} }
/* }}} */
/* {{{ php_pgsql_do_connect
*/
void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
{ {
char *host=NULL,*port=NULL,*options=NULL,*tty=NULL,*dbname=NULL,*connstring=NULL; char *host=NULL,*port=NULL,*options=NULL,*tty=NULL,*dbname=NULL,*connstring=NULL;
@ -497,8 +537,10 @@ void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
efree(hashed_details); efree(hashed_details);
php_pgsql_set_default_link(return_value->value.lval); php_pgsql_set_default_link(return_value->value.lval);
} }
/* }}} */
/* {{{ php_pgsql_get_default_link
*/
int php_pgsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS) int php_pgsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
{ {
PGLS_FETCH(); PGLS_FETCH();
@ -509,7 +551,7 @@ int php_pgsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
} }
return PGG(default_link); return PGG(default_link);
} }
/* }}} */
/* {{{ proto int pg_connect([string connection_string] | [string host, string port [, string options [, string tty,]] string database) /* {{{ proto int pg_connect([string connection_string] | [string host, string port [, string options [, string tty,]] string database)
Open a PostgreSQL connection */ Open a PostgreSQL connection */
@ -576,6 +618,8 @@ PHP_FUNCTION(pg_close)
#define PHP_PG_TTY 5 #define PHP_PG_TTY 5
#define PHP_PG_HOST 6 #define PHP_PG_HOST 6
/* {{{ php_pgsql_get_link_info
*/
void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
{ {
zval **pgsql_link = NULL; zval **pgsql_link = NULL;
@ -626,6 +670,7 @@ void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
return_value->value.str.val = (char *) estrdup(return_value->value.str.val); return_value->value.str.val = (char *) estrdup(return_value->value.str.val);
return_value->type = IS_STRING; return_value->type = IS_STRING;
} }
/* }}} */
/* {{{ proto string pg_dbname([int connection]) /* {{{ proto string pg_dbname([int connection])
Get the database name */ Get the database name */
@ -743,6 +788,7 @@ PHP_FUNCTION(pg_exec)
} }
} }
/* }}} */ /* }}} */
/* {{{ proto int pg_end_copy([int connection]) /* {{{ proto int pg_end_copy([int connection])
Sync with backend. Completes the Copy command */ Sync with backend. Completes the Copy command */
PHP_FUNCTION(pg_end_copy) PHP_FUNCTION(pg_end_copy)
@ -824,6 +870,8 @@ PHP_FUNCTION(pg_put_line)
#define PHP_PG_NUM_FIELDS 2 #define PHP_PG_NUM_FIELDS 2
#define PHP_PG_CMD_TUPLES 3 #define PHP_PG_CMD_TUPLES 3
/* {{{ php_pgsql_get_result_info
*/
void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
{ {
zval **result; zval **result;
@ -858,6 +906,7 @@ void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
} }
return_value->type = IS_LONG; return_value->type = IS_LONG;
} }
/* }}} */
/* {{{ proto int pg_numrows(int result) /* {{{ proto int pg_numrows(int result)
Return the number of rows in the result */ Return the number of rows in the result */
@ -897,6 +946,8 @@ PHP_FUNCTION(pg_last_notice)
} }
/* }}} */ /* }}} */
/* {{{ get_field_name
*/
char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list) char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list)
{ {
PGresult *result; PGresult *result;
@ -941,12 +992,14 @@ char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list)
} }
return ret; return ret;
} }
/* }}} */
#define PHP_PG_FIELD_NAME 1 #define PHP_PG_FIELD_NAME 1
#define PHP_PG_FIELD_SIZE 2 #define PHP_PG_FIELD_SIZE 2
#define PHP_PG_FIELD_TYPE 3 #define PHP_PG_FIELD_TYPE 3
/* {{{ php_pgsql_get_field_info
*/
void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
{ {
zval **result, **field; zval **result, **field;
@ -987,6 +1040,7 @@ void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
RETURN_FALSE; RETURN_FALSE;
} }
} }
/* }}} */
/* {{{ proto string pg_fieldname(int result, int field_number) /* {{{ proto string pg_fieldname(int result, int field_number)
Returns the name of the field */ Returns the name of the field */
@ -1081,7 +1135,8 @@ PHP_FUNCTION(pg_result)
} }
/* }}} */ /* }}} */
/* {{{ void php_pgsql_fetch_hash
*/
static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
{ {
zval **result, **row, **arg3; zval **result, **row, **arg3;
@ -1160,7 +1215,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
} }
} }
} }
/* }}} */
/* {{{ proto array pg_fetch_row(int result, int row) /* {{{ proto array pg_fetch_row(int result, int row)
Get a row as an enumerated array */ Get a row as an enumerated array */
@ -1195,6 +1250,8 @@ PHP_FUNCTION(pg_fetch_object)
#define PHP_PG_DATA_LENGTH 1 #define PHP_PG_DATA_LENGTH 1
#define PHP_PG_DATA_ISNULL 2 #define PHP_PG_DATA_ISNULL 2
/* {{{ php_pgsql_data_info
*/
void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
{ {
zval **result, **row, **field; zval **result, **row, **field;
@ -1240,6 +1297,7 @@ void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
} }
return_value->type = IS_LONG; return_value->type = IS_LONG;
} }
/* }}} */
/* {{{ proto int pg_fieldprtlen(int result, int row, mixed field_name_or_number) /* {{{ proto int pg_fieldprtlen(int result, int row, mixed field_name_or_number)
Returns the printed length */ Returns the printed length */
@ -1311,7 +1369,6 @@ PHP_FUNCTION(pg_getlastoid)
} }
/* }}} */ /* }}} */
/* {{{ proto bool pg_trace(string filename [, string mode [, resource connection]]) /* {{{ proto bool pg_trace(string filename [, string mode [, resource connection]])
Enable tracing a PostgreSQL connection */ Enable tracing a PostgreSQL connection */
PHP_FUNCTION(pg_trace) PHP_FUNCTION(pg_trace)
@ -1367,7 +1424,7 @@ PHP_FUNCTION(pg_trace)
ZEND_REGISTER_RESOURCE(NULL, fp, php_file_le_fopen()); ZEND_REGISTER_RESOURCE(NULL, fp, php_file_le_fopen());
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto bool pg_untrace([int connection]) /* {{{ proto bool pg_untrace([int connection])
Disable tracing of a PostgreSQL connection */ Disable tracing of a PostgreSQL connection */
@ -1397,7 +1454,7 @@ PHP_FUNCTION(pg_untrace)
PQuntrace(pgsql); PQuntrace(pgsql);
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto int pg_locreate(int connection) /* {{{ proto int pg_locreate(int connection)
Create a large object */ Create a large object */
@ -1901,4 +1958,3 @@ PHP_FUNCTION(pg_client_encoding)
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
*/ */

View file

@ -29,7 +29,6 @@
/* $Id$ */ /* $Id$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@ -66,6 +65,8 @@
#define SAFE_STRING(s) ((s)?(s):"") #define SAFE_STRING(s) ((s)?(s):"")
/* {{{ posix_functions[]
*/
function_entry posix_functions[] = { function_entry posix_functions[] = {
/* POSIX.1, 3.3 */ /* POSIX.1, 3.3 */
PHP_FE(posix_kill, NULL) PHP_FE(posix_kill, NULL)
@ -121,9 +122,12 @@ function_entry posix_functions[] = {
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
static PHP_MINFO_FUNCTION(posix); static PHP_MINFO_FUNCTION(posix);
/* {{{ posix_module_entry
*/
zend_module_entry posix_module_entry = { zend_module_entry posix_module_entry = {
"posix", "posix",
posix_functions, posix_functions,
@ -134,17 +138,21 @@ zend_module_entry posix_module_entry = {
PHP_MINFO(posix), PHP_MINFO(posix),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_POSIX #ifdef COMPILE_DL_POSIX
ZEND_GET_MODULE(posix) ZEND_GET_MODULE(posix)
#endif #endif
/* {{{ PHP_MINFO_FUNCTION
*/
static PHP_MINFO_FUNCTION(posix) static PHP_MINFO_FUNCTION(posix)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "Revision", "$Revision$"); php_info_print_table_row(2, "Revision", "$Revision$");
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ proto int posix_kill(int pid, int sig) /* {{{ proto int posix_kill(int pid, int sig)
Send a signal to a process (POSIX.1, 3.3.2) */ Send a signal to a process (POSIX.1, 3.3.2) */
@ -349,7 +357,6 @@ PHP_FUNCTION(posix_setegid)
} }
/* }}} */ /* }}} */
/* {{{ proto long posix_getgroups(void) /* {{{ proto long posix_getgroups(void)
Get supplementary group id's (POSIX.1, 4.2.3) */ Get supplementary group id's (POSIX.1, 4.2.3) */
PHP_FUNCTION(posix_getgroups) PHP_FUNCTION(posix_getgroups)
@ -685,6 +692,7 @@ PHP_FUNCTION(posix_mkfifo)
RETURN_FALSE; RETURN_FALSE;
#endif #endif
} }
/* }}} */
/* /*
POSIX.1, 5.5.1 unlink() POSIX.1, 5.5.1 unlink()
@ -735,7 +743,6 @@ PHP_FUNCTION(posix_getgrnam)
} }
/* }}} */ /* }}} */
/* {{{ proto array posix_getgrgid(long gid) /* {{{ proto array posix_getgrgid(long gid)
Group database access (POSIX.1, 9.2.1) */ Group database access (POSIX.1, 9.2.1) */
PHP_FUNCTION(posix_getgrgid) PHP_FUNCTION(posix_getgrgid)
@ -840,6 +847,8 @@ PHP_FUNCTION(posix_getpwuid)
#define UNLIMITED_STRING "unlimited" #define UNLIMITED_STRING "unlimited"
/* {{{ posix_addlimit
*/
static int posix_addlimit(int limit, char *name, pval *return_value) { static int posix_addlimit(int limit, char *name, pval *return_value) {
int result; int result;
struct rlimit rl; struct rlimit rl;
@ -869,7 +878,10 @@ static int posix_addlimit(int limit, char *name, pval *return_value) {
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ limits[]
*/
struct limitlist { struct limitlist {
int limit; int limit;
char *name; char *name;
@ -924,6 +936,7 @@ struct limitlist {
{ 0, NULL } { 0, NULL }
}; };
/* }}} */
#endif /* HAVE_GETRLIMIT */ #endif /* HAVE_GETRLIMIT */
@ -948,7 +961,6 @@ PHP_FUNCTION(posix_getrlimit)
} }
/* }}} */ /* }}} */
#endif #endif
/* /*
@ -956,4 +968,5 @@ PHP_FUNCTION(posix_getrlimit)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -45,6 +45,8 @@
#define PSPELL_SPEED_MASK_INTERNAL 3L #define PSPELL_SPEED_MASK_INTERNAL 3L
#define PSPELL_RUN_TOGETHER 8L #define PSPELL_RUN_TOGETHER 8L
/* {{{ pspell_functions[]
*/
function_entry pspell_functions[] = { function_entry pspell_functions[] = {
PHP_FE(pspell_new, NULL) PHP_FE(pspell_new, NULL)
PHP_FE(pspell_new_personal, NULL) PHP_FE(pspell_new_personal, NULL)
@ -64,6 +66,7 @@ function_entry pspell_functions[] = {
PHP_FE(pspell_config_repl, NULL) PHP_FE(pspell_config_repl, NULL)
PHP_FE(pspell_config_save_repl, NULL) PHP_FE(pspell_config_save_repl, NULL)
}; };
/* }}} */
static int le_pspell, le_pspell_config; static int le_pspell, le_pspell_config;
@ -87,6 +90,8 @@ static void php_pspell_close_config(zend_rsrc_list_entry *rsrc)
delete_pspell_config(config); delete_pspell_config(config);
} }
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(pspell){ PHP_MINIT_FUNCTION(pspell){
REGISTER_MAIN_LONG_CONSTANT("PSPELL_FAST", PSPELL_FAST, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT("PSPELL_FAST", PSPELL_FAST, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("PSPELL_NORMAL", PSPELL_NORMAL, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT("PSPELL_NORMAL", PSPELL_NORMAL, CONST_PERSISTENT | CONST_CS);
@ -96,6 +101,7 @@ PHP_MINIT_FUNCTION(pspell){
le_pspell_config = zend_register_list_destructors_ex(php_pspell_close_config, NULL, "pspell config", module_number); le_pspell_config = zend_register_list_destructors_ex(php_pspell_close_config, NULL, "pspell config", module_number);
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ proto int pspell_new(string language [, string spelling [, string jargon [, string encoding [, int mode]]]]) /* {{{ proto int pspell_new(string language [, string spelling [, string jargon [, string encoding [, int mode]]]])
Load a dictionary */ Load a dictionary */
@ -777,11 +783,22 @@ PHP_FUNCTION(pspell_config_save_repl){
} }
/* }}} */ /* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(pspell) PHP_MINFO_FUNCTION(pspell)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "PSpell Support", "enabled"); php_info_print_table_row(2, "PSpell Support", "enabled");
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -16,6 +16,7 @@
| Ilia Alshanetsky (iliaa@home.com) | | Ilia Alshanetsky (iliaa@home.com) |
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
/* $Id$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
@ -39,8 +40,8 @@ php_shmop_globals shmop_globals;
int shm_type; int shm_type;
/* Every user visible function must have an entry in shmop_functions[]. /* {{{ shmop_functions[]
*/ */
function_entry shmop_functions[] = { function_entry shmop_functions[] = {
PHP_FE(shmop_open, NULL) PHP_FE(shmop_open, NULL)
PHP_FE(shmop_read, NULL) PHP_FE(shmop_read, NULL)
@ -50,7 +51,10 @@ function_entry shmop_functions[] = {
PHP_FE(shmop_delete, NULL) PHP_FE(shmop_delete, NULL)
{NULL, NULL, NULL} /* Must be the last line in shmop_functions[] */ {NULL, NULL, NULL} /* Must be the last line in shmop_functions[] */
}; };
/* }}} */
/* {{{ shmop_module_entry
*/
zend_module_entry shmop_module_entry = { zend_module_entry shmop_module_entry = {
"shmop", "shmop",
shmop_functions, shmop_functions,
@ -61,36 +65,49 @@ zend_module_entry shmop_module_entry = {
PHP_MINFO(shmop), PHP_MINFO(shmop),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_SHMOP #ifdef COMPILE_DL_SHMOP
ZEND_GET_MODULE(shmop) ZEND_GET_MODULE(shmop)
#endif #endif
/* {{{ rsclean
*/
static void rsclean(zend_rsrc_list_entry *rsrc) static void rsclean(zend_rsrc_list_entry *rsrc)
{ {
struct php_shmop *shmop = (struct php_shmop *)rsrc->ptr; struct php_shmop *shmop = (struct php_shmop *)rsrc->ptr;
shmdt(shmop->addr); shmdt(shmop->addr);
efree(shmop); efree(shmop);
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(shmop) PHP_MINIT_FUNCTION(shmop)
{ {
shm_type = zend_register_list_destructors_ex(rsclean, NULL, "shmop", module_number); shm_type = zend_register_list_destructors_ex(rsclean, NULL, "shmop", module_number);
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(shmop) PHP_MSHUTDOWN_FUNCTION(shmop)
{ {
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(shmop) PHP_MINFO_FUNCTION(shmop)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "shmop support", "enabled"); php_info_print_table_row(2, "shmop support", "enabled");
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ proto int shmop_open (int key, int flags, int mode, int size) /* {{{ proto int shmop_open (int key, int flags, int mode, int size)
gets and attaches a shared memory segment */ gets and attaches a shared memory segment */
@ -158,7 +175,6 @@ PHP_FUNCTION(shmop_open)
} }
/* }}} */ /* }}} */
/* {{{ proto string shmop_read (int shmid, int start, int count) /* {{{ proto string shmop_read (int shmid, int start, int count)
reads from a shm segment */ reads from a shm segment */
PHP_FUNCTION(shmop_read) PHP_FUNCTION(shmop_read)
@ -210,7 +226,6 @@ PHP_FUNCTION(shmop_read)
} }
/* }}} */ /* }}} */
/* {{{ proto void shmop_close (int shmid) /* {{{ proto void shmop_close (int shmid)
closes a shared memory segment */ closes a shared memory segment */
PHP_FUNCTION(shmop_close) PHP_FUNCTION(shmop_close)
@ -235,7 +250,6 @@ PHP_FUNCTION(shmop_close)
} }
/* }}} */ /* }}} */
/* {{{ proto int shmop_size (int shmid) /* {{{ proto int shmop_size (int shmid)
returns the shm size */ returns the shm size */
PHP_FUNCTION(shmop_size) PHP_FUNCTION(shmop_size)
@ -261,7 +275,6 @@ PHP_FUNCTION(shmop_size)
} }
/* }}} */ /* }}} */
/* {{{ proto int shmop_write (int shmid, string data, int offset) /* {{{ proto int shmop_write (int shmid, string data, int offset)
writes to a shared memory segment */ writes to a shared memory segment */
PHP_FUNCTION(shmop_write) PHP_FUNCTION(shmop_write)
@ -298,7 +311,6 @@ PHP_FUNCTION(shmop_write)
} }
/* }}} */ /* }}} */
/* {{{ proto bool shmop_delete (int shmid) /* {{{ proto bool shmop_delete (int shmid)
mark segment for deletion */ mark segment for deletion */
PHP_FUNCTION(shmop_delete) PHP_FUNCTION(shmop_delete)
@ -331,10 +343,10 @@ PHP_FUNCTION(shmop_delete)
#endif /* HAVE_SHMOP */ #endif /* HAVE_SHMOP */
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -15,14 +15,18 @@ ZEND_DECLARE_MODULE_GLOBALS(extname)
/* True global resources - no need for thread safety here */ /* True global resources - no need for thread safety here */
static int le_extname; static int le_extname;
/* Every user visible function must have an entry in extname_functions[]. /* {{{ extname_functions[]
*/ *
* Every user visible function must have an entry in extname_functions[].
*/
function_entry extname_functions[] = { function_entry extname_functions[] = {
PHP_FE(confirm_extname_compiled, NULL) /* For testing, remove later. */ PHP_FE(confirm_extname_compiled, NULL) /* For testing, remove later. */
/* __function_entries_here__ */ /* __function_entries_here__ */
{NULL, NULL, NULL} /* Must be the last line in extname_functions[] */ {NULL, NULL, NULL} /* Must be the last line in extname_functions[] */
}; };
/* {{{ extname_module_entry
*/
zend_module_entry extname_module_entry = { zend_module_entry extname_module_entry = {
"extname", "extname",
extname_functions, extname_functions,
@ -33,18 +37,24 @@ zend_module_entry extname_module_entry = {
PHP_MINFO(extname), PHP_MINFO(extname),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_EXTNAME #ifdef COMPILE_DL_EXTNAME
ZEND_GET_MODULE(extname) ZEND_GET_MODULE(extname)
#endif #endif
/* {{{ PHP_INI
*/
/* Remove comments and fill if you need to have entries in php.ini /* Remove comments and fill if you need to have entries in php.ini
PHP_INI_BEGIN() PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("extname.value", "42", PHP_INI_ALL, OnUpdateInt, global_value, zend_extname_globals, extname_globals) STD_PHP_INI_ENTRY("extname.value", "42", PHP_INI_ALL, OnUpdateInt, global_value, zend_extname_globals, extname_globals)
STD_PHP_INI_ENTRY("extname.string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_extname_globals, extname_globals) STD_PHP_INI_ENTRY("extname.string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_extname_globals, extname_globals)
PHP_INI_END() PHP_INI_END()
*/ */
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(extname) PHP_MINIT_FUNCTION(extname)
{ {
/* Remove comments if you have entries in php.ini /* Remove comments if you have entries in php.ini
@ -52,7 +62,10 @@ PHP_MINIT_FUNCTION(extname)
*/ */
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(extname) PHP_MSHUTDOWN_FUNCTION(extname)
{ {
/* Remove comments if you have entries in php.ini /* Remove comments if you have entries in php.ini
@ -60,19 +73,28 @@ PHP_MSHUTDOWN_FUNCTION(extname)
*/ */
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* Remove if there's nothing to do at request start */ /* Remove if there's nothing to do at request start */
/* {{{ PHP_RINIT_FUNCTION
*/
PHP_RINIT_FUNCTION(extname) PHP_RINIT_FUNCTION(extname)
{ {
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* Remove if there's nothing to do at request end */ /* Remove if there's nothing to do at request end */
/* {{{ PHP_RSHUTDOWN_FUNCTION
*/
PHP_RSHUTDOWN_FUNCTION(extname) PHP_RSHUTDOWN_FUNCTION(extname)
{ {
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(extname) PHP_MINFO_FUNCTION(extname)
{ {
php_info_print_table_start(); php_info_print_table_start();
@ -83,6 +105,7 @@ PHP_MINFO_FUNCTION(extname)
DISPLAY_INI_ENTRIES(); DISPLAY_INI_ENTRIES();
*/ */
} }
/* }}} */
/* Remove the following function when you have succesfully modified config.m4 /* Remove the following function when you have succesfully modified config.m4
so that your module can be compiled into PHP, it exists only for testing so that your module can be compiled into PHP, it exists only for testing
@ -107,12 +130,18 @@ PHP_FUNCTION(confirm_extname_compiled)
RETURN_STRINGL(string, len, 1); RETURN_STRINGL(string, len, 1);
} }
/* }}} */ /* }}} */
/* The previous line is meant for emacs, so it can correctly fold and unfold /* The previous line is meant for vim and emacs, so it can correctly fold and
functions in source code. See the corresponding marks just before function unfold functions in source code. See the corresponding marks just before
definition, where the functions purpose is also documented. Please follow function definition, where the functions purpose is also documented. Please
this convention for the convenience of others editing your code. follow this convention for the convenience of others editing your code.
*/ */
/* __function_stubs_here__ */ /* __function_stubs_here__ */
/* __footer_here__ */ /*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -79,6 +79,8 @@ void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st);
/* constant - can be shared among threads */ /* constant - can be shared among threads */
static oid objid_mib[] = {1, 3, 6, 1, 2, 1}; static oid objid_mib[] = {1, 3, 6, 1, 2, 1};
/* {{{ snmp_functions[]
*/
function_entry snmp_functions[] = { function_entry snmp_functions[] = {
PHP_FE(snmpget, NULL) PHP_FE(snmpget, NULL)
PHP_FE(snmpwalk, NULL) PHP_FE(snmpwalk, NULL)
@ -89,7 +91,10 @@ function_entry snmp_functions[] = {
PHP_FE(snmpset, NULL) PHP_FE(snmpset, NULL)
{NULL,NULL,NULL} {NULL,NULL,NULL}
}; };
/* }}} */
/* {{{ snmp_module_entry
*/
zend_module_entry snmp_module_entry = { zend_module_entry snmp_module_entry = {
"snmp", "snmp",
snmp_functions, snmp_functions,
@ -100,6 +105,7 @@ zend_module_entry snmp_module_entry = {
PHP_MINFO(snmp), PHP_MINFO(snmp),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_SNMP #ifdef COMPILE_DL_SNMP
ZEND_GET_MODULE(snmp) ZEND_GET_MODULE(snmp)
@ -107,12 +113,17 @@ ZEND_GET_MODULE(snmp)
/* THREAD_LS snmp_module php_snmp_module; - may need one of these at some point */ /* THREAD_LS snmp_module php_snmp_module; - may need one of these at some point */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(snmp) PHP_MINIT_FUNCTION(snmp)
{ {
init_mib(); init_mib();
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(snmp) PHP_MINFO_FUNCTION(snmp)
{ {
php_info_print_table_start(); php_info_print_table_start();
@ -120,9 +131,10 @@ PHP_MINFO_FUNCTION(snmp)
php_info_print_table_row(2, "UCD-SNMP Version", VersionInfo); php_info_print_table_row(2, "UCD-SNMP Version", VersionInfo);
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ php_snmp
/* *
* Generic SNMP object fetcher * Generic SNMP object fetcher
* *
* st=1 snmpget() - query an agent and return a single value. * st=1 snmpget() - query an agent and return a single value.
@ -342,6 +354,7 @@ retry:
} /* keepwalking */ } /* keepwalking */
snmp_close(ss); snmp_close(ss);
} }
/* }}} */
/* {{{ proto string snmpget(string host, string community, string object_id [, int timeout [, int retries]]) /* {{{ proto string snmpget(string host, string community, string object_id [, int timeout [, int retries]])
Fetch a SNMP object */ Fetch a SNMP object */
@ -393,8 +406,9 @@ PHP_FUNCTION(snmpset) {
#endif #endif
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
*/ * vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -21,16 +21,21 @@ Created from the snmputil sample in the Microsoft SDK for NT
#include <snmp.h> #include <snmp.h>
#include <mgmtapi.h> #include <mgmtapi.h>
/* {{{ snmp_functions[]
*/
function_entry snmp_functions[] = { function_entry snmp_functions[] = {
{"snmpget", php3_snmpget, NULL}, {"snmpget", php3_snmpget, NULL},
{"snmpwalk", php3_snmpwalk, NULL}, {"snmpwalk", php3_snmpwalk, NULL},
{NULL,NULL,NULL} {NULL,NULL,NULL}
}; };
/* }}} */
/* {{{ snmp_module_entry
*/
zend_module_entry snmp_module_entry = { zend_module_entry snmp_module_entry = {
"SNMP",snmp_functions,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL "SNMP",snmp_functions,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL
}; };
/* }}} */
#if COMPILE_DL #if COMPILE_DL
DLEXPORT zend_module_entry *get_module() { return &snmp_module_entry; } DLEXPORT zend_module_entry *get_module() { return &snmp_module_entry; }
@ -43,8 +48,9 @@ DLEXPORT zend_module_entry *get_module() { return &snmp_module_entry; }
#define TIMEOUT 6000 /* milliseconds */ #define TIMEOUT 6000 /* milliseconds */
#define RETRIES 3 #define RETRIES 3
/* {{{ _php_snmp
void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) { */
void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
pval *a1, *a2, *a3; pval *a1, *a2, *a3;
INT operation; INT operation;
LPSTR agent; LPSTR agent;
@ -209,20 +215,28 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
php_error(E_WARNING,"error on SnmpMgrClose %d\n", GetLastError()); php_error(E_WARNING,"error on SnmpMgrClose %d\n", GetLastError());
} }
} }
/* }}} */
/* {{{ php3_snmpget
*/
DLEXPORT void php3_snmpget(INTERNAL_FUNCTION_PARAMETERS) { DLEXPORT void php3_snmpget(INTERNAL_FUNCTION_PARAMETERS) {
_php3_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); _php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,1);
} }
/* }}} */
/* {{{ php3_snmpwalk
*/
DLEXPORT void php3_snmpwalk(INTERNAL_FUNCTION_PARAMETERS) { DLEXPORT void php3_snmpwalk(INTERNAL_FUNCTION_PARAMETERS) {
_php3_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,2); _php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,2);
} }
/* }}} */
#endif #endif
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -3122,4 +3122,5 @@ PHP_FUNCTION(key_exists)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -329,4 +329,5 @@ PHP_FUNCTION(assert_options)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -196,4 +196,5 @@ PHP_FUNCTION(base64_decode) {
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -2623,4 +2623,5 @@ PHP_FUNCTION(is_callable)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -253,4 +253,5 @@ PHP_FUNCTION(get_browser)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -131,4 +131,5 @@ PHP_NAMED_FUNCTION(php_if_crc32)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -109,3 +109,10 @@ PHPAPI void php_print_credits(int flag)
PUTS("</body></html>\n"); PUTS("</body></html>\n");
} }
} }
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -182,4 +182,5 @@ PHP_FUNCTION(crypt)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -288,3 +288,11 @@ PHP_FUNCTION(convert_cyr_string)
RETVAL_STRING((char *)str, 0) RETVAL_STRING((char *)str, 0)
} }
/* }}} */ /* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -804,4 +804,5 @@ PHP_FUNCTION(strtotime)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -364,4 +364,5 @@ PHP_NAMED_FUNCTION(php_if_readdir)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -227,4 +227,5 @@ PHP_MINFO_FUNCTION(dl)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -324,4 +324,5 @@ PHP_FUNCTION(getmxrr)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -480,4 +480,5 @@ PHP_FUNCTION(shell_exec)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -2447,7 +2447,5 @@ php_meta_tags_token php_next_meta_token(FILE *fp, int socketd, int issock, int *
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: tw=78 sw=4 ts=4 * vim: tw=78 sw=4 ts=4 fdm=marker
*/ */

View file

@ -868,4 +868,5 @@ FileFunction(php_if_stat,17)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -216,3 +216,11 @@ int inet_aton(const char *cp, struct in_addr *ap)
} }
#endif /* !HAVE_INET_ATON */ #endif /* !HAVE_INET_ATON */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -665,4 +665,5 @@ PHP_FUNCTION(user_printf)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -761,5 +761,5 @@ PHP_RSHUTDOWN_FUNCTION(fsock)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 * vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -311,3 +311,11 @@ FILE *php_fopen_url_wrap_ftp(char *path, char *mode, int options, int *issock, i
*socketd = 0; *socketd = 0;
return NULL; return NULL;
} }
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -279,4 +279,5 @@ PHP_FUNCTION(headers_sent)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -471,4 +471,5 @@ PHP_FUNCTION(get_html_translation_table)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -302,3 +302,11 @@ FILE *php_fopen_url_wrap_http(char *path, char *mode, int options, int *issock,
} }
return (fp); return (fp);
} }
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -494,3 +494,11 @@ PHP_FUNCTION(getimagesize)
} }
} }
/* }}} */ /* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -119,3 +119,11 @@ void php_store_class_name(zval *object, const char *name, size_t len)
zend_hash_update(object->value.obj.properties, MAGIC_MEMBER, sizeof(MAGIC_MEMBER), &val, sizeof(val), NULL); zend_hash_update(object->value.obj.properties, MAGIC_MEMBER, sizeof(MAGIC_MEMBER), &val, sizeof(val), NULL);
} }
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -558,4 +558,5 @@ PHP_FUNCTION(php_uname)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -282,6 +282,7 @@ PHP_FUNCTION(iptcembed)
RETURN_TRUE; RETURN_TRUE;
} }
} }
/* }}} */
/* {{{ proto array iptcparse(string iptcdata) /* {{{ proto array iptcparse(string iptcdata)
Parse binary IPTC-data into associative array */ Parse binary IPTC-data into associative array */
@ -374,4 +375,5 @@ PHP_FUNCTION(iptcparse)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -70,6 +70,7 @@ PHP_FUNCTION(ezmlm_hash)
RETURN_LONG((int) h); RETURN_LONG((int) h);
} }
/* }}} */
/* {{{ proto int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]]) /* {{{ proto int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
Send an email message */ Send an email message */
@ -129,6 +130,8 @@ PHP_FUNCTION(mail)
} }
/* }}} */ /* }}} */
/* {{{ php_mail
*/
int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd) int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd)
{ {
#ifdef PHP_WIN32 #ifdef PHP_WIN32
@ -186,7 +189,10 @@ int php_mail(char *to, char *subject, char *message, char *headers, char *extra_
#endif #endif
return 1; return 1;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(mail) PHP_MINFO_FUNCTION(mail)
{ {
#ifdef PHP_WIN32 #ifdef PHP_WIN32
@ -195,6 +201,7 @@ PHP_MINFO_FUNCTION(mail)
php_info_print_table_row(2, "Path to sendmail", INI_STR("sendmail_path") ); php_info_print_table_row(2, "Path to sendmail", INI_STR("sendmail_path") );
#endif #endif
} }
/* }}} */
#else #else
@ -203,9 +210,10 @@ PHP_MINFO_FUNCTION(mail) {}
#endif #endif
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -725,4 +725,5 @@ PHP_FUNCTION(number_format)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -360,4 +360,5 @@ unsigned int len;
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -466,4 +466,5 @@ static int metaphone(char *word, int max_phonemes, char **phoned_word, int tradi
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -146,4 +146,5 @@ PHP_FUNCTION(getrusage)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -613,11 +613,10 @@ PHPAPI int php_get_output_start_lineno()
return OG(output_start_lineno); return OG(output_start_lineno);
} }
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -863,10 +863,10 @@ PHP_MINIT_FUNCTION(pack)
return SUCCESS; return SUCCESS;
} }
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -123,3 +123,11 @@ PHP_FUNCTION(getlastmod)
} }
} }
/* }}} */ /* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -45,3 +45,11 @@ FILE *php_fopen_url_wrap_php(char *path, char *mode, int options, int *issock, i
return NULL; return NULL;
} }
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -127,3 +127,11 @@ PHP_FUNCTION(quoted_printable_decode)
RETVAL_STRINGL(str_out, j, 0); RETVAL_STRINGL(str_out, j, 0);
} }
/* }}} */ /* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -333,7 +333,6 @@ PHP_FUNCTION(getrandmax)
} }
/* }}} */ /* }}} */
/* {{{ proto int mt_getrandmax(void) /* {{{ proto int mt_getrandmax(void)
Returns the maximum value a random number from Mersenne Twister can have */ Returns the maximum value a random number from Mersenne Twister can have */
PHP_FUNCTION(mt_getrandmax) PHP_FUNCTION(mt_getrandmax)
@ -346,9 +345,11 @@ PHP_FUNCTION(mt_getrandmax)
return_value->value.lval = MT_RAND_MAX; /* 2^^31 */ return_value->value.lval = MT_RAND_MAX; /* 2^^31 */
} }
/* }}} */ /* }}} */
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -609,7 +609,6 @@ PHP_FUNCTION(spliti)
/* }}} */ /* }}} */
/* {{{ proto string sql_regcase(string string) /* {{{ proto string sql_regcase(string string)
Make regular expression for case insensitive match */ Make regular expression for case insensitive match */
PHPAPI PHP_FUNCTION(sql_regcase) PHPAPI PHP_FUNCTION(sql_regcase)
@ -646,11 +645,10 @@ PHPAPI PHP_FUNCTION(sql_regcase)
} }
/* }}} */ /* }}} */
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -1242,3 +1242,10 @@ inline void scan_set_error_return(int numVars,pval **return_value) {
} }
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -117,4 +117,5 @@ PHP_FUNCTION(soundex)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -113,7 +113,8 @@ static char *php_bin2hex(const unsigned char *old, const size_t oldlen, size_t *
} }
#ifdef HAVE_LOCALECONV #ifdef HAVE_LOCALECONV
/* glibc's localeconv is not reentrant, so lets make it so ... sorta */ /* {{{ localeconv_r
* glibc's localeconv is not reentrant, so lets make it so ... sorta */
struct lconv *localeconv_r(struct lconv *out) struct lconv *localeconv_r(struct lconv *out)
{ {
struct lconv *res; struct lconv *res;
@ -133,15 +134,21 @@ struct lconv *localeconv_r(struct lconv *out)
return out; return out;
} }
/* }}} */
# ifdef ZTS # ifdef ZTS
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(localeconv) PHP_MINIT_FUNCTION(localeconv)
{ {
locale_mutex = tsrm_mutex_alloc(); locale_mutex = tsrm_mutex_alloc();
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(localeconv) PHP_MSHUTDOWN_FUNCTION(localeconv)
{ {
tsrm_mutex_free( locale_mutex ); tsrm_mutex_free( locale_mutex );
@ -150,6 +157,7 @@ PHP_MSHUTDOWN_FUNCTION(localeconv)
return SUCCESS; return SUCCESS;
} }
/* }}} */
# endif # endif
#endif #endif
@ -227,8 +235,11 @@ PHP_FUNCTION(strcoll)
RETURN_LONG(strcoll((const char *)(*s1)->value.str.val, (const char *)(*s2)->value.str.val)); RETURN_LONG(strcoll((const char *)(*s1)->value.str.val, (const char *)(*s2)->value.str.val));
} }
/* }}} */
#endif #endif
/* {{{ php_trim
*/
PHPAPI void php_trim(zval *str, zval * return_value, int mode) PHPAPI void php_trim(zval *str, zval * return_value, int mode)
/* mode 1 : trim left /* mode 1 : trim left
mode 2 : trim right mode 2 : trim right
@ -264,6 +275,7 @@ PHPAPI void php_trim(zval *str, zval * return_value, int mode)
} }
RETVAL_STRINGL(c, len, 1); RETVAL_STRINGL(c, len, 1);
} }
/* }}} */
/* {{{ proto string rtrim(string str) /* {{{ proto string rtrim(string str)
An alias for chop */ An alias for chop */
@ -325,7 +337,6 @@ PHP_FUNCTION(ltrim)
} }
/* }}} */ /* }}} */
/* {{{ proto string wordwrap(string str [, int width [, string break [, int cut]]]) /* {{{ proto string wordwrap(string str [, int width [, string break [, int cut]]])
Wrap buffer to selected number of characters using string break char */ Wrap buffer to selected number of characters using string break char */
PHP_FUNCTION(wordwrap) PHP_FUNCTION(wordwrap)
@ -483,7 +494,8 @@ PHP_FUNCTION(wordwrap)
} }
/* }}} */ /* }}} */
/* {{{ php_explode
*/
PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, int limit) PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, int limit)
{ {
char *p1, *p2, *endp; char *p1, *p2, *endp;
@ -506,6 +518,7 @@ PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, int limit)
add_next_index_stringl(return_value, p1, endp-p1, 1); add_next_index_stringl(return_value, p1, endp-p1, 1);
} }
} }
/* }}} */
/* {{{ proto array explode(string separator, string str [, int limit]) /* {{{ proto array explode(string separator, string str [, int limit])
Split a string on string separator and return array of components */ Split a string on string separator and return array of components */
@ -550,10 +563,12 @@ PHP_FUNCTION(explode)
} }
/* }}} */ /* }}} */
/* {{{ proto string join(array src, string glue) /* {{{ proto string join(array src, string glue)
An alias for implode */ An alias for implode */
/* }}} */ /* }}} */
/* {{{ php_implode
*/
PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value) PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value)
{ {
zval **tmp; zval **tmp;
@ -592,7 +607,7 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value)
return_value->type = IS_STRING; return_value->type = IS_STRING;
return_value->value.str.len = len; return_value->value.str.len = len;
} }
/* }}} */
/* {{{ proto string implode(array src, string glue) /* {{{ proto string implode(array src, string glue)
Join array elements placing glue string between items and return one string */ Join array elements placing glue string between items and return one string */
@ -623,7 +638,6 @@ PHP_FUNCTION(implode)
} }
/* }}} */ /* }}} */
/* {{{ proto string strtok([string str,] string token) /* {{{ proto string strtok([string str,] string token)
Tokenize a string */ Tokenize a string */
PHP_FUNCTION(strtok) PHP_FUNCTION(strtok)
@ -682,6 +696,8 @@ PHP_FUNCTION(strtok)
} }
/* }}} */ /* }}} */
/* {{{ php_strtoupper
*/
PHPAPI char *php_strtoupper(char *s, size_t len) PHPAPI char *php_strtoupper(char *s, size_t len)
{ {
char *c; char *c;
@ -695,6 +711,7 @@ PHPAPI char *php_strtoupper(char *s, size_t len)
} }
return (s); return (s);
} }
/* }}} */
/* {{{ proto string strtoupper(string str) /* {{{ proto string strtoupper(string str)
Make a string uppercase */ Make a string uppercase */
@ -713,7 +730,8 @@ PHP_FUNCTION(strtoupper)
} }
/* }}} */ /* }}} */
/* {{{ php_strtolower
*/
PHPAPI char *php_strtolower(char *s, size_t len) PHPAPI char *php_strtolower(char *s, size_t len)
{ {
register int ch; register int ch;
@ -727,6 +745,7 @@ PHPAPI char *php_strtolower(char *s, size_t len)
} }
return (s); return (s);
} }
/* }}} */
/* {{{ proto string strtolower(string str) /* {{{ proto string strtolower(string str)
Make a string lowercase */ Make a string lowercase */
@ -746,6 +765,8 @@ PHP_FUNCTION(strtolower)
} }
/* }}} */ /* }}} */
/* {{{ php_basename
*/
PHPAPI char *php_basename(char *s, size_t len) PHPAPI char *php_basename(char *s, size_t len)
{ {
char *ret=NULL, *c, *p=NULL, buf='\0'; char *ret=NULL, *c, *p=NULL, buf='\0';
@ -776,6 +797,7 @@ PHPAPI char *php_basename(char *s, size_t len)
if(buf) *p = buf; if(buf) *p = buf;
return (ret); return (ret);
} }
/* }}} */
/* {{{ proto string basename(string path) /* {{{ proto string basename(string path)
Return the filename component of the path */ Return the filename component of the path */
@ -793,7 +815,9 @@ PHP_FUNCTION(basename)
} }
/* }}} */ /* }}} */
/* This function doesn't work with absolute paths in Win32 such as C:\foo /* {{{ php_dirname
*
* This function doesn't work with absolute paths in Win32 such as C:\foo
* (and it didn't before either). This needs to be fixed * (and it didn't before either). This needs to be fixed
*/ */
PHPAPI void php_dirname(char *path, int len) PHPAPI void php_dirname(char *path, int len)
@ -838,6 +862,7 @@ PHPAPI void php_dirname(char *path, int len)
} }
*(end+1) = '\0'; *(end+1) = '\0';
} }
/* }}} */
/* {{{ proto string dirname(string path) /* {{{ proto string dirname(string path)
Return the directory name component of the path */ Return the directory name component of the path */
@ -922,7 +947,8 @@ PHP_FUNCTION(pathinfo)
} }
/* }}} */ /* }}} */
/* case insensitve strstr */ /* {{{ php_stristr
* case insensitve strstr */
PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, PHPAPI char *php_stristr(unsigned char *s, unsigned char *t,
size_t s_len, size_t t_len) size_t s_len, size_t t_len)
{ {
@ -930,7 +956,10 @@ PHPAPI char *php_stristr(unsigned char *s, unsigned char *t,
php_strtolower(t, t_len); php_strtolower(t, t_len);
return php_memnstr(s, t, t_len, s + s_len); return php_memnstr(s, t, t_len, s + s_len);
} }
/* }}} */
/* {{{ php_strspn
*/
PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end) PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end)
{ {
register const char *p = s1, *spanp; register const char *p = s1, *spanp;
@ -944,7 +973,10 @@ cont:
} }
return (p - s1); return (p - s1);
} }
/* }}} */
/* {{{ php_strcspn
*/
PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end) PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end)
{ {
register const char *p, *spanp; register const char *p, *spanp;
@ -960,6 +992,7 @@ PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end)
} }
/* NOTREACHED */ /* NOTREACHED */
} }
/* }}} */
/* {{{ proto string stristr(string haystack, string needle) /* {{{ proto string stristr(string haystack, string needle)
Find first occurrence of a string within another, case insensitive */ Find first occurrence of a string within another, case insensitive */
@ -1178,6 +1211,8 @@ PHP_FUNCTION(strrchr)
} }
/* }}} */ /* }}} */
/* {{{ php_chunk_split
*/
static char *php_chunk_split(char *src, int srclen, char *end, int endlen, static char *php_chunk_split(char *src, int srclen, char *end, int endlen,
int chunklen, int *destlen) int chunklen, int *destlen)
{ {
@ -1213,6 +1248,7 @@ static char *php_chunk_split(char *src, int srclen, char *end, int endlen,
return(dest); return(dest);
} }
/* }}} */
/* {{{ proto string chunk_split(string str [, int chunklen [, string ending]]) /* {{{ proto string chunk_split(string str [, int chunklen [, string ending]])
Return split line */ Return split line */
@ -1323,7 +1359,6 @@ PHP_FUNCTION(substr)
} }
/* }}} */ /* }}} */
/* {{{ proto string substr_replace(string str, string repl, int start [, int length]) /* {{{ proto string substr_replace(string str, string repl, int start [, int length])
Replace part of a string with another string */ Replace part of a string with another string */
PHP_FUNCTION(substr_replace) PHP_FUNCTION(substr_replace)
@ -1396,7 +1431,6 @@ PHP_FUNCTION(substr_replace)
} }
/* }}} */ /* }}} */
/* {{{ proto string quotemeta(string str) /* {{{ proto string quotemeta(string str)
Quote meta characters */ Quote meta characters */
PHP_FUNCTION(quotemeta) PHP_FUNCTION(quotemeta)
@ -1526,6 +1560,8 @@ PHP_FUNCTION(ucwords)
} }
/* }}} */ /* }}} */
/* {{{ php_strtr
*/
PHPAPI char *php_strtr(char *str, int len, char *str_from, PHPAPI char *php_strtr(char *str, int len, char *str_from,
char *str_to, int trlen) char *str_to, int trlen)
{ {
@ -1548,7 +1584,10 @@ PHPAPI char *php_strtr(char *str, int len, char *str_from,
return str; return str;
} }
/* }}} */
/* {{{ php_strtr_array
*/
static void php_strtr_array(zval *return_value,char *str,int slen,HashTable *hash) static void php_strtr_array(zval *return_value,char *str,int slen,HashTable *hash)
{ {
zval *entry; zval *entry;
@ -1636,6 +1675,7 @@ static void php_strtr_array(zval *return_value,char *str,int slen,HashTable *has
smart_str_0(&result); smart_str_0(&result);
RETVAL_STRINGL(result.c,result.len,0); RETVAL_STRINGL(result.c,result.len,0);
} }
/* }}} */
/* {{{ proto string strtr(string str, string from, string to) /* {{{ proto string strtr(string str, string from, string to)
Translate characters in str using given translation tables */ Translate characters in str using given translation tables */
@ -1678,7 +1718,6 @@ PHP_FUNCTION(strtr)
} }
/* }}} */ /* }}} */
/* {{{ proto string strrev(string str) /* {{{ proto string strrev(string str)
Reverse a string */ Reverse a string */
PHP_FUNCTION(strrev) PHP_FUNCTION(strrev)
@ -1706,6 +1745,8 @@ PHP_FUNCTION(strrev)
} }
/* }}} */ /* }}} */
/* {{{ php_similar_str
*/
static void php_similar_str(const char *txt1, int len1, const char *txt2, static void php_similar_str(const char *txt1, int len1, const char *txt2,
int len2, int *pos1, int *pos2, int *max) int len2, int *pos1, int *pos2, int *max)
{ {
@ -1727,7 +1768,10 @@ static void php_similar_str(const char *txt1, int len1, const char *txt2,
} }
} }
} }
/* }}} */
/* {{{ php_similar_char
*/
static int php_similar_char(const char *txt1, int len1, static int php_similar_char(const char *txt1, int len1,
const char *txt2, int len2) const char *txt2, int len2)
{ {
@ -1744,6 +1788,7 @@ static int php_similar_char(const char *txt1, int len1,
} }
return sum; return sum;
} }
/* }}} */
/* {{{ proto int similar_text(string str1, string str2 [, double percent]) /* {{{ proto int similar_text(string str1, string str2 [, double percent])
Calculates the similarity between two strings */ Calculates the similarity between two strings */
@ -1781,9 +1826,10 @@ PHP_FUNCTION(similar_text)
RETURN_LONG(sim); RETURN_LONG(sim);
} }
/* }}} */ /* }}} */
/* be careful, this edits the string in-place */ /* {{{ php_stripslashes
*
* be careful, this edits the string in-place */
PHPAPI void php_stripslashes(char *str, int *len) PHPAPI void php_stripslashes(char *str, int *len)
{ {
char *s, *t; char *s, *t;
@ -1831,6 +1877,7 @@ PHPAPI void php_stripslashes(char *str, int *len)
*s = '\0'; *s = '\0';
} }
} }
/* }}} */
/* {{{ proto string addcslashes(string str, string charlist) /* {{{ proto string addcslashes(string str, string charlist)
Escape all chars mentioned in charlist with backslash. It creates octal representations if asked to backslash characters with 8th bit set or with ASCII<32 (except '\n', '\r', '\t' etc...) */ Escape all chars mentioned in charlist with backslash. It creates octal representations if asked to backslash characters with 8th bit set or with ASCII<32 (except '\n', '\r', '\t' etc...) */
@ -1912,6 +1959,8 @@ PHP_FUNCTION(stripslashes)
/* }}} */ /* }}} */
#ifndef HAVE_STRERROR #ifndef HAVE_STRERROR
/* {{{ php_strerror
*/
char *php_strerror(int errnum) char *php_strerror(int errnum)
{ {
extern int sys_nerr; extern int sys_nerr;
@ -1922,8 +1971,11 @@ char *php_strerror(int errnum)
(void)sprintf(BG(str_ebuf), "Unknown error: %d", errnum); (void)sprintf(BG(str_ebuf), "Unknown error: %d", errnum);
return(BG(str_ebuf)); return(BG(str_ebuf));
} }
/* }}} */
#endif #endif
/* {{{ php_stripcslashes
*/
PHPAPI void php_stripcslashes(char *str, int *len) PHPAPI void php_stripcslashes(char *str, int *len)
{ {
char *source,*target,*end; char *source,*target,*end;
@ -1981,8 +2033,10 @@ PHPAPI void php_stripcslashes(char *str, int *len)
*len = nlen; *len = nlen;
} }
/* }}} */
/* {{{ php_addcslashes
*/
PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_free, char *what, int wlength) PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_free, char *what, int wlength)
{ {
char flags[256]; char flags[256];
@ -2042,7 +2096,10 @@ PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_
} }
return new_str; return new_str;
} }
/* }}} */
/* {{{ php_addslashes
*/
PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_free) PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_free)
{ {
/* maximum string length, worst case situation */ /* maximum string length, worst case situation */
@ -2091,7 +2148,7 @@ PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_f
} }
return new_str; return new_str;
} }
/* }}} */
#define _HEB_BLOCK_TYPE_ENG 1 #define _HEB_BLOCK_TYPE_ENG 1
#define _HEB_BLOCK_TYPE_HEB 2 #define _HEB_BLOCK_TYPE_HEB 2
@ -2099,6 +2156,8 @@ PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_f
#define _isblank(c) (((((unsigned char) c)==' ' || ((unsigned char) c)=='\t')) ? 1 : 0) #define _isblank(c) (((((unsigned char) c)==' ' || ((unsigned char) c)=='\t')) ? 1 : 0)
#define _isnewline(c) (((((unsigned char) c)=='\n' || ((unsigned char) c)=='\r')) ? 1 : 0) #define _isnewline(c) (((((unsigned char) c)=='\n' || ((unsigned char) c)=='\r')) ? 1 : 0)
/* {{{ php_char_to_str
*/
PHPAPI void php_char_to_str(char *str,uint len,char from,char *to,int to_len,zval *result) PHPAPI void php_char_to_str(char *str,uint len,char from,char *to,int to_len,zval *result)
{ {
int char_count=0; int char_count=0;
@ -2134,7 +2193,10 @@ PHPAPI void php_char_to_str(char *str,uint len,char from,char *to,int to_len,zva
} }
*target = 0; *target = 0;
} }
/* }}} */
/* {{{ php_str_to_str
*/
PHPAPI char *php_str_to_str(char *haystack, int length, PHPAPI char *php_str_to_str(char *haystack, int length,
char *needle, int needle_len, char *str, int str_len, int *_new_length) char *needle, int needle_len, char *str, int str_len, int *_new_length)
{ {
@ -2159,8 +2221,10 @@ PHPAPI char *php_str_to_str(char *haystack, int length,
return result.c; return result.c;
} }
/* }}} */
/* {{{ php_str_replace_in_subject
*/
static void php_str_replace_in_subject(zval *search, zval *replace, zval **subject, zval *result) static void php_str_replace_in_subject(zval *search, zval *replace, zval **subject, zval *result)
{ {
zval **search_entry, zval **search_entry,
@ -2258,7 +2322,7 @@ static void php_str_replace_in_subject(zval *search, zval *replace, zval **subje
} }
} }
} }
/* }}} */
/* {{{ proto mixed str_replace(mixed search, mixed replace, mixed subject) /* {{{ proto mixed str_replace(mixed search, mixed replace, mixed subject)
Replace all occurrences of search in haystack with replace */ Replace all occurrences of search in haystack with replace */
@ -2315,8 +2379,9 @@ PHP_FUNCTION(str_replace)
} }
/* }}} */ /* }}} */
/* {{{ php_hebrev
/* Converts Logical Hebrew text (Hebrew Windows style) to Visual text *
* Converts Logical Hebrew text (Hebrew Windows style) to Visual text
* Cheers/complaints/flames - Zeev Suraski <zeev@php.net> * Cheers/complaints/flames - Zeev Suraski <zeev@php.net>
*/ */
static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS,int convert_newlines) static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS,int convert_newlines)
@ -2481,7 +2546,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS,int convert_newlines)
return_value->type = IS_STRING; return_value->type = IS_STRING;
} }
} }
/* }}} */
/* {{{ proto string hebrev(string str [, int max_chars_per_line]) /* {{{ proto string hebrev(string str [, int max_chars_per_line])
Convert logical Hebrew text to visual text */ Convert logical Hebrew text to visual text */
@ -2659,7 +2724,9 @@ PHP_FUNCTION(parse_str)
#define PHP_TAG_BUF_SIZE 1023 #define PHP_TAG_BUF_SIZE 1023
/* Check if tag is in a set of tags /* {{{ php_tag_find
*
* Check if tag is in a set of tags
* *
* states: * states:
* *
@ -2715,8 +2782,11 @@ int php_tag_find(char *tag, int len, char *set) {
efree(norm); efree(norm);
return done; return done;
} }
/* }}} */
/* A simple little state-machine to strip out html and php tags /* {{{ php_strip_tags
A simple little state-machine to strip out html and php tags
State 0 is the output state, State 1 means we are inside a State 0 is the output state, State 1 means we are inside a
normal html tag and state 2 means we are inside a php tag. normal html tag and state 2 means we are inside a php tag.
@ -2851,6 +2921,7 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allo
efree(buf); efree(buf);
if(allow) efree(tbuf); if(allow) efree(tbuf);
} }
/* }}} */
/* {{{ proto string str_repeat(string input, int mult) /* {{{ proto string str_repeat(string input, int mult)
Returns the input string repeat mult times */ Returns the input string repeat mult times */
@ -2977,6 +3048,8 @@ PHP_FUNCTION(count_chars)
} }
/* }}} */ /* }}} */
/* {{{ php_strnatcmp
*/
static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case) static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
{ {
zval **s1, **s2; zval **s1, **s2;
@ -2992,7 +3065,7 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
(*s2)->value.str.val, (*s2)->value.str.len, (*s2)->value.str.val, (*s2)->value.str.len,
fold_case)); fold_case));
} }
/* }}} */
/* {{{ proto int strnatcmp(string s1, string s2) /* {{{ proto int strnatcmp(string s1, string s2)
Returns the result of string comparison using 'natural' algorithm */ Returns the result of string comparison using 'natural' algorithm */
@ -3090,7 +3163,7 @@ PHP_FUNCTION(localeconv)
zend_hash_update(return_value->value.ht, "grouping", 9, &grouping, sizeof(zval *), NULL); zend_hash_update(return_value->value.ht, "grouping", 9, &grouping, sizeof(zval *), NULL);
zend_hash_update(return_value->value.ht, "mon_grouping", 13, &mon_grouping, sizeof(zval *), NULL); zend_hash_update(return_value->value.ht, "mon_grouping", 13, &mon_grouping, sizeof(zval *), NULL);
} }
/* }}} */
/* {{{ proto int strnatcasecmp(string s1, string s2) /* {{{ proto int strnatcasecmp(string s1, string s2)
Returns the result of case-insensitive string comparison using 'natural' algorithm */ Returns the result of case-insensitive string comparison using 'natural' algorithm */
@ -3100,7 +3173,6 @@ PHP_FUNCTION(strnatcasecmp)
} }
/* }}} */ /* }}} */
/* {{{ proto int substr_count(string haystack, string needle) /* {{{ proto int substr_count(string haystack, string needle)
Returns the number of times a substring occurs in the string */ Returns the number of times a substring occurs in the string */
PHP_FUNCTION(substr_count) PHP_FUNCTION(substr_count)
@ -3145,7 +3217,6 @@ PHP_FUNCTION(substr_count)
} }
/* }}} */ /* }}} */
/* {{{ proto string str_pad(string input, int pad_length [, string pad_string [, int pad_type]]) /* {{{ proto string str_pad(string input, int pad_length [, string pad_string [, int pad_type]])
Returns input string padded on the left or right to specified length with pad_string */ Returns input string padded on the left or right to specified length with pad_string */
PHP_FUNCTION(str_pad) PHP_FUNCTION(str_pad)
@ -3243,7 +3314,6 @@ PHP_FUNCTION(str_pad)
RETURN_STRINGL(result, result_len, 0); RETURN_STRINGL(result, result_len, 0);
} }
/* }}} */ /* }}} */
/* {{{ proto mixed sscanf(string str, string format [, string ...]) /* {{{ proto mixed sscanf(string str, string format [, string ...])
Implements an ANSI C compatible sscanf */ Implements an ANSI C compatible sscanf */
@ -3290,4 +3360,5 @@ PHP_FUNCTION(sscanf)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -156,3 +156,11 @@ PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len
return 1; return 1;
} }
} }
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -199,6 +199,7 @@ PHP_FUNCTION(define_syslog_variables)
start_syslog(BLS_C); start_syslog(BLS_C);
} }
} }
/* }}} */
/* {{{ proto int openlog(string ident, int option, int facility) /* {{{ proto int openlog(string ident, int option, int facility)
Open connection to system logger */ Open connection to system logger */
@ -271,4 +272,5 @@ PHP_FUNCTION(syslog)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -96,3 +96,11 @@ char *php_get_ident_index(char *str)
} }
return (temp); return (temp);
} }
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -92,9 +92,11 @@ function_entry uniqid_functions[] = {
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -439,4 +439,5 @@ int php_raw_url_decode(char *str, int len)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -367,3 +367,11 @@ char *url_adapt(const char *src, size_t srclen, const char *data, size_t *newlen
} }
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -747,3 +747,11 @@ PHP_MSHUTDOWN_FUNCTION(url_scanner)
} }
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -671,4 +671,5 @@ PHP_FUNCTION(unserialize)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -34,6 +34,8 @@
ZEND_DECLARE_MODULE_GLOBALS(swf) ZEND_DECLARE_MODULE_GLOBALS(swf)
/* {{{ swf_functions[]
*/
function_entry swf_functions[] = { function_entry swf_functions[] = {
PHP_FE(swf_openfile, NULL) PHP_FE(swf_openfile, NULL)
PHP_FE(swf_closefile, NULL) PHP_FE(swf_closefile, NULL)
@ -104,7 +106,10 @@ function_entry swf_functions[] = {
PHP_FE(swf_posround, NULL) PHP_FE(swf_posround, NULL)
{NULL,NULL,NULL} {NULL,NULL,NULL}
}; };
/* }}} */
/* {{{ swf_module_entry
*/
zend_module_entry swf_module_entry = { zend_module_entry swf_module_entry = {
"swf", "swf",
swf_functions, swf_functions,
@ -115,19 +120,24 @@ zend_module_entry swf_module_entry = {
PHP_MINFO(swf), PHP_MINFO(swf),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_SWF #ifdef COMPILE_DL_SWF
ZEND_GET_MODULE(swf) ZEND_GET_MODULE(swf)
#endif #endif
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(swf) PHP_MINFO_FUNCTION(swf)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "swf support", "enabled"); php_info_print_table_row(2, "swf support", "enabled");
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(swf) PHP_MINIT_FUNCTION(swf)
{ {
REGISTER_LONG_CONSTANT("MOD_COLOR", MOD_COLOR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("MOD_COLOR", MOD_COLOR, CONST_CS | CONST_PERSISTENT);
@ -152,7 +162,10 @@ PHP_MINIT_FUNCTION(swf)
REGISTER_LONG_CONSTANT("MenuExit", MenuExit, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("MenuExit", MenuExit, CONST_CS | CONST_PERSISTENT);
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_RINIT_FUNCTION
*/
PHP_RINIT_FUNCTION(swf) PHP_RINIT_FUNCTION(swf)
{ {
SWFLS_FETCH(); SWFLS_FETCH();
@ -160,6 +173,7 @@ PHP_RINIT_FUNCTION(swf)
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ proto void swf_openfile(string name, double xsize, double ysize, double framerate, double r, double g, double b) /* {{{ proto void swf_openfile(string name, double xsize, double ysize, double framerate, double r, double g, double b)
Create a Shockwave Flash file given by name, with width xsize and height ysize at a frame rate of framerate and a background color specified by a red value of r, green value of g and a blue value of b */ Create a Shockwave Flash file given by name, with width xsize and height ysize at a frame rate of framerate and a background color specified by a red value of r, green value of g and a blue value of b */
@ -300,6 +314,8 @@ PHP_FUNCTION(swf_getframe)
} }
/* }}} */ /* }}} */
/* {{{ col_swf
*/
void col_swf(INTERNAL_FUNCTION_PARAMETERS, int opt) { void col_swf(INTERNAL_FUNCTION_PARAMETERS, int opt) {
zval **r, **g, **b, **a; zval **r, **g, **b, **a;
if (ZEND_NUM_ARGS() != 4 || if (ZEND_NUM_ARGS() != 4 ||
@ -316,6 +332,7 @@ void col_swf(INTERNAL_FUNCTION_PARAMETERS, int opt) {
swf_mulcolor((float)Z_DVAL_PP(r), (float)Z_DVAL_PP(g), (float)Z_DVAL_PP(b), (float)Z_DVAL_PP(a)); swf_mulcolor((float)Z_DVAL_PP(r), (float)Z_DVAL_PP(g), (float)Z_DVAL_PP(b), (float)Z_DVAL_PP(a));
} }
} }
/* }}} */
/* {{{ proto void swf_mulcolor(double r, double g, double b, double a) /* {{{ proto void swf_mulcolor(double r, double g, double b, double a)
Sets the global multiply color to the rgba value specified */ Sets the global multiply color to the rgba value specified */
@ -377,6 +394,7 @@ PHP_FUNCTION(swf_removeobject)
swf_removeobject(Z_LVAL_PP(depth)); swf_removeobject(Z_LVAL_PP(depth));
} }
/* }}} */
/* {{{ proto int swf_nextid(void) /* {{{ proto int swf_nextid(void)
Returns a free objid */ Returns a free objid */
@ -519,6 +537,8 @@ PHP_FUNCTION(swf_actiongotolabel)
} }
/* }}} */ /* }}} */
/* {{{ php_swf_define
*/
void php_swf_define(INTERNAL_FUNCTION_PARAMETERS, int opt) void php_swf_define(INTERNAL_FUNCTION_PARAMETERS, int opt)
{ {
zval **objid, **x1, **y1, **x2, **y2, **width; zval **objid, **x1, **y1, **x2, **y2, **width;
@ -542,6 +562,7 @@ void php_swf_define(INTERNAL_FUNCTION_PARAMETERS, int opt)
(float)Z_DVAL_PP(x2), (float)Z_DVAL_PP(y2), (float)Z_DVAL_PP(width)); (float)Z_DVAL_PP(x2), (float)Z_DVAL_PP(y2), (float)Z_DVAL_PP(width));
} }
} }
/* }}} */
/* {{{ proto void swf_defineline(int objid, double x1, double y1, double x2, double y2, double width) /* {{{ proto void swf_defineline(int objid, double x1, double y1, double x2, double y2, double width)
Create a line with object id, objid, starting from x1, y1 and going to x2, y2 with width, width */ Create a line with object id, objid, starting from x1, y1 and going to x2, y2 with width, width */
@ -660,6 +681,8 @@ PHP_FUNCTION(swf_shapefillsolid)
} }
/* }}} */ /* }}} */
/* {{{ php_swf_fill_bitmap
*/
void php_swf_fill_bitmap(INTERNAL_FUNCTION_PARAMETERS, int opt) void php_swf_fill_bitmap(INTERNAL_FUNCTION_PARAMETERS, int opt)
{ {
zval **bitmapid; zval **bitmapid;
@ -675,6 +698,7 @@ void php_swf_fill_bitmap(INTERNAL_FUNCTION_PARAMETERS, int opt)
swf_shapefillbitmaptile(Z_LVAL_PP(bitmapid)); swf_shapefillbitmaptile(Z_LVAL_PP(bitmapid));
} }
} }
/* }}} */
/* {{{ proto void swf_shapefillbitmapclip(int bitmapid) /* {{{ proto void swf_shapefillbitmapclip(int bitmapid)
Sets the current fill mode to clipped bitmap fill. Pixels from the previously defined bitmapid will be used to fill areas */ Sets the current fill mode to clipped bitmap fill. Pixels from the previously defined bitmapid will be used to fill areas */
@ -692,6 +716,8 @@ PHP_FUNCTION(swf_shapefillbitmaptile)
} }
/* }}} */ /* }}} */
/* {{{ php_swf_shape
*/
void php_swf_shape(INTERNAL_FUNCTION_PARAMETERS, int opt) void php_swf_shape(INTERNAL_FUNCTION_PARAMETERS, int opt)
{ {
zval **x, **y; zval **x, **y;
@ -708,6 +734,7 @@ void php_swf_shape(INTERNAL_FUNCTION_PARAMETERS, int opt)
swf_shapelineto((float)Z_DVAL_PP(x), (float)Z_DVAL_PP(y)); swf_shapelineto((float)Z_DVAL_PP(x), (float)Z_DVAL_PP(y));
} }
} }
/* }}} */
/* {{{ proto void swf_shapemoveto(double x, double y) /* {{{ proto void swf_shapemoveto(double x, double y)
swf_shapemoveto moves the current position to the given x,y. */ swf_shapemoveto moves the current position to the given x,y. */
@ -1032,6 +1059,8 @@ PHP_FUNCTION(swf_endbutton)
} }
/* }}} */ /* }}} */
/* {{{ php_swf_geo_same
*/
void php_swf_geo_same(INTERNAL_FUNCTION_PARAMETERS, int opt) void php_swf_geo_same(INTERNAL_FUNCTION_PARAMETERS, int opt)
{ {
zval **arg1, **arg2, **arg3, **arg4; zval **arg1, **arg2, **arg3, **arg4;
@ -1058,6 +1087,7 @@ void php_swf_geo_same(INTERNAL_FUNCTION_PARAMETERS, int opt)
Z_DVAL_PP(arg4)); Z_DVAL_PP(arg4));
} }
} }
/* }}} */
/* {{{ proto void swf_viewport(double xmin, double xmax, double ymin, double ymax) /* {{{ proto void swf_viewport(double xmin, double xmax, double ymin, double ymax)
Selects an area on the drawing surface for future drawing */ Selects an area on the drawing surface for future drawing */
@ -1217,3 +1247,11 @@ PHP_FUNCTION(swf_posround)
/* }}} */ /* }}} */
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -56,6 +56,8 @@ union semun {
#endif #endif
/* {{{ sysvsem_functions[]
*/
function_entry sysvsem_functions[] = { function_entry sysvsem_functions[] = {
PHP_FE(sem_get, NULL) PHP_FE(sem_get, NULL)
PHP_FE(sem_acquire, NULL) PHP_FE(sem_acquire, NULL)
@ -63,10 +65,14 @@ function_entry sysvsem_functions[] = {
PHP_FE(sem_remove, NULL) PHP_FE(sem_remove, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
/* {{{ sysvsem_module_entry
*/
zend_module_entry sysvsem_module_entry = { zend_module_entry sysvsem_module_entry = {
"sysvsem", sysvsem_functions, PHP_MINIT(sysvsem), NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES "sysvsem", sysvsem_functions, PHP_MINIT(sysvsem), NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_SYSVSEM #ifdef COMPILE_DL_SYSVSEM
ZEND_GET_MODULE(sysvsem) ZEND_GET_MODULE(sysvsem)
@ -94,7 +100,8 @@ THREAD_LS sysvsem_module php_sysvsem_module;
#define SYSVSEM_USAGE 1 #define SYSVSEM_USAGE 1
#define SYSVSEM_SETVAL 2 #define SYSVSEM_SETVAL 2
/* {{{ release_sysvsem_sem
*/
static void release_sysvsem_sem(zend_rsrc_list_entry *rsrc) static void release_sysvsem_sem(zend_rsrc_list_entry *rsrc)
{ {
sysvsem_sem *sem_ptr = (sysvsem_sem *)rsrc->ptr; sysvsem_sem *sem_ptr = (sysvsem_sem *)rsrc->ptr;
@ -129,14 +136,17 @@ static void release_sysvsem_sem(zend_rsrc_list_entry *rsrc)
efree(sem_ptr); efree(sem_ptr);
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(sysvsem) PHP_MINIT_FUNCTION(sysvsem)
{ {
php_sysvsem_module.le_sem = zend_register_list_destructors_ex(release_sysvsem_sem, NULL, "sysvsem", module_number); php_sysvsem_module.le_sem = zend_register_list_destructors_ex(release_sysvsem_sem, NULL, "sysvsem", module_number);
return SUCCESS; return SUCCESS;
} }
/* }}} */
#define SETVAL_WANTS_PTR #define SETVAL_WANTS_PTR
@ -296,7 +306,8 @@ PHP_FUNCTION(sem_get)
} }
/* }}} */ /* }}} */
/* {{{ php_sysvsem_semop
*/
static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire) static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
{ {
pval **arg_id; pval **arg_id;
@ -343,7 +354,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
sem_ptr->count -= acquire ? -1 : 1; sem_ptr->count -= acquire ? -1 : 1;
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */
/* {{{ proto int sem_acquire(int id) /* {{{ proto int sem_acquire(int id)
Acquires the semaphore with the given id, blocking if necessary */ Acquires the semaphore with the given id, blocking if necessary */
@ -361,9 +372,6 @@ PHP_FUNCTION(sem_release)
} }
/* }}} */ /* }}} */
/* {{{ proto int sem_remove(int id) /* {{{ proto int sem_remove(int id)
Removes semaphore from Unix systems */ Removes semaphore from Unix systems */
@ -419,9 +427,11 @@ PHP_FUNCTION(sem_remove)
/* }}} */ /* }}} */
#endif /* HAVE_SYSVSEM */ #endif /* HAVE_SYSVSEM */
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -37,6 +37,8 @@
#include "php_sysvshm.h" #include "php_sysvshm.h"
#include "../standard/php_var.h" #include "../standard/php_var.h"
/* {{{ sysvshm_functions[]
*/
function_entry sysvshm_functions[] = { function_entry sysvshm_functions[] = {
PHP_FE(shm_attach, NULL) PHP_FE(shm_attach, NULL)
PHP_FE(shm_remove, NULL) PHP_FE(shm_remove, NULL)
@ -46,7 +48,10 @@ function_entry sysvshm_functions[] = {
PHP_FE(shm_remove_var, NULL) PHP_FE(shm_remove_var, NULL)
{0} {0}
}; };
/* }}} */
/* {{{ sysvshm_module_entry
*/
zend_module_entry sysvshm_module_entry = { zend_module_entry sysvshm_module_entry = {
"sysvshm", sysvshm_functions, "sysvshm", sysvshm_functions,
PHP_MINIT(sysvshm), NULL, PHP_MINIT(sysvshm), NULL,
@ -54,7 +59,7 @@ zend_module_entry sysvshm_module_entry = {
NULL, NULL,
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_SYSVSHM #ifdef COMPILE_DL_SYSVSHM
ZEND_GET_MODULE(sysvshm) ZEND_GET_MODULE(sysvshm)
@ -64,13 +69,18 @@ ZEND_GET_MODULE(sysvshm)
THREAD_LS sysvshm_module php_sysvshm; THREAD_LS sysvshm_module php_sysvshm;
/* {{{ php_release_sysvshm
*/
static void php_release_sysvshm(zend_rsrc_list_entry *rsrc) static void php_release_sysvshm(zend_rsrc_list_entry *rsrc)
{ {
sysvshm_shm *shm_ptr = (sysvshm_shm *)rsrc->ptr; sysvshm_shm *shm_ptr = (sysvshm_shm *)rsrc->ptr;
shmdt((void*)shm_ptr->ptr); shmdt((void*)shm_ptr->ptr);
efree(shm_ptr); efree(shm_ptr);
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(sysvshm) PHP_MINIT_FUNCTION(sysvshm)
{ {
php_sysvshm.le_shm = zend_register_list_destructors_ex(php_release_sysvshm, NULL, "sysvshm", module_number); php_sysvshm.le_shm = zend_register_list_destructors_ex(php_release_sysvshm, NULL, "sysvshm", module_number);
@ -80,7 +90,7 @@ PHP_MINIT_FUNCTION(sysvshm)
} }
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ proto int shm_attach(int key [, int memsize [, int perm]]) /* {{{ proto int shm_attach(int key [, int memsize [, int perm]])
Creates or open a shared memory segment */ Creates or open a shared memory segment */
@ -155,8 +165,6 @@ PHP_FUNCTION(shm_attach)
} }
/* }}} */ /* }}} */
/* {{{ proto int shm_detach(int shm_identifier) /* {{{ proto int shm_detach(int shm_identifier)
Disconnects from shared memory segment */ Disconnects from shared memory segment */
PHP_FUNCTION(shm_detach) PHP_FUNCTION(shm_detach)
@ -177,6 +185,7 @@ PHP_FUNCTION(shm_detach)
RETURN_TRUE; RETURN_TRUE;
} }
/* }}} */ /* }}} */
/* {{{ proto int shm_remove(int shm_identifier) /* {{{ proto int shm_remove(int shm_identifier)
Removes shared memory from Unix systems */ Removes shared memory from Unix systems */
@ -205,8 +214,6 @@ PHP_FUNCTION(shm_remove)
} }
/* }}} */ /* }}} */
/* {{{ proto int shm_put_var(int shm_identifier, int variable_key, mixed variable) /* {{{ proto int shm_put_var(int shm_identifier, int variable_key, mixed variable)
Inserts or updates a variable in shared memory */ Inserts or updates a variable in shared memory */
PHP_FUNCTION(shm_put_var) PHP_FUNCTION(shm_put_var)
@ -256,7 +263,6 @@ PHP_FUNCTION(shm_put_var)
} }
/* }}} */ /* }}} */
/* {{{ proto mixed shm_get_var(int id, int variable_key) /* {{{ proto mixed shm_get_var(int id, int variable_key)
Returns a variable from shared memory */ Returns a variable from shared memory */
PHP_FUNCTION(shm_get_var) PHP_FUNCTION(shm_get_var)
@ -342,8 +348,8 @@ PHP_FUNCTION(shm_remove_var)
} }
/* }}} */ /* }}} */
/* {{{ php_put_shm_data
/* inserts an ascii-string into shared memory */ * inserts an ascii-string into shared memory */
int php_put_shm_data(sysvshm_chunk_head *ptr,long key,char *data, long len) { int php_put_shm_data(sysvshm_chunk_head *ptr,long key,char *data, long len) {
sysvshm_chunk* shm_var; sysvshm_chunk* shm_var;
long total_size; long total_size;
@ -367,8 +373,10 @@ int php_put_shm_data(sysvshm_chunk_head *ptr,long key,char *data, long len) {
ptr->free-=total_size; ptr->free-=total_size;
return 0; return 0;
} }
/* }}} */
/* {{{ php_check_shm_data
*/
long php_check_shm_data(sysvshm_chunk_head *ptr, long key) { long php_check_shm_data(sysvshm_chunk_head *ptr, long key) {
long pos; long pos;
sysvshm_chunk *shm_var; sysvshm_chunk *shm_var;
@ -387,8 +395,10 @@ long php_check_shm_data(sysvshm_chunk_head *ptr, long key) {
} }
return -1; return -1;
} }
/* }}} */
/* {{{ php_remove_shm_data
*/
int php_remove_shm_data(sysvshm_chunk_head *ptr, long shm_varpos) { int php_remove_shm_data(sysvshm_chunk_head *ptr, long shm_varpos) {
sysvshm_chunk *chunk_ptr, *next_chunk_ptr; sysvshm_chunk *chunk_ptr, *next_chunk_ptr;
long memcpy_len; long memcpy_len;
@ -403,8 +413,7 @@ int php_remove_shm_data(sysvshm_chunk_head *ptr, long shm_varpos) {
memcpy(chunk_ptr,next_chunk_ptr,memcpy_len); memcpy(chunk_ptr,next_chunk_ptr,memcpy_len);
return 0; return 0;
} }
/* }}} */
#endif /* HAVE_SYSVSHM */ #endif /* HAVE_SYSVSHM */
@ -413,4 +422,5 @@ int php_remove_shm_data(sysvshm_chunk_head *ptr, long shm_varpos) {
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -23,7 +23,7 @@
| If you did not, or have any questions about PHP licensing, please | | If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. | | contact core@php.net. |
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
| Authors: Andrei Zmievski <andrei@ispi.net> | | Authors: Andrei Zmievski <andrei@ispi.net> |
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
@ -97,7 +97,8 @@ typedef struct {
static void php_wddx_process_data(void *user_data, const char *s, int len); static void php_wddx_process_data(void *user_data, const char *s, int len);
/* {{{ wddx_functions[]
*/
function_entry wddx_functions[] = { function_entry wddx_functions[] = {
PHP_FE(wddx_serialize_value, NULL) PHP_FE(wddx_serialize_value, NULL)
PHP_FE(wddx_serialize_vars, NULL) PHP_FE(wddx_serialize_vars, NULL)
@ -107,10 +108,13 @@ function_entry wddx_functions[] = {
PHP_FE(wddx_deserialize, NULL) PHP_FE(wddx_deserialize, NULL)
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */
PHP_MINIT_FUNCTION(wddx); PHP_MINIT_FUNCTION(wddx);
PHP_MINFO_FUNCTION(wddx); PHP_MINFO_FUNCTION(wddx);
/* {{{ wddx_module_entry
*/
zend_module_entry wddx_module_entry = { zend_module_entry wddx_module_entry = {
"wddx", "wddx",
wddx_functions, wddx_functions,
@ -121,9 +125,10 @@ zend_module_entry wddx_module_entry = {
PHP_MINFO(wddx), PHP_MINFO(wddx),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
/* {{{ wddx_stack_init
*/
static int wddx_stack_init(wddx_stack *stack) static int wddx_stack_init(wddx_stack *stack)
{ {
stack->top = 0; stack->top = 0;
@ -136,8 +141,10 @@ static int wddx_stack_init(wddx_stack *stack)
return SUCCESS; return SUCCESS;
} }
} }
/* }}} */
/* {{{ wddx_stack_push
*/
static int wddx_stack_push(wddx_stack *stack, void *element, int size) static int wddx_stack_push(wddx_stack *stack, void *element, int size)
{ {
if (stack->top >= stack->max) { /* we need to allocate more memory */ if (stack->top >= stack->max) { /* we need to allocate more memory */
@ -151,8 +158,10 @@ static int wddx_stack_push(wddx_stack *stack, void *element, int size)
memcpy(stack->elements[stack->top], element, size); memcpy(stack->elements[stack->top], element, size);
return stack->top++; return stack->top++;
} }
/* }}} */
/* {{{ wddx_stack_top
*/
static int wddx_stack_top(wddx_stack *stack, void **element) static int wddx_stack_top(wddx_stack *stack, void **element)
{ {
if (stack->top > 0) { if (stack->top > 0) {
@ -163,8 +172,10 @@ static int wddx_stack_top(wddx_stack *stack, void **element)
return FAILURE; return FAILURE;
} }
} }
/* }}} */
/* {{{ wddx_stack_is_empty
*/
static int wddx_stack_is_empty(wddx_stack *stack) static int wddx_stack_is_empty(wddx_stack *stack)
{ {
if (stack->top == 0) { if (stack->top == 0) {
@ -173,8 +184,10 @@ static int wddx_stack_is_empty(wddx_stack *stack)
return 0; return 0;
} }
} }
/* }}} */
/* {{{ wddx_stack_destroy
*/
static int wddx_stack_destroy(wddx_stack *stack) static int wddx_stack_destroy(wddx_stack *stack)
{ {
register int i; register int i;
@ -194,17 +207,22 @@ static int wddx_stack_destroy(wddx_stack *stack)
} }
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ release_wddx_packet_rsrc
*/
static void release_wddx_packet_rsrc(zend_rsrc_list_entry *rsrc) static void release_wddx_packet_rsrc(zend_rsrc_list_entry *rsrc)
{ {
smart_str *str = (smart_str *)rsrc->ptr; smart_str *str = (smart_str *)rsrc->ptr;
smart_str_free(str); smart_str_free(str);
efree(str); efree(str);
} }
/* }}} */
#include "ext/session/php_session.h" #include "ext/session/php_session.h"
/* {{{ PS_SERIALIZER_ENCODE_FUNC
*/
PS_SERIALIZER_ENCODE_FUNC(wddx) PS_SERIALIZER_ENCODE_FUNC(wddx)
{ {
wddx_packet *packet; wddx_packet *packet;
@ -231,7 +249,10 @@ PS_SERIALIZER_ENCODE_FUNC(wddx)
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PS_SERIALIZER_DECODE_FUNC
*/
PS_SERIALIZER_DECODE_FUNC(wddx) PS_SERIALIZER_DECODE_FUNC(wddx)
{ {
zval *retval; zval *retval;
@ -271,7 +292,10 @@ PS_SERIALIZER_DECODE_FUNC(wddx)
return ret; return ret;
} }
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(wddx) PHP_MINIT_FUNCTION(wddx)
{ {
le_wddx = zend_register_list_destructors_ex(release_wddx_packet_rsrc, NULL, "wddx", module_number); le_wddx = zend_register_list_destructors_ex(release_wddx_packet_rsrc, NULL, "wddx", module_number);
@ -281,16 +305,20 @@ PHP_MINIT_FUNCTION(wddx)
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(wddx) PHP_MINFO_FUNCTION(wddx)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "WDDX Support", "enabled" ); php_info_print_table_row(2, "WDDX Support", "enabled" );
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ php_wddx_packet_start
*/
void php_wddx_packet_start(wddx_packet *packet, char *comment, int comment_len) void php_wddx_packet_start(wddx_packet *packet, char *comment, int comment_len)
{ {
php_wddx_add_chunk_static(packet, WDDX_PACKET_S); php_wddx_add_chunk_static(packet, WDDX_PACKET_S);
@ -304,21 +332,25 @@ void php_wddx_packet_start(wddx_packet *packet, char *comment, int comment_len)
php_wddx_add_chunk_static(packet, WDDX_HEADER); php_wddx_add_chunk_static(packet, WDDX_HEADER);
php_wddx_add_chunk_static(packet, WDDX_DATA_S); php_wddx_add_chunk_static(packet, WDDX_DATA_S);
} }
/* }}} */
/* {{{ php_wddx_packet_end
*/
void php_wddx_packet_end(wddx_packet *packet) void php_wddx_packet_end(wddx_packet *packet)
{ {
php_wddx_add_chunk_static(packet, WDDX_DATA_E); php_wddx_add_chunk_static(packet, WDDX_DATA_E);
php_wddx_add_chunk_static(packet, WDDX_PACKET_E); php_wddx_add_chunk_static(packet, WDDX_PACKET_E);
} }
/* }}} */
#define FLUSH_BUF() \ #define FLUSH_BUF() \
if (l > 0) { \ if (l > 0) { \
php_wddx_add_chunk_ex(packet, buf, l); \ php_wddx_add_chunk_ex(packet, buf, l); \
l = 0; \ l = 0; \
} }
/* {{{ php_wddx_serialize_string
*/
static void php_wddx_serialize_string(wddx_packet *packet, zval *var) static void php_wddx_serialize_string(wddx_packet *packet, zval *var)
{ {
char *buf, char *buf,
@ -368,8 +400,10 @@ static void php_wddx_serialize_string(wddx_packet *packet, zval *var)
php_wddx_add_chunk_static(packet, WDDX_STRING_E); php_wddx_add_chunk_static(packet, WDDX_STRING_E);
} }
/* }}} */
/* {{{ php_wddx_serialize_number
*/
static void php_wddx_serialize_number(wddx_packet *packet, zval *var) static void php_wddx_serialize_number(wddx_packet *packet, zval *var)
{ {
char tmp_buf[WDDX_BUF_LEN]; char tmp_buf[WDDX_BUF_LEN];
@ -383,8 +417,10 @@ static void php_wddx_serialize_number(wddx_packet *packet, zval *var)
php_wddx_add_chunk(packet, tmp_buf); php_wddx_add_chunk(packet, tmp_buf);
} }
/* }}} */
/* {{{ php_wddx_serialize_boolean
*/
static void php_wddx_serialize_boolean(wddx_packet *packet, zval *var) static void php_wddx_serialize_boolean(wddx_packet *packet, zval *var)
{ {
char tmp_buf[WDDX_BUF_LEN]; char tmp_buf[WDDX_BUF_LEN];
@ -392,12 +428,18 @@ static void php_wddx_serialize_boolean(wddx_packet *packet, zval *var)
sprintf(tmp_buf, WDDX_BOOLEAN, Z_LVAL_P(var) ? "true" : "false"); sprintf(tmp_buf, WDDX_BOOLEAN, Z_LVAL_P(var) ? "true" : "false");
php_wddx_add_chunk(packet, tmp_buf); php_wddx_add_chunk(packet, tmp_buf);
} }
/* }}} */
/* {{{ php_wddx_serialize_unset
*/
static void php_wddx_serialize_unset(wddx_packet *packet) static void php_wddx_serialize_unset(wddx_packet *packet)
{ {
php_wddx_add_chunk_static(packet, WDDX_NULL); php_wddx_add_chunk_static(packet, WDDX_NULL);
} }
/* }}} */
/* {{{ php_wddx_serialize_object
*/
static void php_wddx_serialize_object(wddx_packet *packet, zval *obj) static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
{ {
zval **ent, *fname, **varname; zval **ent, *fname, **varname;
@ -485,7 +527,10 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
if (retval) if (retval)
zval_ptr_dtor(&retval); zval_ptr_dtor(&retval);
} }
/* }}} */
/* {{{ php_wddx_serialize_array
*/
static void php_wddx_serialize_array(wddx_packet *packet, zval *arr) static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
{ {
zval **ent; zval **ent;
@ -551,8 +596,10 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
php_wddx_add_chunk_static(packet, WDDX_ARRAY_E); php_wddx_add_chunk_static(packet, WDDX_ARRAY_E);
} }
} }
/* }}} */
/* {{{ php_wddx_serialize_var
*/
void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len) void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len)
{ {
char tmp_buf[WDDX_BUF_LEN]; char tmp_buf[WDDX_BUF_LEN];
@ -597,8 +644,10 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name
php_wddx_add_chunk_static(packet, WDDX_VAR_E); php_wddx_add_chunk_static(packet, WDDX_VAR_E);
} }
} }
/* }}} */
/* {{{ php_wddx_add_var
*/
static void php_wddx_add_var(wddx_packet *packet, zval *name_var) static void php_wddx_add_var(wddx_packet *packet, zval *name_var)
{ {
zval **val; zval **val;
@ -625,8 +674,10 @@ static void php_wddx_add_var(wddx_packet *packet, zval *name_var)
} }
} }
} }
/* }}} */
/* {{{ php_wddx_push_element
*/
static void php_wddx_push_element(void *user_data, const char *name, const char **atts) static void php_wddx_push_element(void *user_data, const char *name, const char **atts)
{ {
st_entry ent; st_entry ent;
@ -731,8 +782,10 @@ static void php_wddx_push_element(void *user_data, const char *name, const char
} }
} }
} }
/* }}} */
/* {{{ php_wddx_pop_element
*/
static void php_wddx_pop_element(void *user_data, const char *name) static void php_wddx_pop_element(void *user_data, const char *name)
{ {
st_entry *ent1, *ent2; st_entry *ent1, *ent2;
@ -839,8 +892,10 @@ static void php_wddx_pop_element(void *user_data, const char *name)
else if (!strcmp(name, EL_VAR) && stack->varname) else if (!strcmp(name, EL_VAR) && stack->varname)
efree(stack->varname); efree(stack->varname);
} }
/* }}} */
/* {{{ php_wddx_process_data
*/
static void php_wddx_process_data(void *user_data, const char *s, int len) static void php_wddx_process_data(void *user_data, const char *s, int len)
{ {
st_entry *ent; st_entry *ent;
@ -906,7 +961,10 @@ static void php_wddx_process_data(void *user_data, const char *s, int len)
} }
} }
} }
/* }}} */
/* {{{ php_wddx_deserialize_ex
*/
int php_wddx_deserialize_ex(char *value, int vallen, zval *return_value) int php_wddx_deserialize_ex(char *value, int vallen, zval *return_value)
{ {
wddx_stack stack; wddx_stack stack;
@ -937,7 +995,7 @@ int php_wddx_deserialize_ex(char *value, int vallen, zval *return_value)
return retval; return retval;
} }
/* }}} */
/* {{{ proto string wddx_serialize_value(mixed var [, string comment]) /* {{{ proto string wddx_serialize_value(mixed var [, string comment])
Creates a new packet and serializes the given value */ Creates a new packet and serializes the given value */
@ -975,7 +1033,6 @@ PHP_FUNCTION(wddx_serialize_value)
} }
/* }}} */ /* }}} */
/* {{{ proto string wddx_serialize_vars(mixed var_name [, mixed ...]) /* {{{ proto string wddx_serialize_vars(mixed var_name [, mixed ...])
Creates a new packet and serializes given variables into a struct */ Creates a new packet and serializes given variables into a struct */
PHP_FUNCTION(wddx_serialize_vars) PHP_FUNCTION(wddx_serialize_vars)
@ -1017,6 +1074,8 @@ PHP_FUNCTION(wddx_serialize_vars)
} }
/* }}} */ /* }}} */
/* {{{ php_wddx_constructor
*/
wddx_packet *php_wddx_constructor(void) wddx_packet *php_wddx_constructor(void)
{ {
smart_str *packet; smart_str *packet;
@ -1026,12 +1085,16 @@ wddx_packet *php_wddx_constructor(void)
return packet; return packet;
} }
/* }}} */
/* {{{ php_wddx_destructor
*/
void php_wddx_destructor(wddx_packet *packet) void php_wddx_destructor(wddx_packet *packet)
{ {
smart_str_free(packet); smart_str_free(packet);
efree(packet); efree(packet);
} }
/* }}} */
/* {{{ proto int wddx_packet_start([string comment]) /* {{{ proto int wddx_packet_start([string comment])
Starts a WDDX packet with optional comment and returns the packet id */ Starts a WDDX packet with optional comment and returns the packet id */
@ -1065,7 +1128,6 @@ PHP_FUNCTION(wddx_packet_start)
} }
/* }}} */ /* }}} */
/* {{{ proto string wddx_packet_end(int packet_id) /* {{{ proto string wddx_packet_end(int packet_id)
Ends specified WDDX packet and returns the string containing the packet */ Ends specified WDDX packet and returns the string containing the packet */
PHP_FUNCTION(wddx_packet_end) PHP_FUNCTION(wddx_packet_end)
@ -1089,7 +1151,6 @@ PHP_FUNCTION(wddx_packet_end)
} }
/* }}} */ /* }}} */
/* {{{ proto int wddx_add_vars(int packet_id [, mixed var_names [, mixed ...]]) /* {{{ proto int wddx_add_vars(int packet_id [, mixed var_names [, mixed ...]])
Serializes given variables and adds them to packet given by packet_id */ Serializes given variables and adds them to packet given by packet_id */
PHP_FUNCTION(wddx_add_vars) PHP_FUNCTION(wddx_add_vars)
@ -1131,7 +1192,6 @@ PHP_FUNCTION(wddx_add_vars)
} }
/* }}} */ /* }}} */
/* {{{ proto mixed wddx_deserialize(string packet) /* {{{ proto mixed wddx_deserialize(string packet)
Deserializes given packet and returns a PHP value */ Deserializes given packet and returns a PHP value */
PHP_FUNCTION(wddx_deserialize) PHP_FUNCTION(wddx_deserialize)
@ -1150,5 +1210,12 @@ PHP_FUNCTION(wddx_deserialize)
} }
/* }}} */ /* }}} */
#endif /* HAVE_LIBEXPAT */ #endif /* HAVE_LIBEXPAT */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -236,7 +236,7 @@ PHP_MINFO_FUNCTION(xml)
php_info_print_table_row(2, "EXPAT Version",XML_ExpatVersion()); php_info_print_table_row(2, "EXPAT Version",XML_ExpatVersion());
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ extension-internal functions */ /* {{{ extension-internal functions */
@ -991,7 +991,6 @@ _xml_externalEntityRefHandler(XML_Parser parserPtr,
} }
/* }}} */ /* }}} */
/* {{{ _xml_startNamespaceDeclHandler() */ /* {{{ _xml_startNamespaceDeclHandler() */
void _xml_startNamespaceDeclHandler(void *userData, void _xml_startNamespaceDeclHandler(void *userData,
@ -1014,7 +1013,6 @@ void _xml_startNamespaceDeclHandler(void *userData,
} }
/* }}} */ /* }}} */
/* {{{ _xml_endNamespaceDeclHandler() */ /* {{{ _xml_endNamespaceDeclHandler() */
void _xml_endNamespaceDeclHandler(void *userData, void _xml_endNamespaceDeclHandler(void *userData,
@ -1318,7 +1316,6 @@ PHP_FUNCTION(xml_set_external_entity_ref_handler)
} }
/* }}} */ /* }}} */
/* {{{ proto int xml_set_start_namespace_decl_handler(int pind, string hdl) /* {{{ proto int xml_set_start_namespace_decl_handler(int pind, string hdl)
Set up character data handler */ Set up character data handler */
PHP_FUNCTION(xml_set_start_namespace_decl_handler) PHP_FUNCTION(xml_set_start_namespace_decl_handler)
@ -1385,6 +1382,7 @@ PHP_FUNCTION(xml_parse)
} }
/* }}} */ /* }}} */
/* {{{ proto int xml_parse_into_struct(int pind, string data, array &struct, array &index) /* {{{ proto int xml_parse_into_struct(int pind, string data, array &struct, array &index)
Parsing a XML document */ Parsing a XML document */
@ -1654,4 +1652,5 @@ PHP_FUNCTION(utf8_decode)
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -16,6 +16,7 @@
+----------------------------------------------------------------------+ +----------------------------------------------------------------------+
*/ */
/* $Id$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
@ -70,6 +71,8 @@ static MH_ERROR error_print(void *, SablotHandle, MH_ERROR, MH_LEVEL, char **);
#define le_xslt_name "XSLT Processor" #define le_xslt_name "XSLT Processor"
static int le_xslt; static int le_xslt;
/* {{{ xslt_functions[]
*/
function_entry xslt_functions[] = { function_entry xslt_functions[] = {
PHP_FE(xslt_create, NULL) PHP_FE(xslt_create, NULL)
PHP_FE(xslt_set_sax_handlers, NULL) PHP_FE(xslt_set_sax_handlers, NULL)
@ -87,7 +90,10 @@ function_entry xslt_functions[] = {
PHP_FE(xslt_errno, NULL) PHP_FE(xslt_errno, NULL)
PHP_FE(xslt_free, NULL) PHP_FE(xslt_free, NULL)
}; };
/* }}} */
/* {{{ xslt_module_entry
*/
zend_module_entry xslt_module_entry = { zend_module_entry xslt_module_entry = {
"xslt", "xslt",
xslt_functions, xslt_functions,
@ -98,12 +104,14 @@ zend_module_entry xslt_module_entry = {
PHP_MINFO(xslt), PHP_MINFO(xslt),
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */
#ifdef COMPILE_DL_XSLT #ifdef COMPILE_DL_XSLT
ZEND_GET_MODULE(xslt) ZEND_GET_MODULE(xslt)
#endif #endif
/* A structure containing the sax handlers, automatically /* {{{ handler structs
A structure containing the sax handlers, automatically
registered whether the user defines them or not */ registered whether the user defines them or not */
static SAXHandler sax_handlers = static SAXHandler sax_handlers =
{ {
@ -134,21 +142,27 @@ static SchemeHandler scheme_handler = {
scheme_put, scheme_put,
scheme_close scheme_close
}; };
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(xslt) PHP_MINIT_FUNCTION(xslt)
{ {
le_xslt = zend_register_list_destructors_ex(free_processor, NULL, le_xslt_name, module_number); le_xslt = zend_register_list_destructors_ex(free_processor, NULL, le_xslt_name, module_number);
return SUCCESS; return SUCCESS;
} }
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(xslt) PHP_MINFO_FUNCTION(xslt)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_header(2, "XSLT support", "enabled"); php_info_print_table_header(2, "XSLT support", "enabled");
php_info_print_table_end(); php_info_print_table_end();
} }
/* }}} */
/* {{{ proto resource xslt_create(void) /* {{{ proto resource xslt_create(void)
Create a new XSLT processor */ Create a new XSLT processor */
@ -435,7 +449,6 @@ PHP_FUNCTION(xslt_set_log)
} }
/* }}} */ /* }}} */
/* {{{ proto string xslt_process(resource processor, string xml, string xslt[, mixed result[, array args[, array params]]]) /* {{{ proto string xslt_process(resource processor, string xml, string xslt[, mixed result[, array args[, array params]]])
Perform the xslt transformation */ Perform the xslt transformation */
PHP_FUNCTION(xslt_process) PHP_FUNCTION(xslt_process)
@ -636,7 +649,6 @@ static void free_processor(zend_rsrc_list_entry *rsrc)
} }
/* }}} */ /* }}} */
/* {{{ register_sax_handler_pair() /* {{{ register_sax_handler_pair()
Register a pair of sax handlers */ Register a pair of sax handlers */
static void register_sax_handler_pair(zval *handler1, zval *handler2, zval **handler) static void register_sax_handler_pair(zval *handler1, zval *handler2, zval **handler)
@ -1014,6 +1026,7 @@ static SAX_RETURN sax_endelement(void *ctx, const char *name)
/* Cleanup */ /* Cleanup */
zval_ptr_dtor(&retval); zval_ptr_dtor(&retval);
} }
/* }}} */
/* {{{ sax_startnamespace() /* {{{ sax_startnamespace()
Called at the beginning of the parsing of a new namespace */ Called at the beginning of the parsing of a new namespace */
@ -1531,4 +1544,5 @@ static MH_ERROR error_print(void *user_data, SablotHandle proc, MH_ERROR code, M
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

View file

@ -241,3 +241,11 @@ extern void xslt_call_function(char *name,
} }
/* }}} */ /* }}} */
#endif #endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/

View file

@ -1252,7 +1252,6 @@ PHP_FUNCTION(yaz_search)
} }
/* }}} */ /* }}} */
/* {{{ proto int yaz_present(int id) /* {{{ proto int yaz_present(int id)
Retrieve records */ Retrieve records */
PHP_FUNCTION(yaz_present) PHP_FUNCTION(yaz_present)
@ -2485,9 +2484,11 @@ ZEND_GET_MODULE(yaz)
#endif #endif
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4
* c-basic-offset: 4 * c-basic-offset: 4
* End: * End:
* vim: sw=4 ts=4 tw=78 fdm=marker
*/ */

Some files were not shown because too many files have changed in this diff Show more