summaryrefslogtreecommitdiff
path: root/ext/tidy/tidy.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tidy/tidy.c')
-rw-r--r--ext/tidy/tidy.c111
1 files changed, 37 insertions, 74 deletions
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index 7084883ecf..97cb697e99 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -45,8 +45,7 @@
#define TIDY_CALL
#endif
-/* {{{ ext/tidy macros
-*/
+/* {{{ ext/tidy macros */
#define FIX_BUFFER(bptr) do { if ((bptr)->size) { (bptr)->bp[(bptr)->size-1] = '\0'; } } while(0)
#define TIDY_SET_CONTEXT \
@@ -164,8 +163,7 @@ if (php_check_open_basedir(filename)) { \
}
/* }}} */
-/* {{{ ext/tidy structs
-*/
+/* {{{ ext/tidy structs */
typedef struct _PHPTidyDoc PHPTidyDoc;
typedef struct _PHPTidyObj PHPTidyObj;
@@ -202,8 +200,7 @@ static inline PHPTidyObj *php_tidy_fetch_object(zend_object *obj) {
#define Z_TIDY_P(zv) php_tidy_fetch_object(Z_OBJ_P((zv)))
/* }}} */
-/* {{{ ext/tidy prototypes
-*/
+/* {{{ ext/tidy prototypes */
static zend_string *php_tidy_file_to_mem(char *, zend_bool);
static void tidy_object_free_storage(zend_object *);
static zend_object *tidy_object_new_node(zend_class_entry *);
@@ -984,8 +981,7 @@ static int php_tidy_output_handler(void **nothing, php_output_context *output_co
return status;
}
-/* {{{ proto bool tidy_parse_string(string input [, mixed config_options [, string encoding]])
- Parse a document stored in a string */
+/* {{{ Parse a document stored in a string */
PHP_FUNCTION(tidy_parse_string)
{
char *enc = NULL;
@@ -1015,8 +1011,7 @@ PHP_FUNCTION(tidy_parse_string)
}
/* }}} */
-/* {{{ proto string tidy_get_error_buffer()
- Return warnings and errors which occurred parsing the specified document*/
+/* {{{ Return warnings and errors which occurred parsing the specified document*/
PHP_FUNCTION(tidy_get_error_buffer)
{
TIDY_FETCH_OBJECT;
@@ -1029,8 +1024,7 @@ PHP_FUNCTION(tidy_get_error_buffer)
}
/* }}} */
-/* {{{ proto string tidy_get_output(tidy tidy)
- Return a string representing the parsed tidy markup */
+/* {{{ Return a string representing the parsed tidy markup */
PHP_FUNCTION(tidy_get_output)
{
TidyBuffer output;
@@ -1044,8 +1038,7 @@ PHP_FUNCTION(tidy_get_output)
}
/* }}} */
-/* {{{ proto bool tidy_parse_file(string file [, mixed config_options [, string encoding [, bool use_include_path]]])
- Parse markup in file or URI */
+/* {{{ Parse markup in file or URI */
PHP_FUNCTION(tidy_parse_file)
{
char *enc = NULL;
@@ -1085,8 +1078,7 @@ PHP_FUNCTION(tidy_parse_file)
}
/* }}} */
-/* {{{ proto bool tidy_clean_repair(tidy tidy)
- Execute configured cleanup and repair operations on parsed markup */
+/* {{{ Execute configured cleanup and repair operations on parsed markup */
PHP_FUNCTION(tidy_clean_repair)
{
TIDY_FETCH_OBJECT;
@@ -1100,24 +1092,21 @@ PHP_FUNCTION(tidy_clean_repair)
}
/* }}} */
-/* {{{ proto bool tidy_repair_string(string data [, mixed config_file [, string encoding]])
- Repair a string using an optionally provided configuration file */
+/* {{{ Repair a string using an optionally provided configuration file */
PHP_FUNCTION(tidy_repair_string)
{
php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, FALSE);
}
/* }}} */
-/* {{{ proto bool tidy_repair_file(string filename [, mixed config_file [, string encoding [, bool use_include_path]]])
- Repair a file using an optionally provided configuration file */
+/* {{{ Repair a file using an optionally provided configuration file */
PHP_FUNCTION(tidy_repair_file)
{
php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, TRUE);
}
/* }}} */
-/* {{{ proto bool tidy_diagnose()
- Run configured diagnostics on parsed and repaired markup. */
+/* {{{ Run configured diagnostics on parsed and repaired markup. */
PHP_FUNCTION(tidy_diagnose)
{
TIDY_FETCH_OBJECT;
@@ -1131,8 +1120,7 @@ PHP_FUNCTION(tidy_diagnose)
}
/* }}} */
-/* {{{ proto string tidy_get_release()
- Get release date (version) for Tidy library */
+/* {{{ Get release date (version) for Tidy library */
PHP_FUNCTION(tidy_get_release)
{
if (zend_parse_parameters_none() == FAILURE) {
@@ -1149,8 +1137,7 @@ PHP_FUNCTION(tidy_get_release)
#ifdef HAVE_TIDYOPTGETDOC
-/* {{{ proto string tidy_get_opt_doc(tidy resource, string optname)
- Returns the documentation for the given option name */
+/* {{{ Returns the documentation for the given option name */
PHP_FUNCTION(tidy_get_opt_doc)
{
PHPTidyObj *obj;
@@ -1182,8 +1169,7 @@ PHP_FUNCTION(tidy_get_opt_doc)
#endif
-/* {{{ proto array tidy_get_config(tidy tidy)
- Get current Tidy configuration */
+/* {{{ Get current Tidy configuration */
PHP_FUNCTION(tidy_get_config)
{
TidyIterator itOpt;
@@ -1221,8 +1207,7 @@ PHP_FUNCTION(tidy_get_config)
}
/* }}} */
-/* {{{ proto int tidy_get_status(tidy tidy)
- Get status of specified document. */
+/* {{{ Get status of specified document. */
PHP_FUNCTION(tidy_get_status)
{
TIDY_FETCH_OBJECT;
@@ -1231,8 +1216,7 @@ PHP_FUNCTION(tidy_get_status)
}
/* }}} */
-/* {{{ proto int tidy_get_html_ver(tidy tidy)
- Get the Detected HTML version for the specified document. */
+/* {{{ Get the Detected HTML version for the specified document. */
PHP_FUNCTION(tidy_get_html_ver)
{
TIDY_FETCH_OBJECT;
@@ -1241,8 +1225,7 @@ PHP_FUNCTION(tidy_get_html_ver)
}
/* }}} */
-/* {{{ proto bool tidy_is_xhtml(tidy tidy)
- Indicates if the document is a XHTML document. */
+/* {{{ Indicates if the document is a XHTML document. */
PHP_FUNCTION(tidy_is_xhtml)
{
TIDY_FETCH_OBJECT;
@@ -1251,8 +1234,7 @@ PHP_FUNCTION(tidy_is_xhtml)
}
/* }}} */
-/* {{{ proto bool tidy_is_xml(tidy tidy)
- Indicates if the document is a generic (non HTML/XHTML) XML document. */
+/* {{{ Indicates if the document is a generic (non HTML/XHTML) XML document. */
PHP_FUNCTION(tidy_is_xml)
{
TIDY_FETCH_OBJECT;
@@ -1261,8 +1243,7 @@ PHP_FUNCTION(tidy_is_xml)
}
/* }}} */
-/* {{{ proto int tidy_error_count(tidy tidy)
- Returns the Number of Tidy errors encountered for specified document. */
+/* {{{ Returns the Number of Tidy errors encountered for specified document. */
PHP_FUNCTION(tidy_error_count)
{
TIDY_FETCH_OBJECT;
@@ -1271,8 +1252,7 @@ PHP_FUNCTION(tidy_error_count)
}
/* }}} */
-/* {{{ proto int tidy_warning_count(tidy tidy)
- Returns the Number of Tidy warnings encountered for specified document. */
+/* {{{ Returns the Number of Tidy warnings encountered for specified document. */
PHP_FUNCTION(tidy_warning_count)
{
TIDY_FETCH_OBJECT;
@@ -1281,8 +1261,7 @@ PHP_FUNCTION(tidy_warning_count)
}
/* }}} */
-/* {{{ proto int tidy_access_count(tidy tidy)
- Returns the Number of Tidy accessibility warnings encountered for specified document. */
+/* {{{ Returns the Number of Tidy accessibility warnings encountered for specified document. */
PHP_FUNCTION(tidy_access_count)
{
TIDY_FETCH_OBJECT;
@@ -1291,8 +1270,7 @@ PHP_FUNCTION(tidy_access_count)
}
/* }}} */
-/* {{{ proto int tidy_config_count(tidy tidy)
- Returns the Number of Tidy configuration errors encountered for specified document. */
+/* {{{ Returns the Number of Tidy configuration errors encountered for specified document. */
PHP_FUNCTION(tidy_config_count)
{
TIDY_FETCH_OBJECT;
@@ -1301,8 +1279,7 @@ PHP_FUNCTION(tidy_config_count)
}
/* }}} */
-/* {{{ proto mixed tidy_getopt(string option)
- Returns the value of the specified configuration option for the tidy document. */
+/* {{{ Returns the value of the specified configuration option for the tidy document. */
PHP_FUNCTION(tidy_getopt)
{
PHPTidyObj *obj;
@@ -1460,40 +1437,35 @@ PHP_METHOD(tidy, parseString)
}
-/* {{{ proto TidyNode tidy_get_root()
- Returns a TidyNode Object representing the root of the tidy parse tree */
+/* {{{ Returns a TidyNode Object representing the root of the tidy parse tree */
PHP_FUNCTION(tidy_get_root)
{
php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_root_node);
}
/* }}} */
-/* {{{ proto TidyNode tidy_get_html()
- Returns a TidyNode Object starting from the <HTML> tag of the tidy parse tree */
+/* {{{ Returns a TidyNode Object starting from the <HTML> tag of the tidy parse tree */
PHP_FUNCTION(tidy_get_html)
{
php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_html_node);
}
/* }}} */
-/* {{{ proto TidyNode tidy_get_head()
- Returns a TidyNode Object starting from the <HEAD> tag of the tidy parse tree */
+/* {{{ Returns a TidyNode Object starting from the <HEAD> tag of the tidy parse tree */
PHP_FUNCTION(tidy_get_head)
{
php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_head_node);
}
/* }}} */
-/* {{{ proto TidyNode tidy_get_body(tidy tidy)
- Returns a TidyNode Object starting from the <BODY> tag of the tidy parse tree */
+/* {{{ Returns a TidyNode Object starting from the <BODY> tag of the tidy parse tree */
PHP_FUNCTION(tidy_get_body)
{
php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_body_node);
}
/* }}} */
-/* {{{ proto bool tidyNode::hasChildren()
- Returns true if this node has children */
+/* {{{ Returns true if this node has children */
PHP_METHOD(tidyNode, hasChildren)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1506,8 +1478,7 @@ PHP_METHOD(tidyNode, hasChildren)
}
/* }}} */
-/* {{{ proto bool tidyNode::hasSiblings()
- Returns true if this node has siblings */
+/* {{{ Returns true if this node has siblings */
PHP_METHOD(tidyNode, hasSiblings)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1520,8 +1491,7 @@ PHP_METHOD(tidyNode, hasSiblings)
}
/* }}} */
-/* {{{ proto bool tidyNode::isComment()
- Returns true if this node represents a comment */
+/* {{{ Returns true if this node represents a comment */
PHP_METHOD(tidyNode, isComment)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1534,8 +1504,7 @@ PHP_METHOD(tidyNode, isComment)
}
/* }}} */
-/* {{{ proto bool tidyNode::isHtml()
- Returns true if this node is part of a HTML document */
+/* {{{ Returns true if this node is part of a HTML document */
PHP_METHOD(tidyNode, isHtml)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1548,8 +1517,7 @@ PHP_METHOD(tidyNode, isHtml)
}
/* }}} */
-/* {{{ proto bool tidyNode::isText()
- Returns true if this node represents text (no markup) */
+/* {{{ Returns true if this node represents text (no markup) */
PHP_METHOD(tidyNode, isText)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1562,8 +1530,7 @@ PHP_METHOD(tidyNode, isText)
}
/* }}} */
-/* {{{ proto bool tidyNode::isJste()
- Returns true if this node is JSTE */
+/* {{{ Returns true if this node is JSTE */
PHP_METHOD(tidyNode, isJste)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1576,8 +1543,7 @@ PHP_METHOD(tidyNode, isJste)
}
/* }}} */
-/* {{{ proto bool tidyNode::isAsp()
- Returns true if this node is ASP */
+/* {{{ Returns true if this node is ASP */
PHP_METHOD(tidyNode, isAsp)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1590,8 +1556,7 @@ PHP_METHOD(tidyNode, isAsp)
}
/* }}} */
-/* {{{ proto bool tidyNode::isPhp()
- Returns true if this node is PHP */
+/* {{{ Returns true if this node is PHP */
PHP_METHOD(tidyNode, isPhp)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1604,8 +1569,7 @@ PHP_METHOD(tidyNode, isPhp)
}
/* }}} */
-/* {{{ proto tidyNode tidyNode::getParent()
- Returns the parent node if available or NULL */
+/* {{{ Returns the parent node if available or NULL */
PHP_METHOD(tidyNode, getParent)
{
TidyNode parent_node;
@@ -1628,8 +1592,7 @@ PHP_METHOD(tidyNode, getParent)
/* }}} */
-/* {{{ proto tidyNode::__construct()
- __constructor for tidyNode. */
+/* {{{ __constructor for tidyNode. */
PHP_METHOD(tidyNode, __construct)
{
zend_throw_error(NULL, "You should not create a tidyNode manually");