axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r328009 - in /webservices/axis2/trunk/c/modules/xml/guththila/src: Makefile.am Makefile.in guththila_array.c guththila_array.h guththila_string.c guththila_string.h guththila_xml_pull_parser.c guththila_xml_stream_writer.c
Date Mon, 24 Oct 2005 09:23:30 GMT
Author: samisa
Date: Mon Oct 24 02:23:17 2005
New Revision: 328009

URL: http://svn.apache.org/viewcvs?rev=328009&view=rev
Log:
removed warnings

Modified:
    webservices/axis2/trunk/c/modules/xml/guththila/src/Makefile.am
    webservices/axis2/trunk/c/modules/xml/guththila/src/Makefile.in
    webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_array.c
    webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_array.h
    webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_string.c
    webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_string.h
    webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c
    webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_stream_writer.c

Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/Makefile.am?rev=328009&r1=328008&r2=328009&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/Makefile.am Mon Oct 24 02:23:17 2005
@@ -1,5 +1,5 @@
 lib_LTLIBRARIES = libguththila.la
-AM_CPPFLAGS = $(CPPFLAGS) -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread
+AM_CPPFLAGS = $(CPPFLAGS) 
 libguththila_la_SOURCES = guththila_token.c \
                             guththila_xml_pull_parser.c \
                             guththila_buffer.c \
@@ -7,7 +7,14 @@
                             guththila_stack.c \
                             guththila_unicode.c \
                             guththila_main.c \
-                            guththila_reader.c
+                            guththila_reader.c \
+                            guththila_allocator.c \
+                            guththila_array.c \
+                            guththila_string.c \
+                            guththila_stream.c \
+                            guththila_environment.c \
+                            guththila_log.c \
+                            guththila_error.c 
 
 libguththila_la_LIBADD = $(LDFLAGS)
-INCLUDES = -I$(top_builddir)/include -I${CUTEST_HOME}/include -I${APR_HOME}/include/apr-1
+INCLUDES = -I$(top_builddir)/include -I${CUTEST_HOME}/include 

Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/Makefile.in
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/Makefile.in?rev=328009&r1=328008&r2=328009&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/Makefile.in (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/Makefile.in Mon Oct 24 02:23:17 2005
@@ -66,7 +66,10 @@
 am_libguththila_la_OBJECTS = guththila_token.lo \
 	guththila_xml_pull_parser.lo guththila_buffer.lo \
 	guththila_xml_stream_writer.lo guththila_stack.lo \
-	guththila_unicode.lo guththila_main.lo guththila_reader.lo
+	guththila_unicode.lo guththila_main.lo guththila_reader.lo \
+	guththila_allocator.lo guththila_array.lo guththila_string.lo \
+	guththila_stream.lo guththila_environment.lo guththila_log.lo \
+	guththila_error.lo
 libguththila_la_OBJECTS = $(am_libguththila_la_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp
@@ -193,7 +196,7 @@
 target_os = @target_os@
 target_vendor = @target_vendor@
 lib_LTLIBRARIES = libguththila.la
-AM_CPPFLAGS = $(CPPFLAGS) -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread
+AM_CPPFLAGS = $(CPPFLAGS) 
 libguththila_la_SOURCES = guththila_token.c \
                             guththila_xml_pull_parser.c \
                             guththila_buffer.c \
@@ -201,10 +204,17 @@
                             guththila_stack.c \
                             guththila_unicode.c \
                             guththila_main.c \
-                            guththila_reader.c
+                            guththila_reader.c \
+                            guththila_allocator.c \
+                            guththila_array.c \
+                            guththila_string.c \
+                            guththila_stream.c \
+                            guththila_environment.c \
+                            guththila_log.c \
+                            guththila_error.c 
 
 libguththila_la_LIBADD = $(LDFLAGS)
-INCLUDES = -I$(top_builddir)/include -I${CUTEST_HOME}/include -I${APR_HOME}/include/apr-1
+INCLUDES = -I$(top_builddir)/include -I${CUTEST_HOME}/include 
 all: all-am
 
 .SUFFIXES:
@@ -274,10 +284,17 @@
 distclean-compile:
 	-rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_allocator.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_array.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_buffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_environment.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_error.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_log.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_main.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_reader.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_stack.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_stream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_string.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_token.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_unicode.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guththila_xml_pull_parser.Plo@am__quote@

Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_array.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_array.c?rev=328009&r1=328008&r2=328009&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_array.c (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_array.c Mon Oct 24 02:23:17 2005
@@ -97,7 +97,7 @@
     ++arr->nelts;
     return arr->elts + (arr->elt_size * (arr->nelts - 1));
 }
-
+/*
 static void *guththila_array_push_noclear(guththila_array_header_t *arr)
 {
     if (arr->nelts == arr->nalloc) {
@@ -114,7 +114,7 @@
     ++arr->nelts;
     return arr->elts + (arr->elt_size * (arr->nelts - 1));
 }
-
+*/
 void guththila_array_cat(guththila_array_header_t *dst,
 			       const guththila_array_header_t *src)
 {
@@ -256,864 +256,3 @@
     return res;
 }
 
-
-/*****************************************************************
- *
- * The "table" functions.
- */
-
-#if GUTHTHILA_CHARSET_EBCDIC
-#define CASE_MASK 0xbfbfbfbf
-#else
-#define CASE_MASK 0xdfdfdfdf
-#endif
-
-#define TABLE_HASH_SIZE 32
-#define TABLE_INDEX_MASK 0x1f
-#define TABLE_HASH(key)  (TABLE_INDEX_MASK & *(guththila_unsigned_char_t *)(key))
-#define TABLE_INDEX_IS_INITIALIZED(t, i) ((t)->index_initialized & (1 << (i)))
-#define TABLE_SET_INDEX_INITIALIZED(t, i) ((t)->index_initialized |= (1 << (i)))
-
-/* Compute the "checksum" for a key, consisting of the first
- * 4 bytes, normalized for case-insensitivity and packed into
- * an int...this checksum allows us to do a single integer
- * comparison as a fast check to determine whether we can
- * skip a strcasecmp
- */
-#define COMPUTE_KEY_CHECKSUM(key, checksum)    \
-{                                              \
-    const guththila_char_t *k = (key);                     \
-    guththila_ssize_t c = (guththila_ssize_t)*k;         \
-    (checksum) = c;                            \
-    (checksum) <<= 8;                          \
-    if (c) {                                   \
-        c = (guththila_ssize_t)*++k;                \
-        checksum |= c;                         \
-    }                                          \
-    (checksum) <<= 8;                          \
-    if (c) {                                   \
-        c = (guththila_ssize_t)*++k;                \
-        checksum |= c;                         \
-    }                                          \
-    (checksum) <<= 8;                          \
-    if (c) {                                   \
-        c = (guththila_ssize_t)*++k;                \
-        checksum |= c;                         \
-    }                                          \
-    checksum &= CASE_MASK;                     \
-}
-
-/** The opaque string-content table type */
-struct guththila_table_t {
-    /* This has to be first to promote backwards compatibility with
-     * older modules which cast a guththila_table_t * to an guththila_array_header_t *...
-     * they should use the guththila_table_elts() function for most of the
-     * cases they do this for.
-     */
-    /** The underlying array for the table */
-    guththila_array_header_t a;
-#ifdef MAKE_TABLE_PROFILE
-    /** Who created the array. */
-    void *creator;
-#endif
-    /* An index to speed up table lookups.  The way this works is:
-     *   - Hash the key into the index:
-     *     - index_first[TABLE_HASH(key)] is the offset within
-     *       the table of the first entry with that key
-     *     - index_last[TABLE_HASH(key)] is the offset within
-     *       the table of the last entry with that key
-     *   - If (and only if) there is no entry in the table whose
-     *     key hashes to index element i, then the i'th bit
-     *     of index_initialized will be zero.  (Check this before
-     *     trying to use index_first[i] or index_last[i]!)
-     */
-    guththila_ssize_t index_initialized;
-    int index_first[TABLE_HASH_SIZE];
-    int index_last[TABLE_HASH_SIZE];
-};
-
-/*
- * NOTICE: if you tweak this you should look at is_empty_table() 
- * and table_elts() in alloc.h
- */
-#ifdef MAKE_TABLE_PROFILE
-static guththila_table_entry_t *table_push(guththila_table_t *t)
-{
-    if (t->a.nelts == t->a.nalloc) {
-        return NULL;
-    }
-    return (guththila_table_entry_t *) guththila_array_push_noclear(&t->a);
-}
-#else /* MAKE_TABLE_PROFILE */
-#define table_push(t)	((guththila_table_entry_t *) guththila_array_push_noclear(&(t)->a))
-#endif /* MAKE_TABLE_PROFILE */
-
-const guththila_array_header_t * guththila_table_elts(const guththila_table_t *t)
-{
-    return (const guththila_array_header_t *)t;
-}
-
-int guththila_is_empty_table(const guththila_table_t *t)
-{
-    return ((t == NULL) || (t->a.nelts == 0));
-}
-
-guththila_table_t * guththila_table_make(guththila_environment_t *environment, int nelts)
-{
-    guththila_table_t *t = guththila_malloc(environment->allocator, sizeof(guththila_table_t));
-
-    make_array_core(&t->a,environment, nelts, sizeof(guththila_table_entry_t), 0);
-#ifdef MAKE_TABLE_PROFILE
-    t->creator = __builtin_return_address(0);
-#endif
-    t->index_initialized = 0;
-    return t;
-}
-
-guththila_table_t * guththila_table_copy(guththila_environment_t *environment, const guththila_table_t *t)
-{
-    guththila_table_t *new = guththila_malloc(environment->allocator, sizeof(guththila_table_t));
-
-
-    make_array_core(&new->a, environment, t->a.nalloc, sizeof(guththila_table_entry_t), 0);
-    memcpy(new->a.elts, t->a.elts, t->a.nelts * sizeof(guththila_table_entry_t));
-    new->a.nelts = t->a.nelts;
-    memcpy(new->index_first, t->index_first, sizeof(int) * TABLE_HASH_SIZE);
-    memcpy(new->index_last, t->index_last, sizeof(int) * TABLE_HASH_SIZE);
-    new->index_initialized = t->index_initialized;
-    return new;
-}
-
-static void table_reindex(guththila_table_t *t)
-{
-    int i;
-    int hash;
-    guththila_table_entry_t *next_elt = (guththila_table_entry_t *) t->a.elts;
-
-    t->index_initialized = 0;
-    for (i = 0; i < t->a.nelts; i++, next_elt++) {
-        hash = TABLE_HASH(next_elt->key);
-        t->index_last[hash] = i;
-        if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
-            t->index_first[hash] = i;
-            TABLE_SET_INDEX_INITIALIZED(t, hash);
-        }
-    }
-}
-
-void guththila_table_clear(guththila_table_t *t)
-{
-    t->a.nelts = 0;
-    t->index_initialized = 0;
-}
-
-const guththila_char_t * guththila_table_get(const guththila_table_t *t, const guththila_char_t *key)
-{
-    guththila_table_entry_t *next_elt;
-    guththila_table_entry_t *end_elt;
-    guththila_ssize_t checksum;
-    int hash;
-
-    if (key == NULL) {
-	return NULL;
-    }
-
-    hash = TABLE_HASH(key);
-    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
-        return NULL;
-    }
-    COMPUTE_KEY_CHECKSUM(key, checksum);
-    next_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_first[hash];;
-    end_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_last[hash];
-
-    for (; next_elt <= end_elt; next_elt++) {
-	if ((checksum == next_elt->key_checksum) &&
-            !stricmp(next_elt->key, key)) {
-	    return next_elt->val;
-	}
-    }
-
-    return NULL;
-}
-
-void guththila_table_set(guththila_table_t *t, const guththila_char_t *key,
-                                const guththila_char_t *val)
-{
-    guththila_table_entry_t *next_elt;
-    guththila_table_entry_t *end_elt;
-    guththila_table_entry_t *table_end;
-    guththila_ssize_t checksum;
-    int hash;
-
-    COMPUTE_KEY_CHECKSUM(key, checksum);
-    hash = TABLE_HASH(key);
-    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
-        t->index_first[hash] = t->a.nelts;
-        TABLE_SET_INDEX_INITIALIZED(t, hash);
-        goto add_new_elt;
-    }
-    next_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_first[hash];;
-    end_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_last[hash];
-    table_end =((guththila_table_entry_t *) t->a.elts) + t->a.nelts;
-
-    for (; next_elt <= end_elt; next_elt++) {
-	if ((checksum == next_elt->key_checksum) &&
-            !stricmp(next_elt->key, key)) {
-
-            
-            /* Found an existing entry with the same key, so overwrite it */
-
-            int must_reindex = 0;
-            guththila_table_entry_t *dst_elt = NULL;
-
-            next_elt->val = guththila_strdup(t->a.environment->string, val);
-
-            /* Remove any other instances of this key */
-            for (next_elt++; next_elt <= end_elt; next_elt++) {
-                if ((checksum == next_elt->key_checksum) &&
-                    !stricmp(next_elt->key, key)) {
-                    t->a.nelts--;
-                    if (!dst_elt) {
-                        dst_elt = next_elt;
-                    }
-                }
-                else if (dst_elt) {
-                    *dst_elt++ = *next_elt;
-                    must_reindex = 1;
-                }
-            }
-
-            /* If we've removed anything, shift over the remainder
-             * of the table (note that the previous loop didn't
-             * run to the end of the table, just to the last match
-             * for the index)
-             */
-            if (dst_elt) {
-                for (; next_elt < table_end; next_elt++) {
-                    *dst_elt++ = *next_elt;
-                }
-                must_reindex = 1;
-            }
-            if (must_reindex) {
-                table_reindex(t);
-            }
-            return;
-        }
-    }
-
-add_new_elt:
-    t->index_last[hash] = t->a.nelts;
-    next_elt = (guththila_table_entry_t *) table_push(t);
-    next_elt->key = guththila_strdup(t->a.environment->string, key);
-    next_elt->val = guththila_strdup(t->a.environment->string, val);
-    next_elt->key_checksum = checksum;
-}
-
-void guththila_table_setn(guththila_table_t *t, const guththila_char_t *key,
-                                 const guththila_char_t *val)
-{
-    guththila_table_entry_t *next_elt;
-    guththila_table_entry_t *end_elt;
-    guththila_table_entry_t *table_end;
-    guththila_ssize_t checksum;
-    int hash;
-
-    COMPUTE_KEY_CHECKSUM(key, checksum);
-    hash = TABLE_HASH(key);
-    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
-        t->index_first[hash] = t->a.nelts;
-        TABLE_SET_INDEX_INITIALIZED(t, hash);
-        goto add_new_elt;
-    }
-    next_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_first[hash];;
-    end_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_last[hash];
-    table_end =((guththila_table_entry_t *) t->a.elts) + t->a.nelts;
-
-    for (; next_elt <= end_elt; next_elt++) {
-	if ((checksum == next_elt->key_checksum) &&
-            !stricmp(next_elt->key, key)) {
-
-            /* Found an existing entry with the same key, so overwrite it */
-
-            int must_reindex = 0;
-            guththila_table_entry_t *dst_elt = NULL;
-
-            next_elt->val = (guththila_char_t *)val;
-
-            /* Remove any other instances of this key */
-            for (next_elt++; next_elt <= end_elt; next_elt++) {
-                if ((checksum == next_elt->key_checksum) &&
-                    !stricmp(next_elt->key, key)) {
-                    t->a.nelts--;
-                    if (!dst_elt) {
-                        dst_elt = next_elt;
-                    }
-                }
-                else if (dst_elt) {
-                    *dst_elt++ = *next_elt;
-                    must_reindex = 1;
-                }
-            }
-
-            /* If we've removed anything, shift over the remainder
-             * of the table (note that the previous loop didn't
-             * run to the end of the table, just to the last match
-             * for the index)
-             */
-            if (dst_elt) {
-                for (; next_elt < table_end; next_elt++) {
-                    *dst_elt++ = *next_elt;
-                }
-                must_reindex = 1;
-            }
-            if (must_reindex) {
-                table_reindex(t);
-            }
-            return;
-        }
-    }
-
-add_new_elt:
-    t->index_last[hash] = t->a.nelts;
-    next_elt = (guththila_table_entry_t *) table_push(t);
-    next_elt->key = (guththila_char_t *)key;
-    next_elt->val = (guththila_char_t *)val;
-    next_elt->key_checksum = checksum;
-}
-
-void guththila_table_unset(guththila_table_t *t, const guththila_char_t *key)
-{
-    guththila_table_entry_t *next_elt;
-    guththila_table_entry_t *end_elt;
-    guththila_table_entry_t *dst_elt;
-    guththila_ssize_t checksum;
-    int hash;
-    int must_reindex;
-
-    hash = TABLE_HASH(key);
-    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
-        return;
-    }
-    COMPUTE_KEY_CHECKSUM(key, checksum);
-    next_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_first[hash];
-    end_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_last[hash];
-    must_reindex = 0;
-    for (; next_elt <= end_elt; next_elt++) {
-	if ((checksum == next_elt->key_checksum) &&
-            !stricmp(next_elt->key, key)) {
-
-            /* Found a match: remove this entry, plus any additional
-             * matches for the same key that might follow
-             */
-            guththila_table_entry_t *table_end = ((guththila_table_entry_t *) t->a.elts) +
-                t->a.nelts;
-            t->a.nelts--;
-            dst_elt = next_elt;
-            for (next_elt++; next_elt <= end_elt; next_elt++) {
-                if ((checksum == next_elt->key_checksum) &&
-                    !stricmp(next_elt->key, key)) {
-                    t->a.nelts--;
-                }
-                else {
-                    *dst_elt++ = *next_elt;
-                }
-            }
-
-            /* Shift over the remainder of the table (note that
-             * the previous loop didn't run to the end of the table,
-             * just to the last match for the index)
-             */
-            for (; next_elt < table_end; next_elt++) {
-                *dst_elt++ = *next_elt;
-            }
-            must_reindex = 1;
-            break;
-        }
-    }
-    if (must_reindex) {
-        table_reindex(t);
-    }
-}
-/*
-void guththila_table_merge(guththila_table_t *t, const guththila_char_t *key,
-				 const guththila_char_t *val)
-{
-    guththila_table_entry_t *next_elt;
-    guththila_table_entry_t *end_elt;
-    guththila_uint32_t checksum;
-    int hash;
-
-    COMPUTE_KEY_CHECKSUM(key, checksum);
-    hash = TABLE_HASH(key);
-    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
-        t->index_first[hash] = t->a.nelts;
-        TABLE_SET_INDEX_INITIALIZED(t, hash);
-        goto add_new_elt;
-    }
-    next_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_first[hash];
-    end_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_last[hash];
-
-    for (; next_elt <= end_elt; next_elt++) {
-	if ((checksum == next_elt->key_checksum) &&
-            !strcasecmp(next_elt->key, key)) {
-
-            /* Found an existing entry with the same key, so merge with it 
-	    next_elt->val = guththila_pstrcat(t->a.pool, next_elt->val, ", ",
-                                        val, NULL);
-            return;
-        }
-        
-    }
-
-add_new_elt:
-    t->index_last[hash] = t->a.nelts;
-    next_elt = (guththila_table_entry_t *) table_push(t);
-    next_elt->key = guththila_pstrdup(t->a.pool, key);
-    next_elt->val = guththila_pstrdup(t->a.pool, val);
-    next_elt->key_checksum = checksum;
-}
-
-void) guththila_table_mergen(guththila_table_t *t, const guththila_char_t *key,
-				  const guththila_char_t *val)
-{
-    guththila_table_entry_t *next_elt;
-    guththila_table_entry_t *end_elt;
-    guththila_uint32_t checksum;
-    int hash;
-
-#if GUTHTHILA_POOL_DEBUG
-    {
-	if (!guththila_pool_is_ancestor(guththila_pool_find(key), t->a.pool)) {
-	    fprintf(stderr, "guththila_table_mergen: key not in ancestor pool of t\n");
-	    abort();
-	}
-	if (!guththila_pool_is_ancestor(guththila_pool_find(val), t->a.pool)) {
-	    fprintf(stderr, "guththila_table_mergen: key not in ancestor pool of t\n");
-	    abort();
-	}
-    }
-#endif
-
-    COMPUTE_KEY_CHECKSUM(key, checksum);
-    hash = TABLE_HASH(key);
-    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
-        t->index_first[hash] = t->a.nelts;
-        TABLE_SET_INDEX_INITIALIZED(t, hash);
-        goto add_new_elt;
-    }
-    next_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_first[hash];;
-    end_elt = ((guththila_table_entry_t *) t->a.elts) + t->index_last[hash];
-
-    for (; next_elt <= end_elt; next_elt++) {
-	if ((checksum == next_elt->key_checksum) &&
-            !strcasecmp(next_elt->key, key)) {
-
-            /* Found an existing entry with the same key, so merge with it 
-	    next_elt->val = guththila_pstrcat(t->a.pool, next_elt->val, ", ",
-                                        val, NULL);
-            return;
-        }
-    }
-
-add_new_elt:
-    t->index_last[hash] = t->a.nelts;
-    next_elt = (guththila_table_entry_t *) table_push(t);
-    next_elt->key = (guththila_char_t *)key;
-    next_elt->val = (guththila_char_t *)val;
-    next_elt->key_checksum = checksum;
-}
-*/
-void guththila_table_add(guththila_table_t *t, const guththila_char_t *key,
-			       const guththila_char_t *val)
-{
-    guththila_table_entry_t *elts;
-    guththila_ssize_t checksum;
-    int hash;
-
-    hash = TABLE_HASH(key);
-    t->index_last[hash] = t->a.nelts;
-    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
-        t->index_first[hash] = t->a.nelts;
-        TABLE_SET_INDEX_INITIALIZED(t, hash);
-    }
-    COMPUTE_KEY_CHECKSUM(key, checksum);
-    elts = (guththila_table_entry_t *) table_push(t);
-    elts->key = guththila_strdup(t->a.environment->string, key);
-    elts->val = guththila_strdup(t->a.environment->string, val);
-    elts->key_checksum = checksum;
-}
-
-void guththila_table_addn(guththila_table_t *t, const guththila_char_t *key,
-				const guththila_char_t *val)
-{
-    guththila_table_entry_t *elts;
-    guththila_ssize_t checksum;
-    int hash;
-
-
-
-    hash = TABLE_HASH(key);
-    t->index_last[hash] = t->a.nelts;
-    if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) {
-        t->index_first[hash] = t->a.nelts;
-        TABLE_SET_INDEX_INITIALIZED(t, hash);
-    }
-    COMPUTE_KEY_CHECKSUM(key, checksum);
-    elts = (guththila_table_entry_t *) table_push(t);
-    elts->key = (guththila_char_t *)key;
-    elts->val = (guththila_char_t *)val;
-    elts->key_checksum = checksum;
-}
-
-guththila_table_t * guththila_table_overlay(guththila_environment_t *environment,
-					     const guththila_table_t *overlay,
-					     const guththila_table_t *base)
-{
-    guththila_table_t *res;
-
-
-    res = guththila_malloc(environment->allocator, sizeof(guththila_table_t));
-    /* behave like append_arrays */
-    res->a.environment = environment;
-    copy_array_hdr_core(&res->a, &overlay->a);
-    guththila_array_cat(&res->a, &base->a);
-    table_reindex(res);
-    return res;
-}
-
-/* And now for something completely abstract ...
-
- * For each key value given as a vararg:
- *   run the function pointed to as
- *     int comp(void *r, char *key, char *value);
- *   on each valid key-value pair in the guththila_table_t t that matches the vararg key,
- *   or once for every valid key-value pair if the vararg list is empty,
- *   until the function returns false (0) or we finish the table.
- *
- * Note that we restart the traversal for each vararg, which means that
- * duplicate varargs will result in multiple executions of the function
- * for each matching key.  Note also that if the vararg list is empty,
- * only one traversal will be made and will cut short if comp returns 0.
- *
- * Note that the table_get and table_merge functions assume that each key in
- * the guththila_table_t is unique (i.e., no multiple entries with the same key).  This
- * function does not make that assumption, since it (unfortunately) isn't
- * true for some of Apache's tables.
- *
- * Note that rec is simply passed-on to the comp function, so that the
- * caller can pass additional info for the task.
- *
- * ADDENDUM for guththila_table_vdo():
- * 
- * The caching api will allow a user to walk the header values:
- *
- * guththila_status_t guththila_cache_el_header_walk(guththila_cache_el *el, 
- *    int (*comp)(void *, const char *, const char *), void *rec, ...);
- *
- * So it can be ..., however from there I use a  callback that use a va_list:
- *
- * guththila_status_t (*cache_el_header_walk)(guththila_cache_el *el, 
- *    int (*comp)(void *, const char *, const char *), void *rec, va_list);
- *
- * To pass those ...'s on down to the actual module that will handle walking
- * their headers, in the file case this is actually just an guththila_table - and
- * rather than reimplementing guththila_table_do (which IMHO would be bad) I just
- * called it with the va_list. For mod_shmem_cache I don't need it since I
- * can't use guththila_table's, but mod_file_cache should (though a good hash would
- * be better, but that's a different issue :). 
- *
- * So to make mod_file_cache easier to maintain, it's a good thing
- */
-int guththila_table_do(guththila_table_do_callback_fn_t *comp,
-                                     void *rec, const guththila_table_t *t, ...)
-{
-    int rv;
-
-    va_list vp;
-    va_start(vp, t);
-    rv = guththila_table_vdo(comp, rec, t, vp);
-    va_end(vp);
-
-    return rv;
-}
-
-int guththila_table_vdo(guththila_table_do_callback_fn_t *comp,
-                               void *rec, const guththila_table_t *t, va_list vp)
-{
-    guththila_char_t *argp;
-    guththila_table_entry_t *elts = (guththila_table_entry_t *) t->a.elts;
-    int vdorv = 1;
-
-    argp = va_arg(vp, guththila_char_t *);
-    do {
-        int rv = 1, i;
-        if (argp) {
-            /* Scan for entries that match the next key */
-            int hash = TABLE_HASH(argp);
-            if (TABLE_INDEX_IS_INITIALIZED(t, hash)) {
-                guththila_ssize_t checksum;
-                COMPUTE_KEY_CHECKSUM(argp, checksum);
-                for (i = t->index_first[hash];
-                     rv && (i <= t->index_last[hash]); ++i) {
-                    if (elts[i].key && (checksum == elts[i].key_checksum) &&
-                                        !stricmp(elts[i].key, argp)) {
-                        rv = (*comp) (rec, elts[i].key, elts[i].val);
-                    }
-                }
-            }
-        }
-        else {
-            /* Scan the entire table */
-            for (i = 0; rv && (i < t->a.nelts); ++i) {
-                if (elts[i].key) {
-                    rv = (*comp) (rec, elts[i].key, elts[i].val);
-                }
-            }
-        }
-        if (rv == 0) {
-            vdorv = 0;
-        }
-    } while (argp && ((argp = va_arg(vp, guththila_char_t *)) != NULL));
-
-    return vdorv;
-}
-
-static guththila_table_entry_t **table_mergesort(guththila_environment_t *environment,
-                                           guththila_table_entry_t **values, int n)
-{
-    /* Bottom-up mergesort, based on design in Sedgewick's "Algorithms
-     * in C," chapter 8
-     */
-    guththila_table_entry_t **values_tmp =
-        (guththila_table_entry_t **)guththila_malloc(environment->allocator, n * sizeof(guththila_table_entry_t*));
-    guththila_ssize_t i;
-    int blocksize;
-
-    /* First pass: sort pairs of elements (blocksize=1) */
-    for (i = 0; i + 1 < n; i += 2) {
-        if (stricmp(values[i]->key, values[i + 1]->key) > 0) {
-            guththila_table_entry_t *swap = values[i];
-            values[i] = values[i + 1];
-            values[i + 1] = swap;
-        }
-    }
-
-    /* Merge successively larger blocks */
-    blocksize = 2;
-    while (blocksize < n) {
-        guththila_table_entry_t **dst = values_tmp;
-        int next_start;
-        guththila_table_entry_t **swap;
-
-        /* Merge consecutive pairs blocks of the next blocksize.
-         * Within a block, elements are in sorted order due to
-         * the previous iteration.
-         */
-        for (next_start = 0; next_start + blocksize < n;
-             next_start += (blocksize + blocksize)) {
-
-            int block1_start = next_start;
-            int block2_start = block1_start + blocksize;
-            int block1_end = block2_start;
-            int block2_end = block2_start + blocksize;
-            if (block2_end > n) {
-                /* The last block may be smaller than blocksize */
-                block2_end = n;
-            }
-            for (;;) {
-
-                /* Merge the next two blocks:
-                 * Pick the smaller of the next element from
-                 * block 1 and the next element from block 2.
-                 * Once either of the blocks is emptied, copy
-                 * over all the remaining elements from the
-                 * other block
-                 */
-                if (block1_start == block1_end) {
-                    for (; block2_start < block2_end; block2_start++) {
-                        *dst++ = values[block2_start];
-                    }
-                    break;
-                }
-                else if (block2_start == block2_end) {
-                    for (; block1_start < block1_end; block1_start++) {
-                        *dst++ = values[block1_start];
-                    }
-                    break;
-                }
-                if (stricmp(values[block1_start]->key,
-                               values[block2_start]->key) > 0) {
-                    *dst++ = values[block2_start++];
-                }
-                else {
-                    *dst++ = values[block1_start++];
-                }
-            }
-        }
-
-        /* If n is not a multiple of 2*blocksize, some elements
-         * will be left over at the end of the array.
-         */
-        for (i = dst - values_tmp; i < n; i++) {
-            values_tmp[i] = values[i];
-        }
-
-        /* The output array of this pass becomes the input
-         * array of the next pass, and vice versa
-         */
-        swap = values_tmp;
-        values_tmp = values;
-        values = swap;
-
-        blocksize += blocksize;
-    }
-
-    return values;
-}
-
-void guththila_table_compress(guththila_table_t *t, unsigned flags)
-{
-    guththila_table_entry_t **sort_array;
-    guththila_table_entry_t **sort_next;
-    guththila_table_entry_t **sort_end;
-    guththila_table_entry_t *table_next;
-    guththila_table_entry_t **last;
-    int i;
-    int dups_found;
-
-    if (t->a.nelts <= 1) {
-        return;
-    }
-
-    /* Copy pointers to all the table elements into an
-     * array and sort to allow for easy detection of
-     * duplicate keys
-     */
-    sort_array = (guththila_table_entry_t **)
-        guththila_malloc(t->a.environment->allocator, t->a.nelts * sizeof(guththila_table_entry_t*));
-    sort_next = sort_array;
-    table_next = (guththila_table_entry_t *)t->a.elts;
-    i = t->a.nelts;
-    do {
-        *sort_next++ = table_next++;
-    } while (--i);
-
-    /* Note: the merge is done with mergesort instead of quicksort
-     * because mergesort is a stable sort and runs in n*log(n)
-     * time regardless of its inputs (quicksort is quadratic in
-     * the worst case)
-     */
-    sort_array = table_mergesort(t->a.environment, sort_array, t->a.nelts);
-
-    /* Process any duplicate keys */
-    dups_found = 0;
-    sort_next = sort_array;
-    sort_end = sort_array + t->a.nelts;
-    last = sort_next++;
-    while (sort_next < sort_end) {
-        if (((*sort_next)->key_checksum == (*last)->key_checksum) &&
-            !stricmp((*sort_next)->key, (*last)->key)) {
-            guththila_table_entry_t **dup_last = sort_next + 1;
-            dups_found = 1;
-            while ((dup_last < sort_end) &&
-                   ((*dup_last)->key_checksum == (*last)->key_checksum) &&
-                   !stricmp((*dup_last)->key, (*last)->key)) {
-                dup_last++;
-            }
-            dup_last--; /* Elements from last through dup_last, inclusive,
-                         * all have the same key
-                         */
-            if (flags == GUTHTHILA_OVERLAP_TABLES_MERGE) {
-                guththila_ssize_t len = 0;
-                guththila_table_entry_t **next = last;
-                guththila_char_t *new_val;
-                guththila_char_t *val_dst;
-                do {
-                    len += strlen((*next)->val);
-                    len += 2; /* for ", " or trailing null */
-                } while (++next <= dup_last);
-                new_val = (guththila_char_t *)guththila_malloc(t->a.environment->allocator, len);
-                val_dst = new_val;
-                next = last;
-                for (;;) {
-                    strcpy(val_dst, (*next)->val);
-                    val_dst += strlen((*next)->val);
-                    next++;
-                    if (next > dup_last) {
-                        *val_dst = 0;
-                        break;
-                    }
-                    else {
-                        *val_dst++ = ',';
-                        *val_dst++ = ' ';
-                    }
-                }
-                (*last)->val = new_val;
-            }
-            else { /* overwrite */
-                (*last)->val = (*dup_last)->val;
-            }
-            do {
-                (*sort_next)->key = NULL;
-            } while (++sort_next <= dup_last);
-        }
-        else {
-            last = sort_next++;
-        }
-    }
-
-    /* Shift elements to the left to fill holes left by removing duplicates */
-    if (dups_found) {
-        guththila_table_entry_t *src = (guththila_table_entry_t *)t->a.elts;
-        guththila_table_entry_t *dst = (guththila_table_entry_t *)t->a.elts;
-        guththila_table_entry_t *last_elt = src + t->a.nelts;
-        do {
-            if (src->key) {
-                *dst++ = *src;
-            }
-        } while (++src < last_elt);
-        t->a.nelts -= (int)(last_elt - dst);
-    }
-
-    table_reindex(t);
-}
-
-static void guththila_table_cat(guththila_table_t *t, const guththila_table_t *s)
-{
-    const int n = t->a.nelts;
-    register int idx;
-
-    guththila_array_cat(&t->a,&s->a);
-
-    if (n == 0) {
-        memcpy(t->index_first,s->index_first,sizeof(int) * TABLE_HASH_SIZE);
-        memcpy(t->index_last, s->index_last, sizeof(int) * TABLE_HASH_SIZE);
-        t->index_initialized = s->index_initialized;
-        return;
-    }
-
-    for (idx = 0; idx < TABLE_HASH_SIZE; ++idx) {
-        if (TABLE_INDEX_IS_INITIALIZED(s, idx)) {
-            t->index_last[idx] = s->index_last[idx] + n;
-            if (!TABLE_INDEX_IS_INITIALIZED(t, idx)) {
-                t->index_first[idx] = s->index_first[idx] + n;
-            }
-        }
-    }
-
-    t->index_initialized |= s->index_initialized;
-}
-
-void guththila_table_overlap(guththila_table_t *a, const guththila_table_t *b,
-				    unsigned flags)
-{
-    if (a->a.nelts + b->a.nelts == 0) {
-        return;
-    }
-
-
-
-    guththila_table_cat(a, b);
-
-    guththila_table_compress(a, flags);
-}

Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_array.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_array.h?rev=328009&r1=328008&r2=328009&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_array.h (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_array.h Mon Oct 24 02:23:17 2005
@@ -43,8 +43,6 @@
  * @{
  */
 
-/** the table abstract data type */
-typedef struct guththila_table_t guththila_table_t;
 
 /** @see guththila_array_header_t */
 typedef struct guththila_array_header_t guththila_array_header_t;
@@ -63,36 +61,6 @@
     guththila_char_t *elts;
 };
 
-/**
- * The (opaque) structure for string-content tables.
- */
-typedef struct guththila_table_entry_t guththila_table_entry_t;
-
-/** The type for each entry in a string-content table */
-struct guththila_table_entry_t {
-    /** The key for the current table entry */
-    guththila_char_t *key;          
-   
-   /** The value for the current table entry */
-    guththila_char_t *val;
-
-    /** A checksum for the key, for use by the guththila_table internals */
-    guththila_ssize_t key_checksum;
-};
-
-/**
- * Get the elements from a table
- * @param t The table
- * @return An array containing the contents of the table
- */
-const guththila_array_header_t * guththila_table_elts(const guththila_table_t *t);
-
-/**
- * Determine if the table is empty
- * @param t The table to check
- * @return True if empty, False otherwise
- */
-int guththila_is_empty_table(const guththila_table_t *t);
 
 /**
  * Determine if the array is empty
@@ -185,233 +153,6 @@
 				      const guththila_array_header_t *arr,
 				      const guththila_char_t sep);
 
-/**
- * Make a new table
- * @param environment guththila_environment
- * @param nelts The number of elements in the initial table.
- * @return The new table.
- * @warning This table can only store text data
- */
-guththila_table_t * guththila_table_make(guththila_environment_t *environment, int nelts);
-
-/**
- * Create a new table and copy another table into it
- * @param environment guththila_environment
- * @param t The table to copy
- * @return A copy of the table passed in
- */
-guththila_table_t * guththila_table_copy(guththila_environment_t *environment,
-                                          const guththila_table_t *t);
-
-/**
- * Delete all of the elements from a table
- * @param t The table to clear
- */
-void guththila_table_clear(guththila_table_t *t);
-
-/**
- * Get the value associated with a given key from the table.  After this call,
- * The data is still in the table
- * @param t The table to search for the key
- * @param key The key to search for
- * @return The value associated with the key, or NULL if the key does not exist. 
- */
-const guththila_char_t * guththila_table_get(const guththila_table_t *t, const guththila_char_t *key);
-
-/**
- * Add a key/value pair to a table, if another element already exists with the
- * same key, this will over-write the old data.
- * @param t The table to add the data to.
- * @param key The key fo use
- * @param val The value to add
- * @remark When adding data, this function makes a copy of both the key and the
- *         value.
- */
-void guththila_table_set(guththila_table_t *t, const guththila_char_t *key,
-                                const guththila_char_t *val);
-
-/**
- * Add a key/value pair to a table, if another element already exists with the
- * same key, this will over-write the old data.
- * @param t The table to add the data to.
- * @param key The key to use
- * @param val The value to add
- * @warning When adding data, this function does not make a copy of the key or 
- *          the value, so care should be taken to ensure that the values will 
- *          not change after they have been added..
- */
-void guththila_table_setn(guththila_table_t *t, const guththila_char_t *key,
-                                 const guththila_char_t *val);
-
-/**
- * Remove data from the table
- * @param t The table to remove data from
- * @param key The key of the data being removed
- */
-void guththila_table_unset(guththila_table_t *t, const guththila_char_t *key);
-
-/**
- * Add data to a table by merging the value with data that has already been 
- * stored
- * @param t The table to search for the data
- * @param key The key to merge data for
- * @param val The data to add
- * @remark If the key is not found, then this function acts like guththila_table_add
- */
-void guththila_table_merge(guththila_table_t *t, const guththila_char_t *key,
-                                  const guththila_char_t *val);
-
-/**
- * Add data to a table by merging the value with data that has already been 
- * stored
- * @param t The table to search for the data
- * @param key The key to merge data for
- * @param val The data to add
- * @remark If the key is not found, then this function acts like guththila_table_addn
- */
-void guththila_table_mergen(guththila_table_t *t, const guththila_char_t *key,
-                                   const guththila_char_t *val);
-
-/**
- * Add data to a table, regardless of whether there is another element with the
- * same key.
- * @param t The table to add to
- * @param key The key to use
- * @param val The value to add.
- * @remark When adding data, this function makes a copy of both the key and the
- *         value.
- */
-void guththila_table_add(guththila_table_t *t, const guththila_char_t *key,
-                                const guththila_char_t *val);
-
-/**
- * Add data to a table, regardless of whether there is another element with the
- * same key.
- * @param t The table to add to
- * @param key The key to use
- * @param val The value to add.
- * @remark When adding data, this function does not make a copy of the key or the
- *         value, so care should be taken to ensure that the values will not 
- *         change after they have been added..
- */
-void guththila_table_addn(guththila_table_t *t, const guththila_char_t *key,
-                                 const guththila_char_t *val);
-
-/**
- * Merge two tables into one new table
- * @param environment guththila_environment
- * @param overlay The first table to put in the new table
- * @param base The table to add at the end of the new table
- * @return A new table containing all of the data from the two passed in
- */
-guththila_table_t * guththila_table_overlay(guththila_environment_t *environment,
-                                             const guththila_table_t *overlay,
-                                             const guththila_table_t *base);
-
-/**
- * Declaration prototype for the iterator callback function of guththila_table_do()
- * and guththila_table_vdo().
- * @param rec The data passed as the first argument to guththila_table_[v]do()
- * @param key The key from this iteration of the table
- * @param value The value from this iteration of the table
- * @remark Iteration continues while this callback function returns non-zero.
- * To export the callback function for guththila_table_[v]do() it must be declared 
- * in the _NONSTD convention.
- */
-typedef int (guththila_table_do_callback_fn_t)(void *rec, const guththila_char_t *key, 
-                                                    const guththila_char_t *value);
-
-/** 
- * Iterate over a table running the provided function once for every
- * element in the table.  If there is data passed in as a vararg, then the 
- * function is only run on those elements whose key matches something in 
- * the vararg.  If the vararg is NULL, then every element is run through the
- * function.  Iteration continues while the function returns non-zero.
- * @param comp The function to run
- * @param rec The data to pass as the first argument to the function
- * @param t The table to iterate over
- * @param ... The vararg.  If this is NULL, then all elements in the table are
- *            run through the function, otherwise only those whose key matches
- *            are run.
- * @return FALSE if one of the comp() iterations returned zero; TRUE if all
- *            iterations returned non-zero
- * @see guththila_table_do_callback_fn_t
- */
-int guththila_table_do(guththila_table_do_callback_fn_t *comp,
-                                     void *rec, const guththila_table_t *t, ...);
-
-/** 
- * Iterate over a table running the provided function once for every
- * element in the table.  If there is data passed in as a vararg, then the 
- * function is only run on those element's whose key matches something in 
- * the vararg.  If the vararg is NULL, then every element is run through the
- * function.  Iteration continues while the function returns non-zero.
- * @param comp The function to run
- * @param rec The data to pass as the first argument to the function
- * @param t The table to iterate over
- * @param vp The vararg table.  If this is NULL, then all elements in the 
- *                table are run through the function, otherwise only those 
- *                whose key matches are run.
- * @return FALSE if one of the comp() iterations returned zero; TRUE if all
- *            iterations returned non-zero
- * @see guththila_table_do_callback_fn_t
- */
-int guththila_table_vdo(guththila_table_do_callback_fn_t *comp,
-                               void *rec, const guththila_table_t *t, va_list vp);
-
-/** flag for overlap to use guththila_table_setn */
-#define GUTHTHILA_OVERLAP_TABLES_SET   (0)
-/** flag for overlap to use guththila_table_mergen */
-#define GUTHTHILA_OVERLAP_TABLES_MERGE (1)
-/**
- * For each element in table b, either use setn or mergen to add the data
- * to table a.  Which method is used is determined by the flags passed in.
- * @param a The table to add the data to.
- * @param b The table to iterate over, adding its data to table a
- * @param flags How to add the table to table a.  One of:
- *          GUTHTHILA_OVERLAP_TABLES_SET        Use guththila_table_setn
- *          GUTHTHILA_OVERLAP_TABLES_MERGE      Use guththila_table_mergen
- * @remark  This function is highly optimized, and uses less memory and CPU cycles
- *          than a function that just loops through table b calling other functions.
- */
-/**
- *<PRE>
- * Conceptually, guththila_table_overlap does this:
- *
- *  guththila_array_header_t *barr = guththila_table_elts(b);
- *  guththila_table_entry_t *belt = (guththila_table_entry_t *)barr->elts;
- *  int i;
- *
- *  for (i = 0; i < barr->nelts; ++i) {
- *      if (flags & GUTHTHILA_OVERLAP_TABLES_MERGE) {
- *          guththila_table_mergen(a, belt[i].key, belt[i].val);
- *      }
- *      else {
- *          guththila_table_setn(a, belt[i].key, belt[i].val);
- *      }
- *  }
- *
- *  Except that it is more efficient (less space and cpu-time) especially
- *  when b has many elements.
- *
- *  Notice the assumptions on the keys and values in b -- they must be
- *  in an ancestor of a's pool.  In practice b and a are usually from
- *  the same pool.
- * </PRE>
- */
-
-void guththila_table_overlap(guththila_table_t *a, const guththila_table_t *b,
-                                     unsigned flags);
-
-/**
- * Eliminate redundant entries in a table by either overwriting
- * or merging duplicates
- *
- * @param t Table.
- * @param flags GUTHTHILA_OVERLAP_TABLES_MERGE to merge, or
- *              GUTHTHILA_OVERLAP_TABLES_SET to overwrite
- */
-void guththila_table_compress(guththila_table_t *t, unsigned flags);
 
 /** @} */
 
@@ -419,4 +160,4 @@
 }
 #endif
 
-#endif	/* ! GUTHTHILA_TABLES_H */
+#endif	/* ! GUTHTHILA__ARRAY_H */

Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_string.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_string.c?rev=328009&r1=328008&r2=328009&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_string.c (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_string.c Mon Oct 24 02:23:17 2005
@@ -17,13 +17,11 @@
 #include <guththila_string.h>
 #include <stdlib.h>
 #include <string.h>
-#include "guththila_unicode.h"
-#include "guththila_defines.h"
 
 void* guththila_string_ops_strdup(const void* ptr)
 {
     if (ptr)
-        return (void*)strdup(ptr);
+        return (void*)strdup((const char*)ptr);
     else
         return NULL;
 }
@@ -63,18 +61,18 @@
         return guththila_strdup_unicode(x, y);
  
 #else 
-        register size_t n;
-	    register guththila_char_t *dst;
-
-	    n = guththila_string_ops_strlen(s1);
-	    if (len < n)
-    	        n = len;
-	    dst = (guththila_char_t *) malloc(n+1);
-	    if (dst)
-	    {
-	        memcpy(dst, s1, n);
-		    dst[n] = '\0';
-	    }
+        register size_t n;
+	    register guththila_char_t *dst;
+
+	    n = guththila_string_ops_strlen(s1);
+	    if (len < n)
+    	        n = len;
+	    dst = (guththila_char_t *) malloc(n+1);
+	    if (dst)
+	    {
+	        memcpy(dst, s1, n);
+		    dst[n] = '\0';
+	    }
 	    return dst;
 #endif
     }

Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_string.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_string.h?rev=328009&r1=328008&r2=328009&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_string.h (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_string.h Mon Oct 24 02:23:17 2005
@@ -19,7 +19,6 @@
 
 #include <guththila_defines.h>
 #include <guththila_allocator.h>
-//#include "guththila_unicode.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -30,8 +29,6 @@
     int (*guththila_string_strcmp)(const guththila_char_t *s1, const guththila_char_t *s2);
     guththila_char_t *(*guththila_string_strndup)(const guththila_char_t *s1,size_t n);
     int  (*guththila_string_strlen)(const guththila_char_t *s);
-    //guththila_char_t *(*guththila_string_strdup_unicode)(const guththila_char_t *s1,size_t n);
-   // guththila_UTF8_char (*guththila_string_strlen_unicode)(const guththila_char_t *);
 }guththila_string_t;
 
 /**
@@ -48,8 +45,6 @@
 #define guththila_strcmp(string, s1, s2) ((string)->guththila_string_strcmp(s1, s2))
 #define guththila_strndup(string,s1,n) ((string)->guththila_string_strndup(s1,n))
 #define guththila_strlen(string,s1) ((string)->guththila_string_strlen(s1))
-//#define guththila_strdup_unicode(string,s1,n) ((string)->guththila_string_strdup(s1,n))
-//#define guththila_strlen_unicode(string,s1) ((string)->guththila_string_strlen_unicode(s1))
 
 #ifdef __cplusplus
 }

Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c?rev=328009&r1=328008&r2=328009&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c Mon Oct 24 02:23:17 2005
@@ -530,7 +530,7 @@
   int c;
   int ref = 0;
   int all_spaces = 1;
-  int last_event = guththila_event;
+/*  int last_event = guththila_event; */
   guththila_event = GUTHTHILA_CHARACTER;
   guththila_xml_pull_parser_open_token (environment,parser);
   do

Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_stream_writer.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_stream_writer.c?rev=328009&r1=328008&r2=328009&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_stream_writer.c (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_stream_writer.c Mon Oct 24 02:23:17 2005
@@ -34,7 +34,7 @@
 
   guththila_xml_stream_writer_t* guththila_create_xml_stream_writer(guththila_environment_t *environment,FILE* writer, guththila_char_t* encoding, int prefix_defaulting)
 {
-    guththila_status_t status;
+ /*   guththila_status_t status; */
     guththila_xml_stream_writer_t *stream_writer;
     if (!writer)
         return 0;
@@ -45,7 +45,6 @@
         stream_writer->encoding = encoding;
     stream_writer->prefix_defaulting = prefix_defaulting;
 
-      /*initialize APR pool, we ned this pool to allocate memory to hash map and stack*/
 
    
 



Mime
View raw message