| 1 | /* |
|---|
| 2 | +----------------------------------------------------------------------+ |
|---|
| 3 | | PHP version 4.0 | |
|---|
| 4 | +----------------------------------------------------------------------+ |
|---|
| 5 | | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | |
|---|
| 6 | +----------------------------------------------------------------------+ |
|---|
| 7 | | This source file is subject to version 2.02 of the PHP license, | |
|---|
| 8 | | that is bundled with this package in the file LICENSE, and is | |
|---|
| 9 | | available at through the world-wide-web at | |
|---|
| 10 | | http://www.php.net/license/2_02.txt. | |
|---|
| 11 | | If you did not receive a copy of the PHP license and are unable to | |
|---|
| 12 | | obtain it through the world-wide-web, please send a note to | |
|---|
| 13 | | license@php.net so we can mail you a copy immediately. | |
|---|
| 14 | +----------------------------------------------------------------------+ |
|---|
| 15 | | Authors: | |
|---|
| 16 | | | |
|---|
| 17 | +----------------------------------------------------------------------+ |
|---|
| 18 | */ |
|---|
| 19 | |
|---|
| 20 | #ifdef HAVE_CONFIG_H |
|---|
| 21 | #include "config.h" |
|---|
| 22 | #endif |
|---|
| 23 | |
|---|
| 24 | #include "php.h" |
|---|
| 25 | #include "php_ini.h" |
|---|
| 26 | #include "ext/standard/info.h" |
|---|
| 27 | #include "php_bp.h" |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | /* If you declare any globals in php_bp.h uncomment this: |
|---|
| 32 | ZEND_DECLARE_MODULE_GLOBALS(bp) |
|---|
| 33 | */ |
|---|
| 34 | |
|---|
| 35 | /* True global resources - no need for thread safety here */ |
|---|
| 36 | static int le_bp; |
|---|
| 37 | |
|---|
| 38 | /* {{{ bp_functions[] |
|---|
| 39 | * |
|---|
| 40 | * Every user visible function must have an entry in bp_functions[]. |
|---|
| 41 | */ |
|---|
| 42 | function_entry bp_functions[] = { |
|---|
| 43 | PHP_FE(bp_html_parse, NULL) |
|---|
| 44 | PHP_FE(bp_html_optimize,NULL) |
|---|
| 45 | {NULL, NULL, NULL} /* Must be the last line in bp_functions[] */ |
|---|
| 46 | }; |
|---|
| 47 | /* }}} */ |
|---|
| 48 | |
|---|
| 49 | /* {{{ bp_module_entry |
|---|
| 50 | */ |
|---|
| 51 | zend_module_entry bp_module_entry = { |
|---|
| 52 | STANDARD_MODULE_HEADER, |
|---|
| 53 | "bp Html Parser", |
|---|
| 54 | bp_functions, |
|---|
| 55 | PHP_MINIT(bp), |
|---|
| 56 | PHP_MSHUTDOWN(bp), |
|---|
| 57 | PHP_RINIT(bp), /* Replace with NULL if there's nothing to do at request start */ |
|---|
| 58 | PHP_RSHUTDOWN(bp), /* Replace with NULL if there's nothing to do at request end */ |
|---|
| 59 | PHP_MINFO(bp), |
|---|
| 60 | "0.1", /* Replace with version number for your extension */ |
|---|
| 61 | STANDARD_MODULE_PROPERTIES |
|---|
| 62 | }; |
|---|
| 63 | /* }}} */ |
|---|
| 64 | |
|---|
| 65 | #ifdef COMPILE_DL_BP |
|---|
| 66 | ZEND_GET_MODULE(bp) |
|---|
| 67 | #endif |
|---|
| 68 | |
|---|
| 69 | /* {{{ PHP_INI |
|---|
| 70 | */ |
|---|
| 71 | /* Remove comments and fill if you need to have entries in php.ini |
|---|
| 72 | PHP_INI_BEGIN() |
|---|
| 73 | STD_PHP_INI_ENTRY("bp.value", "42", PHP_INI_ALL, OnUpdateInt, global_value, zend_bp_globals, bp_globals) |
|---|
| 74 | STD_PHP_INI_ENTRY("bp.string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_bp_globals, bp_globals) |
|---|
| 75 | PHP_INI_END() |
|---|
| 76 | */ |
|---|
| 77 | /* }}} */ |
|---|
| 78 | |
|---|
| 79 | /* {{{ php_bp_init_globals |
|---|
| 80 | */ |
|---|
| 81 | /* Uncomment this function if you have INI entries |
|---|
| 82 | static void php_bp_init_globals(zend_bp_globals *bp_globals) |
|---|
| 83 | { |
|---|
| 84 | bp_globals->value = 0; |
|---|
| 85 | bp_globals->string = NULL; |
|---|
| 86 | } |
|---|
| 87 | */ |
|---|
| 88 | /* }}} */ |
|---|
| 89 | |
|---|
| 90 | /* {{{ PHP_MINIT_FUNCTION |
|---|
| 91 | */ |
|---|
| 92 | PHP_MINIT_FUNCTION(bp) |
|---|
| 93 | { |
|---|
| 94 | /* If you have INI entries, uncomment these lines |
|---|
| 95 | ZEND_INIT_MODULE_GLOBALS(bp, php_bp_init_globals, NULL); |
|---|
| 96 | REGISTER_INI_ENTRIES(); |
|---|
| 97 | */ |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | /* |
|---|
| 101 | 定数を設定する |
|---|
| 102 | */ |
|---|
| 103 | /* それぞれ、大文字小文字を区別する*/ |
|---|
| 104 | REGISTER_LONG_CONSTANT( "BP_IS_TAG" , BP_IS_TAG , CONST_CS); |
|---|
| 105 | REGISTER_LONG_CONSTANT( "BP_IS_TEXT", BP_IS_TEXT, CONST_CS); |
|---|
| 106 | |
|---|
| 107 | return SUCCESS; |
|---|
| 108 | } |
|---|
| 109 | /* }}} */ |
|---|
| 110 | |
|---|
| 111 | /* {{{ PHP_MSHUTDOWN_FUNCTION |
|---|
| 112 | */ |
|---|
| 113 | PHP_MSHUTDOWN_FUNCTION(bp) |
|---|
| 114 | { |
|---|
| 115 | /* uncomment this line if you have INI entries |
|---|
| 116 | UNREGISTER_INI_ENTRIES(); |
|---|
| 117 | */ |
|---|
| 118 | return SUCCESS; |
|---|
| 119 | } |
|---|
| 120 | /* }}} */ |
|---|
| 121 | |
|---|
| 122 | /* Remove if there's nothing to do at request start */ |
|---|
| 123 | /* {{{ PHP_RINIT_FUNCTION |
|---|
| 124 | */ |
|---|
| 125 | PHP_RINIT_FUNCTION(bp) |
|---|
| 126 | { |
|---|
| 127 | return SUCCESS; |
|---|
| 128 | } |
|---|
| 129 | /* }}} */ |
|---|
| 130 | |
|---|
| 131 | /* Remove if there's nothing to do at request end */ |
|---|
| 132 | /* {{{ PHP_RSHUTDOWN_FUNCTION |
|---|
| 133 | */ |
|---|
| 134 | PHP_RSHUTDOWN_FUNCTION(bp) |
|---|
| 135 | { |
|---|
| 136 | return SUCCESS; |
|---|
| 137 | } |
|---|
| 138 | /* }}} */ |
|---|
| 139 | |
|---|
| 140 | /* {{{ PHP_MINFO_FUNCTION |
|---|
| 141 | */ |
|---|
| 142 | PHP_MINFO_FUNCTION(bp) |
|---|
| 143 | { |
|---|
| 144 | php_info_print_table_start(); |
|---|
| 145 | php_info_print_table_header(2, "bp support", "enabled"); |
|---|
| 146 | php_info_print_table_row( 2, "function", "bp_html_parse( $html)"); |
|---|
| 147 | php_info_print_table_end(); |
|---|
| 148 | |
|---|
| 149 | /* Remove comments if you have entries in php.ini |
|---|
| 150 | DISPLAY_INI_ENTRIES(); |
|---|
| 151 | */ |
|---|
| 152 | } |
|---|
| 153 | /* }}} */ |
|---|
| 154 | |
|---|
| 155 | |
|---|
| 156 | /* |
|---|
| 157 | * Local variables: |
|---|
| 158 | * tab-width: 4 |
|---|
| 159 | * c-basic-offset: 4 |
|---|
| 160 | * End: |
|---|
| 161 | * vim600: sw=4 ts=4 tw=78 fdm=marker |
|---|
| 162 | * vim<600: sw=4 ts=4 tw=78 |
|---|
| 163 | */ |
|---|
| 164 | |
|---|
| 165 | |
|---|