axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r805358 [1/4] - in /webservices/axis2/trunk/c/guththila: samples/ src/ tests/
Date Tue, 18 Aug 2009 11:06:04 GMT
Author: shankar
Date: Tue Aug 18 11:06:03 2009
New Revision: 805358

URL: http://svn.apache.org/viewvc?rev=805358&view=rev
Log:
formatting the code

Modified:
    webservices/axis2/trunk/c/guththila/samples/guththila_main.c
    webservices/axis2/trunk/c/guththila/samples/guththila_writer_main.c
    webservices/axis2/trunk/c/guththila/src/guththila_attribute.c
    webservices/axis2/trunk/c/guththila/src/guththila_buffer.c
    webservices/axis2/trunk/c/guththila/src/guththila_namespace.c
    webservices/axis2/trunk/c/guththila/src/guththila_reader.c
    webservices/axis2/trunk/c/guththila/src/guththila_stack.c
    webservices/axis2/trunk/c/guththila/src/guththila_token.c
    webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c
    webservices/axis2/trunk/c/guththila/src/guththila_xml_writer.c
    webservices/axis2/trunk/c/guththila/tests/test.c
    webservices/axis2/trunk/c/guththila/tests/test_attribute.c

Modified: webservices/axis2/trunk/c/guththila/samples/guththila_main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/samples/guththila_main.c?rev=805358&r1=805357&r2=805358&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/samples/guththila_main.c (original)
+++ webservices/axis2/trunk/c/guththila/samples/guththila_main.c Tue Aug 18 11:06:03 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -31,39 +30,36 @@
     guththila_t *parser;
     char *xml_buffer;
     allocator = axutil_allocator_init(NULL);
-    xml_buffer =
-        "<?xml version = \"1.0\"?><test a=\"din\">addddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd123</test>";
+    xml_buffer
+        = "<?xml version = \"1.0\"?><test a=\"din\">addddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd123</test>";
     environment = axutil_env_create(allocator);
 
-    if (argc > 1)
+    if(argc > 1)
         red = guththila_reader_create_for_file(environment, argv[1]);
     else
     {
-        if (xml_buffer)
+        if(xml_buffer)
         {
             int size = 0;
             size = strlen(xml_buffer);
-            red =
-                guththila_reader_create_for_memory(environment,
-                                                   (void *) xml_buffer, size,
-                                                   NULL);
+            red = guththila_reader_create_for_memory(environment, (void *)xml_buffer, size, NULL);
         }
     }
 
     parser = guththila_create(environment, red);
     guththila_read(environment, parser);
 
-    while ((c = guththila_next(environment, parser)) != -1)
+    while((c = guththila_next(environment, parser)) != -1)
     {
-        switch (c)
+        switch(c)
         {
-        case GUTHTHILA_START_DOCUMENT:
+            case GUTHTHILA_START_DOCUMENT:
             {
                 int ix;
                 printf("<?xml ");
 
                 ix = guththila_get_attribute_count(environment, parser);
-                for (; ix > 0; ix--)
+                for(; ix > 0; ix--)
                 {
                     guththila_attribute_t *a;
                     char *p;
@@ -78,9 +74,9 @@
                 }
                 printf("?>\n");
             }
-            break;
-        case GUTHTHILA_START_ELEMENT:
-        case GUTHTHILA_EMPTY_ELEMENT:
+                break;
+            case GUTHTHILA_START_ELEMENT:
+            case GUTHTHILA_EMPTY_ELEMENT:
             {
                 int ia;
                 int d;
@@ -89,7 +85,7 @@
 
                 printf("<");
                 p = guththila_get_prefix(environment, parser);
-                if (p)
+                if(p)
                 {
                     printf("%s:", p);
                     AXIS2_FREE(allocator, p);
@@ -99,46 +95,38 @@
                 AXIS2_FREE(allocator, p);
 
                 ia = guththila_get_attribute_count(environment, parser);
-                for (; ia > 0; ia--)
+                for(; ia > 0; ia--)
                 {
                     /* p = guththila_get_attribute_prefix_by_number
-                       (parser, ia); */
-                    p = guththila_get_attribute_prefix_by_number(environment,
-                                                                 parser, ia);
-                    if (p)
+                     (parser, ia); */
+                    p = guththila_get_attribute_prefix_by_number(environment, parser, ia);
+                    if(p)
                     {
                         printf(" %s:", p);
                         AXIS2_FREE(allocator, p);
-                        p = guththila_get_attribute_name_by_number(environment,
-                                                                   parser, ia);
+                        p = guththila_get_attribute_name_by_number(environment, parser, ia);
                         printf("%s=\"", p);
                         AXIS2_FREE(allocator, p);
-                        p = guththila_get_attribute_value_by_number(environment,
-                                                                    parser, ia);
+                        p = guththila_get_attribute_value_by_number(environment, parser, ia);
                         printf("%s\"", p);
                         AXIS2_FREE(allocator, p);
                     }
                     else
                     {
-                        p = guththila_get_attribute_name_by_number(environment,
-                                                                   parser, ia);
+                        p = guththila_get_attribute_name_by_number(environment, parser, ia);
                         printf(" %s=\"", p);
                         AXIS2_FREE(allocator, p);
-                        p = guththila_get_attribute_value_by_number(environment,
-                                                                    parser, ia);
+                        p = guththila_get_attribute_value_by_number(environment, parser, ia);
                         printf("%s\"", p);
                         AXIS2_FREE(allocator, p);
                     }
                 }
-                depth =
-                    (guththila_depth_t *) axutil_stack_get(parser->dep,
-                                                           environment);
+                depth = (guththila_depth_t *)axutil_stack_get(parser->dep, environment);
                 d = depth->count;
-                for (; d > 0; d--)
+                for(; d > 0; d--)
                 {
-                    p = guththila_get_namespace_prefix_by_number(environment,
-                                                                 parser, d);
-                    if (strncmp(p, "xmlns", 5))
+                    p = guththila_get_namespace_prefix_by_number(environment, parser, d);
+                    if(strncmp(p, "xmlns", 5))
                     {
                         printf(" xmlns:");
                         printf("%s=\"", p);
@@ -146,26 +134,25 @@
                     else
                         printf(" xmlns=\"");
                     AXIS2_FREE(allocator, p);
-                    p = guththila_get_namespace_uri_by_number
-                        (environment, parser, d);
+                    p = guththila_get_namespace_uri_by_number(environment, parser, d);
                     printf("%s\"", p);
                     AXIS2_FREE(allocator, p);
                 }
-                if (parser->guththila_event == GUTHTHILA_START_ELEMENT)
+                if(parser->guththila_event == GUTHTHILA_START_ELEMENT)
                     printf(">");
-                else if (parser->guththila_event == GUTHTHILA_EMPTY_ELEMENT)
+                else if(parser->guththila_event == GUTHTHILA_EMPTY_ELEMENT)
                     printf("/>");
                 else
                     printf("error \n");
 
             }
-            break;
-        case GUTHTHILA_END_ELEMENT:
+                break;
+            case GUTHTHILA_END_ELEMENT:
             {
                 char *p;
                 printf("</");
                 p = guththila_get_prefix(environment, parser);
-                if (p)
+                if(p)
                 {
                     printf("%s:", p);
                     AXIS2_FREE(allocator, p);
@@ -175,8 +162,8 @@
                 AXIS2_FREE(allocator, p);
                 printf(">");
             }
-            break;
-        case GUTHTHILA_CHARACTER:
+                break;
+            case GUTHTHILA_CHARACTER:
             {
                 char *p = NULL;
                 p = guththila_get_value(environment, parser);
@@ -187,9 +174,9 @@
                 printf("%s", p);
                 AXIS2_FREE(allocator, p);
             }
-            break;
-        case GUTHTHILA_COMMENT:
-            break;
+                break;
+            case GUTHTHILA_COMMENT:
+                break;
         };
     }
     guththila_reader_free(environment, red);

Modified: webservices/axis2/trunk/c/guththila/samples/guththila_writer_main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/samples/guththila_writer_main.c?rev=805358&r1=805357&r2=805358&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/samples/guththila_writer_main.c (original)
+++ webservices/axis2/trunk/c/guththila/samples/guththila_writer_main.c Tue Aug 18 11:06:03 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -41,24 +40,23 @@
     guththila_write_start_element(env, parser, "two");
     guththila_write_default_namespace(env, parser, "http://another.host.com");
     guththila_write_start_element_with_prefix_and_namespace(env, parser, "ws",
-                                                            "http://www.wso2.org",
-                                                            "wso2");
+        "http://www.wso2.org", "wso2");
     guththila_write_start_element_with_prefix(env, parser, "ws", "stacks");
     guththila_write_attribute_with_prefix(env, parser, "ws", "stack", "axis2");
     guththila_write_characters(env, parser,
-                               "testadfjaldjf;ajf;lkajdfa;lkjfd;ajdf11111111111122334455");
+        "testadfjaldjf;ajf;lkajdfa;lkjfd;ajdf11111111111122334455");
     guththila_write_end_document(env, parser);
 
-    xml = (char *) AXIS2_MALLOC(env->allocator, MAXA + 1);
+    xml = (char *)AXIS2_MALLOC(env->allocator, MAXA + 1);
     memset(xml, 0, MAXA + 1);
-    if (!argv[1])
+    if(!argv[1])
     {
         file = fopen("/home/dinesh/tmp/mbox_backup/mbox.archived", "r");
     }
     else
         file = fopen(argv[1], "r");
 
-    if (file)
+    if(file)
         fread(xml, 1, MAXA, file);
 
     guththila_write_to_buffer(env, parser, xml);

Modified: webservices/axis2/trunk/c/guththila/src/guththila_attribute.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_attribute.c?rev=805358&r1=805357&r2=805358&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_attribute.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_attribute.c Tue Aug 18 11:06:03 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -14,29 +13,32 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */  
+ */
 #include <guththila_attribute.h>
 #include <guththila_stack.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-    
-int GUTHTHILA_CALL 
-guththila_attr_list_grow(guththila_attr_list_t * at_list, int addition,const axutil_env_t * env) 
+
+int GUTHTHILA_CALL
+guththila_attr_list_grow(
+    guththila_attr_list_t * at_list,
+    int addition,
+    const axutil_env_t * env)
 {
     int i = 0;
 
-    if (addition > 0 ||
-         (addition < 0 && at_list->capacity + addition > 0 &&
-          at_list->capacity + addition >= at_list->size))
+    if(addition > 0 || (addition < 0 && at_list->capacity + addition > 0 && at_list->capacity
+        + addition >= at_list->size))
     {
-        at_list->list =(guththila_attr_t *) realloc(at_list->list,sizeof(guththila_attr_t) *(at_list->capacity + addition));
+        at_list->list = (guththila_attr_t *)realloc(at_list->list, sizeof(guththila_attr_t)
+            * (at_list->capacity + addition));
 
-        if (at_list->list)
+        if(at_list->list)
         {
-            for (i = at_list->capacity; i < at_list->capacity + addition; i++)
+            for(i = at_list->capacity; i < at_list->capacity + addition; i++)
             {
-                guththila_stack_push(&at_list->fr_stack, at_list->list + i,env);
+                guththila_stack_push(&at_list->fr_stack, at_list->list + i, env);
             }
 
             at_list->capacity += addition;
@@ -49,22 +51,25 @@
     return 0;
 }
 
-guththila_attr_list_t *GUTHTHILA_CALL 
-guththila_attr_list_create(const axutil_env_t * env) 
+guththila_attr_list_t *GUTHTHILA_CALL
+guththila_attr_list_create(
+    const axutil_env_t * env)
 {
     int i = 0;
-    guththila_attr_list_t * at_list =(guththila_attr_list_t *) AXIS2_MALLOC(env->allocator,sizeof(guththila_attr_list_t));
+    guththila_attr_list_t * at_list = (guththila_attr_list_t *)AXIS2_MALLOC(env->allocator,
+        sizeof(guththila_attr_list_t));
 
-    if (!at_list)
+    if(!at_list)
         return NULL;
 
-    at_list->list =(guththila_attr_t *) AXIS2_MALLOC(env->allocator,sizeof(guththila_attr_t) *GUTHTHILA_ATTR_DEF_SIZE);
+    at_list->list = (guththila_attr_t *)AXIS2_MALLOC(env->allocator, sizeof(guththila_attr_t)
+        * GUTHTHILA_ATTR_DEF_SIZE);
 
-    if (at_list->list && guththila_stack_init(&at_list->fr_stack, env))
-	{
+    if(at_list->list && guththila_stack_init(&at_list->fr_stack, env))
+    {
         at_list->capacity = GUTHTHILA_ATTR_DEF_SIZE;
         at_list->size = 0;
-        for (i = 0; i < GUTHTHILA_ATTR_DEF_SIZE; i++)
+        for(i = 0; i < GUTHTHILA_ATTR_DEF_SIZE; i++)
         {
             guththila_stack_push(&at_list->fr_stack, at_list->list + i, env);
         }
@@ -74,16 +79,19 @@
 }
 
 int GUTHTHILA_CALL
-guththila_attr_list_init(guththila_attr_list_t * at_list,const axutil_env_t * env) 
+guththila_attr_list_init(
+    guththila_attr_list_t * at_list,
+    const axutil_env_t * env)
 {
     int i = 0;
-    at_list->list =(guththila_attr_t *) AXIS2_MALLOC(env->allocator,sizeof(guththila_attr_t) *GUTHTHILA_ATTR_DEF_SIZE);
+    at_list->list = (guththila_attr_t *)AXIS2_MALLOC(env->allocator, sizeof(guththila_attr_t)
+        * GUTHTHILA_ATTR_DEF_SIZE);
 
-    if (at_list->list && guththila_stack_init(&at_list->fr_stack, env))       
+    if(at_list->list && guththila_stack_init(&at_list->fr_stack, env))
     {
         at_list->capacity = GUTHTHILA_ATTR_DEF_SIZE;
         at_list->size = 0;
-        for (i = 0; i < GUTHTHILA_ATTR_DEF_SIZE; i++)
+        for(i = 0; i < GUTHTHILA_ATTR_DEF_SIZE; i++)
         {
             guththila_stack_push(&at_list->fr_stack, at_list->list + i, env);
         }
@@ -93,9 +101,11 @@
 }
 
 guththila_attr_t *GUTHTHILA_CALL
-guththila_attr_list_get(guththila_attr_list_t * at_list,const axutil_env_t * env) 
+guththila_attr_list_get(
+    guththila_attr_list_t * at_list,
+    const axutil_env_t * env)
 {
-    if (at_list->fr_stack.top > 0 ||guththila_attr_list_grow(at_list, GUTHTHILA_ATTR_DEF_SIZE, env))
+    if(at_list->fr_stack.top > 0 || guththila_attr_list_grow(at_list, GUTHTHILA_ATTR_DEF_SIZE, env))
     {
         return guththila_stack_pop(&at_list->fr_stack, env);
     }
@@ -103,25 +113,32 @@
     return NULL;
 }
 
-int GUTHTHILA_CALL 
-guththila_attr_list_release(guththila_attr_list_t * at_list,guththila_attr_t * attr,const axutil_env_t * env) 
-{    
+int GUTHTHILA_CALL
+guththila_attr_list_release(
+    guththila_attr_list_t * at_list,
+    guththila_attr_t * attr,
+    const axutil_env_t * env)
+{
 
-  return guththila_stack_push(&at_list->fr_stack, attr, env);
+    return guththila_stack_push(&at_list->fr_stack, attr, env);
 
 }
 
 void GUTHTHILA_CALL
-msuila_attr_list_free_data(guththila_attr_list_t * at_list,const axutil_env_t * env) 
+msuila_attr_list_free_data(
+    guththila_attr_list_t * at_list,
+    const axutil_env_t * env)
 {
     AXIS2_FREE(env->allocator, at_list->list);
     guththila_stack_un_init(&at_list->fr_stack, env);
-} 
+}
 
 void GUTHTHILA_CALL
-guththila_attr_list_free(guththila_attr_list_t * at_list,const axutil_env_t * env) 
+guththila_attr_list_free(
+    guththila_attr_list_t * at_list,
+    const axutil_env_t * env)
 {
     AXIS2_FREE(env->allocator, at_list->list);
     guththila_stack_un_init(&at_list->fr_stack, env);
     AXIS2_FREE(env->allocator, at_list);
-} 
+}

Modified: webservices/axis2/trunk/c/guththila/src/guththila_buffer.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_buffer.c?rev=805358&r1=805357&r2=805358&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_buffer.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_buffer.c Tue Aug 18 11:06:03 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -14,27 +13,34 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */  
+ */
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <guththila_buffer.h>
 
 int GUTHTHILA_CALL
-guththila_buffer_init(guththila_buffer_t * buffer,int size,const axutil_env_t * env) 
+guththila_buffer_init(
+    guththila_buffer_t * buffer,
+    int size,
+    const axutil_env_t * env)
 {
 
     buffer->type = GUTHTHILA_MULTIPLE_BUFFER;
-    buffer->data_size =(size_t *) AXIS2_MALLOC(env->allocator,sizeof(size_t)*GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
-    buffer->buffs_size =(size_t *) AXIS2_MALLOC(env->allocator,sizeof(size_t)*GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
-    buffer->buff =(guththila_char_t **) AXIS2_MALLOC(env->allocator,sizeof(guththila_char_t *)*GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
+    buffer->data_size = (size_t *)AXIS2_MALLOC(env->allocator, sizeof(size_t)
+        * GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
+    buffer->buffs_size = (size_t *)AXIS2_MALLOC(env->allocator, sizeof(size_t)
+        * GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
+    buffer->buff = (guththila_char_t **)AXIS2_MALLOC(env->allocator, sizeof(guththila_char_t *)
+        * GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
     buffer->cur_buff = -1;
     buffer->pre_tot_data = 0;
     buffer->no_buffers = GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS;
     buffer->xml = NULL;
-	if (size > 0)
+    if(size > 0)
     {
-        buffer->buff[0] =(guththila_char_t *) AXIS2_MALLOC(env->allocator,sizeof(guththila_char_t) * size);
+        buffer->buff[0] = (guththila_char_t *)AXIS2_MALLOC(env->allocator, sizeof(guththila_char_t)
+            * size);
         buffer->data_size[0] = 0;
         buffer->buffs_size[0] = size;
         buffer->cur_buff = 0;
@@ -43,52 +49,60 @@
 }
 
 int GUTHTHILA_CALL
-guththila_buffer_un_init(guththila_buffer_t * buffer,const axutil_env_t * env) 
+guththila_buffer_un_init(
+    guththila_buffer_t * buffer,
+    const axutil_env_t * env)
 {
     int i = 0;
-    
-    if (buffer->type == GUTHTHILA_SINGLE_BUFFER && buffer->buff && buffer->cur_buff == 0)
+
+    if(buffer->type == GUTHTHILA_SINGLE_BUFFER && buffer->buff && buffer->cur_buff == 0)
     {
 
-            
-        if (buffer->buffs_size)
+        if(buffer->buffs_size)
             AXIS2_FREE(env->allocator, buffer->buffs_size);
-        if (buffer->data_size)
+        if(buffer->data_size)
             AXIS2_FREE(env->allocator, buffer->data_size);
         if(buffer->xml)
-            AXIS2_FREE(env->allocator,buffer->xml);
+            AXIS2_FREE(env->allocator, buffer->xml);
+
+        AXIS2_FREE(env->allocator, buffer->buff);
 
-	AXIS2_FREE(env->allocator, buffer->buff);
-    
     }
-    else if (buffer->type == GUTHTHILA_MULTIPLE_BUFFER && buffer->buff)
+    else if(buffer->type == GUTHTHILA_MULTIPLE_BUFFER && buffer->buff)
     {
-        for (i = 0; i <= buffer->cur_buff; i++)
+        for(i = 0; i <= buffer->cur_buff; i++)
         {
             AXIS2_FREE(env->allocator, buffer->buff[i]);
         }
         if(buffer->xml)
-            AXIS2_FREE(env->allocator,buffer->xml);
+            AXIS2_FREE(env->allocator, buffer->xml);
         AXIS2_FREE(env->allocator, buffer->buff);
-        if (buffer->data_size)
+        if(buffer->data_size)
             AXIS2_FREE(env->allocator, buffer->data_size);
-        if (buffer->buffs_size)
+        if(buffer->buffs_size)
             AXIS2_FREE(env->allocator, buffer->buffs_size);
     }
     return GUTHTHILA_SUCCESS;
 }
 
 int GUTHTHILA_CALL
-guththila_buffer_init_for_buffer(guththila_buffer_t * buffer,char *buff,int size,const axutil_env_t * env) 
+guththila_buffer_init_for_buffer(
+    guththila_buffer_t * buffer,
+    char *buff,
+    int size,
+    const axutil_env_t * env)
 {
     buffer->type = GUTHTHILA_SINGLE_BUFFER;
-    buffer->buff =(char **) AXIS2_MALLOC(env->allocator,sizeof(char *) * GUTHTHILA_BUFFER_DEF_SIZE);
+    buffer->buff
+        = (char **)AXIS2_MALLOC(env->allocator, sizeof(char *) * GUTHTHILA_BUFFER_DEF_SIZE);
     buffer->buff[0] = buff;
     buffer->cur_buff = 0;
-    buffer->buffs_size =(size_t *) AXIS2_MALLOC(env->allocator,sizeof(size_t) * GUTHTHILA_BUFFER_DEF_SIZE);
+    buffer->buffs_size = (size_t *)AXIS2_MALLOC(env->allocator, sizeof(size_t)
+        * GUTHTHILA_BUFFER_DEF_SIZE);
     buffer->buffs_size[0] = size;
     buffer->pre_tot_data = 0;
-    buffer->data_size =(size_t *) AXIS2_MALLOC(env->allocator,sizeof(size_t) * GUTHTHILA_BUFFER_DEF_SIZE);
+    buffer->data_size = (size_t *)AXIS2_MALLOC(env->allocator, sizeof(size_t)
+        * GUTHTHILA_BUFFER_DEF_SIZE);
     buffer->data_size[0] = size;
     buffer->no_buffers = 1;
     buffer->xml = NULL;
@@ -96,22 +110,24 @@
 }
 
 void *GUTHTHILA_CALL
-guththila_buffer_get(guththila_buffer_t * buffer,const axutil_env_t * env) 
+guththila_buffer_get(
+    guththila_buffer_t * buffer,
+    const axutil_env_t * env)
 {
     size_t size = 0, current_size = 0;
     int i = 0;
 
-    for (i = 0; i <= buffer->cur_buff; i++)
+    for(i = 0; i <= buffer->cur_buff; i++)
     {
         size += buffer->data_size[i];
     }
-    buffer->xml = (char *) AXIS2_MALLOC(env->allocator, sizeof(char) * (size + 1));
-    for (i = 0; i <= buffer->cur_buff; i++)
+    buffer->xml = (char *)AXIS2_MALLOC(env->allocator, sizeof(char) * (size + 1));
+    for(i = 0; i <= buffer->cur_buff; i++)
     {
         memcpy(buffer->xml + current_size, buffer->buff[i], buffer->data_size[i]);
         current_size += buffer->data_size[i];
     }
-    
+
     buffer->xml[current_size] = '\0';
     return buffer->xml;
 }

Modified: webservices/axis2/trunk/c/guththila/src/guththila_namespace.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_namespace.c?rev=805358&r1=805357&r2=805358&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_namespace.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_namespace.c Tue Aug 18 11:06:03 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -14,7 +13,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */  
+ */
 #include <guththila_namespace.h>
 #include <guththila_stack.h>
 #include <stdio.h>
@@ -22,21 +21,22 @@
 #include <string.h>
 
 int GUTHTHILA_CALL
-guththila_namespace_list_grow(guththila_namespace_list_t * namesp_list,int addition,const axutil_env_t * env) 
+guththila_namespace_list_grow(
+    guththila_namespace_list_t * namesp_list,
+    int addition,
+    const axutil_env_t * env)
 {
     int i = 0;
-    if (addition > 0 || (addition < 0 && namesp_list->capacity + addition > 0 &&
-          namesp_list->capacity + addition >= namesp_list->size))
+    if(addition > 0 || (addition < 0 && namesp_list->capacity + addition > 0
+        && namesp_list->capacity + addition >= namesp_list->size))
     {
-            namesp_list->list =
-            (guththila_namespace_t *) realloc(namesp_list->list,
-                                              sizeof(guththila_namespace_t) *
-                                              (namesp_list->capacity + addition));
-        if (namesp_list->list)
+        namesp_list->list = (guththila_namespace_t *)realloc(namesp_list->list,
+            sizeof(guththila_namespace_t) * (namesp_list->capacity + addition));
+        if(namesp_list->list)
         {
-            for (i = namesp_list->capacity;i < namesp_list->capacity + addition; i++)
+            for(i = namesp_list->capacity; i < namesp_list->capacity + addition; i++)
             {
-                guththila_stack_push(&namesp_list->fr_stack,namesp_list->list + i, env);
+                guththila_stack_push(&namesp_list->fr_stack, namesp_list->list + i, env);
             }
             namesp_list->capacity += addition;
         }
@@ -49,26 +49,26 @@
 }
 
 guththila_namespace_list_t *GUTHTHILA_CALL
-guththila_namespace_list_create(const axutil_env_t * env) 
+guththila_namespace_list_create(
+    const axutil_env_t * env)
 {
     int i = 0;
-    guththila_namespace_list_t * namesp_list =
-        (guththila_namespace_list_t *) AXIS2_MALLOC(env->allocator,sizeof(guththila_namespace_list_t));
+    guththila_namespace_list_t * namesp_list = (guththila_namespace_list_t *)AXIS2_MALLOC(
+        env->allocator, sizeof(guththila_namespace_list_t));
 
-    if (!namesp_list)
+    if(!namesp_list)
         return NULL;
 
-    namesp_list->list =
-        (guththila_namespace_t *) AXIS2_MALLOC(env->allocator,sizeof(guththila_namespace_t) *
-                                               GUTHTHILA_NAMESPACE_DEF_SIZE);
+    namesp_list->list = (guththila_namespace_t *)AXIS2_MALLOC(env->allocator,
+        sizeof(guththila_namespace_t) * GUTHTHILA_NAMESPACE_DEF_SIZE);
 
-    if (namesp_list->list && guththila_stack_init(&namesp_list->fr_stack, env))
+    if(namesp_list->list && guththila_stack_init(&namesp_list->fr_stack, env))
     {
         namesp_list->capacity = GUTHTHILA_NAMESPACE_DEF_SIZE;
         namesp_list->size = 0;
-        for (i = 0; i < GUTHTHILA_NAMESPACE_DEF_SIZE; i++)
+        for(i = 0; i < GUTHTHILA_NAMESPACE_DEF_SIZE; i++)
         {
-            guththila_stack_push(&namesp_list->fr_stack, namesp_list->list + i,env);
+            guththila_stack_push(&namesp_list->fr_stack, namesp_list->list + i, env);
         }
         return namesp_list;
     }
@@ -76,20 +76,20 @@
 }
 
 int GUTHTHILA_CALL
-guththila_namespace_list_init(guththila_namespace_list_t * namesp_list,const axutil_env_t * env) 
+guththila_namespace_list_init(
+    guththila_namespace_list_t * namesp_list,
+    const axutil_env_t * env)
 {
     int i = 0;
-    namesp_list->list =
-        (guththila_namespace_t *) AXIS2_MALLOC(env->allocator,
-                                               sizeof(guththila_namespace_t) *
-                                               GUTHTHILA_NAMESPACE_DEF_SIZE);
-    if (namesp_list->list && guththila_stack_init(&namesp_list->fr_stack, env))
+    namesp_list->list = (guththila_namespace_t *)AXIS2_MALLOC(env->allocator,
+        sizeof(guththila_namespace_t) * GUTHTHILA_NAMESPACE_DEF_SIZE);
+    if(namesp_list->list && guththila_stack_init(&namesp_list->fr_stack, env))
     {
         namesp_list->capacity = GUTHTHILA_NAMESPACE_DEF_SIZE;
         namesp_list->size = 0;
-        for (i = 0; i < GUTHTHILA_NAMESPACE_DEF_SIZE; i++)
+        for(i = 0; i < GUTHTHILA_NAMESPACE_DEF_SIZE; i++)
         {
-            guththila_stack_push(&namesp_list->fr_stack, namesp_list->list + i,env);
+            guththila_stack_push(&namesp_list->fr_stack, namesp_list->list + i, env);
         }
         return GUTHTHILA_SUCCESS;
     }
@@ -97,9 +97,12 @@
 }
 
 guththila_namespace_t *GUTHTHILA_CALL
-guththila_namespace_list_get(guththila_namespace_list_t *namesp_list,const axutil_env_t * env) 
+guththila_namespace_list_get(
+    guththila_namespace_list_t *namesp_list,
+    const axutil_env_t * env)
 {
-    if (namesp_list->fr_stack.top > 0 ||guththila_namespace_list_grow(namesp_list,GUTHTHILA_NAMESPACE_DEF_SIZE, env))
+    if(namesp_list->fr_stack.top > 0 || guththila_namespace_list_grow(namesp_list,
+        GUTHTHILA_NAMESPACE_DEF_SIZE, env))
     {
         return guththila_stack_pop(&namesp_list->fr_stack, env);
     }
@@ -107,24 +110,30 @@
 }
 
 int GUTHTHILA_CALL
-guththila_namespace_list_release(guththila_namespace_list_t * namesp_list,guththila_namespace_t * namespace,
-				 const axutil_env_t * env) 
+guththila_namespace_list_release(
+    guththila_namespace_list_t * namesp_list,
+    guththila_namespace_t * namespace,
+    const axutil_env_t * env)
 {
     return guththila_stack_push(&namesp_list->fr_stack, namespace, env);
 }
 
 void GUTHTHILA_CALL
-msuila_namespace_list_free_data(guththila_namespace_list_t * namesp_list,const axutil_env_t * env) 
+msuila_namespace_list_free_data(
+    guththila_namespace_list_t * namesp_list,
+    const axutil_env_t * env)
 {
     AXIS2_FREE(env->allocator, namesp_list->list);
     guththila_stack_un_init(&namesp_list->fr_stack, env);
-} 
+}
 
 void GUTHTHILA_CALL
-guththila_namespace_list_free(guththila_namespace_list_t * namesp_list,const axutil_env_t * env) 
+guththila_namespace_list_free(
+    guththila_namespace_list_t * namesp_list,
+    const axutil_env_t * env)
 {
 
     guththila_stack_un_init(&namesp_list->fr_stack, env);
     AXIS2_FREE(env->allocator, namesp_list->list);
     AXIS2_FREE(env->allocator, namesp_list);
-} 
+}

Modified: webservices/axis2/trunk/c/guththila/src/guththila_reader.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_reader.c?rev=805358&r1=805357&r2=805358&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_reader.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_reader.c Tue Aug 18 11:06:03 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -14,23 +13,25 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */  
+ */
 #include <stdlib.h>
 #include <string.h>
 #include <guththila_reader.h>
-GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL 
-guththila_reader_create_for_file(guththila_char_t *file_name, const axutil_env_t * env) 
+GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL
+guththila_reader_create_for_file(
+    guththila_char_t *file_name,
+    const axutil_env_t * env)
 {
     guththila_reader_t * reader = NULL;
 
     FILE * f = NULL;
-    if (!file_name)
+    if(!file_name)
         return NULL;
-    reader =(guththila_reader_t *) AXIS2_MALLOC(env->allocator, sizeof(guththila_reader_t));
-    if (!reader)
+    reader = (guththila_reader_t *)AXIS2_MALLOC(env->allocator, sizeof(guththila_reader_t));
+    if(!reader)
         return NULL;
     f = fopen(file_name, "r");
-    if (!f)
+    if(!f)
     {
         AXIS2_FREE(env->allocator, reader);
         return NULL;
@@ -40,14 +41,15 @@
     return reader;
 }
 
-GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL 
-guththila_reader_create_for_memory(void *buffer, int size,
-                                   const axutil_env_t * env) 
+GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL
+guththila_reader_create_for_memory(
+    void *buffer,
+    int size,
+    const axutil_env_t * env)
 {
-    guththila_reader_t * reader =
-        (guththila_reader_t *) AXIS2_MALLOC(env->allocator,
-                                            sizeof(guththila_reader_t));
-    if (reader)
+    guththila_reader_t * reader = (guththila_reader_t *)AXIS2_MALLOC(env->allocator,
+        sizeof(guththila_reader_t));
+    if(reader)
     {
         reader->type = GUTHTHILA_MEMORY_READER;
         reader->buff = buffer;
@@ -58,15 +60,15 @@
     return NULL;
 }
 
-GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL 
-guththila_reader_create_for_io(GUTHTHILA_READ_INPUT_CALLBACK
-                               input_read_callback, void *ctx,
-                               const axutil_env_t * env) 
+GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL
+guththila_reader_create_for_io(
+    GUTHTHILA_READ_INPUT_CALLBACK input_read_callback,
+    void *ctx,
+    const axutil_env_t * env)
 {
-    guththila_reader_t * reader =
-        (guththila_reader_t *) AXIS2_MALLOC(env->allocator,
-                                            sizeof(guththila_reader_t));
-    if (reader)
+    guththila_reader_t * reader = (guththila_reader_t *)AXIS2_MALLOC(env->allocator,
+        sizeof(guththila_reader_t));
+    if(reader)
     {
         reader->input_read_callback = input_read_callback;
         reader->context = ctx;
@@ -75,40 +77,39 @@
     }
     return NULL;
 }
-GUTHTHILA_EXPORT void GUTHTHILA_CALL 
+GUTHTHILA_EXPORT void GUTHTHILA_CALL
 guththila_reader_free(
     guththila_reader_t * r,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
-    if (r->type == GUTHTHILA_FILE_READER && r->fp)
+    if(r->type == GUTHTHILA_FILE_READER && r->fp)
     {
         fclose(r->fp);
     }
-    if (r->type == GUTHTHILA_IO_READER && r->context)
+    if(r->type == GUTHTHILA_IO_READER && r->context)
     {
-      AXIS2_FREE(env->allocator, r->context);
-    }  
+        AXIS2_FREE(env->allocator, r->context);
+    }
     AXIS2_FREE(env->allocator, r);
-    
+
 }
-GUTHTHILA_EXPORT int GUTHTHILA_CALL 
+GUTHTHILA_EXPORT int GUTHTHILA_CALL
 guththila_reader_read(
     guththila_reader_t * r,
     guththila_char_t * buffer,
     int offset,
     int length,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     int rt = r->type;
-    switch (rt)
+    switch(rt)
     {
-		case GUTHTHILA_FILE_READER:
-			return (int) fread(buffer + offset, 1, length, r->fp);
-		case GUTHTHILA_IO_READER:
-			return r->input_read_callback((buffer + offset), length, r->context);
-		default:
-			return 0;
+        case GUTHTHILA_FILE_READER:
+            return (int)fread(buffer + offset, 1, length, r->fp);
+        case GUTHTHILA_IO_READER:
+            return r->input_read_callback((buffer + offset), length, r->context);
+        default:
+            return 0;
     }
 }
 
-

Modified: webservices/axis2/trunk/c/guththila/src/guththila_stack.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_stack.c?rev=805358&r1=805357&r2=805358&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_stack.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_stack.c Tue Aug 18 11:06:03 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -14,19 +13,17 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */  
+ */
 #include <guththila_stack.h>
 
 int GUTHTHILA_CALL
 guththila_stack_init(
     guththila_stack_t * stack,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     stack->top = 0;
-    stack->data =
-        (void **) AXIS2_MALLOC(env->allocator,
-                               sizeof(void **) * GUTHTHILA_STACK_DEFAULT);
-    if (!stack->data)
+    stack->data = (void **)AXIS2_MALLOC(env->allocator, sizeof(void **) * GUTHTHILA_STACK_DEFAULT);
+    if(!stack->data)
     {
         return GUTHTHILA_FAILURE;
     }
@@ -40,9 +37,9 @@
 void GUTHTHILA_CALL
 guththila_stack_free(
     guththila_stack_t * stack,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
-    if (stack->data)
+    if(stack->data)
         AXIS2_FREE(env->allocator, stack->data);
     AXIS2_FREE(env->allocator, stack);
 }
@@ -50,20 +47,20 @@
 void GUTHTHILA_CALL
 guththila_stack_un_init(
     guththila_stack_t * stack,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
-    if (stack->data)
+    if(stack->data)
         AXIS2_FREE(env->allocator, stack->data);
 }
 
 void *GUTHTHILA_CALL
 guththila_stack_pop(
     guththila_stack_t * stack,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
-    if (stack->top > 0)
-    {                
-        return stack->data[stack->top-- - 1];        
+    if(stack->top > 0)
+    {
+        return stack->data[stack->top-- - 1];
     }
     return NULL;
 }
@@ -72,24 +69,22 @@
 guththila_stack_push(
     guththila_stack_t * stack,
     void *data,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     int i = 0;
     void **temp = NULL;
-    if (stack->top >= stack->max)
+    if(stack->top >= stack->max)
     {
-        
-            temp =
-            (void **) AXIS2_MALLOC(env->allocator,
-                                   sizeof(void **) * (stack->max +=
-                                                      GUTHTHILA_STACK_DEFAULT));
-        for (i = 0; i < stack->top; i++)
+
+        temp = (void **)AXIS2_MALLOC(env->allocator, sizeof(void **) * (stack->max
+            += GUTHTHILA_STACK_DEFAULT));
+        for(i = 0; i < stack->top; i++)
         {
             temp[i] = stack->data[i];
         }
         AXIS2_FREE(env->allocator, stack->data);
         stack->data = temp;
-        if (!stack->data)
+        if(!stack->data)
             return GUTHTHILA_FAILURE;
     }
     stack->data[stack->top] = data;
@@ -99,9 +94,9 @@
 void *GUTHTHILA_CALL
 guththila_stack_peek(
     guththila_stack_t * stack,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
-    if (stack->top > 0)
+    if(stack->top > 0)
     {
         return stack->data[stack->top - 1];
     }
@@ -114,9 +109,9 @@
 int GUTHTHILA_CALL
 guththila_stack_del_top(
     guththila_stack_t * stack,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
-    if (stack->top > 0)
+    if(stack->top > 0)
     {
         AXIS2_FREE(env->allocator, stack->data[stack->top]);
         return GUTHTHILA_SUCCESS;
@@ -127,7 +122,7 @@
 int GUTHTHILA_CALL
 guththila_stack_is_empty(
     guththila_stack_t * stack,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     return stack->top == 0 ? 1 : 0;
 }
@@ -136,20 +131,8 @@
 guththila_stack_get_by_index(
     guththila_stack_t * stack,
     int index,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     return index < stack->top ? stack->data[index] : NULL;
 }
 
-
-
-
-
-
-
-
-
-
-
-
-

Modified: webservices/axis2/trunk/c/guththila/src/guththila_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_token.c?rev=805358&r1=805357&r2=805358&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_token.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_token.c Tue Aug 18 11:06:03 2009
@@ -13,53 +13,47 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */  
+ */
+
 #include <guththila_token.h>
-    
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-    
+
 #define TOK_LIST_FREE(tok_list) \
     (if (tok_list) { AXIS2_FREE(tok_list)} )
-    
-#define TOK_LIST_SIZE(tok_list) (tok_list->size)
 
+#define TOK_LIST_SIZE(tok_list) (tok_list->size)
 
 int GUTHTHILA_CALL
 guththila_tok_list_grow(
     guththila_tok_list_t * tok_list,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     int i = 0;
     int cur = 0;
     int cur_cap = 0;
     guththila_token_t ** list = NULL;
-    if (tok_list->cur_list < tok_list->no_list - 1)
+    if(tok_list->cur_list < tok_list->no_list - 1)
     {
         cur = ++tok_list->cur_list;
         cur_cap = tok_list->capacity[cur - 1] * 2;
-        tok_list->list[cur] =
-            (guththila_token_t *) AXIS2_MALLOC(env->allocator,
-                                               sizeof(guththila_token_t) *
-                                               cur_cap);
-        for (i = 0; i < cur_cap; i++)
+        tok_list->list[cur] = (guththila_token_t *)AXIS2_MALLOC(env->allocator,
+            sizeof(guththila_token_t) * cur_cap);
+        for(i = 0; i < cur_cap; i++)
         {
-            guththila_stack_push(&tok_list->fr_stack, &tok_list->list[cur][i],
-                                  env);
+            guththila_stack_push(&tok_list->fr_stack, &tok_list->list[cur][i], env);
         }
         tok_list->capacity[cur] = cur_cap;
         return GUTHTHILA_SUCCESS;
     }
     else
     {
-        list =
-            (guththila_token_t **) AXIS2_MALLOC(env->allocator,
-                                                sizeof(guththila_token_t *) *
-                                                tok_list->no_list * 2);
-        if (list)
+        list = (guththila_token_t **)AXIS2_MALLOC(env->allocator, sizeof(guththila_token_t *)
+            * tok_list->no_list * 2);
+        if(list)
         {
-            for (i = 0; i <= tok_list->cur_list; i++)
+            for(i = 0; i <= tok_list->cur_list; i++)
             {
                 list[i] = tok_list->list[i];
             }
@@ -75,29 +69,23 @@
 int GUTHTHILA_CALL
 guththila_tok_list_init(
     guththila_tok_list_t * tok_list,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     int i = 0;
-    tok_list->list =
-        (guththila_token_t **) AXIS2_MALLOC(env->allocator,
-                                            sizeof(guththila_token_t *) *
-                                            GUTHTHILA_TOK_DEF_LIST_SIZE);
-    if (tok_list->list && guththila_stack_init(&tok_list->fr_stack, env))
-    {
-        tok_list->capacity =
-            (int *) AXIS2_MALLOC(env->allocator,
-                                 sizeof(int) * GUTHTHILA_TOK_DEF_LIST_SIZE);
-        if (tok_list->capacity)
+    tok_list->list = (guththila_token_t **)AXIS2_MALLOC(env->allocator, sizeof(guththila_token_t *)
+        * GUTHTHILA_TOK_DEF_LIST_SIZE);
+    if(tok_list->list && guththila_stack_init(&tok_list->fr_stack, env))
+    {
+        tok_list->capacity = (int *)AXIS2_MALLOC(env->allocator, sizeof(int)
+            * GUTHTHILA_TOK_DEF_LIST_SIZE);
+        if(tok_list->capacity)
         {
             tok_list->no_list = GUTHTHILA_TOK_DEF_LIST_SIZE;
-            tok_list->list[0] =
-                (guththila_token_t *) AXIS2_MALLOC(env->allocator,
-                                                   sizeof(guththila_token_t) *
-                                                   GUTHTHILA_TOK_DEF_SIZE);
-            for (i = 0; i < GUTHTHILA_TOK_DEF_SIZE; i++)
+            tok_list->list[0] = (guththila_token_t *)AXIS2_MALLOC(env->allocator,
+                sizeof(guththila_token_t) * GUTHTHILA_TOK_DEF_SIZE);
+            for(i = 0; i < GUTHTHILA_TOK_DEF_SIZE; i++)
             {
-                guththila_stack_push(&tok_list->fr_stack,
-                                      &tok_list->list[0][i], env);
+                guththila_stack_push(&tok_list->fr_stack, &tok_list->list[0][i], env);
             }
             tok_list->capacity[0] = GUTHTHILA_TOK_DEF_SIZE;
             tok_list->cur_list = 0;
@@ -111,39 +99,40 @@
 void GUTHTHILA_CALL
 guththila_tok_list_free(
     guththila_tok_list_t * tok_list,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     int i = 0;
     guththila_stack_un_init(&tok_list->fr_stack, env);
-    for (; i <= tok_list->cur_list; i++)
+    for(; i <= tok_list->cur_list; i++)
     {
         AXIS2_FREE(env->allocator, tok_list->list[i]);
     }
     AXIS2_FREE(env->allocator, tok_list->list);
-    AXIS2_FREE(env->allocator,tok_list->capacity);
+    AXIS2_FREE(env->allocator, tok_list->capacity);
     AXIS2_FREE(env->allocator, tok_list);
 }
 
 void GUTHTHILA_CALL
 guththila_tok_list_free_data(
     guththila_tok_list_t * tok_list,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     int i = 0;
     guththila_stack_un_init(&tok_list->fr_stack, env);
-    for (; i <= tok_list->cur_list; i++)
+    for(; i <= tok_list->cur_list; i++)
     {
         AXIS2_FREE(env->allocator, tok_list->list[i]);
     }
-    AXIS2_FREE(env->allocator,tok_list->capacity);
+    AXIS2_FREE(env->allocator, tok_list->capacity);
     AXIS2_FREE(env->allocator, tok_list->list);
 }
 
 guththila_token_t *GUTHTHILA_CALL
-guththila_tok_list_get_token(guththila_tok_list_t * tok_list,
-                                                const axutil_env_t * env) 
+guththila_tok_list_get_token(
+    guththila_tok_list_t * tok_list,
+    const axutil_env_t * env)
 {
-    if (tok_list->fr_stack.top > 0 || guththila_tok_list_grow(tok_list, env))
+    if(tok_list->fr_stack.top > 0 || guththila_tok_list_grow(tok_list, env))
     {
         return guththila_stack_pop(&tok_list->fr_stack, env);
     }
@@ -154,7 +143,7 @@
 guththila_tok_list_release_token(
     guththila_tok_list_t * tok_list,
     guththila_token_t * token,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     return guththila_stack_push(&tok_list->fr_stack, token, env);
 }
@@ -164,14 +153,14 @@
     guththila_token_t * tok,
     guththila_char_t *str,
     size_t str_len,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     unsigned int i = 0;
-    if (tok->size != str_len)
+    if(tok->size != str_len)
         return -1;
-    for (; i < tok->size; i++)
+    for(; i < tok->size; i++)
     {
-        if (tok->start[i] != str[i])
+        if(tok->start[i] != str[i])
         {
             return -1;
         }
@@ -183,35 +172,36 @@
 guththila_tok_tok_cmp(
     guththila_token_t * tok1,
     guththila_token_t * tok2,
-    const axutil_env_t * env) 
+    const axutil_env_t * env)
 {
     unsigned int i = 0;
 
-    if (tok1 && tok2)
+    if(tok1 && tok2)
     {
-        if (tok1->size != tok2->size)
+        if(tok1->size != tok2->size)
             return -1;
-        for (; i < tok1->size; i++)
+        for(; i < tok1->size; i++)
         {
-            if (tok1->start[i] != tok2->start[i])
+            if(tok1->start[i] != tok2->start[i])
             {
-               return -1;
+                return -1;
             }
         }
-		return 0;
+        return 0;
     }
     return -1;
 }
 
 void GUTHTHILA_CALL
-guththila_set_token(guththila_token_t* tok,
-                       guththila_char_t* start,
-                       short type,
-                       int size,
-                       int _start,
-                       int last,
-                       int ref,
-                       const axutil_env_t* env)
+guththila_set_token(
+    guththila_token_t* tok,
+    guththila_char_t* start,
+    short type,
+    int size,
+    int _start,
+    int last,
+    int ref,
+    const axutil_env_t* env)
 {
     if(start)
     {



Mime
View raw message