rasmus          Tue Feb  8 00:29:49 2005 EDT

  Modified files:              (Branch: PHP_5_0)
    /php-src/ext/tidy   php_tidy.h tidy.c 
  Log:
  MFH and eliminate whitespace differences between HEAD and the branch to
  make maintenance easier
  
  
http://cvs.php.net/diff.php/php-src/ext/tidy/php_tidy.h?r1=1.22&r2=1.22.2.1&ty=u
Index: php-src/ext/tidy/php_tidy.h
diff -u php-src/ext/tidy/php_tidy.h:1.22 php-src/ext/tidy/php_tidy.h:1.22.2.1
--- php-src/ext/tidy/php_tidy.h:1.22    Sun Apr 11 23:14:19 2004
+++ php-src/ext/tidy/php_tidy.h Tue Feb  8 00:29:48 2005
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_tidy.h,v 1.22 2004/04/12 03:14:19 john Exp $ */
+/* $Id: php_tidy.h,v 1.22.2.1 2005/02/08 05:29:48 rasmus Exp $ */
 
 #ifndef PHP_TIDY_H
 #define PHP_TIDY_H
@@ -40,9 +40,7 @@
 #define TIDY_ATTR_ME(name, param) TIDY_METHOD_MAP(name, tam_ ##name, param)
 
 PHP_MINIT_FUNCTION(tidy);
-PHP_MSHUTDOWN_FUNCTION(tidy);
 PHP_RINIT_FUNCTION(tidy);
-PHP_RSHUTDOWN_FUNCTION(tidy);
 PHP_MINFO_FUNCTION(tidy);
 
 PHP_FUNCTION(tidy_getopt);
http://cvs.php.net/diff.php/php-src/ext/tidy/tidy.c?r1=1.56.2.4&r2=1.56.2.5&ty=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.56.2.4 php-src/ext/tidy/tidy.c:1.56.2.5
--- php-src/ext/tidy/tidy.c:1.56.2.4    Thu Dec 30 06:57:40 2004
+++ php-src/ext/tidy/tidy.c     Tue Feb  8 00:29:48 2005
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: tidy.c,v 1.56.2.4 2004/12/30 11:57:40 tony2001 Exp $ */
+/* $Id: tidy.c,v 1.56.2.5 2005/02/08 05:29:48 rasmus Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -295,9 +295,9 @@
        "tidy",
        tidy_functions,
        PHP_MINIT(tidy),
-       PHP_MSHUTDOWN(tidy),
+       NULL,
        PHP_RINIT(tidy),
-       PHP_RSHUTDOWN(tidy),
+       NULL,
        PHP_MINFO(tidy),
        PHP_TIDY_MODULE_VERSION,
        STANDARD_MODULE_PROPERTIES
@@ -324,7 +324,7 @@
 
 void php_tidy_panic(ctmbstr msg)
 {
-    TSRMLS_FETCH();
+       TSRMLS_FETCH();
        php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not allocate memory 
for tidy! (Reason: %s)", (char *)msg);
 }
 
@@ -334,7 +334,7 @@
        zval conv = *value;
 
        if (!opt) {
-               php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown Tidy 
Configuration Option '%s'", optname);
+               php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown Tidy 
Configuration Option '%s'", optname);
                return FAILURE;
        }
        
@@ -375,7 +375,7 @@
                                zval_copy_ctor(&conv);
                                convert_to_long(&conv);
                        }
-                       if (tidyOptSetBool(doc,  tidyOptGetId(opt), 
Z_LVAL(conv))) {
+                       if (tidyOptSetBool(doc, tidyOptGetId(opt), 
Z_LVAL(conv))) {
                                return SUCCESS;
                        }
                        break;
@@ -396,9 +396,9 @@
        TidyDoc doc;
        TidyBuffer *errbuf;
        zval *config;
-       
-    TIDY_SET_CONTEXT;
-    
+
+       TIDY_SET_CONTEXT;
+
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zsb", &arg1, 
&arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
                RETURN_FALSE;
        }
@@ -428,7 +428,7 @@
        TIDY_SET_DEFAULT_CONFIG(doc);
        
        /* We can't use TIDY_APPLY_CONFIG_ZVAL() here, it uses RETURN_FALSE */
-       
+
        if (ZEND_NUM_ARGS() > 1) {
                if(Z_TYPE_P(config) == IS_ARRAY) {
                        _php_tidy_apply_config_array(doc, HASH_OF(config) 
TSRMLS_CC);
@@ -604,7 +604,7 @@
        if (!object) {
                ALLOC_ZVAL(object);
        }
-    
+
        Z_TYPE_P(object) = IS_OBJECT;
        object_init_ex(object, pce);
        object->refcount = 1;
@@ -863,7 +863,7 @@
                        php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not 
retrieve key from option array");
                        return FAILURE;
                }
-        
+
                if(opt_name) {
                        _php_tidy_set_tidy_opt(doc, opt_name, *opt_val 
TSRMLS_CC);
                        opt_name = NULL;
@@ -899,12 +899,12 @@
 
 static void tidy_globals_ctor(void *global TSRMLS_DC)
 {
-    
+
 }
 
 static void tidy_globals_dtor(void *global TSRMLS_DC)
 {
-    
+
 }
 
 PHP_MINIT_FUNCTION(tidy)
@@ -929,12 +929,6 @@
        return SUCCESS;
 }
 
-
-PHP_MSHUTDOWN_FUNCTION(tidy)
-{
-       return SUCCESS;
-}
-
 PHP_RINIT_FUNCTION(tidy)
 {
        if (INI_BOOL("tidy.clean_output") == TRUE) {
@@ -946,17 +940,12 @@
        return SUCCESS;
 }
 
-PHP_RSHUTDOWN_FUNCTION(tidy)
-{
-       return SUCCESS;
-}
-
 PHP_MINFO_FUNCTION(tidy)
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "Tidy support", "enabled");
        php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-       php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.56.2.4 2004/12/30 11:57:40 tony2001 
Exp $)");
+       php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.56.2.5 2005/02/08 05:29:48 rasmus 
Exp $)");
        php_info_print_table_end();
 
        DISPLAY_INI_ENTRIES();
@@ -1019,8 +1008,8 @@
        zval *options = NULL;
        
        PHPTidyObj *obj;
-    
-    TIDY_SET_CONTEXT;
+
+       TIDY_SET_CONTEXT;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zs", &input, 
&input_len, &options, &enc, &enc_len) == FAILURE) {
                RETURN_FALSE;
@@ -1080,7 +1069,7 @@
        zval *options = NULL;
        
        PHPTidyObj *obj;
-    TIDY_SET_CONTEXT;
+       TIDY_SET_CONTEXT;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zsb", 
&inputfile, &input_len,
                                                          &options, &enc, 
&enc_len, &use_include_path) == FAILURE) {
@@ -1102,7 +1091,7 @@
                INIT_ZVAL(*return_value);
                RETVAL_FALSE;
        }
-    
+
        efree(contents);
 }
 /* }}} */
@@ -1126,7 +1115,7 @@
    Repair a string using an optionally provided configuration file */
 PHP_FUNCTION(tidy_repair_string)
 {
-    TIDY_SET_CONTEXT;
+       TIDY_SET_CONTEXT;
        php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, FALSE);
 }
 /* }}} */
@@ -1135,7 +1124,7 @@
    Repair a file using an optionally provided configuration file */
 PHP_FUNCTION(tidy_repair_file)
 {
-    TIDY_SET_CONTEXT;
+       TIDY_SET_CONTEXT;
        php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, TRUE);
 }
 /* }}} */
@@ -1159,8 +1148,8 @@
    Get release date (version) for Tidy library */
 PHP_FUNCTION(tidy_get_release)
 {
-    TIDY_SET_CONTEXT;
-    
+       TIDY_SET_CONTEXT;
+
        if (ZEND_NUM_ARGS()) {
                WRONG_PARAM_COUNT;
        }
@@ -1299,7 +1288,7 @@
        TidyOption opt;
        TidyOptionType optt;
        
-    TIDY_SET_CONTEXT;
+       TIDY_SET_CONTEXT;
 
        if (object) {
                if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", 
&optname, &optname_len) == FAILURE) {
@@ -1314,7 +1303,7 @@
        obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC);
 
        opt = tidyGetOptionByName(obj->ptdoc->doc, optname);
-    
+
        if (!opt) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy 
Configuration Option '%s'", optname);
                RETURN_FALSE;
@@ -1356,7 +1345,7 @@
        zval *options = NULL;
        
        PHPTidyObj *obj;
-    TIDY_SET_CONTEXT;  
+       TIDY_SET_CONTEXT;       
        
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|szsb", 
&inputfile, &input_len,
                                                          &options, &enc, 
&enc_len, &use_include_path) == FAILURE) {
@@ -1365,20 +1354,18 @@
        
        obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC);
        
-    if(inputfile) {
-        
-        if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path 
TSRMLS_CC))) {
-            php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into 
memory %s", inputfile, (use_include_path) ? "(Using include path)" : "");
-            return;
-        }
-        
-        TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
+       if (inputfile) {
+               if (!(contents = php_tidy_file_to_mem(inputfile, 
use_include_path TSRMLS_CC))) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot 
Load '%s' into memory %s", inputfile, (use_include_path) ? "(Using include 
path)" : "");
+                       return;
+               }
 
-       php_tidy_parse_string(obj, contents, enc TSRMLS_CC);
-       
-       efree(contents);
-    }
-       
+               TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
+
+               php_tidy_parse_string(obj, contents, enc TSRMLS_CC);
+
+               efree(contents);
+       }
 }
 
 TIDY_DOC_METHOD(parseFile)
@@ -1388,10 +1375,10 @@
        zend_bool use_include_path = 0;
        char *contents;
        zval *options = NULL;
-    PHPTidyObj *obj;
-    
-    TIDY_SET_CONTEXT;
-       
+       PHPTidyObj *obj;
+
+       TIDY_SET_CONTEXT;
+
        obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zsb", 
&inputfile, &input_len,
@@ -1421,8 +1408,8 @@
        int input_len, enc_len = 0;
        zval *options = NULL;
        PHPTidyObj *obj;
-    
-    TIDY_SET_CONTEXT;
+
+       TIDY_SET_CONTEXT;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zs", &input, 
&input_len, &options, &enc, &enc_len) == FAILURE) {
                RETURN_FALSE;
@@ -1444,7 +1431,7 @@
    Returns a TidyNode Object representing the root of the tidy parse tree */
 PHP_FUNCTION(tidy_get_root)
 {
-    TIDY_SET_CONTEXT;
+       TIDY_SET_CONTEXT;
        php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_root_node);
 }
 /* }}} */
@@ -1453,7 +1440,7 @@
    Returns a TidyNode Object starting from the <HTML> tag of the tidy parse 
tree */
 PHP_FUNCTION(tidy_get_html)
 {
-    TIDY_SET_CONTEXT;
+       TIDY_SET_CONTEXT;
        php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_html_node);
 }
 /* }}} */
@@ -1462,7 +1449,7 @@
    Returns a TidyNode Object starting from the <HEAD> tag of the tidy parse 
tree */
 PHP_FUNCTION(tidy_get_head)
 {
-    TIDY_SET_CONTEXT;
+       TIDY_SET_CONTEXT;
        php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_head_node);
 }
 /* }}} */
@@ -1471,7 +1458,7 @@
    Returns a TidyNode Object starting from the <BODY> tag of the tidy parse 
tree */
 PHP_FUNCTION(tidy_get_body)
 {
-    TIDY_SET_CONTEXT;
+       TIDY_SET_CONTEXT;
        php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_body_node);
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to