cvs: pear /PECL/phpdoc phpdoc.c
| From: | Jan Kneschke | Date: | Mon, 17 Dec 2001 21:51:14 +0000 |
| Subject: | cvs: pear /PECL/phpdoc phpdoc.c | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1599@lists.php.net to get a copy of this message | ||
ostborn Mon Dec 17 16:51:14 2001 EDT
Modified files:
/pear/PECL/phpdoc phpdoc.c
Log:
- applied patches from Ol
- made it work with php 4.1.0
- added comment about patching Zend
Index: pear/PECL/phpdoc/phpdoc.c
diff -u pear/PECL/phpdoc/phpdoc.c:1.2 pear/PECL/phpdoc/phpdoc.c:1.3
--- pear/PECL/phpdoc/phpdoc.c:1.2 Fri Dec 14 01:42:15 2001
+++ pear/PECL/phpdoc/phpdoc.c Mon Dec 17 16:51:14 2001
@@ -16,12 +16,20 @@
+----------------------------------------------------------------------+
*/
-/* $Id: phpdoc.c,v 1.2 2001/12/14 06:42:15 sebastian Exp $ */
+/* $Id: phpdoc.c,v 1.3 2001/12/17 21:51:14 ostborn Exp $ */
#include "php.h"
#include "php_ini.h"
#include "php_phpdoc.h"
+/*
+ * remove the 'static' from the following functions in ./Zend/zend_language_scanner.c
+ * - restore_lexical_state
+ * - save_lexical_state
+ * - prepare_string_for_scanning
+ */
+
+
/*
** <!--
@@ -92,13 +100,8 @@
#include "zend_language_scanner.h"
#include "zend_language_parser.h"
-#ifndef ZTS
-extern char *zendtext;
-extern int zendleng;
-#else
-#define zendtext ((char *) zend_get_zendtext(CLS_C))
-#define zendleng zend_get_zendleng(CLS_C)
-#endif
+#define zendtext LANG_SCNG(yy_text)
+#define zendleng LANG_SCNG(yy_leng)
/*
** -->
@@ -125,6 +128,9 @@
};
zend_module_entry phpdoc_module_entry = {
+# if ZEND_MODULE_API_NO >= 20010901
+ STANDARD_MODULE_HEADER,
+#endif
"phpdoc",
phpdoc_functions,
PHP_MINIT(phpdoc),
@@ -132,6 +138,9 @@
PHP_RINIT(phpdoc), /* Replace with NULL if there's nothing to do at request start */
PHP_RSHUTDOWN(phpdoc), /* Replace with NULL if there's nothing to do at request end */
PHP_MINFO(phpdoc),
+#if ZEND_MODULE_API_NO >= 20010901
+ "0.0.1", /* extension version number (string) */
+#endif
STANDARD_MODULE_PROPERTIES
};
@@ -268,10 +277,11 @@
}
-#define T_FUNCTION_PARAM INT_MAX-1
-#define T_FUNCTION_PARAM_DEFAULT INT_MAX-2
-#define T_FUNCTION_PARAM_LIST INT_MAX-3
-#define T_BLOCK INT_MAX-4
+#define T_FUNCTION_PARAM INT_MAX-1
+#define T_FUNCTION_PARAM_DEFAULT INT_MAX-2
+#define T_FUNCTION_PARAM_LIST INT_MAX-3
+#define T_BLOCK INT_MAX-4
+#define T_VAR_DEFAULT INT_MAX-5
typedef struct {
int *stack;
@@ -377,7 +387,7 @@
zend_sprintf(buffer, " name=\"%s\"", zendtext);
PHPDOC_STRCAT(new_string, buffer);
break;
- case -T_FUNCTION:
+ case -T_FUNCTION:
st.stack[st.pos++] = token_type;
break;
case T_FUNCTION_PARAM_LIST:
@@ -417,13 +427,11 @@
case T_REQUIRE_ONCE:
PHPDOC_STRCAT(new_string, zendtext);
break;
- }
- break;
- case T_FUNCTION_PARAM_DEFAULT:
+ case T_FUNCTION_PARAM_DEFAULT:
+ case T_VAR_DEFAULT:
PHPDOC_STRCAT(new_string, zendtext);
PHPDOC_STRCAT(new_string, "\"");
st.pos--;
- break;
}
break;
case T_FILE:
@@ -432,6 +440,7 @@
case T_LNUMBER:
switch(find_something(st.stack, st.pos)) {
case T_FUNCTION_PARAM_DEFAULT:
+ case T_VAR_DEFAULT:
PHPDOC_STRCAT(new_string, zendtext);
PHPDOC_STRCAT(new_string, "\"");
st.pos--;
@@ -443,6 +452,7 @@
case '-':
switch(find_something(st.stack, st.pos)) {
case T_FUNCTION_PARAM_DEFAULT:
+ case T_VAR_DEFAULT:
/* a DNUMBER or LNUMBER will follow */
PHPDOC_STRCAT(new_string, zendtext);
@@ -516,9 +526,9 @@
case '=':
switch (find_something(st.stack, st.pos)) {
case T_VAR:
- zend_sprintf(buffer, ">");
+ zend_sprintf(buffer, " default=\"");
PHPDOC_STRCAT(new_string, buffer);
- st.stack[st.pos-1] = -st.stack[st.pos-1];
+ st.stack[st.pos++] = T_VAR_DEFAULT;
break;
case T_FUNCTION_PARAM:
zend_sprintf(buffer, " default=\"");
@@ -572,6 +582,7 @@
sprint_xml(new_string, zendtext);
break;
case T_FUNCTION_PARAM_DEFAULT:
+ case T_VAR_DEFAULT:
sprint_xml(new_string, zendtext);
PHPDOC_STRCAT(new_string, "\"");
st.pos--;