axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From din...@apache.org
Subject svn commit: r424210 [2/3] - /webservices/axis2/trunk/c/guththila/src/
Date Fri, 21 Jul 2006 07:14:59 GMT
Modified: webservices/axis2/trunk/c/guththila/src/guththila_xml_pull_parser.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_xml_pull_parser.c?rev=424210&r1=424209&r2=424210&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_xml_pull_parser.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_xml_pull_parser.c Fri Jul 21 00:14:58 2006
@@ -17,653 +17,652 @@
  * @author Dinesh Premalal (xydinesh@gmail.com, premalwd@cse.mrt.ac.lk)   
  */
 
-#include "guththila_xml_pull_parser.h"
-#include "guththila_string.h"
+#include <guththila_xml_pull_parser.h>
 
 static int
 guththila_is_space (int c)
 {
-    return (0x20 == c || 0x9 == c || 0xD == c || 0xA == c);
+  return (0x20 == c || 0x9 == c || 0xD == c || 0xA == c);
 }
 
 
-GUTHTHILA_DECLARE (guththila_xml_pull_parser_t *)
-guththila_xml_pull_parser_create (guththila_environment_t * environment,
+AXIS2_EXTERN guththila_xml_pull_parser_t *
+guththila_xml_pull_parser_create (axis2_env_t * environment,
                                   guththila_reader_t * r)
 {
-    guththila_xml_pull_parser_t *parser =
-        (guththila_xml_pull_parser_t *) GUTHTHILA_MALLOC (
-                environment->allocator, sizeof (guththila_xml_pull_parser_t));
+  guththila_xml_pull_parser_t *parser =
+    (guththila_xml_pull_parser_t *) AXIS2_MALLOC (
+						  environment->allocator, sizeof (guththila_xml_pull_parser_t));
                 
-    parser->buffer = guththila_buffer_create (environment, 1024);
-    parser->stack = guththila_stack_create (environment);
-    parser->attrib = guththila_stack_create (environment);
-    parser->namesp = guththila_stack_create (environment);
-    parser->dep = guththila_stack_create (environment);
-    parser->name = NULL;
-    parser->prefix = NULL;
-    parser->value = NULL;
-    parser->reader = r;
-    parser->_next = 0;
-    parser->offset = 0;
-    parser->last = -1;
-    parser->status = S_1;
-    parser->unicode_state = None;
+  parser->buffer = guththila_buffer_create (environment, 1024);
+  parser->stack = axis2_stack_create (environment);
+  parser->attrib = axis2_stack_create (environment);
+  parser->namesp = axis2_stack_create (environment);
+  parser->dep = axis2_stack_create (environment);
+  parser->name = NULL;
+  parser->prefix = NULL;
+  parser->value = NULL;
+  parser->reader = r;
+  parser->_next = 0;
+  parser->offset = 0;
+  parser->last = -1;
+  parser->status = S_1;
+  parser->unicode_state = None;
 
-    return parser;
+  return parser;
 }
 
 
-GUTHTHILA_DECLARE (void)
-guththila_xml_pull_parser_free (guththila_environment_t * environment,
+AXIS2_EXTERN void
+guththila_xml_pull_parser_free (axis2_env_t * environment,
                                 guththila_xml_pull_parser_t * parser)
 {
-    if (parser->buffer)
-        guththila_buffer_free (environment, (void *) parser->buffer);
-    if (parser->stack)
-        guththila_stack_free (environment, parser->stack);
-    if (parser->attrib)
-        guththila_stack_free (environment, parser->attrib);
-    if (parser->namesp)
-        guththila_stack_free (environment, parser->namesp);
-    if (parser->dep)
-        guththila_stack_free (environment, parser->dep);
-    GUTHTHILA_FREE (environment->allocator, (void *) parser);
+  if (parser->buffer)
+    guththila_buffer_free (environment, (void *) parser->buffer);
+  if (parser->stack)
+    AXIS2_STACK_FREE (parser->stack, environment);
+  if (parser->attrib)
+    AXIS2_STACK_FREE (parser->attrib, environment);
+  if (parser->namesp)
+     AXIS2_STACK_FREE (parser->namesp, environment);
+  if (parser->dep)
+    AXIS2_STACK_FREE (parser->dep, environment);
+  AXIS2_FREE (environment->allocator, (void *) parser);
 }
 
 
-int
+AXIS2_EXTERN int
 guththila_xml_pull_parser_exception (guththila_char_t * file, int line, int error_code)
 {
-    printf ("Throws guththila_xml_pull_parser_exception \t %s \t %d \n", file,
-            line);
-    /* Samisa: we should define a set of error codes and a corresponding error message set
-       rather than printing the above line to the console, we should be appending the
-       above string to the error message corresponding to the current error code
-       please delete this comment once this is fixed
-     */
-
-    /* Dinesh: Modified exception function to print line number , file
-       and return error code for particular error. If we feel that
-       file and line number is not necessary lets remove them later.*/
-    return error_code;
+  printf ("Throws guththila_xml_pull_parser_exception \t %s \t %d \n", file,
+	  line);
+  /* Samisa: we should define a set of error codes and a corresponding error message set
+     rather than printing the above line to the console, we should be appending the
+     above string to the error message corresponding to the current error code
+     please delete this comment once this is fixed
+  */
+
+  /* Dinesh: Modified exception function to print line number , file
+     and return error code for particular error. If we feel that
+     file and line number is not necessary lets remove them later.*/
+  return error_code;
 }
 
 
-void
+AXIS2_EXTERN void
 guththila_xml_pull_parser_relocate_tokens 
-                        (guththila_environment_t *environment,
-                         guththila_xml_pull_parser_t *parser,
-                         int offset)
+(axis2_env_t *environment,
+ guththila_xml_pull_parser_t *parser,
+ int offset)
 {
-    guththila_element_t *el = NULL;
-    int isize;
-    isize = guththila_stack_size (environment, parser->stack);
-    el = guththila_stack_last (environment, parser->stack);
-    for (; isize > 0; isize--)
+  guththila_token_t *el = NULL;
+  int isize;
+  isize = AXIS2_STACK_SIZE (parser->stack, environment);
+  el = (guththila_token_t *) AXIS2_STACK_GET_AT (parser->stack, environment, isize);
+  for (; isize > 0; isize--)
     {
-        guththila_token_relocate (environment, el->token, offset);
-        el = el->prev;
+      guththila_token_relocate (environment, el, offset);
+      el = (guththila_token_t *) AXIS2_STACK_GET_AT (parser->stack, environment, isize);
     }
 }
 
 
-void
-guththila_xml_pull_parser_shift (guththila_environment_t * environment,
+AXIS2_EXTERN void
+guththila_xml_pull_parser_shift (axis2_env_t * environment,
                                  guththila_xml_pull_parser_t * parser)
 {
-    memmove (parser->buffer->buff, parser->buffer->buff + (parser->offset),
-             (parser->_next) - (parser->offset));
-    parser->_next -= parser->offset;
-    parser->last -= parser->offset;
-    parser->offset = 0;
+  memmove (parser->buffer->buff, parser->buffer->buff + (parser->offset),
+	   (parser->_next) - (parser->offset));
+  parser->_next -= parser->offset;
+  parser->last -= parser->offset;
+  parser->offset = 0;
 }
 
 
-GUTHTHILA_DECLARE (int)
-guththila_xml_pull_parser_read (guththila_environment_t * environment,
+AXIS2_EXTERN int
+guththila_xml_pull_parser_read (axis2_env_t * environment,
                                 guththila_xml_pull_parser_t * parser)
 {
-    int c = 0;
-    if (parser->_next == parser->buffer->size)
+  int c = 0;
+  if (parser->_next == parser->buffer->size)
     {
-        if (parser->offset > 0)
+      if (parser->offset > 0)
         {
-            guththila_xml_pull_parser_relocate_tokens (environment, parser,
-                                                       parser->offset);
-            guththila_xml_pull_parser_shift (environment, parser);
+	  guththila_xml_pull_parser_relocate_tokens (environment, parser,
+						     parser->offset);
+	  guththila_xml_pull_parser_shift (environment, parser);
         }
-        else
+      else
         {
-            int b = parser->buffer->size;
-            parser->buffer =
-                guththila_buffer_grow (environment, parser->buffer);
-            guththila_xml_pull_parser_relocate_tokens (
+	  int b = parser->buffer->size;
+	  parser->buffer =
+	    guththila_buffer_grow (environment, parser->buffer);
+	  guththila_xml_pull_parser_relocate_tokens (
             environment, parser, (parser->buffer->size - b));
         }
     }
-    c = guththila_reader_read (environment, (parser->buffer->buff),
-                               (parser->_next),
-                               (parser->buffer->size) - (parser->_next),
-                               parser->reader);
-    parser->last += c;
-    return !c;
+  c = guththila_reader_read (environment, (parser->buffer->buff),
+			     (parser->_next),
+			     (parser->buffer->size) - (parser->_next),
+			     parser->reader);
+  parser->last += c;
+  return !c;
 }
 
 
-int
-guththila_xml_pull_parser_from_utf16 (guththila_environment_t * environment,
+AXIS2_EXTERN int
+guththila_xml_pull_parser_from_utf16 (axis2_env_t * environment,
                                       guththila_xml_pull_parser_t * parser,
                                       int eof)
 {
-    int c = parser->buffer->buff[parser->_next++];
-    if (((parser->_next) > (parser->last))
-        && guththila_xml_pull_parser_read (environment, parser))
-    {
-        if (eof)
-            return -1;
-        else
-     guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_UNEXPECTED_UTF16_EOF);
+  int c = parser->buffer->buff[parser->_next++];
+  if (((parser->_next) > (parser->last))
+      && guththila_xml_pull_parser_read (environment, parser))
+    {
+      if (eof)
+	return -1;
+      else
+	guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_UNEXPECTED_UTF16_EOF);
     }
-    while (!c)
-        c = parser->buffer->buff[parser->_next++];
-    return c;
+  while (!c)
+    c = parser->buffer->buff[parser->_next++];
+  return c;
 }
 
 
-int
-guththila_xml_pull_parser_next_char (guththila_environment_t * environment,
+AXIS2_EXTERN int
+guththila_xml_pull_parser_next_char (axis2_env_t * environment,
                                      guththila_xml_pull_parser_t * parser,
                                      int eof)
 {
-    if (((parser->_next) > (parser->last))
-        && guththila_xml_pull_parser_read (environment, parser))
+  if (((parser->_next) > (parser->last))
+      && guththila_xml_pull_parser_read (environment, parser))
+    {
+      if (eof)
+	return -1;
+      else
+	guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_UNEXPECTED_EOF);
+    }
+  if (parser->_next == 0)
     {
-        if (eof)
-            return -1;
-        else
-            guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_UNEXPECTED_EOF);
-    }
-    if (parser->_next == 0)
-    {
-        guththila_UTF8_char iu =
-            (guththila_UTF8_char) parser->buffer->buff[parser->_next++];
-
-        if (0xff == iu
-            && 0xfe ==
-            (guththila_UTF8_char) parser->buffer->buff[parser->_next++])
+      guththila_UTF8_char iu =
+	(guththila_UTF8_char) parser->buffer->buff[parser->_next++];
+
+      if (0xff == iu
+	  && 0xfe ==
+	  (guththila_UTF8_char) parser->buffer->buff[parser->_next++])
         {
-            parser->unicode_state = LE;
+	  parser->unicode_state = LE;
         }
-        else if (0xfe == iu
-                 && 0xff ==
-                 (guththila_UTF8_char) parser->buffer->buff[parser->_next++])
+      else if (0xfe == iu
+	       && 0xff ==
+	       (guththila_UTF8_char) parser->buffer->buff[parser->_next++])
         {
-            parser->unicode_state = BE;
+	  parser->unicode_state = BE;
         }
-        else if (0xef == iu
-                 && 0xbb ==
-                 (guththila_UTF8_char) parser->buffer->buff[parser->_next++]
-                 && 0xbf ==
-                 (guththila_UTF8_char) parser->buffer->buff[parser->_next++])
+      else if (0xef == iu
+	       && 0xbb ==
+	       (guththila_UTF8_char) parser->buffer->buff[parser->_next++]
+	       && 0xbf ==
+	       (guththila_UTF8_char) parser->buffer->buff[parser->_next++])
         {
-            parser->unicode_state = None;
+	  parser->unicode_state = None;
         }
-        else
+      else
         {
-            parser->unicode_state = None;
-            parser->_next = 0;
+	  parser->unicode_state = None;
+	  parser->_next = 0;
         }
     }
 
-    if (parser->unicode_state == None)
-        return parser->buffer->buff[parser->_next++];
-    else
-        return guththila_xml_pull_parser_from_utf16 (environment, parser,
-                                                     eof);
+  if (parser->unicode_state == None)
+    return parser->buffer->buff[parser->_next++];
+  else
+    return guththila_xml_pull_parser_from_utf16 (environment, parser,
+						 eof);
 }
 
 
-guththila_char_t *
-guththila_xml_pull_parser_last_char (guththila_environment_t * environment,
+AXIS2_EXTERN guththila_char_t *
+guththila_xml_pull_parser_last_char (axis2_env_t * environment,
                                      guththila_xml_pull_parser_t * parser)
 {
-    return parser->buffer->buff + (parser->_next - 1);
+  return parser->buffer->buff + (parser->_next - 1);
 }
 
 
-void
-guththila_xml_pull_parser_open_token (guththila_environment_t * environment,
+AXIS2_EXTERN void
+guththila_xml_pull_parser_open_token (axis2_env_t * environment,
                                       guththila_xml_pull_parser_t * parser)
 {
-    guththila_token_t *t =
-        (guththila_token_t *) GUTHTHILA_MALLOC (environment->allocator,
-                                                sizeof (guththila_token_t));
-    t->type = Unknown;
-    t->start = guththila_xml_pull_parser_last_char (environment, parser);
-    guththila_stack_push (environment, parser->stack, t, NULL);
+  guththila_token_t *t =
+    (guththila_token_t *) AXIS2_MALLOC (environment->allocator,
+					sizeof (guththila_token_t));
+  t->type = Unknown;
+  t->start = guththila_xml_pull_parser_last_char (environment, parser);
+  AXIS2_STACK_PUSH (parser->stack, environment, t);
 }
 
 
-void
-guththila_xml_pull_parser_close_token (guththila_environment_t * environment,
+AXIS2_EXTERN void
+guththila_xml_pull_parser_close_token (axis2_env_t * environment,
                                        guththila_xml_pull_parser_t * parser,
                                        int t, int refer)
 {
-    guththila_element_t *e =
-        guththila_stack_last (environment, parser->stack);
-    e->token->type = t;
-    e->token->ref = refer;
-    e->token->end =
-        guththila_xml_pull_parser_last_char (environment, parser) - 1;
+  guththila_token_t *token =
+    (guththila_token_t *) AXIS2_STACK_GET (parser->stack, environment);
+  token->type = t;
+  token->ref = refer;
+  token->end =
+    guththila_xml_pull_parser_last_char (environment, parser) - 1;
 }
 
 
-int
-guththila_xml_pull_parser_skip_spaces (guththila_environment_t * environment,
+AXIS2_EXTERN int
+guththila_xml_pull_parser_skip_spaces (axis2_env_t * environment,
                                        guththila_xml_pull_parser_t * parser,
                                        int c)
 {
-    while (0x20 == c || 0x9 == c || 0xD == c || 0xA == c)
-        c = guththila_xml_pull_parser_next_char (environment, parser, 0);
-    return c;
+  while (0x20 == c || 0x9 == c || 0xD == c || 0xA == c)
+    c = guththila_xml_pull_parser_next_char (environment, parser, 0);
+  return c;
 }
 
 
-int
-guththila_xml_pull_parser_process_eq (guththila_environment_t * environment,
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_eq (axis2_env_t * environment,
                                       guththila_xml_pull_parser_t * parser,
                                       int c)
 {
-    int ic;
-    if (0x3D ==
-        guththila_xml_pull_parser_skip_spaces (environment, parser, c))
-    {
-        ic = guththila_xml_pull_parser_next_char (environment, parser, 0);
-        return guththila_xml_pull_parser_skip_spaces (environment, parser,
-                                                      ic);
+  int ic;
+  if (0x3D ==
+      guththila_xml_pull_parser_skip_spaces (environment, parser, c))
+    {
+      ic = guththila_xml_pull_parser_next_char (environment, parser, 0);
+      return guththila_xml_pull_parser_skip_spaces (environment, parser,
+						    ic);
     }
-    else
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_PROCESS_EQUAL);
-    return 0;
+  else
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_PROCESS_EQUAL);
+  return 0;
 }
 
 
-int
-guththila_xml_pull_parser_process_version_info (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_version_info (axis2_env_t *
                                                 environment,
                                                 guththila_xml_pull_parser_t *
                                                 parser)
 {
-    int ic;
-    int quote;
-    int nc;
-    ic = guththila_xml_pull_parser_next_char (environment, parser, 0);
-    ic = guththila_xml_pull_parser_skip_spaces (environment, parser, ic);
-    if (ic == 'v')
-    {
-        guththila_xml_pull_parser_open_token (environment, parser);
-        if ('e' ==
-            guththila_xml_pull_parser_next_char (environment, parser, 0)
-            && 'r' == guththila_xml_pull_parser_next_char (environment,
-                                                           parser, 0)
-            && 's' == guththila_xml_pull_parser_next_char (environment,
-                                                           parser, 0)
-            && 'i' == guththila_xml_pull_parser_next_char (environment,
-                                                           parser, 0)
-            && 'o' == guththila_xml_pull_parser_next_char (environment,
-                                                           parser, 0)
-            && 'n' == guththila_xml_pull_parser_next_char (environment,
-                                                           parser, 0))
-        {
-            ic = guththila_xml_pull_parser_next_char (environment, parser, 0);
-            guththila_xml_pull_parser_close_token (environment, parser,
-                                                   _attribute, 0);
-            quote =
-                guththila_xml_pull_parser_process_eq (environment, parser,
-                                                      ic);
-            nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
-            /* 0, since we don't expect EOF line here */
-            guththila_xml_pull_parser_open_token (environment, parser);
-            while (quote != nc)
-                nc = guththila_xml_pull_parser_next_char (environment, parser,
-                                                          0);
-            guththila_xml_pull_parser_close_token (environment, parser,
-                                                   _attribute_value, 0);
-            nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
-            return guththila_xml_pull_parser_skip_spaces (environment, parser,
-                                                          nc);
-        }
-        else
-            guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_INCORRECT_VERSION_INFO);
-    }
-    else
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_VERSION_INFO_NOT_FOUND);
-    return 0;
+  int ic;
+  int quote;
+  int nc;
+  ic = guththila_xml_pull_parser_next_char (environment, parser, 0);
+  ic = guththila_xml_pull_parser_skip_spaces (environment, parser, ic);
+  if (ic == 'v')
+    {
+      guththila_xml_pull_parser_open_token (environment, parser);
+      if ('e' ==
+	  guththila_xml_pull_parser_next_char (environment, parser, 0)
+	  && 'r' == guththila_xml_pull_parser_next_char (environment,
+							 parser, 0)
+	  && 's' == guththila_xml_pull_parser_next_char (environment,
+							 parser, 0)
+	  && 'i' == guththila_xml_pull_parser_next_char (environment,
+							 parser, 0)
+	  && 'o' == guththila_xml_pull_parser_next_char (environment,
+							 parser, 0)
+	  && 'n' == guththila_xml_pull_parser_next_char (environment,
+							 parser, 0))
+        {
+	  ic = guththila_xml_pull_parser_next_char (environment, parser, 0);
+	  guththila_xml_pull_parser_close_token (environment, parser,
+						 _attribute, 0);
+	  quote =
+	    guththila_xml_pull_parser_process_eq (environment, parser,
+						  ic);
+	  nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
+	  /* 0, since we don't expect EOF line here */
+	  guththila_xml_pull_parser_open_token (environment, parser);
+	  while (quote != nc)
+	    nc = guththila_xml_pull_parser_next_char (environment, parser,
+						      0);
+	  guththila_xml_pull_parser_close_token (environment, parser,
+						 _attribute_value, 0);
+	  nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
+	  return guththila_xml_pull_parser_skip_spaces (environment, parser,
+							nc);
+        }
+      else
+	guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_INCORRECT_VERSION_INFO);
+    }
+  else
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_VERSION_INFO_NOT_FOUND);
+  return 0;
 }
 
 
-int
-guththila_xml_pull_parser_process_encoding_decl (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_encoding_decl (axis2_env_t *
                                                  environment,
                                                  guththila_xml_pull_parser_t *
                                                  parser)
 {
-    int quote;
-    int nc;
-    int ic;
-    guththila_xml_pull_parser_open_token (environment, parser);
-    if ('n' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'c' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'o' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'd' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'i' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'n' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'g' == guththila_xml_pull_parser_next_char (environment, parser,
-                                                       0))
-    {
-        ic = guththila_xml_pull_parser_next_char (environment, parser, 0);
-        guththila_xml_pull_parser_close_token (environment, parser,
-                                               _attribute, 0);
-        quote =
-            guththila_xml_pull_parser_process_eq (environment, parser, ic);
-        nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
-        guththila_xml_pull_parser_open_token (environment, parser);
-        while (quote != nc)
-            nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
-        guththila_xml_pull_parser_close_token (environment, parser,
-                                               _attribute_value, 0);
-        nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
-        return guththila_xml_pull_parser_skip_spaces (environment, parser,
-                                                      nc);
-    }
-    else
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_ENCODING_DECLARATION_ERROR);
-    return 0;
+  int quote;
+  int nc;
+  int ic;
+  guththila_xml_pull_parser_open_token (environment, parser);
+  if ('n' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'c' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'o' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'd' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'i' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'n' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'g' == guththila_xml_pull_parser_next_char (environment, parser,
+						     0))
+    {
+      ic = guththila_xml_pull_parser_next_char (environment, parser, 0);
+      guththila_xml_pull_parser_close_token (environment, parser,
+					     _attribute, 0);
+      quote =
+	guththila_xml_pull_parser_process_eq (environment, parser, ic);
+      nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
+      guththila_xml_pull_parser_open_token (environment, parser);
+      while (quote != nc)
+	nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
+      guththila_xml_pull_parser_close_token (environment, parser,
+					     _attribute_value, 0);
+      nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
+      return guththila_xml_pull_parser_skip_spaces (environment, parser,
+						    nc);
+    }
+  else
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_ENCODING_DECLARATION_ERROR);
+  return 0;
 }
 
 
-int
-guththila_xml_pull_parser_process_sd_decl (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_sd_decl (axis2_env_t *
                                            environment,
                                            guththila_xml_pull_parser_t *
                                            parser)
 {
-    int quote = 0;
-    int nc = 0;
-    int ic = 0;
-    guththila_xml_pull_parser_open_token (environment, parser);
-    if ('t' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'a' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'n' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'd' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'a' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'l' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'o' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'n' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'e' == guththila_xml_pull_parser_next_char (environment, parser,
-                                                       0))
-        ic = guththila_xml_pull_parser_next_char (environment, parser, 0);
-    guththila_xml_pull_parser_close_token (environment, parser, _attribute,
-                                           0);
-    quote = guththila_xml_pull_parser_process_eq (environment, parser, ic);
-    nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
-    guththila_xml_pull_parser_open_token (environment, parser);
-    while (quote != nc)
-    {
-        if ('y' == nc)
-        {
-            if ('e' !=
-                guththila_xml_pull_parser_next_char (environment, parser, 0)
-                || 's' != guththila_xml_pull_parser_next_char (environment,
-                                                               parser, 0))
-                guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_STANDALONE_ERROR_IN_YES);
-            else
-                nc = guththila_xml_pull_parser_next_char (environment, parser,
-                                                          0);
-        }
-        else if ('n' == nc)
-        {
-            if ('o' !=
-                guththila_xml_pull_parser_next_char (environment, parser, 0))
-         guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_STANDALONE_ERROR_IN_NO);
-            else
-                nc = guththila_xml_pull_parser_next_char (environment, parser,
-                                                          0);
-        }
-        else
-            guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_STANDALONE_ERROR_YES_OR_NO_NOT_AVAILABLE);
-    }
-    guththila_xml_pull_parser_close_token (environment, parser,
-                                           _attribute_value, 0);
-    nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
-    return guththila_xml_pull_parser_skip_spaces (environment, parser, nc);
+  int quote = 0;
+  int nc = 0;
+  int ic = 0;
+  guththila_xml_pull_parser_open_token (environment, parser);
+  if ('t' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'a' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'n' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'd' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'a' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'l' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'o' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'n' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'e' == guththila_xml_pull_parser_next_char (environment, parser,
+						     0))
+    ic = guththila_xml_pull_parser_next_char (environment, parser, 0);
+  guththila_xml_pull_parser_close_token (environment, parser, _attribute,
+					 0);
+  quote = guththila_xml_pull_parser_process_eq (environment, parser, ic);
+  nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
+  guththila_xml_pull_parser_open_token (environment, parser);
+  while (quote != nc)
+    {
+      if ('y' == nc)
+        {
+	  if ('e' !=
+	      guththila_xml_pull_parser_next_char (environment, parser, 0)
+	      || 's' != guththila_xml_pull_parser_next_char (environment,
+							     parser, 0))
+	    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_STANDALONE_ERROR_IN_YES);
+	  else
+	    nc = guththila_xml_pull_parser_next_char (environment, parser,
+						      0);
+        }
+      else if ('n' == nc)
+        {
+	  if ('o' !=
+	      guththila_xml_pull_parser_next_char (environment, parser, 0))
+	    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_STANDALONE_ERROR_IN_NO);
+	  else
+	    nc = guththila_xml_pull_parser_next_char (environment, parser,
+						      0);
+        }
+      else
+	guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_STANDALONE_ERROR_YES_OR_NO_NOT_AVAILABLE);
+    }
+  guththila_xml_pull_parser_close_token (environment, parser,
+					 _attribute_value, 0);
+  nc = guththila_xml_pull_parser_next_char (environment, parser, 0);
+  return guththila_xml_pull_parser_skip_spaces (environment, parser, nc);
 }
 
 
-int
-guththila_xml_pull_parser_process_xml_decl (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_xml_decl (axis2_env_t *
                                             environment,
                                             guththila_xml_pull_parser_t *
                                             parser)
 {
-    int ix;
-    if ('x' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'm' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && 'l' == guththila_xml_pull_parser_next_char (environment, parser,
-                                                       0))
-    {
-        ix = guththila_xml_pull_parser_process_version_info (environment,
-                                                             parser);
-
-        if ('e' == ix)
-            ix = guththila_xml_pull_parser_process_encoding_decl (environment,
-                                                                  parser);
-
-        if ('s' == ix)
-            ix = guththila_xml_pull_parser_process_sd_decl (environment,
-                                                            parser);
+  int ix;
+  if ('x' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'm' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && 'l' == guththila_xml_pull_parser_next_char (environment, parser,
+						     0))
+    {
+      ix = guththila_xml_pull_parser_process_version_info (environment,
+							   parser);
+
+      if ('e' == ix)
+	ix = guththila_xml_pull_parser_process_encoding_decl (environment,
+							      parser);
+
+      if ('s' == ix)
+	ix = guththila_xml_pull_parser_process_sd_decl (environment,
+							parser);
 
-        if ('?' == ix)
+      if ('?' == ix)
         {
-            if ('>' !=
-                guththila_xml_pull_parser_next_char (environment, parser, 0))
-                guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_MISSING_GREATER_SIGN_IN_XML_DECLARATION);
-            else
-                parser->guththila_event = GUTHTHILA_START_DOCUMENT;
+	  if ('>' !=
+	      guththila_xml_pull_parser_next_char (environment, parser, 0))
+	    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_MISSING_GREATER_SIGN_IN_XML_DECLARATION);
+	  else
+	    parser->guththila_event = GUTHTHILA_START_DOCUMENT;
         }
     }
-    else
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_INCORRECT_XML_DECLARATION);
-    return 0;
+  else
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_INCORRECT_XML_DECLARATION);
+  return 0;
 }
 
 
-void
-guththila_xml_pull_parser_reset (guththila_environment_t * environment,
+AXIS2_EXTERN void
+guththila_xml_pull_parser_reset (axis2_env_t * environment,
                                  guththila_xml_pull_parser_t * parser)
 {
-    parser->offset = parser->_next;
-    parser->name = NULL;
-    parser->prefix = NULL;
-    parser->value = NULL;
-    guththila_stack_clear (environment, parser->attrib);
-    guththila_stack_clear (environment, parser->stack);
-    if (parser->guththila_event == GUTHTHILA_END_ELEMENT
-        || parser->guththila_event == GUTHTHILA_EMPTY_ELEMENT)
-        guththila_xml_pull_parser_close_element (environment, parser);
+  parser->offset = parser->_next;
+  parser->name = NULL;
+  parser->prefix = NULL;
+  parser->value = NULL;
+/*   guththila_stack_clear (environment, parser->attrib); */
+/*   guththila_stack_clear (environment, parser->stack); */
+  if (parser->guththila_event == GUTHTHILA_END_ELEMENT
+      || parser->guththila_event == GUTHTHILA_EMPTY_ELEMENT)
+    guththila_xml_pull_parser_close_element (environment, parser);
 }
 
 
-int
-guththila_xml_pull_parser_is_space (guththila_environment_t * environment,
+AXIS2_EXTERN int
+guththila_xml_pull_parser_is_space (axis2_env_t * environment,
                                     int c)
 {
-    if (0x20 == c || 0xD == c || 0xA == c || 0x9 == c)
-        return 1;
-    else
-        return 0;
+  if (0x20 == c || 0xD == c || 0xA == c || 0x9 == c)
+    return 1;
+  else
+    return 0;
 }
 
 
-int
-guththila_xml_pull_parser_is_valid_starting_char (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_is_valid_starting_char (axis2_env_t *
                                                   environment,
                                                   guththila_xml_pull_parser_t
                                                   * parser, int c)
 {
-    if (isalpha (c) || '_' == c || ':' == c)
-        return 1;
-    else
-        return 0;
+  if (isalpha (c) || '_' == c || ':' == c)
+    return 1;
+  else
+    return 0;
 }
 
 
-int
-guththila_xml_pull_parser_process_name (guththila_environment_t * environment,
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_name (axis2_env_t * environment,
                                         guththila_xml_pull_parser_t * parser)
 {
-    int c;
-    guththila_char_t *x;
-    x = guththila_xml_pull_parser_last_char (environment, parser);
-    if (!guththila_xml_pull_parser_is_valid_starting_char
-        (environment, parser, x[0]))
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_INVALID_NAME_STARTING_CHARACTER);
+  int c;
+  guththila_char_t *x;
+  x = guththila_xml_pull_parser_last_char (environment, parser);
+  if (!guththila_xml_pull_parser_is_valid_starting_char
+      (environment, parser, x[0]))
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_INVALID_NAME_STARTING_CHARACTER);
 
-    guththila_xml_pull_parser_open_token (environment, parser);
-    c = guththila_xml_pull_parser_next_char (environment, parser, 0);
-    while (!
-           (guththila_xml_pull_parser_is_space (environment, c) || '/' == c
-            || '=' == c || '?' == c || '>' == c))
+  guththila_xml_pull_parser_open_token (environment, parser);
+  c = guththila_xml_pull_parser_next_char (environment, parser, 0);
+  while (!
+	 (guththila_xml_pull_parser_is_space (environment, c) || '/' == c
+	  || '=' == c || '?' == c || '>' == c))
     {
-        if (':' == c)
+      if (':' == c)
         {
-            guththila_xml_pull_parser_close_token (environment, parser,
-                                                   _prefix, 0);
-            c = guththila_xml_pull_parser_next_char (environment, parser, 0);
-            guththila_xml_pull_parser_open_token (environment, parser);
+	  guththila_xml_pull_parser_close_token (environment, parser,
+						 _prefix, 0);
+	  c = guththila_xml_pull_parser_next_char (environment, parser, 0);
+	  guththila_xml_pull_parser_open_token (environment, parser);
         }
-        else
-            c = guththila_xml_pull_parser_next_char (environment, parser, 0);
+      else
+	c = guththila_xml_pull_parser_next_char (environment, parser, 0);
     }
-    guththila_xml_pull_parser_close_token (environment, parser, _name, 0);
+  guththila_xml_pull_parser_close_token (environment, parser, _name, 0);
 
-    return c;
+  return c;
 }
 
 
-int
-guththila_xml_pull_parser_process_attribute_value (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_attribute_value (axis2_env_t *
                                                    environment,
                                                    guththila_xml_pull_parser_t
                                                    * parser, int quote)
 {
-    int c = 0;
-    if ('\'' == quote || '\"' == quote)
+  int c = 0;
+  if ('\'' == quote || '\"' == quote)
     {
-        c = guththila_xml_pull_parser_next_char (environment, parser, 0);
-        guththila_xml_pull_parser_open_token (environment, parser);
-        do
+      c = guththila_xml_pull_parser_next_char (environment, parser, 0);
+      guththila_xml_pull_parser_open_token (environment, parser);
+      do
         {
-            c = guththila_xml_pull_parser_next_char (environment, parser, 0);
-            if (quote == c)
+	  c = guththila_xml_pull_parser_next_char (environment, parser, 0);
+	  if (quote == c)
             {
-                guththila_xml_pull_parser_close_token (environment, parser,
-                                                       _attribute_value, 0);
-                return guththila_xml_pull_parser_next_char (environment,
-                                                            parser, 0);
+	      guththila_xml_pull_parser_close_token (environment, parser,
+						     _attribute_value, 0);
+	      return guththila_xml_pull_parser_next_char (environment,
+							  parser, 0);
             }
         }
-        while ('<' != c || '&' != c);
+      while ('<' != c || '&' != c);
     }
-    else
-        guththila_xml_pull_parser_exception (p_FILE, LINE,  GUTHTHILA_ERROR_QUOTES_NOT_FOUND_BEFORE_ATTRIBUTE_VALUE );
-    return c;
+  else
+    guththila_xml_pull_parser_exception (p_FILE, LINE,  GUTHTHILA_ERROR_QUOTES_NOT_FOUND_BEFORE_ATTRIBUTE_VALUE );
+  return c;
 }
 
 
-int
-guththila_xml_pull_parser_process_attribute (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_attribute (axis2_env_t *
                                              environment,
                                              guththila_xml_pull_parser_t *
                                              parser, int c)
 {
-    int q;
-    q = guththila_xml_pull_parser_skip_spaces (environment, parser, c);
-    q = guththila_xml_pull_parser_process_name (environment, parser);
-    q = guththila_xml_pull_parser_process_eq (environment, parser, q);
-    q = guththila_xml_pull_parser_process_attribute_value (environment,
-                                                           parser, q);
-    return q;
+  int q;
+  q = guththila_xml_pull_parser_skip_spaces (environment, parser, c);
+  q = guththila_xml_pull_parser_process_name (environment, parser);
+  q = guththila_xml_pull_parser_process_eq (environment, parser, q);
+  q = guththila_xml_pull_parser_process_attribute_value (environment,
+							 parser, q);
+  return q;
 }
 
 
-int
-guththila_xml_pull_parser_processSTagOrEmptyElem (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_processSTagOrEmptyElem (axis2_env_t *
                                                   environment,
                                                   guththila_xml_pull_parser_t
                                                   * parser)
 {
-    int c;
-    c = guththila_xml_pull_parser_process_name (environment, parser);
-    c = guththila_xml_pull_parser_skip_spaces (environment, parser, c);
-    parser->guththila_event = GUTHTHILA_START_ELEMENT;
-    for (;;)
+  int c;
+  c = guththila_xml_pull_parser_process_name (environment, parser);
+  c = guththila_xml_pull_parser_skip_spaces (environment, parser, c);
+  parser->guththila_event = GUTHTHILA_START_ELEMENT;
+  for (;;)
     {
-        if ('/' == c)
+      if ('/' == c)
         {
-            parser->guththila_event = GUTHTHILA_EMPTY_ELEMENT;
-            if ('>' ==
-                guththila_xml_pull_parser_next_char (environment, parser, 0))
-                return c;
-            else
-                guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_EMPTY_ELEMENT_NOT_CLOSED);
+	  parser->guththila_event = GUTHTHILA_EMPTY_ELEMENT;
+	  if ('>' ==
+	      guththila_xml_pull_parser_next_char (environment, parser, 0))
+	    return c;
+	  else
+	    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_EMPTY_ELEMENT_NOT_CLOSED);
         }
-        else if ('>' == c)
-            return c;
-        else
+      else if ('>' == c)
+	return c;
+      else
         {
-            c = guththila_xml_pull_parser_process_attribute (environment,
-                                                             parser, c);
-            c = guththila_xml_pull_parser_skip_spaces (environment, parser,
-                                                       c);
+	  c = guththila_xml_pull_parser_process_attribute (environment,
+							   parser, c);
+	  c = guththila_xml_pull_parser_skip_spaces (environment, parser,
+						     c);
         }
     }
 }
 
 
-int
-guththila_xml_pull_parser_process_char_data (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_char_data (axis2_env_t *
                                              environment,
                                              guththila_xml_pull_parser_t *
                                              parser)
 {
-    int c;
-    int ref = 0;
-    /*     int all_spaces = 1; */
-    /*  int last_event = parser->guththila_event; */
-    parser->guththila_event = GUTHTHILA_CHARACTER;
-    guththila_xml_pull_parser_open_token (environment, parser);
-    do
-    {
-        c = guththila_xml_pull_parser_next_char (environment, parser, -1);
+  int c;
+  int ref = 0;
+  /*     int all_spaces = 1; */
+  /*  int last_event = parser->guththila_event; */
+  parser->guththila_event = GUTHTHILA_CHARACTER;
+  guththila_xml_pull_parser_open_token (environment, parser);
+  do
+    {
+      c = guththila_xml_pull_parser_next_char (environment, parser, -1);
 
-        /* if (c != '<') */
-   /*             all_spaces = (all_spaces && guththila_is_space (c)); */
+      /* if (c != '<') */
+      /*             all_spaces = (all_spaces && guththila_is_space (c)); */
 
-        if (c == '&')
-            ref = 1;
+      if (c == '&')
+	ref = 1;
 
-        if (c == -1)
+      if (c == -1)
         {
-            guththila_xml_pull_parser_close_token (environment, parser,
-                                                   _char_data, ref);
-            return 0;
+	  guththila_xml_pull_parser_close_token (environment, parser,
+						 _char_data, ref);
+	  return 0;
         }
     }
-    while (c != '<');
+  while (c != '<');
 
-
+  
     /*  if (all_spaces) */
     /*         parser->guththila_event = GUTHTHILA_SPACE; */
     guththila_xml_pull_parser_close_token (environment, parser, _char_data,
@@ -672,406 +671,404 @@
 }
 
 
-int
-guththila_xml_pull_parser_process_end_tag (guththila_environment_t *
-                                             environment,
-                                             guththila_xml_pull_parser_t *
-                                             parser)
-{
-    int c;
-    c = guththila_xml_pull_parser_next_char (environment, parser, 0);
-    c = guththila_xml_pull_parser_process_name (environment, parser);
-    c = guththila_xml_pull_parser_skip_spaces (environment, parser, c);
-    if ('>' == c)
-        parser->guththila_event = GUTHTHILA_END_ELEMENT;
-    else
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_END_TAG_NOT_CLOSED);
-    return c;
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_end_tag (axis2_env_t *
+					   environment,
+					   guththila_xml_pull_parser_t *
+					   parser)
+{
+  int c;
+  c = guththila_xml_pull_parser_next_char (environment, parser, 0);
+  c = guththila_xml_pull_parser_process_name (environment, parser);
+  c = guththila_xml_pull_parser_skip_spaces (environment, parser, c);
+  if ('>' == c)
+    parser->guththila_event = GUTHTHILA_END_ELEMENT;
+  else
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_END_TAG_NOT_CLOSED);
+  return c;
 }
 
 
-int
-guththila_xml_pull_parser_process_pi (guththila_environment_t * environment,
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_pi (axis2_env_t * environment,
                                       guththila_xml_pull_parser_t * parser)
 {
-    int c;
-    parser->guththila_event = GUTHTHILA_COMMENT;
+  int c;
+  parser->guththila_event = GUTHTHILA_COMMENT;
+  c = guththila_xml_pull_parser_next_char (environment, parser, 0);
+  while ('<' != c)
     c = guththila_xml_pull_parser_next_char (environment, parser, 0);
-    while ('<' != c)
-        c = guththila_xml_pull_parser_next_char (environment, parser, 0);
-    return c;
+  return c;
 }
 
 
-int
-guththila_xml_pull_parser_process_comment (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_process_comment (axis2_env_t *
                                            environment,
                                            guththila_xml_pull_parser_t *
                                            parser)
 {
-    int c;
-    if ('-' == guththila_xml_pull_parser_next_char (environment, parser, 0)
-        && '-' == guththila_xml_pull_parser_next_char (environment, parser,
-                                                       0))
+  int c;
+  if ('-' == guththila_xml_pull_parser_next_char (environment, parser, 0)
+      && '-' == guththila_xml_pull_parser_next_char (environment, parser,
+						     0))
     {
-        c = guththila_xml_pull_parser_next_char (environment, parser, 0);
-        while (1)
+      c = guththila_xml_pull_parser_next_char (environment, parser, 0);
+      while (1)
         {
-            c = guththila_xml_pull_parser_next_char (environment, parser, 0);
-            if ('-' == c)
+	  c = guththila_xml_pull_parser_next_char (environment, parser, 0);
+	  if ('-' == c)
             {
-                c = guththila_xml_pull_parser_next_char (environment, parser,
-                                                         0);
-                if ('-' == c)
+	      c = guththila_xml_pull_parser_next_char (environment, parser,
+						       0);
+	      if ('-' == c)
                 {
-                    if ('>' ==
-                        guththila_xml_pull_parser_next_char (environment,
-                                                             parser, 0))
+		  if ('>' ==
+		      guththila_xml_pull_parser_next_char (environment,
+							   parser, 0))
                     {
-                        parser->guththila_event = GUTHTHILA_COMMENT;
-                        while ('<' != c)
+		      parser->guththila_event = GUTHTHILA_COMMENT;
+		      while ('<' != c)
                         {
-                            c = guththila_xml_pull_parser_next_char
-                                (environment, parser, -1);
-                            if (c == -1)
-                                return c;
+			  c = guththila_xml_pull_parser_next_char
+			    (environment, parser, -1);
+			  if (c == -1)
+			    return c;
                         }
-                        return c;
+		      return c;
                     }
-                    else
-                        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_MORE_HYPENS_OCCURED_IN_COMMENT);
+		  else
+		    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_MORE_HYPENS_OCCURED_IN_COMMENT);
                 }
             }
         }
     }
-    else
+  else
     {
-        c = guththila_xml_pull_parser_next_char (environment, parser, 0);
-        while ('<' != c)
-            c = guththila_xml_pull_parser_next_char (environment, parser, -1);
+      c = guththila_xml_pull_parser_next_char (environment, parser, 0);
+      while ('<' != c)
+	c = guththila_xml_pull_parser_next_char (environment, parser, -1);
     }
-    return 0;
+  return 0;
 }
 
 
-int
-guththila_xml_pull_parser_tokenize (guththila_environment_t * environment,
+AXIS2_EXTERN int
+guththila_xml_pull_parser_tokenize (axis2_env_t * environment,
                                     guththila_xml_pull_parser_t * parser)
 {
-    do
+  do
     {
-        int c;
-        c = guththila_xml_pull_parser_next_char (environment, parser, -1);
-        if (c == -1)
-            return -1;
+      int c;
+      c = guththila_xml_pull_parser_next_char (environment, parser, -1);
+      if (c == -1)
+	return -1;
 
-        switch (parser->status)
+      switch (parser->status)
         {
         case S_1:
-            while (isspace(c))
+	  while (isspace(c))
             {
-               c = guththila_xml_pull_parser_next_char (environment, parser, -1);
-               if (c == -1)
-                   return -1;
-            }
+	      c = guththila_xml_pull_parser_next_char (environment, parser, -1);
+		if (c == -1)
+		  return -1;
+		  }
 
             if ('<' == c)
-                parser->status = S_2;
+	      parser->status = S_2;
             else
-                parser->status = S_0;
+	      parser->status = S_0;
             break;
         case S_2:
-            {
-                if ('?' == c)
-                {
-                    guththila_xml_pull_parser_process_xml_decl (environment,
-                                                                parser);
-                    parser->status = S_3;
-                }
-                else if ('!' == c)
-                {
-                    guththila_xml_pull_parser_process_comment (environment,
-                                                               parser);
-                    parser->status = S_4;
-                }
-                else
-                {
-                    guththila_xml_pull_parser_processSTagOrEmptyElem
-                        (environment, parser);
-                    parser->status = S_3;
-                }
-            }
-            break;
+	  {
+	    if ('?' == c)
+	      {
+		guththila_xml_pull_parser_process_xml_decl (environment,
+							    parser);
+		parser->status = S_3;
+	      }
+	    else if ('!' == c)
+	      {
+		guththila_xml_pull_parser_process_comment (environment,
+							   parser);
+		parser->status = S_4;
+	      }
+	    else
+	      {
+		guththila_xml_pull_parser_processSTagOrEmptyElem
+		  (environment, parser);
+		parser->status = S_3;
+	      }
+	  }
+	  break;
         case S_3:
-            if ('<' == c)
-                parser->status = S_4;
-            else
+	  if ('<' == c)
+	    parser->status = S_4;
+	  else
             {
-                c = guththila_xml_pull_parser_process_char_data (environment,
-                                                                 parser);
-                if ('<' == c)
+	      c = guththila_xml_pull_parser_process_char_data (environment,
+							       parser);
+	      if ('<' == c)
                 {
-                    parser->status = S_4;
-                    return parser->guththila_event;
+		  parser->status = S_4;
+		  return parser->guththila_event;
                 }
-                else if ('\0' == c)
-                    parser->status = S_3;
-                else
-                    parser->status = S_0;
+	      else if ('\0' == c)
+		parser->status = S_3;
+	      else
+		parser->status = S_0;
             }
-            break;
+	  break;
         case S_4:
-            if ('/' == c)
+	  if ('/' == c)
             {
-                guththila_xml_pull_parser_process_end_tag (environment,
-                                                             parser);
-                parser->status = S_3;
+	      guththila_xml_pull_parser_process_end_tag (environment,
+							 parser);
+	      parser->status = S_3;
             }
-            else if ('?' == c)
-                guththila_xml_pull_parser_process_pi (environment, parser);
-            else if ('!' == c)
-                guththila_xml_pull_parser_process_comment (environment,
-                                                           parser);
-            else
+	  else if ('?' == c)
+	    guththila_xml_pull_parser_process_pi (environment, parser);
+	  else if ('!' == c)
+	    guththila_xml_pull_parser_process_comment (environment,
+						       parser);
+	  else
             {
-                guththila_xml_pull_parser_processSTagOrEmptyElem (environment,
-                                                                  parser);
-                parser->status = S_3;
+	      guththila_xml_pull_parser_processSTagOrEmptyElem (environment,
+								parser);
+	      parser->status = S_3;
             }
-            break;
+	  break;
         case S_0:
-            guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_TOKENIZE_ERROR);
+	  guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_TOKENIZE_ERROR);
         }
     }
-    while (parser->status != S_3);
-    return parser->guththila_event;
+  while (parser->status != S_3);
+  return parser->guththila_event;
 }
 
 
-GUTHTHILA_DECLARE (int)
-guththila_xml_pull_parser_next (guththila_environment_t * environment,
+AXIS2_EXTERN int
+guththila_xml_pull_parser_next (axis2_env_t * environment,
                                 guththila_xml_pull_parser_t * parser)
 {
-    int ix;
-    guththila_xml_pull_parser_reset (environment, parser);
-    ix = guththila_xml_pull_parser_tokenize (environment, parser);
-    switch (ix)
+  int ix;
+  guththila_xml_pull_parser_reset (environment, parser);
+  ix = guththila_xml_pull_parser_tokenize (environment, parser);
+  switch (ix)
     {
     case -1:
-        return -1;
+      return -1;
 
     case GUTHTHILA_START_DOCUMENT:
-        {
-            int ix;
-            guththila_element_t *e;
-            guththila_token_t *att_name;
-            guththila_token_t *att_value;
-            ix = guththila_stack_size (environment, parser->stack);
-            for (; ix > 0; ix--)
-            {
-                e = guththila_stack_pull (environment, parser->stack);
-                if (e->token->type == _attribute_value)
-                {
-                    att_value = e->token;
-                    e = guththila_stack_pull (environment, parser->stack);
-                    ix--;
-                    att_name = e->token;
-                    guththila_xml_pull_parser_add_attribute (environment,
-                                                             parser, att_name,
-                                                             att_value);
-                }
-            }
-        }
-        break;
+      {
+	int ix;
+	guththila_token_t *token;
+	guththila_token_t *att_name;
+	guththila_token_t *att_value;
+	ix = AXIS2_STACK_SIZE (parser->stack, environment);
+	for (; ix > 0; ix--)
+	  {
+	    token = (guththila_token_t *)AXIS2_STACK_POP (parser->stack, environment);
+	    if (token->type == _attribute_value)
+	      {
+		att_value = token;
+	    token = (guththila_token_t *)AXIS2_STACK_POP (parser->stack, environment);
+	    ix--;
+		att_name = token;
+		guththila_xml_pull_parser_add_attribute (environment,
+							 parser, att_name,
+							 att_value);
+	      }
+	  }
+      }
+      break;
     case GUTHTHILA_START_ELEMENT:
     case GUTHTHILA_EMPTY_ELEMENT:
-        {
-            int is = 0;
-            guththila_element_t *e;
-            guththila_token_t *name = NULL;
-            guththila_token_t *value = NULL;
-            is = guththila_stack_size (environment, parser->stack);
-            for (;
-                 is > 0 && guththila_stack_size (environment, parser->stack);
-                 is--)
-            {
-                e = guththila_stack_pull (environment, parser->stack);
-                /* be careful about memory leaks, when we pull it we get
-                   seperate _element need to free it properly */
-                if (e->token->type == _attribute_value)
-                {
-                    value = e->token;
-                    e = guththila_stack_pull (environment, parser->stack);
-                    is--;
-                    name = e->token;
-                    if (!guththila_token_compare
-                        (environment, e->token, "xmlns", 5,
-                         parser->unicode_state))
-                        guththila_xml_pull_parser_add_namespace (environment,
-                                                                 parser, name,
-                                                                 value);
-                    else
-                        guththila_xml_pull_parser_add_attribute (environment,
-                                                                 parser, name,
-                                                                 value);
-                }
-                else if (e->token->type == _name)
-                {
-                    name = e->token;
-                    parser->name = name;
-                    parser->prefix = NULL;
-
-                }
-                else if (e->token->type == _prefix)
-                {
-                    guththila_element_t *ex;
-                    if (!guththila_token_compare
-                        (environment, e->token, "xmlns", 5,
-                         parser->unicode_state))
-                    {
-                        ex = guththila_stack_pull (environment,
-                                                   parser->attrib);
-                        guththila_xml_pull_parser_add_namespace (environment,
-                                                                 parser,
-                                                                 ex->
-                                                                 attribute->
-                                                                 name,
-                                                                 ex->
-                                                                 attribute->
-                                                                 value);
-                    }
-                    else
-                    {
-                        if (parser->name)
-                            parser->prefix = e->token;
-                        else
-                        {
-                            ex = guththila_stack_pull (environment,
-                                                       parser->attrib);
-                            guththila_xml_pull_parser_add_attribute_with_prefix
-                                (environment, parser, e->token,
-                                 ex->attribute->name, ex->attribute->value);
-                        }
-                    }
-                }
-                else
-                    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_INVALID_TOKEN_TYPE);
-            }
-            guththila_xml_pull_parser_open_element (environment, parser);
-        }
-        break;
+      {
+	int is = 0;
+	guththila_token_t *token;
+	guththila_token_t *name = NULL;
+	guththila_token_t *value = NULL;
+	is = AXIS2_STACK_SIZE (parser->stack, environment);
+	for (;
+	     is > 0 && 	AXIS2_STACK_SIZE (parser->stack, environment);
+	     is--)
+	  {
+	    token = (guththila_token_t *) AXIS2_STACK_POP (parser->stack, environment);
+	    /* be careful about memory leaks, when we pull it we get
+	       seperate _element need to free it properly */
+	    if (token->type == _attribute_value)
+	      {
+		value = token;
+		token = (guththila_token_t *) AXIS2_STACK_POP (parser->stack, environment);
+		is--;
+		name = token;
+		if (!guththila_token_compare
+		    (environment, token, "xmlns", 5,
+		     parser->unicode_state))
+		  guththila_xml_pull_parser_add_namespace (environment,
+							   parser, name,
+							   value);
+		else
+		  guththila_xml_pull_parser_add_attribute (environment,
+							   parser, name,
+							   value);
+	      }
+	    else if (token->type == _name)
+	      {
+		name = token;
+		parser->name = name;
+		parser->prefix = NULL;
+
+	      }
+	    else if (token->type == _prefix)
+	      {
+		guththila_attribute_t *attribute;
+		if (!guththila_token_compare
+		    (environment, token, "xmlns", 5,
+		     parser->unicode_state))
+		  {
+		    attribute = (guththila_attribute_t *) AXIS2_STACK_POP ( parser->attrib, environment);
+		    guththila_xml_pull_parser_add_namespace (environment,
+							     parser,
+							     attribute->
+							     name,
+							     attribute->
+							     value);
+		  }
+		else
+		  {
+		    if (parser->name)
+		      parser->prefix = token;
+		    else
+		      {
+			attribute = (guththila_attribute_t *) AXIS2_STACK_POP ( parser->attrib, environment);
+			guththila_xml_pull_parser_add_attribute_with_prefix
+			  (environment, parser, token,
+			   attribute->name, attribute->value);
+		      }
+		  }
+	      }
+	    else
+	      guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_INVALID_TOKEN_TYPE);
+	  }
+	guththila_xml_pull_parser_open_element (environment, parser);
+      }
+      break;
     case GUTHTHILA_END_ELEMENT:
-        {
-            guththila_element_t *e;
-            e = guththila_stack_pull (environment, parser->stack);
-            if (e->token->type == _name)
-                parser->name = e->token;
-            e = guththila_stack_pull (environment, parser->stack);
-            if (e->token->type == _prefix)
-                parser->prefix = e->token;
-        }
-        break;
+      {
+	guththila_token_t *token;
+	token = (guththila_token_t *) AXIS2_STACK_POP (parser->stack, environment);
+	if (token->type == _name)
+	  parser->name = token;
+
+	if (AXIS2_STACK_SIZE (parser->stack, environment))
+	  {
+	    token = (guththila_token_t *) AXIS2_STACK_POP (parser->stack, environment);
+	    if (token->type == _prefix)
+	      parser->prefix = token;
+	  }
+      }
+      break;
     case GUTHTHILA_CHARACTER:
-        {
-            guththila_element_t *e;
-            e = guththila_stack_pull (environment, parser->stack);
-            parser->value = e->token;
-        }
-        break;
+      {
+	guththila_token_t *token;
+	token = (guththila_token_t *) AXIS2_STACK_POP (parser->stack, environment);
+	parser->value = token;
+      }
+      break;
     case GUTHTHILA_ENTITY_REFERANCE:
-        break;
+      break;
     case GUTHTHILA_COMMENT:
-        break;
+      break;
 
     };
-    return parser->guththila_event;
+  return parser->guththila_event;
 }
 
 
-void
-guththila_xml_pull_parser_open_element (guththila_environment_t * environment,
+AXIS2_EXTERN void
+guththila_xml_pull_parser_open_element (axis2_env_t * environment,
                                         guththila_xml_pull_parser_t * parser)
 {
-    int ii;
-    guththila_depth_t *m =
-        (guththila_depth_t *) GUTHTHILA_MALLOC (environment->allocator,
-                                                sizeof (guththila_depth_t));
-    guththila_depth_t *l = NULL;
-    guththila_element_t *e;
-    ii = guththila_stack_size (environment, parser->dep);
-    if (!ii)
-    {
-        m->first = 0;
-        m->total = guththila_stack_size (environment, parser->namesp);
-        m->count = m->total;
-        guththila_stack_push_depth (environment, parser->dep, m);
-    }
-    else
-    {
-        e = guththila_stack_pull_current (environment, parser->dep);
-        l = e->depth;
-        m->first = l->first + l->count;
-        m->total = guththila_stack_size (environment, parser->namesp);
-        m->count = m->total - l->total;
-        guththila_stack_push_depth (environment, parser->dep, m);
+  int ii;
+  guththila_depth_t *m =
+    (guththila_depth_t *) AXIS2_MALLOC (environment->allocator,
+					sizeof (guththila_depth_t));
+  guththila_depth_t *l = NULL;
+  guththila_depth_t *depth;
+  ii = AXIS2_STACK_SIZE (parser->dep, environment);
+  if (!ii)
+    {
+      m->first = 0;
+      m->total = AXIS2_STACK_SIZE (parser->dep, environment);
+      m->count = m->total;
+/*       guththila_stack_push_depth (environment, parser->dep, m); */
+      AXIS2_STACK_PUSH (parser->dep, environment, m);
+    }
+  else
+    {
+      depth = (guththila_depth_t *) AXIS2_STACK_GET (parser->dep, environment);
+      l = depth;
+      m->first = l->first + l->count;
+      m->total = AXIS2_STACK_SIZE (parser->namesp, environment);
+      m->count = m->total - l->total;
+      AXIS2_STACK_PUSH (parser->dep, environment, m);
     }
 }
 
 
-void
-guththila_xml_pull_parser_close_element (guththila_environment_t *
+AXIS2_EXTERN void
+guththila_xml_pull_parser_close_element (axis2_env_t *
                                          environment,
                                          guththila_xml_pull_parser_t * parser)
 {
-    guththila_element_t *d;
-    guththila_element_t *e;
-    int ii;
-    d = guththila_stack_pull (environment, parser->dep);
-    ii = d->depth->count;
-    for (; ii > 0; ii--)
+  guththila_depth_t *depth;
+  guththila_namespace_t *namespace;
+  int ii;
+  depth = (guththila_depth_t *) AXIS2_STACK_POP (parser->dep, environment);
+  ii = depth->count;
+  for (; ii > 0; ii--)
     {
-        e = guththila_stack_pull (environment, parser->namesp);
-        if (e->_namespace->name)
+      namespace = (guththila_namespace_t *) AXIS2_STACK_POP (parser->namesp, environment);
+      if (namespace->name)
         {
-            free (e->_namespace->name);
-            e->_namespace->name = NULL;
+	  AXIS2_FREE (environment->allocator, namespace->name);
+	  namespace->name = NULL;
         }
-        if (e->_namespace->uri)
+      if (namespace->uri)
         {
-            free (e->_namespace->uri);
-            e->_namespace->uri = NULL;
-        }
-        if (e)
-        {
-            free (e);
-            e = NULL;
+	  AXIS2_FREE (environment->allocator, namespace->uri);
+	  namespace->uri = NULL;
         }
+      
     }
 
 }
 
 
-void
-guththila_xml_pull_parser_add_attribute (guththila_environment_t *
+AXIS2_EXTERN void
+guththila_xml_pull_parser_add_attribute (axis2_env_t *
                                          environment,
                                          guththila_xml_pull_parser_t * parser,
                                          guththila_token_t * name,
                                          guththila_token_t * value)
 {
-    guththila_attribute_t *att;
-    att =
-        (guththila_attribute_t *) GUTHTHILA_MALLOC (environment->allocator,
-                                                    sizeof
-                                                    (guththila_attribute_t));
-    att->name = name;
-    att->value = value;
-    att->prefix = NULL;
-    guththila_stack_push (environment, parser->attrib, NULL, att);
+  guththila_attribute_t *att;
+  att =
+    (guththila_attribute_t *) AXIS2_MALLOC (environment->allocator,
+					    sizeof
+					    (guththila_attribute_t));
+  att->name = name;
+  att->value = value;
+  att->prefix = NULL;
+/*   guththila_stack_push (environment, parser->attrib, NULL, att); */
+  AXIS2_STACK_PUSH (parser->attrib, environment, att);
 }
 
 
-void
-guththila_xml_pull_parser_add_attribute_with_prefix (guththila_environment_t *
+AXIS2_EXTERN void
+guththila_xml_pull_parser_add_attribute_with_prefix (axis2_env_t *
                                                      environment,
                                                      guththila_xml_pull_parser_t
                                                      * parser,
@@ -1081,350 +1078,333 @@
                                                      guththila_token_t *
                                                      value)
 {
-    guththila_attribute_t *att;
-    att =
-        (guththila_attribute_t *) GUTHTHILA_MALLOC (environment->allocator,
-                                                    sizeof
-                                                    (guththila_attribute_t));
-    att->name = name;
-    att->value = value;
-    att->prefix = prefix;
-    guththila_stack_push (environment, parser->attrib, NULL, att);
-    /* _element can keep , tokens and attributes here token set to null */
+  guththila_attribute_t *att;
+  att =
+    (guththila_attribute_t *) AXIS2_MALLOC (environment->allocator,
+					    sizeof
+					    (guththila_attribute_t));
+  att->name = name;
+  att->value = value;
+  att->prefix = prefix;
+  AXIS2_STACK_PUSH (parser->attrib, environment, att);
+/*   guththila_stack_push (environment, parser->attrib, NULL, att); */
+  /* _element can keep , tokens and attributes here token set to null */
 }
 
 
-void
-guththila_xml_pull_parser_add_namespace (guththila_environment_t *
+AXIS2_EXTERN void
+guththila_xml_pull_parser_add_namespace (axis2_env_t *
                                          environment,
                                          guththila_xml_pull_parser_t * parser,
                                          guththila_token_t * name,
                                          guththila_token_t * uri)
 {
-    guththila_namespace_t *ns;
-    ns = (guththila_namespace_t *) GUTHTHILA_MALLOC (environment->allocator,
-                                                     sizeof
-                                                     (guththila_namespace_t));
-    ns->name =
-        guththila_token_to_string (environment, name, parser->unicode_state);
-    ns->length = GUTHTHILA_STRLEN ( ns->name);
-    ns->uri =
-        guththila_token_to_string (environment, uri, parser->unicode_state);
-    ns->lengthuri = GUTHTHILA_STRLEN ( ns->uri);
-    guththila_stack_push_namespace (environment, parser->namesp, ns);
+  guththila_namespace_t *ns;
+  ns = (guththila_namespace_t *) AXIS2_MALLOC (environment->allocator,
+					       sizeof
+					       (guththila_namespace_t));
+  ns->name =
+    guththila_token_to_string (environment, name, parser->unicode_state);
+  ns->length = AXIS2_STRLEN ( ns->name);
+  ns->uri =
+    guththila_token_to_string (environment, uri, parser->unicode_state);
+  ns->lengthuri = AXIS2_STRLEN ( ns->uri);
+  AXIS2_STACK_PUSH (parser->namesp, environment, ns);
+/*   guththila_stack_push_namespace (environment, parser->namesp, ns); */
 }
 
 
-GUTHTHILA_DECLARE (int)
-guththila_xml_pull_parser_get_attribute_count (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_get_attribute_count (axis2_env_t *
                                                environment,
                                                guththila_xml_pull_parser_t *
                                                parser)
 {
-    return guththila_stack_size (environment, parser->attrib);
+  return AXIS2_STACK_SIZE (parser->attrib, environment);
 }
 
 
-GUTHTHILA_DECLARE (guththila_attribute_t *)
-guththila_xml_pull_parser_get_attribute (guththila_environment_t *
+AXIS2_EXTERN guththila_attribute_t *
+guththila_xml_pull_parser_get_attribute (axis2_env_t *
                                          environment,
                                          guththila_xml_pull_parser_t * parser)
 {
-    guththila_element_t *e;
-    e = guththila_stack_pull (environment, parser->attrib);
-    if (e->attribute)
-        return e->attribute;
-    else
-        return NULL;
+  guththila_attribute_t *attribute;
+  attribute = (guththila_attribute_t *) AXIS2_STACK_POP (parser->attrib, environment);
+  if (attribute)
+    return attribute;
+  else
+    return NULL;
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_attribute_name (guththila_environment_t *
+AXIS2_EXTERN guththila_char_t *
+guththila_xml_pull_parser_get_attribute_name (axis2_env_t *
                                               environment,
                                               guththila_xml_pull_parser_t *
                                               parser,
                                               guththila_attribute_t * att)
 {
-    if (!att)
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_NULL_ATTRIBUTE_NAME);
-    if (att->name->end)
-        return guththila_token_to_string (environment, att->name,
-                                          parser->unicode_state);
-    return NULL;
+  if (!att)
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_NULL_ATTRIBUTE_NAME);
+  if (att->name->end)
+    return guththila_token_to_string (environment, att->name,
+				      parser->unicode_state);
+  return NULL;
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_attribute_value (guththila_environment_t *
+AXIS2_EXTERN guththila_char_t *
+guththila_xml_pull_parser_get_attribute_value (axis2_env_t *
                                                environment,
                                                guththila_xml_pull_parser_t *
                                                parser,
                                                guththila_attribute_t * att)
 {
-    if (!att)
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_NULL_ATTRIBUTE_VALUE);
-    if (att->value->end)
-        return guththila_token_to_string (environment, att->value,
-                                          parser->unicode_state);
-    return NULL;
+  if (!att)
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_NULL_ATTRIBUTE_VALUE);
+  if (att->value->end)
+    return guththila_token_to_string (environment, att->value,
+				      parser->unicode_state);
+  return NULL;
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_attribute_prefix (guththila_environment_t *
+AXIS2_EXTERN guththila_char_t *
+guththila_xml_pull_parser_get_attribute_prefix (axis2_env_t *
                                                 environment,
                                                 guththila_xml_pull_parser_t *
                                                 parser,
                                                 guththila_attribute_t * att)
 {
-    if (!att)
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_NULL_ATTRIBUTE_PREFIX);
-    if (att->prefix->end)
-        return guththila_token_to_string (environment, att->prefix,
-                                          parser->unicode_state);
-    return NULL;
+  if (!att)
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_NULL_ATTRIBUTE_PREFIX);
+  if (att->prefix->end)
+    return guththila_token_to_string (environment, att->prefix,
+				      parser->unicode_state);
+  return NULL;
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
+AXIS2_EXTERN guththila_char_t *
 guththila_xml_pull_parser_get_attribute_prefix_by_number
-(guththila_environment_t * environment, guththila_xml_pull_parser_t * parser, int i)
+(axis2_env_t * environment, guththila_xml_pull_parser_t * parser, int i)
 {
-    int ix = parser->attrib->pointer;
-    guththila_element_t *e;
-    guththila_attribute_t *att = NULL;
-    if (i > ix)
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE);
-    else
+ /*   int ix = parser->attrib->pointer; */
+  int ix = AXIS2_STACK_SIZE (parser->attrib, environment);
+  guththila_attribute_t *attribute;
+  if (i > ix)
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE);
+  else
     {
-        e = guththila_stack_last (environment, parser->attrib);
-        for (; ix > i; ix--)
-        {
-            if (e->prev)
-                e = e->prev;
-        }
-        if (e->attribute)
-            att = e->attribute;
+/*       e = guththila_stack_last (environment, parser->attrib); */
+      attribute = (guththila_attribute_t *) AXIS2_STACK_GET_AT (parser->attrib, environment, i);
     }
-    return guththila_token_to_string (environment, att->prefix,
-                                      parser->unicode_state);
+  return guththila_token_to_string (environment, attribute->prefix,
+				    parser->unicode_state);
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
+AXIS2_EXTERN guththila_char_t *
 guththila_xml_pull_parser_get_attribute_name_by_number
-(guththila_environment_t * environment, guththila_xml_pull_parser_t * parser, int i)
+(axis2_env_t * environment, guththila_xml_pull_parser_t * parser, int i)
 {
-    int ix = parser->attrib->pointer;
-    guththila_element_t *e;
-    guththila_attribute_t *att = NULL;
-    if (i > ix)
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE);
-    else
+  /* int ix = parser->attrib->pointer; */
+  int ix = AXIS2_STACK_SIZE (parser->attrib, environment);
+  guththila_attribute_t *attribute;
+  if (i > ix)
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE);
+  else
     {
-        e = guththila_stack_last (environment, parser->attrib);
-        for (; ix > i; ix--)
-        {
-            if (e->prev)
-                e = e->prev;
-        }
-        if (e->attribute)
-            att = e->attribute;
+/*       e = guththila_stack_last (environment, parser->attrib); */
+      attribute = (guththila_attribute_t *) AXIS2_STACK_GET_AT (parser->attrib, environment, i);
     }
-    return guththila_token_to_string (environment, att->name,
-                                      parser->unicode_state);
+  return guththila_token_to_string (environment, attribute->name,
+				    parser->unicode_state);
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
+AXIS2_EXTERN guththila_char_t *
 guththila_xml_pull_parser_get_attribute_value_by_number
-(guththila_environment_t * environment, guththila_xml_pull_parser_t * parser, int i)
+(axis2_env_t * environment, guththila_xml_pull_parser_t * parser, int i)
 {
-    int ix = parser->attrib->pointer;
-    guththila_element_t *e;
-    guththila_attribute_t *att = NULL;
-    if (i > ix)
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE);
-    else
+/*   int ix = parser->attrib->pointer; */
+  int ix = AXIS2_STACK_SIZE (parser->attrib, environment);
+  guththila_attribute_t *attribute;
+  if (i > ix)
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE);
+  else
     {
-        e = guththila_stack_last (environment, parser->attrib);
-        for (; ix > i; ix--)
-        {
-            if (e->prev)
-                e = e->prev;
-        }
-        if (e->attribute)
-            att = e->attribute;
+/*       e = guththila_stack_last (environment, parser->attrib); */
+      attribute = (guththila_attribute_t *) AXIS2_STACK_GET_AT (parser->attrib, environment, i);
     }
-    return guththila_token_to_string (environment, att->value,
-                                      parser->unicode_state);
+  return guththila_token_to_string (environment, attribute->value,
+				    parser->unicode_state);
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_name (guththila_environment_t * environment,
+AXIS2_EXTERN guththila_char_t *
+guththila_xml_pull_parser_get_name (axis2_env_t * environment,
                                     guththila_xml_pull_parser_t * parser)
 {
-    if (parser->name->end)
-        return guththila_token_to_string (environment, parser->name,
-                                          parser->unicode_state);
-    return NULL;
+  if (parser->name->end)
+    return guththila_token_to_string (environment, parser->name,
+				      parser->unicode_state);
+  return NULL;
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_value (guththila_environment_t * environment,
+AXIS2_EXTERN guththila_char_t *
+guththila_xml_pull_parser_get_value (axis2_env_t * environment,
                                      guththila_xml_pull_parser_t * parser)
 {
-    if (parser->value->end)
-        return guththila_token_to_string (environment, parser->value,
-                                          parser->unicode_state);
-    else
-      return NULL;
+  if (parser->value->end)
+    return guththila_token_to_string (environment, parser->value,
+				      parser->unicode_state);
+  else
+    return NULL;
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_prefix (guththila_environment_t * environment,
+AXIS2_EXTERN guththila_char_t *
+guththila_xml_pull_parser_get_prefix (axis2_env_t * environment,
                                       guththila_xml_pull_parser_t * parser)
 {
-    if (parser->prefix)
-        return guththila_token_to_string (environment, parser->prefix,
-                                          parser->unicode_state);
-    return NULL;
+  if (parser->prefix)
+    return guththila_token_to_string (environment, parser->prefix,
+				      parser->unicode_state);
+  return NULL;
 }
 
 
-GUTHTHILA_DECLARE (int)
-guththila_xml_pull_parser_get_namespace_count (guththila_environment_t *
+AXIS2_EXTERN int
+guththila_xml_pull_parser_get_namespace_count (axis2_env_t *
                                                environment,
                                                guththila_xml_pull_parser_t *
                                                parser)
 {
-    if (parser->namesp)
-        return guththila_stack_size (environment, parser->namesp);
-    else
-        return 0;
+  if (parser->namesp)
+    return AXIS2_STACK_SIZE (parser->namesp, environment);
+  else
+    return 0;
 }
 
 
-GUTHTHILA_DECLARE (guththila_namespace_t *)
-guththila_xml_pull_parser_get_namespace (guththila_environment_t *
+AXIS2_EXTERN guththila_namespace_t *
+guththila_xml_pull_parser_get_namespace (axis2_env_t *
                                          environment,
                                          guththila_xml_pull_parser_t * parser)
 {
-    guththila_element_t *e;
-    e = guththila_stack_pull_current (environment, parser->namesp);
-    if (e->_namespace)
-        return e->_namespace;
-    else
-        return NULL;
+  guththila_namespace_t *namespace;
+/*   e = guththila_stack_pull_current (environment, parser->namesp); */
+ namespace = (guththila_namespace_t *) AXIS2_STACK_GET (parser->namesp, environment);
+  if (namespace)
+    return namespace;
+  else
+    return NULL;
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_namespace_prefix (guththila_environment_t *
+AXIS2_EXTERN guththila_char_t *
+guththila_xml_pull_parser_get_namespace_prefix (axis2_env_t *
                                                 environment,
                                                 guththila_xml_pull_parser_t *
                                                 parser,
                                                 guththila_namespace_t * ns)
 {
-    if (ns)
-        return GUTHTHILA_STRDUP (environment , ns->name);
-    else
-        return NULL;
+  if (ns)
+    return AXIS2_STRDUP (ns->name, environment);
+  else
+    return NULL;
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_namespace_uri (guththila_environment_t *
+AXIS2_EXTERN guththila_char_t *
+guththila_xml_pull_parser_get_namespace_uri (axis2_env_t *
                                              environment,
                                              guththila_xml_pull_parser_t *
                                              parser,
                                              guththila_namespace_t * ns)
 {
-    if (ns)
-        return GUTHTHILA_STRDUP (environment, ns->uri);
-    else
-        return NULL;
+  if (ns)
+    return AXIS2_STRDUP (ns->uri, environment);
+  else
+    return NULL;
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
+AXIS2_EXTERN guththila_char_t *
 guththila_xml_pull_parser_get_namespace_prefix_by_number
-(guththila_environment_t * environment, guththila_xml_pull_parser_t * parser, int i)
+(axis2_env_t * environment, guththila_xml_pull_parser_t * parser, int i)
 {
-    int ix = parser->namesp->pointer;
-    guththila_element_t *e;
-    guththila_namespace_t *ns = NULL;
-    if (i > ix)
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE);
-    else
+/*   int ix = parser->namesp->pointer; */
+  int ix = AXIS2_STACK_SIZE (parser->namesp, environment);
+  guththila_namespace_t *ns;
+  if (i > ix)
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE);
+  else
     {
-        e = guththila_stack_get (environment, parser->namesp, i);
-        if (e->_namespace)
-            ns = e->_namespace;
+/*       e = guththila_stack_get (environment, parser->namesp, i); */
+      ns = (guththila_namespace_t *) AXIS2_STACK_GET_AT (parser->namesp, environment, i);
     }
-    return GUTHTHILA_STRDUP (environment, ns->name);
+  return AXIS2_STRDUP (ns->name, environment);
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
-guththila_xml_pull_parser_get_namespace_uri_by_number (guththila_environment_t
+AXIS2_EXTERN guththila_char_t *
+guththila_xml_pull_parser_get_namespace_uri_by_number (axis2_env_t
                                                        * environment,
                                                        guththila_xml_pull_parser_t
                                                        * parser, int i)
 {
-    int ix = parser->namesp->pointer;
-    guththila_element_t *e;
-    guththila_namespace_t *ns = NULL;
-    if (i > ix)
-        guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE);
-    else
+/*   int ix = parser->namesp->pointer; */
+  int ix = AXIS2_STACK_SIZE (parser->namesp, environment);
+  guththila_namespace_t *ns = NULL;
+  if (i > ix)
+    guththila_xml_pull_parser_exception (p_FILE, LINE, GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE);
+  else
     {
-        e = guththila_stack_get (environment, parser->namesp, i);
-        if (e->_namespace)
-            ns = e->_namespace;
+/*       e = guththila_stack_get (environment, parser->namesp, i); */
+      ns = (guththila_namespace_t *) AXIS2_STACK_GET_AT (parser->namesp, environment, i);
     }
-    return GUTHTHILA_STRDUP (environment , ns->uri);
+  return AXIS2_STRDUP (ns->uri, environment);
 }
 
 
-GUTHTHILA_DECLARE (guththila_char_t *)
+AXIS2_EXTERN guththila_char_t *
 guththila_xml_pull_parser_get_attribute_namespace_by_number
-(guththila_environment_t * environment, guththila_xml_pull_parser_t * parser, int i)
+(axis2_env_t * environment, guththila_xml_pull_parser_t * parser, int i)
 {
-    guththila_char_t *att_prefix;
-    int ii;
-    int ix = parser->namesp->pointer;
-    guththila_element_t *e;
-    guththila_namespace_t *ns = NULL;
-    att_prefix =
-        guththila_xml_pull_parser_get_attribute_prefix_by_number (environment,
-                                                                  parser, i);
-
-    for (ii = 0; ii <= ix; ii++)
-    {
-        e = guththila_stack_get (environment, parser->namesp, ii);
-        if (e)
+  guththila_char_t *att_prefix;
+  int ii;
+/*   int ix = parser->namesp->pointer; */
+  int ix = AXIS2_STACK_SIZE (parser->namesp, environment);
+  guththila_namespace_t *ns = NULL;
+  att_prefix =
+    guththila_xml_pull_parser_get_attribute_prefix_by_number (environment,
+							      parser, i);
+
+  for (ii = 0; ii <= ix; ii++)
+    {
+/*       e = guththila_stack_get (environment, parser->namesp, ii); */
+      ns = (guththila_namespace_t *) AXIS2_STACK_GET_AT (parser->namesp, environment, ii);
+      if (ns)
         {
-            if (e->_namespace && att_prefix)
+	  if (ns && att_prefix)
             {
-                ns = e->_namespace;
-                if (!
-                    (GUTHTHILA_STRCMP
-                     ( ns->name, att_prefix)))
-                    return GUTHTHILA_STRDUP (environment , ns->uri);
+	      if (!
+		  (AXIS2_STRCMP
+		   ( ns->name, att_prefix)))
+		return AXIS2_STRDUP (ns->uri, environment);
             }
         }
     }
-    return 0;
+  return 0;
 }
 
-GUTHTHILA_DECLARE (guththila_char_t *)
-     guththila_xml_pull_parser_get_encoding(guththila_environment_t *environment,
-                   guththila_xml_pull_parser_t *parser)
+AXIS2_EXTERN guththila_char_t *
+guththila_xml_pull_parser_get_encoding(axis2_env_t *environment,
+				       guththila_xml_pull_parser_t *parser)
 {
   /* parser will find character encoding base on Byte Order Mark
      (BOM). */



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message