You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by mi...@apache.org on 2007/06/15 14:13:26 UTC

svn commit: r547645 [1/3] - in /webservices/axis2/scratch/c/guththila_ng: ./ guththila/include/ guththila/src/

Author: milinda
Date: Fri Jun 15 05:13:24 2007
New Revision: 547645

URL: http://svn.apache.org/viewvc?view=rev&rev=547645
Log:
Fix some compilation bugs in guththila in Linux environment

Modified:
    webservices/axis2/scratch/c/guththila_ng/build.sh
    webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila.h
    webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_attribute.h
    webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_defines.h
    webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_error.h
    webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_namespace.h
    webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_reader.h
    webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_stack.h
    webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_token.h
    webservices/axis2/scratch/c/guththila_ng/guththila/src/Makefile.am
    webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_attribute.c
    webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_buffer.c
    webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_namespace.c
    webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_reader.c
    webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_stack.c
    webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_token.c
    webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_xml_parser.c
    webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_xml_writer.c

Modified: webservices/axis2/scratch/c/guththila_ng/build.sh
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/build.sh?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/build.sh (original)
+++ webservices/axis2/scratch/c/guththila_ng/build.sh Fri Jun 15 05:13:24 2007
@@ -7,7 +7,7 @@
 
 echo "AXIS2C_HOME = ${AXIS2C_HOME}"
 
-sh configure --prefix=${AXIS2C_HOME}
+sh configure --prefix=${AXIS2C_HOME} --enable-guththila=yes
 make 
 make install
 

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila.h
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila.h?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila.h (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila.h Fri Jun 15 05:13:24 2007
@@ -1,182 +1,182 @@
-#ifndef GUTHTHILA_H
-#define GUTHTHILA_H
-
-#include <guththila_defines.h>
-#include <guththila_token.h>
-#include <guththila_reader.h>
-#include <guththila_xml_writer.h>
-#include <guththila_attribute.h>
-#include <guththila_namespace.h>
-#include <guththila_buffer.h>
-#include <guththila_stack.h>
-#include <guththila_error.h>
-
-/*
-All the functions in this library does not check weather the given arguments are NULL. 
-It is the responsblity of the user to check weather the arguments contain NULL values.
-*/
-
-EXTERN_C_START()
-
-enum guththila_status
-{
-	S_0 = 0,
-	S_1,
-	S_2,
-	S_3
-};
-
-enum guththila_UTF16_endianess
-{ None = 1, LE, BE };
-
-typedef enum guththila_type {
-	type_file_name = 0,
-	type_memory_buffer,
-	type_reader,
-	type_io
-}guththila_type_t;
-
-enum guththila_event_types
-{
-	GUTHTHILA_START_DOCUMENT = 0,    
-	GUTHTHILA_END_ELEMENT,
-    GUTHTHILA_CHARACTER,
-    GUTHTHILA_ENTITY_REFERANCE,
-    GUTHTHILA_COMMENT,
-	GUTHTHILA_SPACE,
-	GUTHTHILA_START_ELEMENT,
-	GUTHTHILA_EMPTY_ELEMENT,
-};
-
-typedef struct guththila_s
-{
-	guththila_tok_list_t tokens;
-
-	guththila_reader_t *reader;
-	guththila_token_t *prefix;
-	guththila_token_t *name;
-	guththila_token_t *value;
-
-	guththila_stack_t elem;
-	guththila_stack_t attrib;
-	guththila_stack_t namesp;
-
-	int is_whitespace;
-	int is_char;
-	int unicode_state;
-	int status;
-	int guththila_event;	
-
-	guththila_token_t *temp_prefix;
-	guththila_token_t *temp_name;
-	guththila_token_t *temp_tok;
-} guththila_t;
-
-typedef struct guththila_elem_namesp_s {
-	guththila_namespace_t *namesp;
-	int no;
-	int size;
-} guththila_elem_namesp_t;
-
-typedef struct guththila_element_s {
-	guththila_token_t *name;
-	guththila_token_t *prefix;
-	int is_namesp;
-} guththila_element_t;
-
-#ifndef GUTHTHILA_IS_SPACE
-#define GUTHTHILA_IS_SPACE(c) (0x20 == c || 0xD == c || 0xA == c || 0x9 == c)     
-#endif
-
-#ifndef GUTHTHILA_IS_VALID_STRING_CHAR
-#define GUTHTHILA_IS_VALID_STRING_CHAR(c) (isalpha(c) || '_' == c || ':' == c)
-#endif
-
-
-#ifndef GUTHTHILA_IS_VALID_STARTING_CHAR
-#define GUTHTHILA_IS_VALID_STARTING_CHAR(c) (isalpha(c) || '_' == c || ':' == c)
-#endif
-
-GUTHTHILA_EXPORT int GUTHTHILA_CALL guththila_init(guththila_t *m, void *reader);
-GUTHTHILA_EXPORT guththila_t* GUTHTHILA_CALL guththila_create(void *reader);
-GUTHTHILA_EXPORT void GUTHTHILA_CALL guththila_free(guththila_t *m);
-GUTHTHILA_EXPORT int GUTHTHILA_CALL guththila_un_init(guththila_t *m);
-
-
-/*static int GUTHTHILA_CALL guththila_next_char(guththila_t *m, int eof);*/
-/*static int GUTHTHILA_CALL guththila_next_no_char(guththila_t *m, int eof, char *bytes, int no);*/
-
-typedef void  (GUTHTHILA_CALL *guththila_error_func)(void *arg, 
-						 const char *msg,
-						 guththila_error_level level,
-						 void *locator);
-
-/*
-Public functions for reading XML documents
-*/
-GUTHTHILA_EXPORT  int GUTHTHILA_CALL
-guththila_next(guththila_t * p);
-                                                                                               
-GUTHTHILA_EXPORT int GUTHTHILA_CALL
-guththila_get_attribute_count(guththila_t *p);
-                                                                  
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_attribute_name(guththila_t * p, guththila_attr_t * att);                                 
-                                 
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_attribute_value (guththila_t *p, guththila_attr_t * att);
-                                 
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_attribute_prefix (guththila_t *p, guththila_attr_t * att);
-                                                                  
-GUTHTHILA_EXPORT guththila_attr_t * GUTHTHILA_CALL
-guththila_get_attribute (guththila_t * p);
-                                                                                  
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_attribute_name_by_number (guththila_t * p, int i);
-                                                                                  
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_attribute_value_by_number (guththila_t * p, int i);
-                                                                                  
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_attribute_prefix_by_number (guththila_t * p, int i);
-                                                                                  
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_name (guththila_t * p);
-                                                                        
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_prefix (guththila_t * p);
-                                                                            
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_value (guththila_t * p);
-                                                                          
-GUTHTHILA_EXPORT guththila_namespace_t * GUTHTHILA_CALL
-guththila_get_namespace (guththila_t * p);
-                                                                                  
-GUTHTHILA_EXPORT int GUTHTHILA_CALL
-guththila_get_namespace_count (guththila_t *p);
-                                                                                  
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_namespace_uri (guththila_t * p, guththila_namespace_t * ns);
-                                                                                          
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_namespace_prefix (guththila_t *p, guththila_namespace_t * ns);
-                                     
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_namespace_prefix_by_number (guththila_t * p, int i);
-                                                                          
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_namespace_uri_by_number (guththila_t * p, int i);
-                                                                              
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_attribute_namespace_by_number (guththila_t * p, int i);
-
-GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
-guththila_get_encoding (guththila_t *p);
-
-GUTHTHILA_EXPORT void guththila_set_error_handler(guththila_t *m, guththila_error_func);
-
-EXTERN_C_END()
-
-#endif
-
+#ifndef GUTHTHILA_H
+#define GUTHTHILA_H
+
+#include <guththila_defines.h>
+#include <guththila_token.h>
+#include <guththila_reader.h>
+#include <guththila_xml_writer.h>
+#include <guththila_attribute.h>
+#include <guththila_namespace.h>
+#include <guththila_buffer.h>
+#include <guththila_stack.h>
+#include <guththila_error.h>
+
+/*
+All the functions in this library does not check weather the given arguments are NULL. 
+It is the responsblity of the user to check weather the arguments contain NULL values.
+*/
+
+EXTERN_C_START()
+
+enum guththila_status
+{
+	S_0 = 0,
+	S_1,
+	S_2,
+	S_3
+};
+
+enum guththila_UTF16_endianess
+{ None = 1, LE, BE };
+
+typedef enum guththila_type {
+	type_file_name = 0,
+	type_memory_buffer,
+	type_reader,
+	type_io
+}guththila_type_t;
+
+enum guththila_event_types
+{
+	GUTHTHILA_START_DOCUMENT = 0,    
+	GUTHTHILA_END_ELEMENT,
+    GUTHTHILA_CHARACTER,
+    GUTHTHILA_ENTITY_REFERANCE,
+    GUTHTHILA_COMMENT,
+	GUTHTHILA_SPACE,
+	GUTHTHILA_START_ELEMENT,
+	GUTHTHILA_EMPTY_ELEMENT,
+};
+
+typedef struct guththila_s
+{
+	guththila_tok_list_t tokens;
+
+	guththila_reader_t *reader;
+	guththila_token_t *prefix;
+	guththila_token_t *name;
+	guththila_token_t *value;
+
+	guththila_stack_t elem;
+	guththila_stack_t attrib;
+	guththila_stack_t namesp;
+
+	int is_whitespace;
+	int is_char;
+	int unicode_state;
+	int status;
+	int guththila_event;	
+
+	guththila_token_t *temp_prefix;
+	guththila_token_t *temp_name;
+	guththila_token_t *temp_tok;
+} guththila_t;
+
+typedef struct guththila_elem_namesp_s {
+	guththila_namespace_t *namesp;
+	int no;
+	int size;
+} guththila_elem_namesp_t;
+
+typedef struct guththila_element_s {
+	guththila_token_t *name;
+	guththila_token_t *prefix;
+	int is_namesp;
+} guththila_element_t;
+
+#ifndef GUTHTHILA_IS_SPACE
+#define GUTHTHILA_IS_SPACE(c) (0x20 == c || 0xD == c || 0xA == c || 0x9 == c)     
+#endif
+
+#ifndef GUTHTHILA_IS_VALID_STRING_CHAR
+#define GUTHTHILA_IS_VALID_STRING_CHAR(c) (isalpha(c) || '_' == c || ':' == c)
+#endif
+
+
+#ifndef GUTHTHILA_IS_VALID_STARTING_CHAR
+#define GUTHTHILA_IS_VALID_STARTING_CHAR(c) (isalpha(c) || '_' == c || ':' == c)
+#endif
+
+GUTHTHILA_EXPORT int GUTHTHILA_CALL guththila_init(guththila_t *m, void *reader);
+GUTHTHILA_EXPORT guththila_t* GUTHTHILA_CALL guththila_create(void *reader);
+GUTHTHILA_EXPORT void GUTHTHILA_CALL guththila_free(guththila_t *m);
+GUTHTHILA_EXPORT int GUTHTHILA_CALL guththila_un_init(guththila_t *m);
+
+
+/*static int GUTHTHILA_CALL guththila_next_char(guththila_t *m, int eof);*/
+/*static int GUTHTHILA_CALL guththila_next_no_char(guththila_t *m, int eof, char *bytes, int no);*/
+
+typedef void  (GUTHTHILA_CALL *guththila_error_func)(void *arg, 
+						 const char *msg,
+						 guththila_error_level level,
+						 void *locator);
+
+/*
+Public functions for reading XML documents
+*/
+GUTHTHILA_EXPORT  int GUTHTHILA_CALL
+guththila_next(guththila_t * p);
+                                                                                               
+GUTHTHILA_EXPORT int GUTHTHILA_CALL
+guththila_get_attribute_count(guththila_t *p);
+                                                                  
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_attribute_name(guththila_t * p, guththila_attr_t * att);                                 
+                                 
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_attribute_value (guththila_t *p, guththila_attr_t * att);
+                                 
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_attribute_prefix (guththila_t *p, guththila_attr_t * att);
+                                                                  
+GUTHTHILA_EXPORT guththila_attr_t * GUTHTHILA_CALL
+guththila_get_attribute (guththila_t * p);
+                                                                                  
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_attribute_name_by_number (guththila_t * p, int i);
+                                                                                  
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_attribute_value_by_number (guththila_t * p, int i);
+                                                                                  
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_attribute_prefix_by_number (guththila_t * p, int i);
+                                                                                  
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_name (guththila_t * p);
+                                                                        
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_prefix (guththila_t * p);
+                                                                            
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_value (guththila_t * p);
+                                                                          
+GUTHTHILA_EXPORT guththila_namespace_t * GUTHTHILA_CALL
+guththila_get_namespace (guththila_t * p);
+                                                                                  
+GUTHTHILA_EXPORT int GUTHTHILA_CALL
+guththila_get_namespace_count (guththila_t *p);
+                                                                                  
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_namespace_uri (guththila_t * p, guththila_namespace_t * ns);
+                                                                                          
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_namespace_prefix (guththila_t *p, guththila_namespace_t * ns);
+                                     
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_namespace_prefix_by_number (guththila_t * p, int i);
+                                                                          
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_namespace_uri_by_number (guththila_t * p, int i);
+                                                                              
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_attribute_namespace_by_number (guththila_t * p, int i);
+
+GUTHTHILA_EXPORT guththila_char * GUTHTHILA_CALL
+guththila_get_encoding (guththila_t *p);
+
+GUTHTHILA_EXPORT void guththila_set_error_handler(guththila_t *m, guththila_error_func);
+
+EXTERN_C_END()
+
+#endif
+

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_attribute.h
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_attribute.h?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_attribute.h (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_attribute.h Fri Jun 15 05:13:24 2007
@@ -1,38 +1,38 @@
-#ifndef GUTHTHILA_ATTRIBUTE_H
-#define GUTHTHILA_ATTRIBUTE_H
-
-#include <guththila_defines.h>
-#include <guththila_token.h>
-
-EXTERN_C_START()
-
-#ifndef GUTHTHILA_ATTR_DEF_SIZE
-#define GUTHTHILA_ATTR_DEF_SIZE 16
-#endif
-
-typedef struct guththila_attr_s
-{
-    guththila_token_t *pref;
-    guththila_token_t *name;
-    guththila_token_t *val;
-} guththila_attr_t;
-
-typedef struct guththila_attr_list_s
-{
-	guththila_attr_t *list;
-	guththila_stack_t fr_stack;
-	int size;
-	int capacity;		
-} guththila_attr_list_t;
-
-guththila_attr_list_t * GUTHTHILA_CALL guththila_attr_list_create();
-int GUTHTHILA_CALL guththila_attr_list_init(guththila_attr_list_t *at_list);
-guththila_attr_t * GUTHTHILA_CALL guththila_attr_list_get(guththila_attr_list_t *at_list);
-int GUTHTHILA_CALL guththila_attr_list_release(guththila_attr_list_t *at_list, guththila_attr_t *attr);
-void GUTHTHILA_CALL msuila_attr_list_free_data(guththila_attr_list_t *at_list);
-void GUTHTHILA_CALL guththila_attr_list_free(guththila_attr_list_t *at_list);
-
-EXTERN_C_END()
-
-#endif
-
+#ifndef GUTHTHILA_ATTRIBUTE_H
+#define GUTHTHILA_ATTRIBUTE_H
+
+#include <guththila_defines.h>
+#include <guththila_token.h>
+
+EXTERN_C_START()
+
+#ifndef GUTHTHILA_ATTR_DEF_SIZE
+#define GUTHTHILA_ATTR_DEF_SIZE 16
+#endif
+
+typedef struct guththila_attr_s
+{
+    guththila_token_t *pref;
+    guththila_token_t *name;
+    guththila_token_t *val;
+} guththila_attr_t;
+
+typedef struct guththila_attr_list_s
+{
+	guththila_attr_t *list;
+	guththila_stack_t fr_stack;
+	int size;
+	int capacity;		
+} guththila_attr_list_t;
+
+guththila_attr_list_t * GUTHTHILA_CALL guththila_attr_list_create();
+int GUTHTHILA_CALL guththila_attr_list_init(guththila_attr_list_t *at_list);
+guththila_attr_t * GUTHTHILA_CALL guththila_attr_list_get(guththila_attr_list_t *at_list);
+int GUTHTHILA_CALL guththila_attr_list_release(guththila_attr_list_t *at_list, guththila_attr_t *attr);
+void GUTHTHILA_CALL msuila_attr_list_free_data(guththila_attr_list_t *at_list);
+void GUTHTHILA_CALL guththila_attr_list_free(guththila_attr_list_t *at_list);
+
+EXTERN_C_END()
+
+#endif
+

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_defines.h
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_defines.h?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_defines.h (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_defines.h Fri Jun 15 05:13:24 2007
@@ -1,46 +1,57 @@
-#ifndef GUTHTHILA_DEFINES_H
-#define GUTHTHILA_DEFINES_H
-
-
-#ifndef GUTHTHILA_EXPORT 
-#define	GUTHTHILA_EXPORT  __declspec(dllexport)
-#endif
-
-#ifndef GUTHTHILA_CALL
-#define GUTHTHILA_CALL __stdcall
-#endif
-
-#ifndef guththila_char
-#define guththila_char char
-#endif
-
-#ifndef GUTHTHILA_SUCCESS
-#define GUTHTHILA_SUCCESS	1
-#endif
-
-#ifndef GUTHTHILA_FAILURE
-#define GUTHTHILA_FAILURE	0
-#endif
-
-#ifdef __cplusplus
-#define EXTERN_C_START() extern "C" {
-#define EXTERN_C_END() }
-#else
-#define EXTERN_C_START() 
-#define EXTERN_C_END() 
-#endif
-
-#ifndef GUTHTHILA_EOF
-#define GUTHTHILA_EOF	(-1)
-#endif
-
-#ifndef GUTHTHILA_FALSE
-#define GUTHTHILA_FALSE	0
-#endif
-
-#ifndef GUTHTHILA_TURE
-#define GUTHTHILA_TRUE		1
-#endif
-
-#endif
-
+#ifndef GUTHTHILA_DEFINES_H
+#define GUTHTHILA_DEFINES_H
+
+#if defined(WIN32)
+#define	GUTHTHILA_EXPORT  __declspec(dllexport)
+#else
+#define GUTHTHILA_EXPORT
+#endif
+
+#if defined(__GNUC__)
+#if defined(__i386)
+#define GUTHTHILA_CALL __attribute__((cdecl))
+#else
+#define GUTHTHILA_CALL
+#endif
+#else
+#if defined(__unix)
+#define GUTHTHILA_CALL
+#else
+#define GUTHTHILA_CALL __stdcall
+#endif
+#endif
+
+#ifndef guththila_char
+#define guththila_char char
+#endif
+
+#ifndef GUTHTHILA_SUCCESS
+#define GUTHTHILA_SUCCESS	1
+#endif
+
+#ifndef GUTHTHILA_FAILURE
+#define GUTHTHILA_FAILURE	0
+#endif
+
+#ifdef __cplusplus
+#define EXTERN_C_START() extern "C" {
+#define EXTERN_C_END() }
+#else
+#define EXTERN_C_START() 
+#define EXTERN_C_END() 
+#endif
+
+#ifndef GUTHTHILA_EOF
+#define GUTHTHILA_EOF	(-1)
+#endif
+
+#ifndef GUTHTHILA_FALSE
+#define GUTHTHILA_FALSE	0
+#endif
+
+#ifndef GUTHTHILA_TURE
+#define GUTHTHILA_TRUE		1
+#endif
+
+#endif
+

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_error.h
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_error.h?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_error.h (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_error.h Fri Jun 15 05:13:24 2007
@@ -1,83 +1,83 @@
-#include <guththila_defines.h>
-
-#ifndef GUTHTHILA_ERROR_H
-#define GUTHTHILA_ERROR_H
-
-EXTERN_C_START()
-
-typedef enum guththila_error_l{
-	GUTHTHILA_VALIDITY_ERROR,
-	GUTHTHILA_VALIDITY_WARNING,
-	GUTHTHILA_PARSER_ERROR,
-	GUTHTHILA_PARSER_WARNING,
-} guththila_error_level;
-
-enum guththila_error_codes {							
-	GUTHTHILA_ERROR_NONE = 0,
-	GUTHTHILA_ERROR_NO_MEMORY,
-	GUTHTHILA_ERROR_INVALID_NULL_PARAMETER,
-	GUTHTHILA_ERROR_INVALID_ITERATOR_STATE,
-	GUTHTHILA_ERROR_INVALID_NODE_TYPE,
-	GUTHTHILA_STREAM_WRITER_ERROR_NOT_IN_GUTHTHILA_START_ELEMENT,
-	GUTHTHILA_STREAM_WRITER_ERROR_WRITING_TO_STREAM,
-	GUTHTHILA_STREAM_WRITER_ERROR_STREAM_STRUCT_NULL,
-	GUTHTHILA_STREAM_WRITER_ERROR_LOCAL_NAME_NULL,
-	GUTHTHILA_STREAM_WRITER_ERROR_GUTHTHILA_namespace_t_NULL,
-	GUTHTHILA_STREAM_WRITER_ERROR_PREFIX_NULL,
-	GUTHTHILA_STREAM_WRITER_ERROR_GUTHTHILA_namespace_t_NOT_DECLARED,
-	GUTHTHILA_STREAM_WRITER_ERROR_GUTHTHILA_element_t_GUTHTHILA_stack_t_EMPTY,
-	GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_STATE,
-	GUTHTHILA_STREAM_WRITER_ERROR_GUTHTHILA_COMMENT_NULL,
-	GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_GUTHTHILA_COMMENT,
-	GUTHTHILA_STREAM_WRITER_ERROR_PROCESSING_INSTRUCTION_TARGET_NULL,
-	GUTHTHILA_STREAM_WRITER_ERROR_CDATA_NULL,
-	GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_CDATA,
-	GUTHTHILA_STREAM_WRITER_ERROR_DTD_NULL,
-	GUTHTHILA_STREAM_WRITER_ERROR_ENTITY_REF_NULL,
-	GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_XML_VERSION,
-	GUTHTHILA_STREAM_WRITER_ERROR_TEXT_NULL,
-	GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_PREFIX,
-	GUTHTHILA_STREAM_WRITER_ERROR_OUT_OF_MEMORY,
-	GUTHTHILA_STREAM_WRITER_ERROR_FILE_NOT_FOUND,
-	GUTHTHILA_STREAM_READER_ERROR_OUT_OF_MEMORY,
-	GUTHTHILA_ERROR_INVALID_ENCODING_DECLARATION,
-	GUTHTHILA_ERROR_UNEXPECTED_UTF16_EOF,
-	GUTHTHILA_ERROR_UNEXPECTED_EOF,
-	GUTHTHILA_ERROR_PROCESS_EQUAL,
-	GUTHTHILA_ERROR_INCORRECT_VERSION_INFO,
-	GUTHTHILA_ERROR_INCORRECT_XML_DECLARATION,
-	GUTHTHILA_ERROR_VERSION_INFO_NOT_FOUND,
-	GUTHTHILA_ERROR_ENCODING_DECLARATION_ERROR,
-	GUTHTHILA_ERROR_STANDALONE_ERROR_IN_YES,
-	GUTHTHILA_ERROR_STANDALONE_ERROR_IN_NO,
-	GUTHTHILA_ERROR_STANDALONE_ERROR_YES_OR_NO_NOT_AVAILABLE,
-	GUTHTHILA_ERROR_MISSING_GREATER_SIGN_IN_XML_DECLARATION,
-	GUTHTHILA_ERROR_INVALID_NAME_STARTING_CHARACTER,
-	GUTHTHILA_ERROR_QUOTES_NOT_FOUND_BEFORE_ATTRIBUTE_VALUE,
-	GUTHTHILA_ERROR_EMPTY_ELEMENT_NOT_CLOSED,
-	GUTHTHILA_ERROR_END_TAG_NOT_CLOSED,
-	GUTHTHILA_ERROR_MORE_HYPENS_OCCURED_IN_COMMENT,
-	GUTHTHILA_ERROR_TOKENIZE_ERROR,
-	GUTHTHILA_ERROR_INVALID_TOKEN_TYPE,
-	GUTHTHILA_ERROR_NULL_ATTRIBUTE_NAME,
-	GUTHTHILA_ERROR_NULL_ATTRIBUTE_VALUE,
-	GUTHTHILA_ERROR_NULL_ATTRIBUTE_PREFIX,
-	GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE,
-	GUTHTHILA_WRITER_ERROR_EMPTY_ARGUMENTS,
-	GUTHTHILA_WRITER_ERROR_NON_EXSISTING_PREFIX,
-	GUTHTHILA_WRITER_ERROR_EMPTY_WRITER,
-	GUTHTHILA_WRITER_ERROR_NON_MATCHING_ELEMENTS,
-	GUTHTHILA_WRITER_ERROR_INVALID_BUFFER,
-	GUTHTHILA_WRITER_ERROR_INVALID_CHAR_IN_NAME,
-	GUTHTHILA_WRITER_ERROR_XML_STRING_IN_NAME,
-	GUTHTHILA_WRITER_ERROR_EXCESS_HYPENS_IN_COMMENT,
-	GUTHTHILA_WRITER_ERROR_INVALID_CHAR_IN_ATTRIBUTE,
-	GUTHTHILA_WRITER_ERROR_NON_EXSISTING_URI,
-	GUTHTHILA_WRITER_ERROR_SAME_ATTRIBUTE_REPEAT,
-	GUTHTHILA_ERROR_ATTRIBUTE_FREE												
-};
-
-EXTERN_C_END()
-
-#endif
-
+#include <guththila_defines.h>
+
+#ifndef GUTHTHILA_ERROR_H
+#define GUTHTHILA_ERROR_H
+
+EXTERN_C_START()
+
+typedef enum guththila_error_l{
+	GUTHTHILA_VALIDITY_ERROR,
+	GUTHTHILA_VALIDITY_WARNING,
+	GUTHTHILA_PARSER_ERROR,
+	GUTHTHILA_PARSER_WARNING,
+} guththila_error_level;
+
+enum guththila_error_codes {							
+	GUTHTHILA_ERROR_NONE = 0,
+	GUTHTHILA_ERROR_NO_MEMORY,
+	GUTHTHILA_ERROR_INVALID_NULL_PARAMETER,
+	GUTHTHILA_ERROR_INVALID_ITERATOR_STATE,
+	GUTHTHILA_ERROR_INVALID_NODE_TYPE,
+	GUTHTHILA_STREAM_WRITER_ERROR_NOT_IN_GUTHTHILA_START_ELEMENT,
+	GUTHTHILA_STREAM_WRITER_ERROR_WRITING_TO_STREAM,
+	GUTHTHILA_STREAM_WRITER_ERROR_STREAM_STRUCT_NULL,
+	GUTHTHILA_STREAM_WRITER_ERROR_LOCAL_NAME_NULL,
+	GUTHTHILA_STREAM_WRITER_ERROR_GUTHTHILA_namespace_t_NULL,
+	GUTHTHILA_STREAM_WRITER_ERROR_PREFIX_NULL,
+	GUTHTHILA_STREAM_WRITER_ERROR_GUTHTHILA_namespace_t_NOT_DECLARED,
+	GUTHTHILA_STREAM_WRITER_ERROR_GUTHTHILA_element_t_GUTHTHILA_stack_t_EMPTY,
+	GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_STATE,
+	GUTHTHILA_STREAM_WRITER_ERROR_GUTHTHILA_COMMENT_NULL,
+	GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_GUTHTHILA_COMMENT,
+	GUTHTHILA_STREAM_WRITER_ERROR_PROCESSING_INSTRUCTION_TARGET_NULL,
+	GUTHTHILA_STREAM_WRITER_ERROR_CDATA_NULL,
+	GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_CDATA,
+	GUTHTHILA_STREAM_WRITER_ERROR_DTD_NULL,
+	GUTHTHILA_STREAM_WRITER_ERROR_ENTITY_REF_NULL,
+	GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_XML_VERSION,
+	GUTHTHILA_STREAM_WRITER_ERROR_TEXT_NULL,
+	GUTHTHILA_STREAM_WRITER_ERROR_ILLEGAL_PREFIX,
+	GUTHTHILA_STREAM_WRITER_ERROR_OUT_OF_MEMORY,
+	GUTHTHILA_STREAM_WRITER_ERROR_FILE_NOT_FOUND,
+	GUTHTHILA_STREAM_READER_ERROR_OUT_OF_MEMORY,
+	GUTHTHILA_ERROR_INVALID_ENCODING_DECLARATION,
+	GUTHTHILA_ERROR_UNEXPECTED_UTF16_EOF,
+	GUTHTHILA_ERROR_UNEXPECTED_EOF,
+	GUTHTHILA_ERROR_PROCESS_EQUAL,
+	GUTHTHILA_ERROR_INCORRECT_VERSION_INFO,
+	GUTHTHILA_ERROR_INCORRECT_XML_DECLARATION,
+	GUTHTHILA_ERROR_VERSION_INFO_NOT_FOUND,
+	GUTHTHILA_ERROR_ENCODING_DECLARATION_ERROR,
+	GUTHTHILA_ERROR_STANDALONE_ERROR_IN_YES,
+	GUTHTHILA_ERROR_STANDALONE_ERROR_IN_NO,
+	GUTHTHILA_ERROR_STANDALONE_ERROR_YES_OR_NO_NOT_AVAILABLE,
+	GUTHTHILA_ERROR_MISSING_GREATER_SIGN_IN_XML_DECLARATION,
+	GUTHTHILA_ERROR_INVALID_NAME_STARTING_CHARACTER,
+	GUTHTHILA_ERROR_QUOTES_NOT_FOUND_BEFORE_ATTRIBUTE_VALUE,
+	GUTHTHILA_ERROR_EMPTY_ELEMENT_NOT_CLOSED,
+	GUTHTHILA_ERROR_END_TAG_NOT_CLOSED,
+	GUTHTHILA_ERROR_MORE_HYPENS_OCCURED_IN_COMMENT,
+	GUTHTHILA_ERROR_TOKENIZE_ERROR,
+	GUTHTHILA_ERROR_INVALID_TOKEN_TYPE,
+	GUTHTHILA_ERROR_NULL_ATTRIBUTE_NAME,
+	GUTHTHILA_ERROR_NULL_ATTRIBUTE_VALUE,
+	GUTHTHILA_ERROR_NULL_ATTRIBUTE_PREFIX,
+	GUTHTHILA_ERROR_REQUESTED_NUMBER_GREATER_THAN_STACK_SIZE,
+	GUTHTHILA_WRITER_ERROR_EMPTY_ARGUMENTS,
+	GUTHTHILA_WRITER_ERROR_NON_EXSISTING_PREFIX,
+	GUTHTHILA_WRITER_ERROR_EMPTY_WRITER,
+	GUTHTHILA_WRITER_ERROR_NON_MATCHING_ELEMENTS,
+	GUTHTHILA_WRITER_ERROR_INVALID_BUFFER,
+	GUTHTHILA_WRITER_ERROR_INVALID_CHAR_IN_NAME,
+	GUTHTHILA_WRITER_ERROR_XML_STRING_IN_NAME,
+	GUTHTHILA_WRITER_ERROR_EXCESS_HYPENS_IN_COMMENT,
+	GUTHTHILA_WRITER_ERROR_INVALID_CHAR_IN_ATTRIBUTE,
+	GUTHTHILA_WRITER_ERROR_NON_EXSISTING_URI,
+	GUTHTHILA_WRITER_ERROR_SAME_ATTRIBUTE_REPEAT,
+	GUTHTHILA_ERROR_ATTRIBUTE_FREE												
+};
+
+EXTERN_C_END()
+
+#endif
+

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_namespace.h
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_namespace.h?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_namespace.h (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_namespace.h Fri Jun 15 05:13:24 2007
@@ -1,37 +1,37 @@
-#ifndef GUTHTHILA_NAMESPACE_H
-#define GUTHTHILA_NAMESPACE_H
-
-#include <guththila_defines.h>
-#include <guththila_token.h>
-
-EXTERN_C_START()
-
-#ifndef GUTHTHILA_NAMESPACE_DEF_SIZE
-#define GUTHTHILA_NAMESPACE_DEF_SIZE 4
-#endif
-
-typedef struct guththila_namespace_s
-{
-    guththila_token_t *name;
-    guththila_token_t *uri;	 
-} guththila_namespace_t;
-
-typedef struct guththila_namespace_list_s
-{
-	guththila_namespace_t *list;
-	guththila_stack_t fr_stack;
-	int size;
-	int capacity;		
-} guththila_namespace_list_t;
-
-guththila_namespace_list_t * GUTHTHILA_CALL guththila_namespace_list_create();
-int GUTHTHILA_CALL guththila_namespace_list_init(guththila_namespace_list_t *at_list);
-guththila_namespace_t * GUTHTHILA_CALL guththila_namespace_list_get(guththila_namespace_list_t *at_list);
-int GUTHTHILA_CALL guththila_namespace_list_release(guththila_namespace_list_t *at_list, guththila_namespace_t *namesp);
-void GUTHTHILA_CALL msuila_namespace_list_free_data(guththila_namespace_list_t *at_list);
-void GUTHTHILA_CALL guththila_namespace_list_free(guththila_namespace_list_t *at_list);
-
-EXTERN_C_END()
-
-#endif
-
+#ifndef GUTHTHILA_NAMESPACE_H
+#define GUTHTHILA_NAMESPACE_H
+
+#include <guththila_defines.h>
+#include <guththila_token.h>
+
+EXTERN_C_START()
+
+#ifndef GUTHTHILA_NAMESPACE_DEF_SIZE
+#define GUTHTHILA_NAMESPACE_DEF_SIZE 4
+#endif
+
+typedef struct guththila_namespace_s
+{
+    guththila_token_t *name;
+    guththila_token_t *uri;	 
+} guththila_namespace_t;
+
+typedef struct guththila_namespace_list_s
+{
+	guththila_namespace_t *list;
+	guththila_stack_t fr_stack;
+	int size;
+	int capacity;		
+} guththila_namespace_list_t;
+
+guththila_namespace_list_t * GUTHTHILA_CALL guththila_namespace_list_create();
+int GUTHTHILA_CALL guththila_namespace_list_init(guththila_namespace_list_t *at_list);
+guththila_namespace_t * GUTHTHILA_CALL guththila_namespace_list_get(guththila_namespace_list_t *at_list);
+int GUTHTHILA_CALL guththila_namespace_list_release(guththila_namespace_list_t *at_list, guththila_namespace_t *namesp);
+void GUTHTHILA_CALL msuila_namespace_list_free_data(guththila_namespace_list_t *at_list);
+void GUTHTHILA_CALL guththila_namespace_list_free(guththila_namespace_list_t *at_list);
+
+EXTERN_C_END()
+
+#endif
+

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_reader.h
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_reader.h?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_reader.h (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_reader.h Fri Jun 15 05:13:24 2007
@@ -1,60 +1,60 @@
-#ifndef GUTHTHILA_READER_H
-#define GUTHTHILA_READER_H
-
-#include <stdio.h>
-#include <guththila_defines.h>
-#include <guththila_buffer.h>
-
-EXTERN_C_START()
-
-typedef int (GUTHTHILA_CALL *GUTHTHILA_READ_INPUT_CALLBACK)(char *buffer, int size, 
-    void* ctx);
-
-enum guththila_reader_type
-{
-	GUTHTHILA_FILE_READER = 1,
-    GUTHTHILA_IO_READER,
-    GUTHTHILA_MEMORY_READER
-};
-
-typedef struct guththila_reader_s
-{
-	int type;
-	FILE *fp;
-	int next;
-	int last_start; /*if -1 we are not in a token*/
-	/*char *buffer;*/
-	guththila_buffer_t buffer;
-	GUTHTHILA_READ_INPUT_CALLBACK input_read_callback;
-	void* context;	
-} guththila_reader_t;
-
-#ifndef GUTHTHILA_READER_SET_LAST_START
-#define GUTHTHILA_READER_SET_LAST_START(_reader, _start) ((_reader)->start = _start)
-#endif
-
-#ifndef GUTHTHILA_READER_STEP_BACK
-#define GUTHTHILA_READER_STEP_BACK(_reader) ((_reader->next--))
-#endif
-
-GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL
-guththila_reader_create_for_file (char* filename);
-
-GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL 
-guththila_reader_create_for_io(GUTHTHILA_READ_INPUT_CALLBACK input_read_callback, void *ctx);
-
-GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL
-guththila_reader_create_for_memory(void *buffer, int size); 
-
-GUTHTHILA_EXPORT int GUTHTHILA_CALL
-guththila_reader_read (guththila_reader_t *r, guththila_char *buffer, int offset, int length);
-                       
-GUTHTHILA_EXPORT void GUTHTHILA_CALL
-guththila_reader_free (guththila_reader_t * r);
-
-int GUTHTHILA_CALL guththila_reader_next_char(guththila_reader_t *r, int eof);
-int GUTHTHILA_CALL guththila_reader_next_no_char (guththila_reader_t *r, int eof, char *bytes, int no);
-EXTERN_C_END()
-
-#endif
-
+#ifndef GUTHTHILA_READER_H
+#define GUTHTHILA_READER_H
+
+#include <stdio.h>
+#include <guththila_defines.h>
+#include <guththila_buffer.h>
+
+EXTERN_C_START()
+
+typedef int (GUTHTHILA_CALL *GUTHTHILA_READ_INPUT_CALLBACK)(char *buffer, int size, 
+    void* ctx);
+
+enum guththila_reader_type
+{
+	GUTHTHILA_FILE_READER = 1,
+    GUTHTHILA_IO_READER,
+    GUTHTHILA_MEMORY_READER
+};
+
+typedef struct guththila_reader_s
+{
+	int type;
+	FILE *fp;
+	int next;
+	int last_start; /*if -1 we are not in a token*/
+	/*char *buffer;*/
+	guththila_buffer_t buffer;
+	GUTHTHILA_READ_INPUT_CALLBACK input_read_callback;
+	void* context;	
+} guththila_reader_t;
+
+#ifndef GUTHTHILA_READER_SET_LAST_START
+#define GUTHTHILA_READER_SET_LAST_START(_reader, _start) ((_reader)->start = _start)
+#endif
+
+#ifndef GUTHTHILA_READER_STEP_BACK
+#define GUTHTHILA_READER_STEP_BACK(_reader) ((_reader->next--))
+#endif
+
+GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL
+guththila_reader_create_for_file (char* filename);
+
+GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL 
+guththila_reader_create_for_io(GUTHTHILA_READ_INPUT_CALLBACK input_read_callback, void *ctx);
+
+GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL
+guththila_reader_create_for_memory(void *buffer, int size); 
+
+GUTHTHILA_EXPORT int GUTHTHILA_CALL
+guththila_reader_read (guththila_reader_t *r, guththila_char *buffer, int offset, int length);
+                       
+GUTHTHILA_EXPORT void GUTHTHILA_CALL
+guththila_reader_free (guththila_reader_t * r);
+
+int GUTHTHILA_CALL guththila_reader_next_char(guththila_reader_t *r, int eof);
+int GUTHTHILA_CALL guththila_reader_next_no_char (guththila_reader_t *r, int eof, char *bytes, int no);
+EXTERN_C_END()
+
+#endif
+

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_stack.h
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_stack.h?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_stack.h (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_stack.h Fri Jun 15 05:13:24 2007
@@ -1,44 +1,44 @@
-#ifndef GUTHTHILA_STACK_H
-#define GUTHTHILA_STACK_H
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <guththila_defines.h>
-
-#define GUTHTHILA_STACK_DEFAULT	16
-
-EXTERN_C_START()
-
-typedef struct guththila_stack_s
-{
-	/* Number of Items in the stack*/
-	int top;
-	/* Max number of Items that can be hold in data*/
-	int max;
-	void **data;			
-} guththila_stack_t;
-
-#ifndef GUTHTHILA_STACK_SIZE
-#define GUTHTHILA_STACK_SIZE(_stack) ((_stack).top)
-#endif
-
-#ifndef GUTHTHILA_STACK_TOP_INDEX
-#define GUTHTHILA_STACK_TOP_INDEX(_stack) (((_stack).top - 1))
-#endif
-
-guththila_stack_t* GUTHTHILA_CALL guththila_stack_create();
-int GUTHTHILA_CALL guththila_stack_init(guththila_stack_t *stack);
-void GUTHTHILA_CALL guththila_stack_free(guththila_stack_t *stack);
-void GUTHTHILA_CALL guththila_stack_free_data(guththila_stack_t *stack);
-void * GUTHTHILA_CALL guththila_stack_pop(guththila_stack_t *stack);
-int GUTHTHILA_CALL guththila_stack_push(guththila_stack_t *stack, void *data);
-void * GUTHTHILA_CALL guththila_stack_peek(guththila_stack_t *stack);
-void * GUTHTHILA_CALL guththila_stack_get_by_index(guththila_stack_t *stack, int index);
-int GUTHTHILA_CALL guththila_stack_del_top(guththila_stack_t *stack);
-int GUTHTHILA_CALL guththila_stack_is_empty(guththila_stack_t *stack);
-
-EXTERN_C_END()
-
-#endif
-
+#ifndef GUTHTHILA_STACK_H
+#define GUTHTHILA_STACK_H
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <guththila_defines.h>
+
+#define GUTHTHILA_STACK_DEFAULT	16
+
+EXTERN_C_START()
+
+typedef struct guththila_stack_s
+{
+	/* Number of Items in the stack*/
+	int top;
+	/* Max number of Items that can be hold in data*/
+	int max;
+	void **data;			
+} guththila_stack_t;
+
+#ifndef GUTHTHILA_STACK_SIZE
+#define GUTHTHILA_STACK_SIZE(_stack) ((_stack).top)
+#endif
+
+#ifndef GUTHTHILA_STACK_TOP_INDEX
+#define GUTHTHILA_STACK_TOP_INDEX(_stack) (((_stack).top - 1))
+#endif
+
+guththila_stack_t* GUTHTHILA_CALL guththila_stack_create();
+int GUTHTHILA_CALL guththila_stack_init(guththila_stack_t *stack);
+void GUTHTHILA_CALL guththila_stack_free(guththila_stack_t *stack);
+void GUTHTHILA_CALL guththila_stack_free_data(guththila_stack_t *stack);
+void * GUTHTHILA_CALL guththila_stack_pop(guththila_stack_t *stack);
+int GUTHTHILA_CALL guththila_stack_push(guththila_stack_t *stack, void *data);
+void * GUTHTHILA_CALL guththila_stack_peek(guththila_stack_t *stack);
+void * GUTHTHILA_CALL guththila_stack_get_by_index(guththila_stack_t *stack, int index);
+int GUTHTHILA_CALL guththila_stack_del_top(guththila_stack_t *stack);
+int GUTHTHILA_CALL guththila_stack_is_empty(guththila_stack_t *stack);
+
+EXTERN_C_END()
+
+#endif
+

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_token.h
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_token.h?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_token.h (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/include/guththila_token.h Fri Jun 15 05:13:24 2007
@@ -1,71 +1,71 @@
-#ifndef GUTHTHILA_TOKEN_H
-#define GUTHTHILA_TOKEN_H
-
-#include <guththila_defines.h>
-#include <guththila_stack.h>
-
-EXTERN_C_START()
-
-typedef struct guththila_token_s
-{
-	short type;
-	char *start;
-	int _start;
-	size_t size;
-	int last;
-	int ref;	
-} guththila_token_t;
-
-enum guththila_token_type
-{  
-	_Unknown = 1,
-    _name,
-	_attribute_name,
-    _attribute_value,
-    _prefix,
-    _char_data
-};
-
-typedef struct guththila_tok_list_s
-{
-	guththila_stack_t fr_stack;
-	guththila_token_t **list;
-	int no_list;
-	int cur_list;	
-	int *capacity;
-} guththila_tok_list_t;
-
-#ifndef GUTHTHILA_TOK_DEF_SIZE
-#define GUTHTHILA_TOK_DEF_SIZE 4
-#endif
-
-#ifndef GUTHTHILA_TOK_DEF_LIST_SIZE
-#define GUTHTHILA_TOK_DEF_LIST_SIZE 16
-#endif
-
-#ifndef GUTHTHILA_TOKEN_LEN
-#define GUTHTHILA_TOKEN_LEN(tok) (tok->size)
-#endif
-
-#ifndef GUTHTHILA_TOKEN_TO_STRING
-#define GUTHTHILA_TOKEN_TO_STRING(tok, string) \
-	string = (char *)malloc((GUTHTHILA_TOKEN_LEN(tok) + 1) * sizeof (char));	\
-	memcpy(string, (tok)->start, GUTHTHILA_TOKEN_LEN(tok));						\
-	string[GUTHTHILA_TOKEN_LEN(tok)] = 0;										
-#endif
-
-guththila_tok_list_t * GUTHTHILA_CALL guththila_tok_list_create();
-int GUTHTHILA_CALL guththila_tok_list_init(guththila_tok_list_t *tok_list);
-void GUTHTHILA_CALL guththila_tok_list_free(guththila_tok_list_t *tok_list);
-guththila_token_t * GUTHTHILA_CALL guththila_tok_list_get_token(guththila_tok_list_t *tok_list);
-int GUTHTHILA_CALL guththila_tok_list_release_token(guththila_tok_list_t *tok_list, guththila_token_t *token);
-void GUTHTHILA_CALL guththila_tok_list_free_data(guththila_tok_list_t *tok_list);
-int GUTHTHILA_CALL guththila_tok_list_grow(guththila_tok_list_t *tok_list);
-
-int GUTHTHILA_CALL guththila_tok_str_cmp(guththila_token_t *tok, char *str, size_t str_len);
-int GUTHTHILA_CALL guththila_tok_tok_cmp(guththila_token_t *tok1, guththila_token_t *tok2);
-
-EXTERN_C_END()
-
-#endif
-
+#ifndef GUTHTHILA_TOKEN_H
+#define GUTHTHILA_TOKEN_H
+
+#include <guththila_defines.h>
+#include <guththila_stack.h>
+
+EXTERN_C_START()
+
+typedef struct guththila_token_s
+{
+	short type;
+	char *start;
+	int _start;
+	size_t size;
+	int last;
+	int ref;	
+} guththila_token_t;
+
+enum guththila_token_type
+{  
+	_Unknown = 1,
+    _name,
+	_attribute_name,
+    _attribute_value,
+    _prefix,
+    _char_data
+};
+
+typedef struct guththila_tok_list_s
+{
+	guththila_stack_t fr_stack;
+	guththila_token_t **list;
+	int no_list;
+	int cur_list;	
+	int *capacity;
+} guththila_tok_list_t;
+
+#ifndef GUTHTHILA_TOK_DEF_SIZE
+#define GUTHTHILA_TOK_DEF_SIZE 4
+#endif
+
+#ifndef GUTHTHILA_TOK_DEF_LIST_SIZE
+#define GUTHTHILA_TOK_DEF_LIST_SIZE 16
+#endif
+
+#ifndef GUTHTHILA_TOKEN_LEN
+#define GUTHTHILA_TOKEN_LEN(tok) (tok->size)
+#endif
+
+#ifndef GUTHTHILA_TOKEN_TO_STRING
+#define GUTHTHILA_TOKEN_TO_STRING(tok, string) \
+	string = (char *)malloc((GUTHTHILA_TOKEN_LEN(tok) + 1) * sizeof (char));	\
+	memcpy(string, (tok)->start, GUTHTHILA_TOKEN_LEN(tok));						\
+	string[GUTHTHILA_TOKEN_LEN(tok)] = 0;										
+#endif
+
+guththila_tok_list_t * GUTHTHILA_CALL guththila_tok_list_create();
+int GUTHTHILA_CALL guththila_tok_list_init(guththila_tok_list_t *tok_list);
+void GUTHTHILA_CALL guththila_tok_list_free(guththila_tok_list_t *tok_list);
+guththila_token_t * GUTHTHILA_CALL guththila_tok_list_get_token(guththila_tok_list_t *tok_list);
+int GUTHTHILA_CALL guththila_tok_list_release_token(guththila_tok_list_t *tok_list, guththila_token_t *token);
+void GUTHTHILA_CALL guththila_tok_list_free_data(guththila_tok_list_t *tok_list);
+int GUTHTHILA_CALL guththila_tok_list_grow(guththila_tok_list_t *tok_list);
+
+int GUTHTHILA_CALL guththila_tok_str_cmp(guththila_token_t *tok, char *str, size_t str_len);
+int GUTHTHILA_CALL guththila_tok_tok_cmp(guththila_token_t *tok1, guththila_token_t *tok2);
+
+EXTERN_C_END()
+
+#endif
+

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/src/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/src/Makefile.am?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/src/Makefile.am (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/src/Makefile.am Fri Jun 15 05:13:24 2007
@@ -1,12 +1,12 @@
 lib_LTLIBRARIES = libguththila.la
 
 libguththila_la_SOURCES = guththila_buffer.c \
+			  guththila_namespace.c \			  
 	 		  guththila_token.c \
 			  guththila_reader.c \
-			  guththila_writer.c \
 			  guththila_attribute.c \
-			  guththila_xml_pull_parser.c \
-			  guththila_unicode.c \
+			  guththila_xml_parser.c \
+			  guththila_stack.c \
 			  guththila_xml_writer.c
 
 libguththila_la_LIBADD = ../../util/src/libaxutil.la

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_attribute.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_attribute.c?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_attribute.c (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_attribute.c Fri Jun 15 05:13:24 2007
@@ -1,82 +1,83 @@
-#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)
-{
-	int  i = 0;
-	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));
-		if (at_list->list){			
-			for (i = at_list->capacity; i < at_list->capacity + addition; i++){
-				guththila_stack_push(&at_list->fr_stack, at_list->list + i);
-			}
-			at_list->capacity += addition;
-		} else {
-			return GUTHTHILA_FAILURE;
-		}
-	}
-	return 0;
-}
-
-guththila_attr_list_t * GUTHTHILA_CALL guththila_attr_list_create()
-{
-	int i = 0;
-	guththila_attr_list_t *at_list = (guththila_attr_list_t *) malloc(sizeof(guththila_attr_list_t));
-	if (!at_list) return NULL;
-
-	at_list->list = (guththila_attr_t *)malloc(sizeof(guththila_attr_t) * GUTHTHILA_ATTR_DEF_SIZE);
-
-	if (at_list->list && guththila_stack_init(&at_list->fr_stack)){
-		at_list->capacity = GUTHTHILA_ATTR_DEF_SIZE;
-		at_list->size = 0;
-		for (i = 0;i < GUTHTHILA_ATTR_DEF_SIZE; i++){
-			guththila_stack_push(&at_list->fr_stack, at_list->list + i);
-		}
-		return at_list;	
-	}
-	return NULL;
-}
-
-int GUTHTHILA_CALL guththila_attr_list_init(guththila_attr_list_t *at_list)
-{
-	int i = 0;	
-	at_list->list = (guththila_attr_t *)malloc(sizeof(guththila_attr_t) * GUTHTHILA_ATTR_DEF_SIZE);
-
-	if (at_list->list && guththila_stack_init(&at_list->fr_stack)){
-		at_list->capacity = GUTHTHILA_ATTR_DEF_SIZE;
-		at_list->size = 0;
-		for (i = 0;i < GUTHTHILA_ATTR_DEF_SIZE; i++){
-			guththila_stack_push(&at_list->fr_stack, at_list->list + i);
-		}
-		return GUTHTHILA_SUCCESS;	
-	}
-	return GUTHTHILA_FAILURE;
-}
-
-guththila_attr_t * GUTHTHILA_CALL guththila_attr_list_get(guththila_attr_list_t *at_list)
-{
-	if (at_list->fr_stack.top > 0 || guththila_attr_list_grow(at_list, GUTHTHILA_ATTR_DEF_SIZE)){
-		return guththila_stack_pop(&at_list->fr_stack);			
-	} 	
-	return NULL;
-}
-int GUTHTHILA_CALL guththila_attr_list_release(guththila_attr_list_t *at_list, guththila_attr_t *attr)
-{
-	return guththila_stack_push(&at_list->fr_stack, attr); 			
-}
-
-void GUTHTHILA_CALL msuila_attr_list_free_data(guththila_attr_list_t *at_list)
-{
-	free(at_list->list);
-	guththila_stack_free_data(&at_list->fr_stack);
-}
-
-void GUTHTHILA_CALL guththila_attr_list_free(guththila_attr_list_t *at_list)
-{
-	free(at_list->list);
-	guththila_stack_free_data(&at_list->fr_stack);
-	free(at_list);
-}
\ No newline at end of file
+#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)
+{
+	int  i = 0;
+	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));
+		if (at_list->list){			
+			for (i = at_list->capacity; i < at_list->capacity + addition; i++){
+				guththila_stack_push(&at_list->fr_stack, at_list->list + i);
+			}
+			at_list->capacity += addition;
+		} else {
+			return GUTHTHILA_FAILURE;
+		}
+	}
+	return 0;
+}
+
+guththila_attr_list_t * GUTHTHILA_CALL guththila_attr_list_create()
+{
+	int i = 0;
+	guththila_attr_list_t *at_list = (guththila_attr_list_t *) malloc(sizeof(guththila_attr_list_t));
+	if (!at_list) return NULL;
+
+	at_list->list = (guththila_attr_t *)malloc(sizeof(guththila_attr_t) * GUTHTHILA_ATTR_DEF_SIZE);
+
+	if (at_list->list && guththila_stack_init(&at_list->fr_stack)){
+		at_list->capacity = GUTHTHILA_ATTR_DEF_SIZE;
+		at_list->size = 0;
+		for (i = 0;i < GUTHTHILA_ATTR_DEF_SIZE; i++){
+			guththila_stack_push(&at_list->fr_stack, at_list->list + i);
+		}
+		return at_list;	
+	}
+	return NULL;
+}
+
+int GUTHTHILA_CALL guththila_attr_list_init(guththila_attr_list_t *at_list)
+{
+	int i = 0;	
+	at_list->list = (guththila_attr_t *)malloc(sizeof(guththila_attr_t) * GUTHTHILA_ATTR_DEF_SIZE);
+
+	if (at_list->list && guththila_stack_init(&at_list->fr_stack)){
+		at_list->capacity = GUTHTHILA_ATTR_DEF_SIZE;
+		at_list->size = 0;
+		for (i = 0;i < GUTHTHILA_ATTR_DEF_SIZE; i++){
+			guththila_stack_push(&at_list->fr_stack, at_list->list + i);
+		}
+		return GUTHTHILA_SUCCESS;	
+	}
+	return GUTHTHILA_FAILURE;
+}
+
+guththila_attr_t * GUTHTHILA_CALL guththila_attr_list_get(guththila_attr_list_t *at_list)
+{
+	if (at_list->fr_stack.top > 0 || guththila_attr_list_grow(at_list, GUTHTHILA_ATTR_DEF_SIZE)){
+		return guththila_stack_pop(&at_list->fr_stack);			
+	} 	
+	return NULL;
+}
+int GUTHTHILA_CALL guththila_attr_list_release(guththila_attr_list_t *at_list, guththila_attr_t *attr)
+{
+	return guththila_stack_push(&at_list->fr_stack, attr); 			
+}
+
+void GUTHTHILA_CALL msuila_attr_list_free_data(guththila_attr_list_t *at_list)
+{
+	free(at_list->list);
+	guththila_stack_free_data(&at_list->fr_stack);
+}
+
+void GUTHTHILA_CALL guththila_attr_list_free(guththila_attr_list_t *at_list)
+{
+	free(at_list->list);
+	guththila_stack_free_data(&at_list->fr_stack);
+	free(at_list);
+}
+

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_buffer.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_buffer.c?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_buffer.c (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_buffer.c Fri Jun 15 05:13:24 2007
@@ -1,137 +1,139 @@
-#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)
-{
-	buffer->type = GUTHTHILA_BUFFER_FILE;
-
-	buffer->data_size = (size_t *)malloc(sizeof(size_t) * GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
-	buffer->buffs_size = (size_t *)malloc(sizeof(size_t) * GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
-	buffer->buff = (char **)malloc(sizeof(char *) * GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
-	buffer->cur_buff = -1;
-	buffer->pre_tot_data = 0;
-	buffer->no_buffers = GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS;
-	if (size > 0 ){
-		buffer->buff[0] = (guththila_char *)malloc(sizeof(guththila_char) * size);	
-		buffer->data_size[0] = 0;
-		buffer->buffs_size[0] = size;
-		buffer->cur_buff = 0;
-	}		
-	return GUTHTHILA_SUCCESS;
-}
-
-int GUTHTHILA_CALL guththila_buffer_un_init(guththila_buffer_t *buffer) 
-{
-	int i = 0;	
-	if (buffer->type == GUTHTHILA_BUFFER_MEMORY && buffer->buff && buffer->cur_buff == 0) {
-		if (buffer->buff[0]) free(buffer->buff[0]);
-		if (buffer->buffs_size) free(buffer->buffs_size);
-		if (buffer->data_size) free(buffer->data_size);
-		free(buffer->buff);
-	} else if (buffer->type == GUTHTHILA_BUFFER_MEMORY && buffer->buff){
-		for (i = 0; i <= buffer->cur_buff; i++) {
-			free(buffer->buff[i]);
-		}
-		free(buffer->buff);
-		if (buffer->data_size) free(buffer->data_size);
-		if (buffer->buffs_size) free(buffer->buffs_size);
-	}
-	return GUTHTHILA_SUCCESS;
-}
-
-int GUTHTHILA_CALL guththila_buffer_init_for_buffer (guththila_buffer_t *buffer, char *buff, int size)
-{
-	buffer->type = GUTHTHILA_BUFFER_MEMORY;	
-
-	buffer->buff = (char **)malloc(sizeof(char *) * GUTHTHILA_BUFFER_DEF_SIZE);
-	buffer->buff[0] = buff;
-	buffer->cur_buff = 0;
-	buffer->buffs_size = (size_t *)malloc(sizeof(size_t) * GUTHTHILA_BUFFER_DEF_SIZE);
-	buffer->buffs_size[0] = size;
-	buffer->pre_tot_data = 0;
-	buffer->data_size = (size_t *)malloc(sizeof(size_t) * GUTHTHILA_BUFFER_DEF_SIZE);
-	buffer->data_size[0] = size;
-	buffer->no_buffers = 1;
-	return GUTHTHILA_SUCCESS;
-}
-
-
-int GUTHTHILA_CALL guththila_buffer_insert_data (guththila_buffer_t * buffer, void *buff, size_t buff_len)
-{
-	size_t no_written = 0;
-	if (buffer->data_size[buffer->cur_buff] + buff_len <= buffer->buffs_size[buffer->cur_buff]) {
-		memcpy(buffer->buff[buffer->cur_buff] + buffer->cur_buff_pos, buff, buff_len);
-	} else {
-		do {
-			if (buff_len > no_written + buffer->buffs_size[buffer->cur_buff] - buffer->cur_buff_pos) {
-				memcpy(buffer->buff[buffer->cur_buff] + buffer->cur_buff_pos, (char *)buff + no_written, buffer->buffs_size[buffer->cur_buff] - buffer->cur_buff_pos);
-				no_written = buffer->buffs_size[buffer->cur_buff] - buffer->cur_buff_pos;			
-				buffer->data_size[buffer->cur_buff] = buffer->buffs_size[buffer->cur_buff];
-				if (buffer->cur_buff == buffer->no_buffers - 1) {
-					buffer->data_size = (size_t *)realloc(buffer->data_size, buffer->no_buffers * 2);
-					buffer->buffs_size = (size_t *)realloc(buffer->data_size, buffer->no_buffers * 2);
-					buffer->buff = (char **)realloc(buffer->buff, buffer->no_buffers * 2);
-					buffer->no_buffers *= 2;
-				}
-				buffer->buff[buffer->cur_buff + 1] = (char *)malloc(sizeof(char) * buffer->data_size[buffer->cur_buff] * 2);    
-				buffer->cur_buff++;
-				buffer->buffs_size[buffer->cur_buff] = buffer->data_size[buffer->cur_buff - 1] * 2;
-				buffer->data_size[buffer->cur_buff] = 0;
-				buffer->pre_tot_data += buffer->data_size[buffer->cur_buff - 1];
-			} else {
-				memcpy(buffer->buff[buffer->cur_buff] + buffer->cur_buff_pos, (char *)buff + no_written, buff_len - no_written);
-				buffer->data_size[buffer->cur_buff] = 0;
-				break;
-			}			
-		} while (1);
-	}
-	return GUTHTHILA_SUCCESS;
-}
-
-int GUTHTHILA_CALL guththila_buffer_shift(guththila_buffer_t * buffer, int no)
-{
-	size_t i = 0, sum = 0, data_move = 0;
-	for (i = 0; i < (size_t)buffer->cur_buff; i++) {
-		sum += buffer->data_size[i];							
-	}
-	data_move = buffer->data_size[buffer->cur_buff] - (no - sum);	
-	if (buffer->cur_buff == buffer->no_buffers - 1) {
-		buffer->data_size = (size_t *)realloc(buffer->data_size, buffer->no_buffers * 2);
-		buffer->buffs_size = (size_t *)realloc(buffer->data_size, buffer->no_buffers * 2);
-		buffer->buff = (char **)realloc(buffer->buff, buffer->no_buffers * 2);
-		buffer->no_buffers *= 2;
-	}
-	buffer->buff[buffer->cur_buff + 1] = (char *)malloc(sizeof(char) * buffer->data_size[buffer->cur_buff] * 2);    
-	buffer->cur_buff++;
-	buffer->buffs_size[buffer->cur_buff] = buffer->data_size[buffer->cur_buff - 1] * 2;
-	buffer->data_size[buffer->cur_buff] = data_move;
-	memcpy(buffer->buff[buffer->cur_buff], buffer->buff[buffer->cur_buff - 1] + buffer->data_size[buffer->cur_buff] - data_move, data_move); 
-	buffer->data_size[buffer->cur_buff] -= data_move; 
-	buffer->pre_tot_data += buffer->data_size[buffer->cur_buff - 1];
-	return GUTHTHILA_SUCCESS;
-}
-
-void * GUTHTHILA_CALL guththila_buffer_get(guththila_buffer_t * buffer)
-{
-	size_t size = 0, i = 0, current_size = 0;
-	char *buff = NULL;
-	for (i = 0; i <= (size_t)buffer->cur_buff; i++) {
-		size += buffer->data_size[i];
-	}
-	buff = (char *) malloc(sizeof(char) * size);
-
-	for (i = 0; i <= buffer->cur_buff; i++) {
-		memcpy(buff + current_size, buffer->buff[i] , buffer->data_size[i]);
-		current_size += buffer->data_size[i];
-	}
-	return buff;
-}
-
-void * GUTHTHILA_CALL guththila_get_position(guththila_buffer_t *buffer, int pos)
-{
-	if (pos > buffer->pre_tot_data) {
-		return buffer->buff[buffer->cur_buff] + pos - buffer->pre_tot_data;
-	}
-}
\ No newline at end of file
+#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)
+{
+	buffer->type = GUTHTHILA_BUFFER_FILE;
+
+	buffer->data_size = (size_t *)malloc(sizeof(size_t) * GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
+	buffer->buffs_size = (size_t *)malloc(sizeof(size_t) * GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
+	buffer->buff = (char **)malloc(sizeof(char *) * GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS);
+	buffer->cur_buff = -1;
+	buffer->pre_tot_data = 0;
+	buffer->no_buffers = GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS;
+	if (size > 0 ){
+		buffer->buff[0] = (guththila_char *)malloc(sizeof(guththila_char) * size);	
+		buffer->data_size[0] = 0;
+		buffer->buffs_size[0] = size;
+		buffer->cur_buff = 0;
+	}		
+	return GUTHTHILA_SUCCESS;
+}
+
+int GUTHTHILA_CALL guththila_buffer_un_init(guththila_buffer_t *buffer) 
+{
+	int i = 0;	
+	if (buffer->type == GUTHTHILA_BUFFER_MEMORY && buffer->buff && buffer->cur_buff == 0) {
+		if (buffer->buff[0]) free(buffer->buff[0]);
+		if (buffer->buffs_size) free(buffer->buffs_size);
+		if (buffer->data_size) free(buffer->data_size);
+		free(buffer->buff);
+	} else if (buffer->type == GUTHTHILA_BUFFER_MEMORY && buffer->buff){
+		for (i = 0; i <= buffer->cur_buff; i++) {
+			free(buffer->buff[i]);
+		}
+		free(buffer->buff);
+		if (buffer->data_size) free(buffer->data_size);
+		if (buffer->buffs_size) free(buffer->buffs_size);
+	}
+	return GUTHTHILA_SUCCESS;
+}
+
+int GUTHTHILA_CALL guththila_buffer_init_for_buffer (guththila_buffer_t *buffer, char *buff, int size)
+{
+	buffer->type = GUTHTHILA_BUFFER_MEMORY;	
+
+	buffer->buff = (char **)malloc(sizeof(char *) * GUTHTHILA_BUFFER_DEF_SIZE);
+	buffer->buff[0] = buff;
+	buffer->cur_buff = 0;
+	buffer->buffs_size = (size_t *)malloc(sizeof(size_t) * GUTHTHILA_BUFFER_DEF_SIZE);
+	buffer->buffs_size[0] = size;
+	buffer->pre_tot_data = 0;
+	buffer->data_size = (size_t *)malloc(sizeof(size_t) * GUTHTHILA_BUFFER_DEF_SIZE);
+	buffer->data_size[0] = size;
+	buffer->no_buffers = 1;
+	return GUTHTHILA_SUCCESS;
+}
+
+
+int GUTHTHILA_CALL guththila_buffer_insert_data (guththila_buffer_t * buffer, void *buff, size_t buff_len)
+{
+	size_t no_written = 0;
+	if (buffer->data_size[buffer->cur_buff] + buff_len <= buffer->buffs_size[buffer->cur_buff]) {
+		memcpy(buffer->buff[buffer->cur_buff] + buffer->cur_buff_pos, buff, buff_len);
+	} else {
+		do {
+			if (buff_len > no_written + buffer->buffs_size[buffer->cur_buff] - buffer->cur_buff_pos) {
+				memcpy(buffer->buff[buffer->cur_buff] + buffer->cur_buff_pos, (char *)buff + no_written, buffer->buffs_size[buffer->cur_buff] - buffer->cur_buff_pos);
+				no_written = buffer->buffs_size[buffer->cur_buff] - buffer->cur_buff_pos;			
+				buffer->data_size[buffer->cur_buff] = buffer->buffs_size[buffer->cur_buff];
+				if (buffer->cur_buff == buffer->no_buffers - 1) {
+					buffer->data_size = (size_t *)realloc(buffer->data_size, buffer->no_buffers * 2);
+					buffer->buffs_size = (size_t *)realloc(buffer->data_size, buffer->no_buffers * 2);
+					buffer->buff = (char **)realloc(buffer->buff, buffer->no_buffers * 2);
+					buffer->no_buffers *= 2;
+				}
+				buffer->buff[buffer->cur_buff + 1] = (char *)malloc(sizeof(char) * buffer->data_size[buffer->cur_buff] * 2);    
+				buffer->cur_buff++;
+				buffer->buffs_size[buffer->cur_buff] = buffer->data_size[buffer->cur_buff - 1] * 2;
+				buffer->data_size[buffer->cur_buff] = 0;
+				buffer->pre_tot_data += buffer->data_size[buffer->cur_buff - 1];
+			} else {
+				memcpy(buffer->buff[buffer->cur_buff] + buffer->cur_buff_pos, (char *)buff + no_written, buff_len - no_written);
+				buffer->data_size[buffer->cur_buff] = 0;
+				break;
+			}			
+		} while (1);
+	}
+	return GUTHTHILA_SUCCESS;
+}
+
+int GUTHTHILA_CALL guththila_buffer_shift(guththila_buffer_t * buffer, int no)
+{
+	size_t i = 0, sum = 0, data_move = 0;
+	for (i = 0; i < (size_t)buffer->cur_buff; i++) {
+		sum += buffer->data_size[i];							
+	}
+	data_move = buffer->data_size[buffer->cur_buff] - (no - sum);	
+	if (buffer->cur_buff == buffer->no_buffers - 1) {
+		buffer->data_size = (size_t *)realloc(buffer->data_size, buffer->no_buffers * 2);
+		buffer->buffs_size = (size_t *)realloc(buffer->data_size, buffer->no_buffers * 2);
+		buffer->buff = (char **)realloc(buffer->buff, buffer->no_buffers * 2);
+		buffer->no_buffers *= 2;
+	}
+	buffer->buff[buffer->cur_buff + 1] = (char *)malloc(sizeof(char) * buffer->data_size[buffer->cur_buff] * 2);    
+	buffer->cur_buff++;
+	buffer->buffs_size[buffer->cur_buff] = buffer->data_size[buffer->cur_buff - 1] * 2;
+	buffer->data_size[buffer->cur_buff] = data_move;
+	memcpy(buffer->buff[buffer->cur_buff], buffer->buff[buffer->cur_buff - 1] + buffer->data_size[buffer->cur_buff] - data_move, data_move); 
+	buffer->data_size[buffer->cur_buff] -= data_move; 
+	buffer->pre_tot_data += buffer->data_size[buffer->cur_buff - 1];
+	return GUTHTHILA_SUCCESS;
+}
+
+void * GUTHTHILA_CALL guththila_buffer_get(guththila_buffer_t * buffer)
+{
+	size_t size = 0, i = 0, current_size = 0;
+	char *buff = NULL;
+	for (i = 0; i <= (size_t)buffer->cur_buff; i++) {
+		size += buffer->data_size[i];
+	}
+	buff = (char *) malloc(sizeof(char) * size);
+
+	for (i = 0; i <= buffer->cur_buff; i++) {
+		memcpy(buff + current_size, buffer->buff[i] , buffer->data_size[i]);
+		current_size += buffer->data_size[i];
+	}
+	return buff;
+}
+
+void * GUTHTHILA_CALL guththila_get_position(guththila_buffer_t *buffer, int pos)
+{
+	if (pos > buffer->pre_tot_data) {
+		return buffer->buff[buffer->cur_buff] + pos - buffer->pre_tot_data;
+	}
+	return NULL;
+}
+

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_namespace.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_namespace.c?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_namespace.c (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_namespace.c Fri Jun 15 05:13:24 2007
@@ -1,82 +1,83 @@
-#include <guththila_namespace.h>
-#include <guththila_stack.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-int GUTHTHILA_CALL guththila_namespace_list_grow(guththila_namespace_list_t *namesp_list, int addition)
-{
-	int  i = 0;
-	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){			
-			for (i = namesp_list->capacity; i < namesp_list->capacity + addition; i++){
-				guththila_stack_push(&namesp_list->fr_stack, namesp_list->list + i);
-			}
-			namesp_list->capacity += addition;
-		} else {
-			return GUTHTHILA_FAILURE;
-		}
-	}
-	return 0;
-}
-
-guththila_namespace_list_t * GUTHTHILA_CALL guththila_namespace_list_create()
-{
-	int i = 0;
-	guththila_namespace_list_t *namesp_list = (guththila_namespace_list_t *) malloc(sizeof(guththila_namespace_list_t));
-	if (!namesp_list) return NULL;
-
-	namesp_list->list = (guththila_namespace_t *)malloc(sizeof(guththila_namespace_t) * GUTHTHILA_NAMESPACE_DEF_SIZE);
-
-	if (namesp_list->list && guththila_stack_init(&namesp_list->fr_stack)){
-		namesp_list->capacity = GUTHTHILA_NAMESPACE_DEF_SIZE;
-		namesp_list->size = 0;
-		for (i = 0;i < GUTHTHILA_NAMESPACE_DEF_SIZE; i++){
-			guththila_stack_push(&namesp_list->fr_stack, namesp_list->list + i);
-		}
-		return namesp_list;	
-	}
-	return NULL;
-}
-
-int GUTHTHILA_CALL guththila_namespace_list_init(guththila_namespace_list_t *namesp_list)
-{
-	int i = 0;	
-	namesp_list->list = (guththila_namespace_t *)malloc(sizeof(guththila_namespace_t) * GUTHTHILA_NAMESPACE_DEF_SIZE);
-
-	if (namesp_list->list && guththila_stack_init(&namesp_list->fr_stack)){
-		namesp_list->capacity = GUTHTHILA_NAMESPACE_DEF_SIZE;
-		namesp_list->size = 0;
-		for (i = 0;i < GUTHTHILA_NAMESPACE_DEF_SIZE; i++){
-			guththila_stack_push(&namesp_list->fr_stack, namesp_list->list + i);
-		}
-		return GUTHTHILA_SUCCESS;	
-	}
-	return GUTHTHILA_FAILURE;
-}
-
-guththila_namespace_t * GUTHTHILA_CALL guththila_namespace_list_get(guththila_namespace_list_t *namesp_list)
-{
-	if (namesp_list->fr_stack.top > 0 || guththila_namespace_list_grow(namesp_list, GUTHTHILA_NAMESPACE_DEF_SIZE)){
-		return guththila_stack_pop(&namesp_list->fr_stack);			
-	} 	
-	return NULL;
-}
-int GUTHTHILA_CALL guththila_namespace_list_release(guththila_namespace_list_t *namesp_list, guththila_namespace_t *namespace)
-{
-	return guththila_stack_push(&namesp_list->fr_stack, namespace); 			
-}
-
-void GUTHTHILA_CALL msuila_namespace_list_free_data(guththila_namespace_list_t *namesp_list)
-{
-	free(namesp_list->list);
-	guththila_stack_free_data(&namesp_list->fr_stack);
-}
-
-void GUTHTHILA_CALL guththila_namespace_list_free(guththila_namespace_list_t *namesp_list)
-{
-	free(namesp_list->list);
-	guththila_stack_free_data(&namesp_list->fr_stack);
-	free(namesp_list);
-}
\ No newline at end of file
+#include <guththila_namespace.h>
+#include <guththila_stack.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int GUTHTHILA_CALL guththila_namespace_list_grow(guththila_namespace_list_t *namesp_list, int addition)
+{
+	int  i = 0;
+	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){			
+			for (i = namesp_list->capacity; i < namesp_list->capacity + addition; i++){
+				guththila_stack_push(&namesp_list->fr_stack, namesp_list->list + i);
+			}
+			namesp_list->capacity += addition;
+		} else {
+			return GUTHTHILA_FAILURE;
+		}
+	}
+	return 0;
+}
+
+guththila_namespace_list_t * GUTHTHILA_CALL guththila_namespace_list_create()
+{
+	int i = 0;
+	guththila_namespace_list_t *namesp_list = (guththila_namespace_list_t *) malloc(sizeof(guththila_namespace_list_t));
+	if (!namesp_list) return NULL;
+
+	namesp_list->list = (guththila_namespace_t *)malloc(sizeof(guththila_namespace_t) * GUTHTHILA_NAMESPACE_DEF_SIZE);
+
+	if (namesp_list->list && guththila_stack_init(&namesp_list->fr_stack)){
+		namesp_list->capacity = GUTHTHILA_NAMESPACE_DEF_SIZE;
+		namesp_list->size = 0;
+		for (i = 0;i < GUTHTHILA_NAMESPACE_DEF_SIZE; i++){
+			guththila_stack_push(&namesp_list->fr_stack, namesp_list->list + i);
+		}
+		return namesp_list;	
+	}
+	return NULL;
+}
+
+int GUTHTHILA_CALL guththila_namespace_list_init(guththila_namespace_list_t *namesp_list)
+{
+	int i = 0;	
+	namesp_list->list = (guththila_namespace_t *)malloc(sizeof(guththila_namespace_t) * GUTHTHILA_NAMESPACE_DEF_SIZE);
+
+	if (namesp_list->list && guththila_stack_init(&namesp_list->fr_stack)){
+		namesp_list->capacity = GUTHTHILA_NAMESPACE_DEF_SIZE;
+		namesp_list->size = 0;
+		for (i = 0;i < GUTHTHILA_NAMESPACE_DEF_SIZE; i++){
+			guththila_stack_push(&namesp_list->fr_stack, namesp_list->list + i);
+		}
+		return GUTHTHILA_SUCCESS;	
+	}
+	return GUTHTHILA_FAILURE;
+}
+
+guththila_namespace_t * GUTHTHILA_CALL guththila_namespace_list_get(guththila_namespace_list_t *namesp_list)
+{
+	if (namesp_list->fr_stack.top > 0 || guththila_namespace_list_grow(namesp_list, GUTHTHILA_NAMESPACE_DEF_SIZE)){
+		return guththila_stack_pop(&namesp_list->fr_stack);			
+	} 	
+	return NULL;
+}
+int GUTHTHILA_CALL guththila_namespace_list_release(guththila_namespace_list_t *namesp_list, guththila_namespace_t *namespace)
+{
+	return guththila_stack_push(&namesp_list->fr_stack, namespace); 			
+}
+
+void GUTHTHILA_CALL msuila_namespace_list_free_data(guththila_namespace_list_t *namesp_list)
+{
+	free(namesp_list->list);
+	guththila_stack_free_data(&namesp_list->fr_stack);
+}
+
+void GUTHTHILA_CALL guththila_namespace_list_free(guththila_namespace_list_t *namesp_list)
+{
+	free(namesp_list->list);
+	guththila_stack_free_data(&namesp_list->fr_stack);
+	free(namesp_list);
+}
+

Modified: webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_reader.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_reader.c?view=diff&rev=547645&r1=547644&r2=547645
==============================================================================
--- webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_reader.c (original)
+++ webservices/axis2/scratch/c/guththila_ng/guththila/src/guththila_reader.c Fri Jun 15 05:13:24 2007
@@ -1,224 +1,224 @@
-#include <stdlib.h>
-#include <string.h>
-#include <guththila_reader.h>
-
-GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL
-guththila_reader_create_for_file (char* file_name)
-{
-	guththila_reader_t *reader = NULL;
-	FILE *f = NULL;
-	if (!file_name)
-		return NULL;
-	reader = (guththila_reader_t *) malloc(sizeof(guththila_reader_t));
-	if (!reader)
-		return NULL;
-	f = fopen(file_name, "r");
-
-	if (!f) {
-		free(reader);
-		return NULL;
-	}
-	reader->fp = f;
-	reader->type = GUTHTHILA_FILE_READER;
-	guththila_buffer_init(&reader->buffer, 0);
-	reader->next = 0;
-	reader->last_start = -1;
-	return reader;
-}
-
-GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL
-guththila_reader_create_for_memory(void *buffer, int size)
-{
-	guththila_reader_t *reader = (guththila_reader_t *) malloc(sizeof(guththila_reader_t));	
-	if (reader) {
-		reader->type = GUTHTHILA_MEMORY_READER;
-		guththila_buffer_init_for_buffer(&reader->buffer, buffer, size);	
-		reader->next = 0;
-		reader->last_start = -1;
-		return reader;
-	}
-	return NULL;
-}
-
-GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL 
-guththila_reader_create_for_io(GUTHTHILA_READ_INPUT_CALLBACK input_read_callback, void *ctx)
-{
-	guththila_reader_t *reader = (guththila_reader_t *)malloc(sizeof(guththila_reader_t));
-    if (reader){
-		reader->input_read_callback = input_read_callback;
-		reader->context = ctx;
-		reader->type = GUTHTHILA_IO_READER;
-		reader->next = 0;
-		guththila_buffer_init(&reader->buffer, 0);
-		reader->last_start = -1;
-		return reader;
-    }
-    return NULL;
-}
-
-GUTHTHILA_EXPORT void GUTHTHILA_CALL
-guththila_reader_free (guththila_reader_t * r)
-{
-	if (r->type == GUTHTHILA_FILE_READER && r->fp){
-		fclose(r->fp);
-	}	
-	guththila_buffer_un_init(&r->buffer);
-	free(r);
-}
-
-GUTHTHILA_EXPORT int GUTHTHILA_CALL
-guththila_reader_read (guththila_reader_t *r, guththila_char *buffer, int offset, int length)
-{
-	int rt = r->type;
-	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 r->buffer.buffs_size[0];	
-	}
-	return 0;
-}
-
-int GUTHTHILA_CALL guththila_reader_next_char(guththila_reader_t *r, int eof)
-{
-	int c = -1;
-	size_t temp = 0, data_move = 0, i = 0;
-	char **temp1 = NULL;
-	size_t *temp2 = NULL, *temp3 = NULL;
-	if (r->type == GUTHTHILA_MEMORY_READER && r->next < GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer)){        		
-		c = r->buffer.buff[0][r->next++];
-		return c >= 0 ? c : -1;
-	} else if (r->type == GUTHTHILA_IO_READER || r->type == GUTHTHILA_FILE_READER){
-		if (r->next < GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer) + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer) && r->buffer.cur_buff != -1) {
-			c = r->buffer.buff[r->buffer.cur_buff][r->next++ - GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer)];			 
-			return c >= 0 ? c : -1;
-		} else if (r->next >= GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer) + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer) && r->buffer.cur_buff != -1){
-			if (r->buffer.cur_buff == r->buffer.no_buffers - 1) {				
-				temp = r->buffer.no_buffers * 2;
-				temp1 = (char **)malloc(sizeof(char *) * temp);
-				temp2 = (size_t *)malloc(sizeof(size_t) * temp);
-				temp3 = (size_t *)malloc(sizeof(size_t) * temp);
-				for (i = 0; i < r->buffer.no_buffers; i++) {
-					temp1[i] = r->buffer.buff[i];
-					temp2[i] = r->buffer.buffs_size[i];
-					temp3[i] = r->buffer.data_size[i];
-				}
-				free(r->buffer.buff);
-				free(r->buffer.data_size);
-				free(r->buffer.buffs_size);
-				r->buffer.buff = temp1;
-				r->buffer.buffs_size = temp2;
-				r->buffer.data_size = temp3;
-				r->buffer.no_buffers *= 2;				
-			}
-			r->buffer.cur_buff++;
-			r->buffer.buff[r->buffer.cur_buff] = (char *)malloc(sizeof(char) * r->buffer.buffs_size[r->buffer.cur_buff - 1] * 2);    
-			r->buffer.buffs_size[r->buffer.cur_buff] = r->buffer.buffs_size[r->buffer.cur_buff - 1] * 2;
-			r->buffer.data_size[r->buffer.cur_buff] = 0;						
-			
-			if (r->last_start != -1) {
-				data_move = r->buffer.data_size[r->buffer.cur_buff - 1] - (r->last_start - r->buffer.pre_tot_data);
-				memcpy(r->buffer.buff[r->buffer.cur_buff], 
-					r->buffer.buff[r->buffer.cur_buff - 1] + r->buffer.data_size[r->buffer.cur_buff] - data_move, 
-					data_move); 
-				r->buffer.data_size[r->buffer.cur_buff - 1] -= data_move; 
-				r->buffer.data_size[r->buffer.cur_buff] += data_move; 				
-			}
-			r->buffer.pre_tot_data += r->buffer.data_size[r->buffer.cur_buff - 1];								
-			temp = guththila_reader_read(r, GUTHTHILA_BUFFER_CURRENT_BUFF(r->buffer), 0, GUTHTHILA_BUFFER_CURRENT_BUFF_SIZE(r->buffer));			
-			if (temp > 0) {
-				r->buffer.data_size[r->buffer.cur_buff] += temp; 
-			} else {
-				return -1;
-			}
-			c = r->buffer.buff[r->buffer.cur_buff][r->next++ - GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer)];
-			return c >= 0 ? c : -1;
-		} else if (r->buffer.cur_buff == -1){
-			r->buffer.buff[0] = (char *) malloc(sizeof(char) * GUTHTHILA_BUFFER_DEF_SIZE);
-			r->buffer.buffs_size[0] = GUTHTHILA_BUFFER_DEF_SIZE;
-			r->buffer.cur_buff = 0;
-			temp = guththila_reader_read(r, r->buffer.buff[0], 0, GUTHTHILA_BUFFER_DEF_SIZE);
-			r->buffer.data_size[0] = temp;
-			c = r->buffer.buff[0][r->next++];
-			return c >= 0 ? c : -1;
-		}
-	} 
-	return -1;
-}
-
-int GUTHTHILA_CALL guththila_reader_next_no_char (guththila_reader_t *r, int eof, char *bytes, int no)
-{
-	int c = -1, temp = 0, data_move = 0, i = 0;
-	char **temp1 = NULL;
-	size_t *temp2 = NULL, *temp3 = NULL;
-	if (r->type == GUTHTHILA_MEMORY_READER && r->next + no - 1 < GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer) && r->buffer.cur_buff != -1){        
-		for (i = 0; i < no; i++){
-			bytes[i] = r->buffer.buff[0][r->next++];								
-		}
-		return no;
-	} else if (r->type == GUTHTHILA_IO_READER || r->type == GUTHTHILA_FILE_READER){
-		if (r->next < GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer) + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer) + no && r->buffer.cur_buff != -1) {
-			for (i = 0; i < no; i++){
-				bytes[i] = r->buffer.buff[r->buffer.cur_buff][r->next++ - GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer)];	
-			}
-			return no;
-		} else if (r->next >= GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer) + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer) + no && r->buffer.cur_buff != -1){
-			if (r->buffer.cur_buff == r->buffer.no_buffers - 1) {
-				temp = r->buffer.no_buffers * 2;
-				temp1 = (char **)malloc(sizeof(char *) * temp);
-				temp2 = (size_t *)malloc(sizeof(size_t) * temp);
-				temp3 = (size_t *)malloc(sizeof(size_t) * temp);
-				for (i = 0; i < r->buffer.no_buffers; i++) {
-					temp1[i] = r->buffer.buff[i];
-					temp2[i] = r->buffer.buffs_size[i];
-					temp3[i] = r->buffer.data_size[i];
-				}
-				free(r->buffer.buff);
-				free(r->buffer.data_size);
-				free(r->buffer.buffs_size);
-				r->buffer.buff = temp1;
-				r->buffer.buffs_size = temp2;
-				r->buffer.data_size = temp3;
-				r->buffer.no_buffers *= 2;
-			}
-			r->buffer.buff[r->buffer.cur_buff + 1] = (char *)malloc(sizeof(char) * r->buffer.data_size[r->buffer.cur_buff] * 2);    
-			r->buffer.cur_buff++;
-			r->buffer.buffs_size[r->buffer.cur_buff] = r->buffer.buffs_size[r->buffer.cur_buff - 1] * 2;
-			r->buffer.data_size[r->buffer.cur_buff] = 0;						
-			
-			if (r->last_start != -1) {
-				data_move = r->buffer.data_size[r->buffer.cur_buff - 1] - (r->last_start - r->buffer.pre_tot_data);
-				memcpy(r->buffer.buff[r->buffer.cur_buff], 
-					r->buffer.buff[r->buffer.cur_buff - 1] + r->buffer.data_size[r->buffer.cur_buff] - data_move, 
-					data_move); 
-				r->buffer.data_size[r->buffer.cur_buff - 1] -= data_move; 
-				r->buffer.data_size[r->buffer.cur_buff] += data_move; 				
-			}
-			r->buffer.pre_tot_data += r->buffer.data_size[r->buffer.cur_buff - 1];								
-			temp = guththila_reader_read(r, GUTHTHILA_BUFFER_CURRENT_BUFF(r->buffer), 0, GUTHTHILA_BUFFER_CURRENT_BUFF_SIZE(r->buffer));			
-			if (temp > 0) {
-				r->buffer.data_size[r->buffer.cur_buff] += temp; 
-			} else {
-				return -1;
-			}
-			for (i = 0; i < no; i++){
-				bytes[i] = r->buffer.buff[r->buffer.cur_buff][r->next++ - GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer)];
-			}
-			return no;
-		} else if (r->buffer.cur_buff == -1){
-			r->buffer.buff[0] = (char *) malloc(sizeof(char) * GUTHTHILA_BUFFER_DEF_SIZE);
-			r->buffer.buffs_size[0] = GUTHTHILA_BUFFER_DEF_SIZE;
-			r->buffer.cur_buff = 0;
-			temp = guththila_reader_read(r, r->buffer.buff[0], 0, GUTHTHILA_BUFFER_DEF_SIZE);
-			r->buffer.data_size[0] = temp;
-			for (i = 0; i < no; i++){
-				bytes[i] = r->buffer.buff[r->buffer.cur_buff][r->next++ - GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer)];
-			}
-		    return no;
-		}
-	}
-	return c >= 0 ? c : -1;
-}
-                       
+#include <stdlib.h>
+#include <string.h>
+#include <guththila_reader.h>
+
+GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL
+guththila_reader_create_for_file (char* file_name)
+{
+	guththila_reader_t *reader = NULL;
+	FILE *f = NULL;
+	if (!file_name)
+		return NULL;
+	reader = (guththila_reader_t *) malloc(sizeof(guththila_reader_t));
+	if (!reader)
+		return NULL;
+	f = fopen(file_name, "r");
+
+	if (!f) {
+		free(reader);
+		return NULL;
+	}
+	reader->fp = f;
+	reader->type = GUTHTHILA_FILE_READER;
+	guththila_buffer_init(&reader->buffer, 0);
+	reader->next = 0;
+	reader->last_start = -1;
+	return reader;
+}
+
+GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL
+guththila_reader_create_for_memory(void *buffer, int size)
+{
+	guththila_reader_t *reader = (guththila_reader_t *) malloc(sizeof(guththila_reader_t));	
+	if (reader) {
+		reader->type = GUTHTHILA_MEMORY_READER;
+		guththila_buffer_init_for_buffer(&reader->buffer, buffer, size);	
+		reader->next = 0;
+		reader->last_start = -1;
+		return reader;
+	}
+	return NULL;
+}
+
+GUTHTHILA_EXPORT guththila_reader_t * GUTHTHILA_CALL 
+guththila_reader_create_for_io(GUTHTHILA_READ_INPUT_CALLBACK input_read_callback, void *ctx)
+{
+	guththila_reader_t *reader = (guththila_reader_t *)malloc(sizeof(guththila_reader_t));
+    if (reader){
+		reader->input_read_callback = input_read_callback;
+		reader->context = ctx;
+		reader->type = GUTHTHILA_IO_READER;
+		reader->next = 0;
+		guththila_buffer_init(&reader->buffer, 0);
+		reader->last_start = -1;
+		return reader;
+    }
+    return NULL;
+}
+
+GUTHTHILA_EXPORT void GUTHTHILA_CALL
+guththila_reader_free (guththila_reader_t * r)
+{
+	if (r->type == GUTHTHILA_FILE_READER && r->fp){
+		fclose(r->fp);
+	}	
+	guththila_buffer_un_init(&r->buffer);
+	free(r);
+}
+
+GUTHTHILA_EXPORT int GUTHTHILA_CALL
+guththila_reader_read (guththila_reader_t *r, guththila_char *buffer, int offset, int length)
+{
+	int rt = r->type;
+	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 r->buffer.buffs_size[0];	
+	}
+	return 0;
+}
+
+int GUTHTHILA_CALL guththila_reader_next_char(guththila_reader_t *r, int eof)
+{
+	int c = -1;
+	size_t temp = 0, data_move = 0, i = 0;
+	char **temp1 = NULL;
+	size_t *temp2 = NULL, *temp3 = NULL;
+	if (r->type == GUTHTHILA_MEMORY_READER && r->next < GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer)){        		
+		c = r->buffer.buff[0][r->next++];
+		return c >= 0 ? c : -1;
+	} else if (r->type == GUTHTHILA_IO_READER || r->type == GUTHTHILA_FILE_READER){
+		if (r->next < GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer) + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer) && r->buffer.cur_buff != -1) {
+			c = r->buffer.buff[r->buffer.cur_buff][r->next++ - GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer)];			 
+			return c >= 0 ? c : -1;
+		} else if (r->next >= GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer) + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer) && r->buffer.cur_buff != -1){
+			if (r->buffer.cur_buff == r->buffer.no_buffers - 1) {				
+				temp = r->buffer.no_buffers * 2;
+				temp1 = (char **)malloc(sizeof(char *) * temp);
+				temp2 = (size_t *)malloc(sizeof(size_t) * temp);
+				temp3 = (size_t *)malloc(sizeof(size_t) * temp);
+				for (i = 0; i < r->buffer.no_buffers; i++) {
+					temp1[i] = r->buffer.buff[i];
+					temp2[i] = r->buffer.buffs_size[i];
+					temp3[i] = r->buffer.data_size[i];
+				}
+				free(r->buffer.buff);
+				free(r->buffer.data_size);
+				free(r->buffer.buffs_size);
+				r->buffer.buff = temp1;
+				r->buffer.buffs_size = temp2;
+				r->buffer.data_size = temp3;
+				r->buffer.no_buffers *= 2;				
+			}
+			r->buffer.cur_buff++;
+			r->buffer.buff[r->buffer.cur_buff] = (char *)malloc(sizeof(char) * r->buffer.buffs_size[r->buffer.cur_buff - 1] * 2);    
+			r->buffer.buffs_size[r->buffer.cur_buff] = r->buffer.buffs_size[r->buffer.cur_buff - 1] * 2;
+			r->buffer.data_size[r->buffer.cur_buff] = 0;						
+			
+			if (r->last_start != -1) {
+				data_move = r->buffer.data_size[r->buffer.cur_buff - 1] - (r->last_start - r->buffer.pre_tot_data);
+				memcpy(r->buffer.buff[r->buffer.cur_buff], 
+					r->buffer.buff[r->buffer.cur_buff - 1] + r->buffer.data_size[r->buffer.cur_buff] - data_move, 
+					data_move); 
+				r->buffer.data_size[r->buffer.cur_buff - 1] -= data_move; 
+				r->buffer.data_size[r->buffer.cur_buff] += data_move; 				
+			}
+			r->buffer.pre_tot_data += r->buffer.data_size[r->buffer.cur_buff - 1];								
+			temp = guththila_reader_read(r, GUTHTHILA_BUFFER_CURRENT_BUFF(r->buffer), 0, GUTHTHILA_BUFFER_CURRENT_BUFF_SIZE(r->buffer));			
+			if (temp > 0) {
+				r->buffer.data_size[r->buffer.cur_buff] += temp; 
+			} else {
+				return -1;
+			}
+			c = r->buffer.buff[r->buffer.cur_buff][r->next++ - GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer)];
+			return c >= 0 ? c : -1;
+		} else if (r->buffer.cur_buff == -1){
+			r->buffer.buff[0] = (char *) malloc(sizeof(char) * GUTHTHILA_BUFFER_DEF_SIZE);
+			r->buffer.buffs_size[0] = GUTHTHILA_BUFFER_DEF_SIZE;
+			r->buffer.cur_buff = 0;
+			temp = guththila_reader_read(r, r->buffer.buff[0], 0, GUTHTHILA_BUFFER_DEF_SIZE);
+			r->buffer.data_size[0] = temp;
+			c = r->buffer.buff[0][r->next++];
+			return c >= 0 ? c : -1;
+		}
+	} 
+	return -1;
+}
+
+int GUTHTHILA_CALL guththila_reader_next_no_char (guththila_reader_t *r, int eof, char *bytes, int no)
+{
+	int c = -1, temp = 0, data_move = 0, i = 0;
+	char **temp1 = NULL;
+	size_t *temp2 = NULL, *temp3 = NULL;
+	if (r->type == GUTHTHILA_MEMORY_READER && r->next + no - 1 < GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer) && r->buffer.cur_buff != -1){        
+		for (i = 0; i < no; i++){
+			bytes[i] = r->buffer.buff[0][r->next++];								
+		}
+		return no;
+	} else if (r->type == GUTHTHILA_IO_READER || r->type == GUTHTHILA_FILE_READER){
+		if (r->next < GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer) + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer) + no && r->buffer.cur_buff != -1) {
+			for (i = 0; i < no; i++){
+				bytes[i] = r->buffer.buff[r->buffer.cur_buff][r->next++ - GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer)];	
+			}
+			return no;
+		} else if (r->next >= GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer) + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(r->buffer) + no && r->buffer.cur_buff != -1){
+			if (r->buffer.cur_buff == r->buffer.no_buffers - 1) {
+				temp = r->buffer.no_buffers * 2;
+				temp1 = (char **)malloc(sizeof(char *) * temp);
+				temp2 = (size_t *)malloc(sizeof(size_t) * temp);
+				temp3 = (size_t *)malloc(sizeof(size_t) * temp);
+				for (i = 0; i < r->buffer.no_buffers; i++) {
+					temp1[i] = r->buffer.buff[i];
+					temp2[i] = r->buffer.buffs_size[i];
+					temp3[i] = r->buffer.data_size[i];
+				}
+				free(r->buffer.buff);
+				free(r->buffer.data_size);
+				free(r->buffer.buffs_size);
+				r->buffer.buff = temp1;
+				r->buffer.buffs_size = temp2;
+				r->buffer.data_size = temp3;
+				r->buffer.no_buffers *= 2;
+			}
+			r->buffer.buff[r->buffer.cur_buff + 1] = (char *)malloc(sizeof(char) * r->buffer.data_size[r->buffer.cur_buff] * 2);    
+			r->buffer.cur_buff++;
+			r->buffer.buffs_size[r->buffer.cur_buff] = r->buffer.buffs_size[r->buffer.cur_buff - 1] * 2;
+			r->buffer.data_size[r->buffer.cur_buff] = 0;						
+			
+			if (r->last_start != -1) {
+				data_move = r->buffer.data_size[r->buffer.cur_buff - 1] - (r->last_start - r->buffer.pre_tot_data);
+				memcpy(r->buffer.buff[r->buffer.cur_buff], 
+					r->buffer.buff[r->buffer.cur_buff - 1] + r->buffer.data_size[r->buffer.cur_buff] - data_move, 
+					data_move); 
+				r->buffer.data_size[r->buffer.cur_buff - 1] -= data_move; 
+				r->buffer.data_size[r->buffer.cur_buff] += data_move; 				
+			}
+			r->buffer.pre_tot_data += r->buffer.data_size[r->buffer.cur_buff - 1];								
+			temp = guththila_reader_read(r, GUTHTHILA_BUFFER_CURRENT_BUFF(r->buffer), 0, GUTHTHILA_BUFFER_CURRENT_BUFF_SIZE(r->buffer));			
+			if (temp > 0) {
+				r->buffer.data_size[r->buffer.cur_buff] += temp; 
+			} else {
+				return -1;
+			}
+			for (i = 0; i < no; i++){
+				bytes[i] = r->buffer.buff[r->buffer.cur_buff][r->next++ - GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer)];
+			}
+			return no;
+		} else if (r->buffer.cur_buff == -1){
+			r->buffer.buff[0] = (char *) malloc(sizeof(char) * GUTHTHILA_BUFFER_DEF_SIZE);
+			r->buffer.buffs_size[0] = GUTHTHILA_BUFFER_DEF_SIZE;
+			r->buffer.cur_buff = 0;
+			temp = guththila_reader_read(r, r->buffer.buff[0], 0, GUTHTHILA_BUFFER_DEF_SIZE);
+			r->buffer.data_size[0] = temp;
+			for (i = 0; i < no; i++){
+				bytes[i] = r->buffer.buff[r->buffer.cur_buff][r->next++ - GUTHTHILA_BUFFER_PRE_DATA_SIZE(r->buffer)];
+			}
+		    return no;
+		}
+	}
+	return c >= 0 ? c : -1;
+}
+                       



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