axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r354013 - in /webservices/axis2/trunk/c/bindings/php/axis2: axis2.c om_document.c om_processing_instruction.c om_stax_builder.c xml_reader.c
Date Mon, 05 Dec 2005 08:07:25 GMT
Author: samisa
Date: Mon Dec  5 00:07:16 2005
New Revision: 354013

URL: http://svn.apache.org/viewcvs?rev=354013&view=rev
Log:
modified builder

Modified:
    webservices/axis2/trunk/c/bindings/php/axis2/axis2.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_document.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_processing_instruction.c
    webservices/axis2/trunk/c/bindings/php/axis2/om_stax_builder.c
    webservices/axis2/trunk/c/bindings/php/axis2/xml_reader.c

Modified: webservices/axis2/trunk/c/bindings/php/axis2/axis2.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/axis2.c?rev=354013&r1=354012&r2=354013&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/axis2.c (original)
+++ webservices/axis2/trunk/c/bindings/php/axis2/axis2.c Mon Dec  5 00:07:16 2005
@@ -172,6 +172,8 @@
     
     REGISTER_AXIS2_CLASS(ce, "Axis2OMComment", axis2_om_node_class_entry , php_axis2_om_comment_class_functions
, axis2_om_comment_class_entry);
 
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMPI", axis2_om_node_class_entry , php_axis2_om_pi_class_functions
, axis2_om_pi_class_entry);
+
     
     REGISTER_LONG_CONSTANT("AXIS2_XML_READER_START_DOCUMENT",	AXIS2_XML_READER_START_DOCUMENT,
	CONST_CS | CONST_PERSISTENT);
     REGISTER_LONG_CONSTANT("AXIS2_XML_READER_START_ELEMENT",	AXIS2_XML_READER_START_ELEMENT
,		CONST_CS | CONST_PERSISTENT);

Modified: webservices/axis2/trunk/c/bindings/php/axis2/om_document.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/om_document.c?rev=354013&r1=354012&r2=354013&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/om_document.c (original)
+++ webservices/axis2/trunk/c/bindings/php/axis2/om_document.c Mon Dec  5 00:07:16 2005
@@ -61,24 +61,27 @@
         php_std_error_handling();
         return;
     }
-    
+       
     env = php_axis2_get_env();
-    
+   
     AXIS2_GET_OBJ(om_obj_builder, object_builder, om_object_ptr, intern_builder);
     
+    /*   
     AXIS2_GET_OBJ(node_obj_root, object_root, om_node_ptr, intern_root);
-    
+     root    = (axis2_om_node_t *)(node_obj_root->ptr);
+   */
     intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
     om_obj = (om_object_ptr)emalloc(sizeof(om_object));
     om_obj->obj_type = OM_DOCUMENT;
     om_obj->ptr = NULL;
     
     builder = (axis2_om_stax_builder_t *)(om_obj_builder->ptr);
-    root    = (axis2_om_node_t *)(node_obj_root->ptr);
     
-    document = axis2_om_document_create(&env, root, builder);
+    document = axis2_om_document_create(&env, NULL, builder);
     om_obj->ptr = document;
     intern->ptr = om_obj; 
+    
+    
 }
 
 PHP_FUNCTION(axis2_om_document_build_next)
@@ -172,5 +175,20 @@
 }
 PHP_FUNCTION(axis2_om_document_build_all)
 {
- php_printf("not implemented yet");
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+
+    axis2_om_document_t *document = NULL;
+    axis2_env_t *env = NULL; 
+
+    AXIS2_GET_THIS(object);
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    env = php_axis2_get_env();
+    document = (axis2_om_document_t *)(om_obj->ptr);
+    
+    if(document)
+    {
+        AXIS2_OM_DOCUMENT_BUILD_ALL(document, &env);
+    }    
 }

Modified: webservices/axis2/trunk/c/bindings/php/axis2/om_processing_instruction.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/om_processing_instruction.c?rev=354013&r1=354012&r2=354013&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/om_processing_instruction.c (original)
+++ webservices/axis2/trunk/c/bindings/php/axis2/om_processing_instruction.c Mon Dec  5 00:07:16
2005
@@ -19,7 +19,7 @@
 #include "axis2_om_node.h"
 #include "axis2_om_processing_instruction.h"
 
-zend_function_entry axis2_om_pi_class_functions[] =
+zend_function_entry php_axis2_om_pi_class_functions[] =
 {
     PHP_FALIAS(setValue , axis2_om_pi_set_value, NULL)
     PHP_FALIAS(setTarget , axis2_om_pi_set_target, NULL)
@@ -165,6 +165,36 @@
         AXIS2_OM_PROCESSING_INSTRUCION_SET_VALUE(om_pi, &env, value);
     }
 }
-PHP_FUNCTION(axis2_om_pi_set_target){}
+PHP_FUNCTION(axis2_om_pi_set_target)
+{
+    axis2_object_ptr intern = NULL;
+    om_node_ptr node_obj = NULL;
+    
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    char *target = NULL;
+    int target_len = 0;
+
+    axis2_om_processing_instruction_t *om_pi = NULL;
+    axis2_om_node_t *node = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Os",&object, axis2_om_pi_class_entry, &target, &target_len)
== FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    
+    node = (axis2_om_node_t *)(node_obj->ptr);
+    if(node)
+    {
+        om_pi = (axis2_om_processing_instruction_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(node,
&env);     
+        AXIS2_OM_PROCESSING_INSTRUCION_SET_TARGET(om_pi, &env, target);
+    }
+}
+
 PHP_FUNCTION(axis2_om_pi_serialize){}
 

Modified: webservices/axis2/trunk/c/bindings/php/axis2/om_stax_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/om_stax_builder.c?rev=354013&r1=354012&r2=354013&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/om_stax_builder.c (original)
+++ webservices/axis2/trunk/c/bindings/php/axis2/om_stax_builder.c Mon Dec  5 00:07:16 2005
@@ -20,6 +20,7 @@
 #include "axis2_om_node.h"
 #include "axis2_om_stax_builder.h"
 
+
 zend_function_entry php_axis2_om_stax_builder_class_functions[] =
 {
     PHP_FALIAS(next , axis2_om_stax_builder_next, NULL)
@@ -52,16 +53,18 @@
     }
     
     env = php_axis2_get_env();
-    AXIS2_GET_OBJ(om_obj_reader, object_reader, om_object_ptr, intern_reader);
-    
     intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+
+    AXIS2_GET_OBJ(om_obj_reader, object_reader, om_object_ptr, intern_reader);
+    reader  = (axis2_xml_reader_t *)(om_obj_reader->ptr);
     
     om_obj = (om_object_ptr)emalloc(sizeof(om_object));
     om_obj->obj_type = OM_STAX_BUILDER;
     om_obj->ptr = NULL;
-    reader  = (axis2_xml_reader_t *)(om_obj_reader->ptr);
     builder = axis2_om_stax_builder_create(&env, reader);
+   
     om_obj->ptr = builder;
+    
     intern->ptr = om_obj; 
 }
 
@@ -92,10 +95,10 @@
     builder = (axis2_om_stax_builder_t *)(om_obj->ptr);
     
     
+    
     if(builder)
     {
         node = AXIS2_OM_STAX_BUILDER_NEXT(builder, &env);
-        /*
         if(node)
         {
             node_type = AXIS2_OM_NODE_GET_NODE_TYPE(node, &env);
@@ -103,11 +106,7 @@
             object_node = php_axis2_create_om_node_object(node, node_type, ce_node TSRMLS_CC);
             RETURN_ZVAL(object_node, NULL, NULL);        
         }
-                */     
-
     }
-    
-      
     RETURN_NULL();    
 }
 

Modified: webservices/axis2/trunk/c/bindings/php/axis2/xml_reader.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2/xml_reader.c?rev=354013&r1=354012&r2=354013&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2/xml_reader.c (original)
+++ webservices/axis2/trunk/c/bindings/php/axis2/xml_reader.c Mon Dec  5 00:07:16 2005
@@ -48,21 +48,17 @@
     int length;
     axis2_env_t *env;
     
-  
-    
     if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object,
axis2_xml_reader_class_entry, &path, &length) == FAILURE)
     {
         php_std_error_handling();
         return;
     }
     env = php_axis2_get_env();
-     
     om_obj = emalloc(sizeof(om_object));
     om_obj->ptr = NULL;
     om_obj->obj_type = AXIS2_XML_READER;
     om_obj->ptr = axis2_xml_reader_create_for_file(&env, path, NULL);
     om_obj->ref_count = 1;
-    
     axis2_obj = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);   
     axis2_obj->ptr = om_obj;
    



Mime
View raw message