Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

some misguided RINIT and RSHUTDOWN calls in a few fringe extensions
  • Loading branch information...
commit 25c3a3a39d7aebdce95825e6af2ad8c62905b7cc 1 parent 4efe6f7
@rlerdorf rlerdorf authored
Showing with 1,769 additions and 570 deletions.
  1. +4 −5 CODING_STANDARDS
  2. +20 −4 ext/aspell/aspell.c
  3. +1 −0  ext/crack/crack.c
  4. +14 −6 ext/ctype/ctype.c
  5. +45 −3 ext/curl/curl.c
  6. +31 −0 ext/cybercash/cybercash.c
  7. +13 −63 ext/cybermut/cybermut.c
  8. +75 −13 ext/db/db.c
  9. +31 −6 ext/dba/dba.c
  10. +8 −0 ext/dba/dba_cdb.c
  11. +8 −0 ext/dba/dba_db2.c
  12. +8 −0 ext/dba/dba_db3.c
  13. +8 −0 ext/dba/dba_dbm.c
  14. +8 −0 ext/dba/dba_gdbm.c
  15. +8 −0 ext/dba/dba_ndbm.c
  16. +7 −0 ext/dbase/dbase.c
  17. +1 −3 ext/ereg/ereg.c
  18. +59 −21 ext/exif/exif.c
  19. +16 −19 ext/fdf/fdf.c
  20. +7 −2 ext/filepro/filepro.c
  21. +16 −35 ext/fribidi/fribidi.c
  22. +114 −35 ext/ftp/ftp.c
  23. +63 −24 ext/gd/gd.c
  24. +62 −12 ext/gmp/gmp.c
  25. +15 −5 ext/iconv/iconv.c
  26. +11 −2 ext/imap/php_imap.c
  27. +41 −46 ext/ldap/ldap.c
  28. +29 −25 ext/msql/php_msql.c
  29. +61 −30 ext/mysql/php_mysql.c
  30. +7 −4 ext/oci8/oci8.c
  31. +15 −2 ext/odbc/php_odbc.c
  32. +23 −13 ext/openssl/openssl.c
  33. +25 −18 ext/pcre/php_pcre.c
  34. +64 −4 ext/pdf/pdf.c
  35. +1 −0  ext/pfpro/pfpro.c
  36. +75 −19 ext/pgsql/pgsql.c
  37. +17 −4 ext/posix/posix.c
  38. +17 −0 ext/pspell/pspell.c
  39. +20 −8 ext/shmop/shmop.c
  40. +36 −7 ext/skeleton/skeleton.c
  41. +21 −7 ext/snmp/snmp.c
  42. +20 −6 ext/snmp/winsnmp.c
  43. +1 −0  ext/standard/array.c
  44. +1 −0  ext/standard/assert.c
  45. +1 −0  ext/standard/base64.c
  46. +1 −0  ext/standard/basic_functions.c
  47. +1 −0  ext/standard/browscap.c
  48. +1 −0  ext/standard/crc32.c
  49. +7 −0 ext/standard/credits.c
  50. +1 −0  ext/standard/crypt.c
  51. +8 −0 ext/standard/cyr_convert.c
  52. +1 −0  ext/standard/datetime.c
  53. +1 −0  ext/standard/dir.c
  54. +1 −0  ext/standard/dl.c
  55. +1 −0  ext/standard/dns.c
  56. +1 −0  ext/standard/exec.c
  57. +1 −3 ext/standard/file.c
  58. +1 −0  ext/standard/filestat.c
  59. +8 −0 ext/standard/flock_compat.c
  60. +1 −0  ext/standard/formatted_print.c
  61. +1 −1  ext/standard/fsock.c
  62. +8 −0 ext/standard/ftp_fopen_wrapper.c
  63. +1 −0  ext/standard/head.c
  64. +1 −0  ext/standard/html.c
  65. +8 −0 ext/standard/http_fopen_wrapper.c
  66. +8 −0 ext/standard/image.c
  67. +8 −0 ext/standard/incomplete_class.c
  68. +1 −0  ext/standard/info.c
  69. +2 −0  ext/standard/iptc.c
  70. +9 −1 ext/standard/mail.c
  71. +1 −0  ext/standard/math.c
  72. +1 −0  ext/standard/md5.c
  73. +1 −0  ext/standard/metaphone.c
  74. +1 −0  ext/standard/microtime.c
  75. +1 −2  ext/standard/output.c
  76. +2 −2 ext/standard/pack.c
  77. +8 −0 ext/standard/pageinfo.c
  78. +8 −0 ext/standard/php_fopen_wrapper.c
  79. +8 −0 ext/standard/quot_print.c
  80. +2 −1  ext/standard/rand.c
  81. +1 −3 ext/standard/reg.c
  82. +7 −0 ext/standard/scanf.c
  83. +1 −0  ext/standard/soundex.c
  84. +99 −28 ext/standard/string.c
  85. +8 −0 ext/standard/strnatcmp.c
  86. +2 −0  ext/standard/syslog.c
  87. +8 −0 ext/standard/type.c
  88. +2 −0  ext/standard/uniqid.c
  89. +1 −0  ext/standard/url.c
  90. +8 −0 ext/standard/url_scanner.c
  91. +8 −0 ext/standard/url_scanner_ex.c
  92. +1 −0  ext/standard/var.c
  93. +39 −1 ext/swf/swf.c
  94. +17 −7 ext/sysvsem/sysvsem.c
  95. +23 −13 ext/sysvshm/sysvshm.c
  96. +94 −27 ext/wddx/wddx.c
  97. +3 −4 ext/xml/xml.c
  98. +18 −4 ext/xslt/sablot.c
  99. +8 −0 ext/xslt/xslt.c
  100. +2 −1  ext/yaz/php_yaz.c
  101. +24 −1 ext/zip/zip.c
  102. +53 −12 ext/zlib/zlib.c
  103. +1 −0  main/SAPI.c
  104. +8 −0 main/alloca.c
  105. +1 −1  main/fopen_wrappers.c
  106. +1 −0  main/internal_functions_win32.c
  107. +1 −0  main/main.c
  108. +8 −0 main/mergesort.c
  109. +1 −1  main/network.c
  110. +1 −2  main/output.c
  111. +1 −0  main/php.h
  112. +1 −0  main/php_content_types.c
  113. +1 −0  main/php_ini.c
  114. +8 −0 main/php_logos.c
  115. +14 −2 main/php_open_temporary_file.c
  116. +8 −0 main/php_sprintf.c
  117. +1 −1  main/php_ticks.c
  118. +1 −0  main/php_variables.c
  119. +8 −0 main/reentrancy.c
  120. +1 −0  main/rfc1867.c
  121. +8 −0 main/safe_mode.c
  122. +8 −0 main/snprintf.c
  123. +1 −1  main/streams.c
  124. +8 −0 main/strlcat.c
  125. +8 −0 main/strlcpy.c
View
9 CODING_STANDARDS
@@ -171,11 +171,10 @@ PHP_FUNCTION(abs)
/* }}} */
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
-useful when dealing with large files because you can scroll through the
-file quickly and just unfold the function you wish to work on. The }}}
-at the end of each function marks the end of the fold, and should be on
-a separate line.
+Emacs and vim (set fdm=marker). Folding is very useful when dealing with
+large files because you can scroll through the file quickly and just unfold
+the function you wish to work on. The }}} at the end of each function marks
+the end of the fold, and should be on a separate line.
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
View
24 ext/aspell/aspell.c
@@ -37,6 +37,8 @@
#include <aspell-c.h>
#include "ext/standard/info.h"
+/* {{{ aspell_functions[]
+ */
function_entry aspell_functions[] = {
PHP_FE(aspell_new, NULL)
PHP_FE(aspell_check, NULL)
@@ -44,6 +46,7 @@ function_entry aspell_functions[] = {
PHP_FE(aspell_suggest, NULL)
{NULL, NULL, NULL}
};
+/* }}} */
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
};
-
#ifdef COMPILE_DL_ASPELL
ZEND_GET_MODULE(aspell)
#endif
+/* {{{ php_aspell_close
+ */
static void php_aspell_close(zend_rsrc_list_entry *rsrc)
{
aspell *sc = (aspell *)rsrc->ptr;
aspell_free(sc);
}
+/* }}} */
-
+/* {{{ PHP_MINIT_FUNCTION
+ */
PHP_MINIT_FUNCTION(aspell)
{
le_aspell = zend_register_list_destructors_ex(php_aspell_close, NULL, "aspell", module_number);
return SUCCESS;
-
}
+/* }}} */
/* {{{ proto int aspell_new(string master [, string personal])
Load a dictionary */
@@ -97,7 +103,6 @@ PHP_FUNCTION(aspell_new)
}
/* }}} */
-
/* {{{ proto array aspell_suggest(aspell int, string word)
Return array of Suggestions */
PHP_FUNCTION(aspell_suggest)
@@ -199,11 +204,22 @@ PHP_FUNCTION(aspell_check_raw)
}
/* }}} */
+/* {{{ PHP_MINFO_FUNCTION
+ */
PHP_MINFO_FUNCTION(aspell)
{
php_info_print_table_start();
php_info_print_table_row(2, "ASpell Support", "enabled");
php_info_print_table_end();
}
+/* }}} */
#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
+ */
View
1  ext/crack/crack.c
@@ -259,4 +259,5 @@ ZEND_FUNCTION(crack_getlastmessage)
* tab-width: 4
* c-basic-offset: 4
* End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
*/
View
20 ext/ctype/ctype.c
@@ -41,8 +41,9 @@ ZEND_DECLARE_MODULE_GLOBALS(ctype)
/* True global resources - no need for thread safety here */
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[] = {
PHP_FE(ctype_alnum, NULL)
PHP_FE(ctype_alpha, NULL)
@@ -57,7 +58,10 @@ function_entry ctype_functions[] = {
PHP_FE(ctype_xdigit, NULL)
{NULL, NULL, NULL} /* Must be the last line in ctype_functions[] */
};
+/* }}} */
+/* {{{ ctype_mpodule_entry
+ */
zend_module_entry ctype_module_entry = {
"ctype",
ctype_functions,
@@ -68,6 +72,7 @@ zend_module_entry ctype_module_entry = {
PHP_MINFO(ctype),
STANDARD_MODULE_PROPERTIES
};
+/* }}} */
#ifdef COMPILE_DL_CTYPE
ZEND_GET_MODULE(ctype)
@@ -77,7 +82,8 @@ ZEND_GET_MODULE(ctype)
#define PHP_EXPERIMENTAL(x,y)
#endif
-
+/* {{{ PHP_MINFO_FUNCTION
+ */
PHP_MINFO_FUNCTION(ctype)
{
ELS_FETCH();
@@ -87,8 +93,10 @@ PHP_MINFO_FUNCTION(ctype)
php_info_print_table_row(2, "ctype functions", "enabled (experimental)");
php_info_print_table_end();
}
+/* }}} */
-
+/* {{{ ctype
+ */
static int ctype(int (*iswhat)(int),zval **c)
{
switch ((*c)->type) {
@@ -111,6 +119,7 @@ static int ctype(int (*iswhat)(int),zval **c)
}
return 0;
}
+/* }}} */
/* {{{ proto bool isalnum(mixed c)
Check for alphanumeric character(s) */
@@ -310,13 +319,12 @@ PHP_FUNCTION(ctype_xdigit)
}
/* }}} */
-
#endif /* HAVE_CTYPE */
-
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
*/
View
48 ext/curl/curl.c
@@ -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;
+/* {{{ curl_functions[]
+ */
function_entry curl_functions[] = {
PHP_FE(curl_init, NULL)
PHP_FE(curl_version, NULL)
@@ -59,7 +61,10 @@ function_entry curl_functions[] = {
PHP_FE(curl_close, NULL)
{NULL, NULL, NULL}
};
+/* }}} */
+/* {{{ curl_module_entry
+ */
zend_module_entry curl_module_entry = {
"curl",
curl_functions,
@@ -70,11 +75,14 @@ zend_module_entry curl_module_entry = {
PHP_MINFO(curl),
STANDARD_MODULE_PROPERTIES
};
+/* }}} */
#ifdef COMPILE_DL_CURL
ZEND_GET_MODULE (curl)
#endif
+/* {{{ PHP_MINFO_FUNCTION
+ */
PHP_MINFO_FUNCTION(curl)
{
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_end();
}
+/* }}} */
#define REGISTER_CURL_CONSTANT(name, value) REGISTER_LONG_CONSTANT(name, value, CONST_CS | CONST_PERSISTENT)
+/* {{{ PHP_MINIT_FUNCTION
+ */
PHP_MINIT_FUNCTION(curl)
{
le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number);
@@ -230,6 +241,7 @@ PHP_MINIT_FUNCTION(curl)
return SUCCESS;
}
+/* }}} */
#define PHP_CURL_STDOUT 0
#define PHP_CURL_FILE 1
@@ -239,6 +251,8 @@ PHP_MINIT_FUNCTION(curl)
#define PHP_CURL_ASCII 5
#define PHP_CURL_BINARY 6
+/* {{{ curl_write
+ */
static size_t curl_write(char *data, size_t size, size_t nmemb, void *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;
}
+/* }}} */
+/* {{{ curl_read
+ */
static size_t curl_read(char *data, size_t size, size_t nmemb, void *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;
}
+/* }}} */
+/* {{{ _php_curl_write_header
+ */
static size_t _php_curl_write_header(char *data, size_t size, size_t nmemb, void *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;
}
+/* }}} */
+/* {{{ _php_curl_passwd
+ */
static size_t _php_curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
{
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;
}
-
-
+/* }}} */
+/* {{{ curl_free_string
+ */
static void curl_free_string(void **string)
{
efree(*string);
-}
+}
+/* }}} */
+/* {{{ curl_free_post
+ */
static void curl_free_post(void **post)
{
curl_formfree((struct HttpPost *) *post);
}
+/* }}} */
+/* {{{ curl_free_slist
+ */
static void curl_free_slist(void **slist)
{
curl_slist_free_all((struct curl_slist *) *slist);
}
+/* }}} */
/* {{{ proto string curl_version(void)
Return the CURL version string. */
@@ -445,6 +476,8 @@ PHP_FUNCTION(curl_version)
}
/* }}} */
+/* {{{ alloc_curl_handle
+ */
static void alloc_curl_handle(php_curl **ch)
{
*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),
(void(*)(void *)) curl_free_post, 0);
}
+/* }}} */
/* {{{ proto int curl_init([string url])
Initialize a CURL session */
@@ -939,3 +973,11 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc)
/* }}} */
#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
+ */
View
31 ext/cybercash/cybercash.c
@@ -28,6 +28,8 @@
+----------------------------------------------------------------------+
*/
+/* $Id$ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -40,6 +42,8 @@
#include "mckcrypt.h"
#include "base64.h"
+/* {{{ cybercash_functions[]
+ */
function_entry cybercash_functions[] = {
PHP_FE(cybercash_encr, NULL)
PHP_FE(cybercash_decr, NULL)
@@ -47,7 +51,10 @@ function_entry cybercash_functions[] = {
PHP_FE(cybercash_base64_decode, NULL)
{NULL, NULL, NULL}
};
+/* }}} */
+/* {{{ cybercash_module_entry
+ */
zend_module_entry cybercash_module_entry = {
"cybercash",
cybercash_functions,
@@ -58,18 +65,24 @@ zend_module_entry cybercash_module_entry = {
PHP_MINFO(cybercash),
STANDARD_MODULE_PROPERTIES,
};
+/* }}} */
#ifdef COMPILE_DL_CYBERCASH
ZEND_GET_MODULE(cybercash)
#endif
+/* {{{ PHP_MINFO_FUNCTION
+ */
PHP_MINFO_FUNCTION(cybercash)
{
php_info_print_table_start();
php_info_print_table_row(2, "Cybercash Support", "enabled");
php_info_print_table_end();
}
+/* }}} */
+/* {{{ proto cybercash_encr(string wmk, string sk, string data)
+ Cybercash encrypt */
PHP_FUNCTION(cybercash_encr)
{
zval **wmk, **sk, **inbuff;
@@ -116,7 +129,10 @@ PHP_FUNCTION(cybercash_encr)
efree(macbuff);
}
}
+/* }}} */
+/* {{{ proto array cybercash_decr(string wmp, string sk, string data)
+ Cybercash decrypt */
PHP_FUNCTION(cybercash_decr)
{
zval **wmk,**sk,**inbuff;
@@ -164,7 +180,10 @@ PHP_FUNCTION(cybercash_decr)
efree(macbuff);
}
}
+/* }}} */
+/* {{{ proto string cybercash_base64_encode(string data)
+ base64 encode data for cybercash */
PHP_FUNCTION(cybercash_base64_encode)
{
zval **inbuff;
@@ -185,7 +204,10 @@ PHP_FUNCTION(cybercash_base64_encode)
RETURN_STRINGL(outbuff, ret_length, 0);
}
+/* }}} */
+/* {{{ proto string cybercash_base64_decode(string data)
+ base64 decode data for cybercash */
PHP_FUNCTION(cybercash_base64_decode)
{
zval **inbuff;
@@ -204,4 +226,13 @@ PHP_FUNCTION(cybercash_base64_decode)
RETURN_STRINGL(outbuff, ret_length, 0);
}
+/* }}} */
#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
+ */
View
76 ext/cybermut/cybermut.c
@@ -13,10 +13,11 @@
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Sylvain PAGES <spages@free.fr> |
- | |
+----------------------------------------------------------------------+
*/
+/* $Id$ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -34,103 +35,53 @@ ZEND_DECLARE_MODULE_GLOBALS(cybermut)
/* True global resources - no need for thread safety here */
static int le_cybermut;
-/* Every user visible function must have an entry in cybermut_functions[].
-*/
+/* {{{ cybermut_functions[]
+ */
function_entry cybermut_functions[] = {
- PHP_FE(confirm_cybermut_compiled, NULL) /* For testing, remove later. */
PHP_FE(cybermut_creerformulairecm, NULL)
PHP_FE(cybermut_testmac, NULL)
PHP_FE(cybermut_creerreponsecm, NULL)
{NULL, NULL, NULL} /* Must be the last line in cybermut_functions[] */
};
+/* }}} */
+/* {{{ cybermut_module_entry
+ */
zend_module_entry cybermut_module_entry = {
"cybermut",
cybermut_functions,
PHP_MINIT(cybermut),
PHP_MSHUTDOWN(cybermut),
- PHP_RINIT(cybermut), /* Replace with NULL if there's nothing to do at request start */
- PHP_RSHUTDOWN(cybermut), /* Replace with NULL if there's nothing to do at request end */
+ NULL,
+ NULL,
PHP_MINFO(cybermut),
STANDARD_MODULE_PROPERTIES
};
+/* }}} */
#ifdef COMPILE_DL_CYBERMUT
ZEND_GET_MODULE(cybermut)
#endif
-/* Remove comments and fill if you need to have entries in php.ini
-PHP_INI_BEGIN()
-PHP_INI_END()
-*/
-
PHP_MINIT_FUNCTION(cybermut)
{
-/* Remove comments if you have entries in php.ini
- REGISTER_INI_ENTRIES();
-*/
return SUCCESS;
}
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;
}
+/* {{{ PHP_MINFO_FUNCTION
+ */
PHP_MINFO_FUNCTION(cybermut)
{
php_info_print_table_start();
php_info_print_table_header(2, "cybermut support", "enabled");
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)
Return a string containing source HTML of the form of request for payment.
@@ -222,11 +173,10 @@ PHP_FUNCTION(cybermut_creerreponsecm)
}
/* }}} */
-
-
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
*/
View
88 ext/db/db.c
@@ -103,6 +103,8 @@
#define DBM_FIRSTKEY(dbf) dbm_firstkey(dbf)
#define DBM_NEXTKEY(dbf, key) dbm_nextkey(dbf)
+/* {{{ php_dbm_key_exists
+ */
static int php_dbm_key_exists(DBM *dbf, datum key_datum) {
datum value_datum;
int ret;
@@ -114,6 +116,7 @@ static int php_dbm_key_exists(DBM *dbf, datum key_datum) {
ret = 0;
return ret;
}
+/* }}} */
#endif
#if !NDBM && !GDBM
@@ -163,6 +166,8 @@ static int numthreads=0;
/*needed for blocking calls in windows*/
void *dbm_mutex;
+/* {{{ php_find_dbm
+ */
dbm_info *php_find_dbm(pval *id)
{
list_entry *le;
@@ -193,7 +198,10 @@ dbm_info *php_find_dbm(pval *id)
return NULL;
return info;
}
+/* }}} */
+/* {{{ php_get_info_db
+ */
static char *php_get_info_db(void)
{
static char temp1[128];
@@ -228,8 +236,10 @@ static char *php_get_info_db(void)
return temp;
}
+/* }}} */
-
+/* {{{ PHP_MINFO_FUNCTION
+ */
PHP_MINFO_FUNCTION(db)
{
/* 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_info_print_box_end();
}
+/* }}} */
/* {{{ proto string dblist(void)
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 *info;
int ret, lock=0;
@@ -408,6 +420,7 @@ dbm_info *php_dbm_open(char *filename, char *mode) {
return NULL;
}
+/* }}} */
/* {{{ proto bool dbmclose(int dbm_identifier)
Closes a dbm database */
@@ -427,6 +440,8 @@ PHP_FUNCTION(dbmclose) {
}
/* }}} */
+/* {{{ php_dbm_close
+ */
int php_dbm_close(zend_rsrc_list_entry *rsrc) {
int ret = 0;
dbm_info *info = (dbm_info *)rsrc->ptr;
@@ -454,7 +469,8 @@ int php_dbm_close(zend_rsrc_list_entry *rsrc) {
efree(info);
return(ret);
-}
+}
+/* }}} */
/*
* 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) {
datum key_datum, value_datum;
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);
return(ret);
-}
+}
+/* }}} */
/* {{{ proto int dbmreplace(int dbm_identifier, string key, string value)
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) {
DBM_TYPE dbf;
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);
return(ret);
-}
+}
+/* }}} */
/* {{{ proto string dbmfetch(int dbm_identifier, string key)
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) {
datum key_datum, value_datum;
char *ret;
@@ -650,6 +673,7 @@ char *php_dbm_fetch(dbm_info *info, char *key) {
}
return(ret);
}
+/* }}} */
/* {{{ proto int dbmexists(int dbm_identifier, string key)
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) {
datum key_datum;
int ret;
@@ -696,6 +722,7 @@ int php_dbm_exists(dbm_info *info, char *key) {
return(ret);
}
+/* }}} */
/* {{{ proto int dbmdelete(int dbm_identifier, string key)
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) {
datum key_datum;
int ret;
@@ -741,6 +770,7 @@ int php_dbm_delete(dbm_info *info, char *key) {
ret = DBM_DELETE(dbf, key_datum);
return(ret);
}
+/* }}} */
/* {{{ proto string dbmfirstkey(int dbm_identifier)
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) {
datum ret_datum;
char *ret;
@@ -799,6 +831,7 @@ char *php_dbm_first_key(dbm_info *info) {
return (ret);
}
+/* }}} */
/* {{{ proto string dbmnextkey(int dbm_identifier, string key)
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) {
datum key_datum, ret_datum;
char *ret;
@@ -873,11 +907,12 @@ char *php_dbm_nextkey(dbm_info *info, char *key) {
}
return(ret);
}
-
+/* }}} */
#if !GDBM && !NDBM
static long CurrentFlatFilePos = 0L;
-
+/* {{{ flatfile_store
+ */
int flatfile_store(FILE *dbf, datum key_datum, datum value_datum, int mode) {
int ret;
@@ -905,7 +940,10 @@ int flatfile_store(FILE *dbf, datum key_datum, datum value_datum, int mode) {
ret=0;
return ret;
}
+/* }}} */
+/* {{{ flatfile_fetch
+ */
datum flatfile_fetch(FILE *dbf, datum key_datum) {
datum value_datum = {NULL, 0};
int num=0, buf_size=1024;
@@ -926,7 +964,10 @@ datum flatfile_fetch(FILE *dbf, datum key_datum) {
}
return value_datum;
}
+/* }}} */
+/* {{{ flatfile_delete
+ */
int flatfile_delete(FILE *dbf, datum key_datum) {
char *key = key_datum.dptr;
int size = key_datum.dsize;
@@ -981,7 +1022,10 @@ int flatfile_delete(FILE *dbf, datum key_datum) {
if (buf) efree(buf);
return FAILURE;
}
+/* }}} */
+/* {{{ flatfile_findkey
+ */
int flatfile_findkey(FILE *dbf, datum key_datum) {
char *buf = NULL;
int num;
@@ -1023,8 +1067,11 @@ int flatfile_findkey(FILE *dbf, datum key_datum) {
}
if (buf) efree(buf);
return(ret);
-}
+}
+/* }}} */
+/* {{{ flatfile_firstkey
+ */
datum flatfile_firstkey(FILE *dbf) {
datum buf;
int num;
@@ -1060,8 +1107,11 @@ datum flatfile_firstkey(FILE *dbf) {
if (buf.dptr) efree(buf.dptr);
buf.dptr = NULL;
return(buf);
-}
+}
+/* }}} */
+/* {{{ latfile_nextkey
+ */
datum flatfile_nextkey(FILE *dbf) {
datum buf;
int num;
@@ -1098,9 +1148,11 @@ datum flatfile_nextkey(FILE *dbf) {
buf.dptr = NULL;
return(buf);
}
+/* }}} */
#endif
-
+/* {{{ PHP_MINIT_FUNCTION
+ */
PHP_MINIT_FUNCTION(db)
{
#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);
return SUCCESS;
}
+/* }}} */
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
static PHP_MSHUTDOWN_FUNCTION(db)
{
#ifdef THREAD_SAFE
@@ -1142,7 +1197,10 @@ static PHP_MSHUTDOWN_FUNCTION(db)
#endif
return SUCCESS;
}
+/* }}} */
+/* {{{ PHP_RINIT_FUNCTION
+ */
PHP_RINIT_FUNCTION(db)
{
#if !GDBM && !NDBM
@@ -1150,8 +1208,10 @@ PHP_RINIT_FUNCTION(db)
#endif
return SUCCESS;
}
+/* }}} */
-
+/* {{{ dbm_functions[]
+ */
function_entry dbm_functions[] = {
PHP_FE(dblist, NULL)
PHP_FE(dbmopen, NULL)
@@ -1165,6 +1225,7 @@ function_entry dbm_functions[] = {
PHP_FE(dbmnextkey, NULL)
{NULL,NULL,NULL}
};
+/* }}} */
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
@@ -1181,4 +1242,5 @@ ZEND_GET_MODULE(dbm)
* tab-width: 4
* c-basic-offset: 4
* End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
*/
View
37 ext/dba/dba.c
@@ -47,6 +47,8 @@
#include "php_db2.h"
#include "php_db3.h"
+/* {{{ dba_functions[]
+ */
function_entry dba_functions[] = {
PHP_FE(dba_open, NULL)
PHP_FE(dba_popen, NULL)
@@ -62,6 +64,7 @@ function_entry dba_functions[] = {
PHP_FE(dba_sync, NULL)
{NULL,NULL,NULL}
};
+/* }}} */
static PHP_MINIT_FUNCTION(dba);
static PHP_MSHUTDOWN_FUNCTION(dba);
@@ -179,9 +182,8 @@ static int le_pdb;
static HashTable ht_keys;
/* }}} */
-/* {{{ helper routines */
- /* {{{ dba_close */
-
+/* {{{ dba_close
+ */
static void dba_close(dba_info *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)
{
dba_info *info = (dba_info *)rsrc->ptr;
dba_close(info);
}
+/* }}} */
+/* {{{ PHP_MINIT_FUNCTION
+ */
static PHP_MINIT_FUNCTION(dba)
{
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);
return SUCCESS;
}
+/* }}} */
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
static PHP_MSHUTDOWN_FUNCTION(dba)
{
zend_hash_destroy(&ht_keys);
return SUCCESS;
}
+/* }}} */
#include "ext/standard/php_smart_str.h"
+/* {{{ PHP_MINFO_FUNCTION
+ */
static PHP_MINFO_FUNCTION(dba)
{
dba_handler *hptr;
@@ -233,8 +246,10 @@ static PHP_MINFO_FUNCTION(dba)
}
php_info_print_table_end();
}
+/* }}} */
-
+/* {{{ php_dba_update
+ */
static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
DBA_ID_PARS;
@@ -253,9 +268,12 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
RETURN_TRUE;
RETURN_FALSE;
}
+/* }}} */
#define FREENOW if(args) efree(args); if(key) efree(key)
+/* {{{ php_dba_open
+ */
static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
pval ***args = (pval ***) NULL;
@@ -355,9 +373,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
FREENOW;
RETURN_LONG(listid);
}
-#undef FREENOW
-/* }}} */
/* }}} */
+#undef FREENOW
/* {{{ proto int dba_popen(string path, string mode, string handlername [, string ...])
Opens path using the specified handler in mode persistently */
@@ -501,3 +518,11 @@ PHP_FUNCTION(dba_sync)
/* }}} */
#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
+ */
View
8 ext/dba/dba_cdb.c
@@ -218,3 +218,11 @@ DBA_SYNC_FUNC(cdb)
}
#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
+ */
View
8 ext/dba/dba_db2.c
@@ -199,3 +199,11 @@ DBA_SYNC_FUNC(db2)
}
#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
+ */
View
8 ext/dba/dba_db3.c
@@ -206,3 +206,11 @@ DBA_SYNC_FUNC(db3)
}
#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
+ */
View
8 ext/dba/dba_dbm.c
@@ -184,3 +184,11 @@ DBA_SYNC_FUNC(dbm)
}
#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
+ */
View
8 ext/dba/dba_gdbm.c
@@ -187,3 +187,11 @@ DBA_SYNC_FUNC(gdbm)
return SUCCESS;
}
#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
+ */
View
8 ext/dba/dba_ndbm.c
@@ -164,3 +164,11 @@ DBA_SYNC_FUNC(ndbm)
return SUCCESS;
}
#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
+ */
View
7 ext/dbase/dbase.c
@@ -16,6 +16,8 @@
+----------------------------------------------------------------------+
*/
+/* $Id$ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -731,6 +733,8 @@ PHP_FUNCTION(dbase_create) {
}
/* }}} */
+/* {{{ dbase_functions[]
+ */
function_entry dbase_functions[] = {
PHP_FE(dbase_open, NULL)
PHP_FE(dbase_create, NULL)
@@ -745,6 +749,7 @@ function_entry dbase_functions[] = {
PHP_FE(dbase_pack, NULL)
{NULL, NULL, NULL}
};
+/* }}} */
zend_module_entry dbase_module_entry = {
"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
+
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
*/
View
4 ext/ereg/ereg.c
@@ -609,7 +609,6 @@ PHP_FUNCTION(spliti)
/* }}} */
-
/* {{{ proto string sql_regcase(string string)
Make regular expression for case insensitive match */
PHPAPI PHP_FUNCTION(sql_regcase)
@@ -646,11 +645,10 @@ PHPAPI PHP_FUNCTION(sql_regcase)
}
/* }}} */
-
-
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
*/
View
80 ext/exif/exif.c
@@ -57,7 +57,8 @@ typedef unsigned char uchar;
#define FALSE 0
#endif
-/*
+
+/* {{{ structs
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
stored in a nexif header
@@ -108,17 +109,23 @@ typedef struct {
int Type;
unsigned Size;
} Section_t;
+/* }}} */
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
+/* {{{ exif_functions[]
+ */
function_entry exif_functions[] = {
PHP_FE(read_exif_data, NULL)
{NULL, NULL, NULL}
};
+/* }}} */
PHP_MINFO_FUNCTION(exif);
+/* {{{ exif_module_entry
+ */
zend_module_entry exif_module_entry = {
"exif",
exif_functions,
@@ -127,18 +134,22 @@ zend_module_entry exif_module_entry = {
PHP_MINFO(exif),
STANDARD_MODULE_PROPERTIES
};
+/* }}} */
#ifdef COMPILE_DL_EXIF
ZEND_GET_MODULE(exif)
#endif
+/* {{{ PHP_MINFO_FUNCTION
+ */
PHP_MINFO_FUNCTION(exif) {
php_info_print_table_start();
php_info_print_table_row(2, "EXIF Support", "enabled" );
php_info_print_table_end();
}
+/* }}} */
-/*
+/* {{{ Markers
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
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. */
-/*
+/* }}} */
+
+/* {{{ Get16m
Get 16 bits motorola order (always) for jpeg header stuff.
*/
static int Get16m(void *Short)
{
return (((uchar *)Short)[0] << 8) | ((uchar *)Short)[1];
}
+/* }}} */
-
-/*
+/* {{{ process_COM
Process a COM marker.
We want to print out the marker contents as legible text;
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);
}
-
+/* }}} */
-/* 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)
{
int data_precision, num_components;
@@ -249,8 +263,9 @@ static void process_SOFn (ImageInfoType *ImageInfo, uchar *Data, int marker)
default: process = "Unknown"; break;
}
}
+/* }}} */
-/*
+/* {{{ format description defines
Describes format descriptor
*/
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_FOCALPLANEUNITS 0xa210
#define TAG_IMAGEWIDTH 0xA002
+/* }}} */
+/* {{{ TabTable[]
+ */
static const struct {
unsigned short Tag;
char *Desc;
@@ -408,10 +426,10 @@ static const struct {
{ 0xA301, "SceneType"},
{ 0, NULL}
} ;
+/* }}} */
-
-
-/* Convert a 16 bit unsigned value from file's native byte order */
+/* {{{ Get16u
+ * Convert a 16 bit unsigned value from file's native byte order */
static int Get16u(void *Short, int MotorolaOrder)
{
if (MotorolaOrder) {
@@ -420,8 +438,10 @@ static int Get16u(void *Short, int MotorolaOrder)
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)
{
if (MotorolaOrder) {
@@ -432,14 +452,18 @@ static int Get32s(void *Long, int MotorolaOrder)
| (((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)
{
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)
{
double Value;
@@ -475,8 +499,10 @@ static double ConvertAnyFormat(void *ValuePtr, int Format, int MotorolaOrder)
}
return Value;
}
+/* }}} */
-/* Grab the thumbnail - by Matt Bonneau */
+/* {{{ ExtractThumbnail
+ * Grab the thumbnail - by Matt Bonneau */
static void ExtractThumbnail(ImageInfoType *ImageInfo, char *OffsetBase, unsigned ExifLength) {
/* according to exif2.1, the thumbnail is not supposed to be greater than 64K */
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)
{
int de;
@@ -767,8 +795,9 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse
ProcessExifDir(ImageInfo, OffsetBase + NextDirOffset, OffsetBase, ExifLength, LastExifRefd);
}
}
+/* }}} */
-/*
+/* {{{ process_EXIF
Process an EXIF marker
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);
}
}
-
-/* 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)
{
int a;
@@ -953,8 +984,9 @@ static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t *
}
return TRUE;
}
+/* }}} */
-/*
+/* {{{ DiscardData
Discard read data.
*/
void DiscardData(Section_t *Sections, int *SectionsRead)
@@ -965,8 +997,9 @@ void DiscardData(Section_t *Sections, int *SectionsRead)
}
*SectionsRead = 0;
}
+/* }}} */
-/*
+/* {{{ ReadJpegFile
Read image data.
*/
int ReadJpegFile(ImageInfoType *ImageInfo, Section_t *Sections,
@@ -1024,7 +1057,10 @@ int ReadJpegFile(ImageInfoType *ImageInfo, Section_t *Sections,
return ret;
}
+/* }}} */
+/* {{{ php_read_jpeg_exif
+ */
int php_read_jpeg_exif(ImageInfoType *ImageInfo, char *FileName, int ReadAll)
{
Section_t Sections[20];
@@ -1057,6 +1093,7 @@ int php_read_jpeg_exif(ImageInfoType *ImageInfo, char *FileName, int ReadAll)
}
return(ret);
}
+/* }}} */
/* {{{ proto string read_exif_data(string filename)
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);
}
}
+/* }}} */
#endif
View
35 ext/fdf/fdf.c
@@ -42,6 +42,8 @@ static int le_fdf;
SAPI_POST_HANDLER_FUNC(fdf_post_handler);
+/* {{{ fdf_functions[]
+ */
function_entry fdf_functions[] = {
PHP_FE(fdf_open, NULL)
PHP_FE(fdf_create, NULL)
@@ -62,6 +64,7 @@ function_entry fdf_functions[] = {
PHP_FE(fdf_set_javascript_action, NULL)
{NULL, NULL, NULL}
};
+/* }}} */
zend_module_entry fdf_module_entry = {
"fdf",
@@ -95,7 +98,8 @@ static sapi_post_entry php_fdf_post_entry = {
fdf_post_handler
};
-
+/* {{{ PHP_MINIT_FUNCTION
+ */
PHP_MINIT_FUNCTION(fdf)
{
FDFErc err;
@@ -140,7 +144,10 @@ PHP_MINIT_FUNCTION(fdf)
if((err = FDFInitialize()) == FDFErcOK) return SUCCESS;
return FAILURE;
}
+/* }}} */
+/* {{{ PHP_MINFO_FUNCTION
+ */
PHP_MINFO_FUNCTION(fdf)
{
/* 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_end();
}
+/* }}} */
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
PHP_MSHUTDOWN_FUNCTION(fdf)
{
FDFErc err;
@@ -163,7 +173,7 @@ PHP_MSHUTDOWN_FUNCTION(fdf)
if((err = FDFFinalize()) == FDFErcOK) return SUCCESS;
return FAILURE;
}
-
+/* }}} */
/* {{{ proto int fdf_open(string filename)
Opens a new FDF document */
@@ -190,7 +200,6 @@ PHP_FUNCTION(fdf_open)
}
/* }}} */
-
/* {{{ proto int fdf_create(void)
Creates a new FDF document */
PHP_FUNCTION(fdf_create)
@@ -209,7 +218,6 @@ PHP_FUNCTION(fdf_create)
}
/* }}} */
-
/* {{{ proto bool fdf_close(int fdfdoc)
Closes the FDF document */
PHP_FUNCTION(fdf_close)
@@ -226,7 +234,6 @@ PHP_FUNCTION(fdf_close)
}
/* }}} */
-
/* {{{ proto string fdf_get_value(int fdfdoc, string fieldname)
Gets the value of a field as string */
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)
Sets the value of a field */
PHP_FUNCTION(fdf_set_value)
@@ -291,7 +297,6 @@ PHP_FUNCTION(fdf_set_value)
}
/* }}} */
-
/* {{{ proto string fdf_next_field_name(int fdfdoc [, string fieldname])
Gets the name of the next field name or the first 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)
Sets the appearence of a field */
PHP_FUNCTION(fdf_set_ap)
@@ -383,7 +387,6 @@ PHP_FUNCTION(fdf_set_ap)
}
/* }}} */
-
/* {{{ proto bool fdf_set_status(int fdfdoc, string status)
Sets the value of /Status key */
PHP_FUNCTION(fdf_set_status)
@@ -410,7 +413,6 @@ PHP_FUNCTION(fdf_set_status)
}
/* }}} */
-
/* {{{ proto string fdf_get_status(int fdfdoc)
Gets the value of /Status key */
PHP_FUNCTION(fdf_get_status)
@@ -446,7 +448,6 @@ PHP_FUNCTION(fdf_get_status)
}
/* }}} */
-
/* {{{ proto bool fdf_set_file(int fdfdoc, string filename)
Sets the value of /F key */
PHP_FUNCTION(fdf_set_file)
@@ -473,7 +474,6 @@ PHP_FUNCTION(fdf_set_file)
}
/* }}} */
-
/* {{{ proto string fdf_get_file(int fdfdoc)
Gets the value of /F key */
PHP_FUNCTION(fdf_get_file)
@@ -509,7 +509,6 @@ PHP_FUNCTION(fdf_get_file)
}
/* }}} */
-
/* {{{ proto bool fdf_save(int fdfdoc, string filename)
Writes out the FDF file */
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)
Adds a template into the FDF document */
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)
Sets flags for a field in the FDF document */
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)
Sets a value in the opt array for a field */
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)
Sets the submit form action for a field */
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)
Sets the javascript action for a field */
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)
{
FILE *fp;
@@ -760,6 +755,7 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler)
if(lastfieldname) efree(lastfieldname);
}
}
+/* }}} */
#endif
@@ -768,4 +764,5 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler)
* tab-width: 4
* c-basic-offset: 4
* End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
*/
View
9 ext/filepro/filepro.c
@@ -78,7 +78,8 @@ static signed int fp_keysize = -1; /* Size of key records */
static FP_FIELD *fp_fieldlist = NULL; /* List of fields */
#endif
-
+/* {{{ PHP_MINIT_FUNCTION
+ */
PHP_MINIT_FUNCTION(filepro)
{
#ifdef THREAD_SAFE
@@ -104,7 +105,10 @@ PHP_MINIT_FUNCTION(filepro)
return SUCCESS;
}
+/* }}} */
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
PHP_MSHUTDOWN_FUNCTION(filepro)
{
#ifdef THREAD_SAFE
@@ -125,7 +129,7 @@ PHP_MSHUTDOWN_FUNCTION(filepro)
#endif
return SUCCESS;
}
-
+/* }}} */
function_entry filepro_functions[] = {
PHP_FE(filepro, NULL)
@@ -568,4 +572,5 @@ PHP_FUNCTION(filepro_retrieve)
* tab-width: 4
* c-basic-offset: 4
* End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
*/
View
51 ext/fribidi/fribidi.c
@@ -13,10 +13,11 @@
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: |
- | |
+----------------------------------------------------------------------+
*/
+/* $Id$ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -41,7 +42,7 @@ ZEND_DECLARE_MODULE_GLOBALS(fribidi)
/* Every user visible function must have an entry in 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[] */
};
@@ -50,8 +51,8 @@ zend_module_entry fribidi_module_entry = {
fribidi_functions,
PHP_MINIT(fribidi),
PHP_MSHUTDOWN(fribidi),
- PHP_RINIT(fribidi), /* Replace with NULL if there's nothing to do at request start */
- PHP_RSHUTDOWN(fribidi), /* Replace with NULL if there's nothing to do at request end */
+ NULL,
+ NULL,
PHP_MINFO(fribidi),
STANDARD_MODULE_PROPERTIES
};
@@ -60,17 +61,10 @@ zend_module_entry fribidi_module_entry = {
ZEND_GET_MODULE(fribidi)
#endif
-/* Remove comments and fill if you need to have entries in php.ini
-PHP_INI_BEGIN()
-PHP_INI_END()
-*/
-
+/* {{{ PHP_MINIT_FUNCTION
+ */
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_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);
@@ -80,38 +74,25 @@ PHP_MINIT_FUNCTION(fribidi)
return SUCCESS;
}
+/* }}} */
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
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;
}
+/* }}} */
+/* {{{ PHP_MINFO_FUNCTION
+ */
PHP_MINFO_FUNCTION(fribidi)
{
php_info_print_table_start();
php_info_print_table_header(2, "fribidi support", "enabled");
php_info_print_table_end();
-
- /* Remove comments if you have entries in php.ini
- DISPLAY_INI_ENTRIES();
- */
}
-
+/* }}} */
/*--------------------------------------------------------------*/
/* Name: fribidi_log2vis */
@@ -138,7 +119,7 @@ PHP_MINFO_FUNCTION(fribidi)
/* {{{ proto string fribidi_log2vis(string str, string direction, int charset)
Convert a logical string to a visual one */
-ZEND_FUNCTION(fribidi_log2vis)
+PHP_FUNCTION(fribidi_log2vis)
{
zval **parameter1,**parameter2, **parameter3;
@@ -264,10 +245,10 @@ ZEND_FUNCTION(fribidi_log2vis)
#endif /* HAVE_FRIBIDI */
-
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
+ * vim: sw=4 ts=4 tw=78 fdm=marker
*/
View
149 ext/ftp/ftp.c
@@ -23,8 +23,7 @@
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
- | Authors: |
- | Andrew Skalski <askalski@chek.com> |
+ | Authors: Andrew Skalski <askalski@chek.com> |
+----------------------------------------------------------------------+
*/
@@ -108,7 +107,8 @@ union ipbox {
unsigned char c[8];
};
-
+/* {{{ ftp_open
+ */
ftpbuf_t*
ftp_open(const char *host, short port)
{
@@ -172,8 +172,10 @@ ftp_open(const char *host, short port)
free(ftp);
return NULL;
}
+/* }}} */
-
+/* {{{ ftp_close
+ */
ftpbuf_t*
ftp_close(ftpbuf_t *ftp)
{
@@ -185,8 +187,10 @@ ftp_close(ftpbuf_t *ftp)
free(ftp);
return NULL;
}
+/* }}} */
-
+/* {{{ ftp_gc
+ */
void
ftp_gc(ftpbuf_t *ftp)
{
@@ -198,8 +202,10 @@ ftp_gc(ftpbuf_t *ftp)
free(ftp->syst);
ftp->syst = NULL;
}
+/* }}} */
-
+/* {{{ ftp_quit
+ */
int
ftp_quit(ftpbuf_t *ftp)
{
@@ -216,8 +222,10 @@ ftp_quit(ftpbuf_t *ftp)
return 1;
}
+/* }}} */
-
+/* {{{ ftp_login
+ */
int
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 (ftp->resp == 230);
}
+/* }}} */
-
+/* {{{ ftp_reinit
+ */
int
ftp_reinit(ftpbuf_t *ftp)
{
@@ -255,8 +265,10 @@ ftp_reinit(ftpbuf_t *ftp)
return 1;
}
+/* }}} */
-
+/* {{{ ftp_syst
+ */
const char*
ftp_syst(ftpbuf_t *ftp)
{
@@ -283,8 +295,10 @@ ftp_syst(ftpbuf_t *ftp)
return ftp->syst;
}
+/* }}} */
-
+/* {{{ ftp_pwd
+ */
const char*
ftp_pwd(ftpbuf_t *ftp)
{
@@ -312,8 +326,10 @@ ftp_pwd(ftpbuf_t *ftp)
return ftp->pwd;
}
+/* }}} */
-
+/* {{{ ftp_exec
+ */
int
ftp_exec(ftpbuf_t *ftp, const char *cmd)
{
@@ -326,8 +342,10 @@ ftp_exec(ftpbuf_t *ftp, const char *cmd)
return 1;
}
+/* }}} */
-
+/* {{{ ftp_chdir
+ */
int
ftp_chdir(ftpbuf_t *ftp, const char *dir)
{
@@ -344,8 +362,10 @@ ftp_chdir(ftpbuf_t *ftp, const char *dir)
return 1;
}
+/* }}} */
-
+/* {{{ ftp_cdup
+ */
int
ftp_cdup(ftpbuf_t *ftp)
{
@@ -362,8 +382,10 @@ ftp_cdup(ftpbuf_t *ftp)
return 1;
}
+/* }}} */
-