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 sa...@apache.org on 2005/10/07 05:56:05 UTC
svn commit: r306992 - in
/webservices/axis2/trunk/c/modules/xml/guththila/src: guththila_stack.c
guththila_token.c guththila_token.h guththila_xml_pull_parser.c
Author: samisa
Date: Thu Oct 6 20:55:57 2005
New Revision: 306992
URL: http://svn.apache.org/viewcvs?rev=306992&view=rev
Log:
Refactered the naming in token
Modified:
webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_stack.c
webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_token.c
webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_token.h
webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c
Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_stack.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_stack.c?rev=306992&r1=306991&r2=306992&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_stack.c (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_stack.c Thu Oct 6 20:55:57 2005
@@ -63,7 +63,7 @@
}
}
else
- Token_Exception ();
+ guththila_token_exception ();
return 0;
}
@@ -176,7 +176,7 @@
}
}
else
- Token_Exception ();
+ guththila_token_exception ();
return 0;
}
@@ -231,7 +231,7 @@
}
}
else
- Token_Exception ();
+ guththila_token_exception ();
return 0;
}
Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_token.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_token.c?rev=306992&r1=306991&r2=306992&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_token.c (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_token.c Thu Oct 6 20:55:57 2005
@@ -22,7 +22,7 @@
#include "guththila_unicode.h"
guththila_token_t *
-Token_createTokenBuffer (int size)
+guththila_token_create_token_buffer (int size)
{
guththila_token_t *tok = (guththila_token_t *) malloc (sizeof(guththila_token_t)*size);
tok->size = size;
@@ -31,7 +31,7 @@
void
-Token_freeTokenBuffer (guththila_token_t *tok)
+guththila_token_free_token_buffer (guththila_token_t *tok)
{
if (tok)
free (tok);
@@ -39,7 +39,7 @@
void
-Token_Exception ()
+guththila_token_exception ()
{
printf ("Throws new token Exception");
exit (0);
@@ -47,18 +47,18 @@
int
-Token_length (guththila_token_t *tok)
+guththila_token_length (guththila_token_t *tok)
{
if (tok->end)
return (tok->end) - (tok->start) + 1;
else
- Token_Exception ();
+ guththila_token_exception ();
return 0;
}
guththila_token_t *
-Token_grow (guththila_token_t *tok)
+guththila_token_grow (guththila_token_t *tok)
{
tok->size <<= 1;
tok = (guththila_token_t *) realloc (tok, sizeof(guththila_token_t)*tok->size);
@@ -67,31 +67,31 @@
guththila_token_t *
-Token_append (guththila_token_t *tok)
+guththila_token_append (guththila_token_t *tok)
{
if (++ (tok->last) > (tok->size))
- Token_grow (tok);
+ guththila_token_grow (tok);
return &tok[tok->last];
}
guththila_token_t *
-Token_last (guththila_token_t *tok)
+guththila_token_last (guththila_token_t *tok)
{
if (tok->last < 0)
- Token_Exception ();
+ guththila_token_exception ();
return &tok[tok->last];
}
int
-Token_count (guththila_token_t *tok)
+guththila_token_count (guththila_token_t *tok)
{
return tok->last;
}
char*
-Token_char_ref (char *buffer)
+guththila_token_char_ref (char *buffer)
{
int len;
int ii;
@@ -143,7 +143,7 @@
ii +=5;
}
else
- Token_Exception ();
+ guththila_token_exception ();
}
else
ref_buffer[ix] = buffer[ii];
@@ -153,7 +153,7 @@
char *
-Token_toString (guththila_token_t *tok, int unicode)
+guththila_token_to_string (guththila_token_t *tok, int unicode)
{
if (tok)
{
@@ -161,12 +161,12 @@
{
int length;
char *buffer;
- length = Token_length (tok);
+ length = guththila_token_length (tok);
buffer = (char *) malloc (length + 1);
memcpy (buffer, tok->start, length);
buffer[length] = 0;
if (tok->ref)
- Token_char_ref (buffer);
+ guththila_token_char_ref (buffer);
else
return buffer;
}
@@ -174,11 +174,11 @@
{
int length;
char *buffer;
- length = Token_length (tok);
+ length = guththila_token_length (tok);
buffer = (char *) malloc (length + 1);
memcpy (buffer, tok->start, length);
buffer[length] = 0;
- return Token_convert_utf16_to_utf8 (buffer, length);
+ return guththila_token_convert_utf16_to_utf8 (buffer, length);
}
}
else
@@ -187,7 +187,7 @@
void
-Token_relocate (guththila_token_t *tok, int offset)
+guththila_token_relocate (guththila_token_t *tok, int offset)
{
tok->start -= offset;
tok->end -= offset;
@@ -195,21 +195,21 @@
int
-Token_compare (guththila_token_t *tok, const char *s, int n, int unicode_state)
+guththila_token_compare (guththila_token_t *tok, const char *s, int n, int unicode_state)
{
if (unicode_state == None)
return strncmp (tok->start, s, n);
else
{
char *buffer;
- buffer = Token_toString (tok, unicode_state);
+ buffer = guththila_token_to_string (tok, unicode_state);
return strncmp (buffer, s, n);
}
}
int
-Token_length_utf16 (unsigned int utf16_ch)
+guththila_token_length_utf16 (unsigned int utf16_ch)
{
int length;
@@ -231,7 +231,7 @@
char*
-Token_build_utf8 (unsigned int utf16_ch, int length)
+guththila_token_build_utf8 (unsigned int utf16_ch, int length)
{
UTF8_char mask = 0;
int ii = 0;
@@ -275,7 +275,7 @@
char *
-Token_convert_utf16_to_utf8 (char *buffer, int length)
+guththila_token_convert_utf16_to_utf8 (char *buffer, int length)
{
unsigned int utf16_char = 0;
int length_utf16 = 0;
@@ -288,8 +288,8 @@
{
utf16_char = *((UTF16_char *)&input_buffer[ii]);
ii += 2;
- length_utf16 = Token_length_utf16 (utf16_char);
- output_char = Token_build_utf8 (utf16_char, length_utf16);
+ length_utf16 = guththila_token_length_utf16 (utf16_char);
+ output_char = guththila_token_build_utf8 (utf16_char, length_utf16);
total_length += length_utf16;
output_buffer = strcat (output_buffer, output_char);
}
Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_token.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_token.h?rev=306992&r1=306991&r2=306992&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_token.h (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_token.h Thu Oct 6 20:55:57 2005
@@ -47,20 +47,20 @@
};
-guththila_token_t* Token_createTokenBuffer(int size);
-void Token_freeTokenBuffer (guththila_token_t *tok);
-int Token_length (guththila_token_t *tok);
-void Token_Exception ();
-guththila_token_t* Token_append (guththila_token_t *tok);
-guththila_token_t* Token_grow (guththila_token_t *tok);
-guththila_token_t* Token_last (guththila_token_t *tok);
-int Token_count (guththila_token_t *tok);
-char* Token_toString (guththila_token_t *tok, int unicode);
-void Token_relocate (guththila_token_t *tok, int offset);
-int Token_compare (guththila_token_t *tok, const char *st, int n, int unicode_state);
-char *Token_convert_utf16_to_utf8 (char *buffer, int length);
-int Token_length_utf16 (unsigned int utf16_ch);
-char *Token_build_utf8 (unsigned int utf16_ch, int length);
-char *Token_char_ref (char *buffer);
+guththila_token_t* guththila_token_create_token_buffer(int size);
+void guththila_token_free_token_buffer (guththila_token_t *tok);
+int guththila_token_length (guththila_token_t *tok);
+void guththila_token_exception ();
+guththila_token_t* guththila_token_append (guththila_token_t *tok);
+guththila_token_t* guththila_token_grow (guththila_token_t *tok);
+guththila_token_t* guththila_token_last (guththila_token_t *tok);
+int guththila_token_count (guththila_token_t *tok);
+char* guththila_token_to_string (guththila_token_t *tok, int unicode);
+void guththila_token_relocate (guththila_token_t *tok, int offset);
+int guththila_token_compare (guththila_token_t *tok, const char *st, int n, int unicode_state);
+char *guththila_token_convert_utf16_to_utf8 (char *buffer, int length);
+int guththila_token_length_utf16 (unsigned int utf16_ch);
+char *guththila_token_build_utf8 (unsigned int utf16_ch, int length);
+char *guththila_token_char_ref (char *buffer);
#endif /* GUTHTHILA_guththila_token_t_H */
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=306992&r1=306991&r2=306992&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 Thu Oct 6 20:55:57 2005
@@ -78,7 +78,7 @@
el = Stack_last (parser->stack);
for (; isize > 0; isize--)
{
- Token_relocate (el->token, offset);
+ guththila_token_relocate (el->token, offset);
el = el->prev;
}
}
@@ -735,7 +735,7 @@
e = Stack_pull (parser->stack);
is--;
name = e->token;
- if (!Token_compare
+ if (!guththila_token_compare
(e->token, "xmlns", 5, parser->unicode_state))
XML_PullParser_addNamespace (parser, name, value);
else
@@ -751,7 +751,7 @@
else if (e->token->type == Prefix)
{
ELEMENT *ex;
- if (!Token_compare
+ if (!guththila_token_compare
(e->token, "xmlns", 5, parser->unicode_state))
{
ex = Stack_pull (parser->attrib);
@@ -892,9 +892,9 @@
{
NAMESPACE *ns;
ns = (NAMESPACE *) malloc (sizeof (NAMESPACE));
- ns->name = Token_toString (name, parser->unicode_state);
+ ns->name = guththila_token_to_string (name, parser->unicode_state);
ns->length = strlen (ns->name);
- ns->uri = Token_toString (uri, parser->unicode_state);
+ ns->uri = guththila_token_to_string (uri, parser->unicode_state);
ns->lengthuri = strlen (ns->uri);
Stack_push_namespace (parser->namesp, ns);
}
@@ -925,7 +925,7 @@
if (!att)
XML_PullParser_Exception (p_FILE, LINE);
if (att->name->end)
- return Token_toString (att->name, parser->unicode_state);
+ return guththila_token_to_string (att->name, parser->unicode_state);
return NULL;
}
@@ -936,7 +936,7 @@
if (!att)
XML_PullParser_Exception (p_FILE, LINE);
if (att->value->end)
- return Token_toString (att->value, parser->unicode_state);
+ return guththila_token_to_string (att->value, parser->unicode_state);
return NULL;
}
@@ -947,7 +947,7 @@
if (!att)
XML_PullParser_Exception (p_FILE, LINE);
if (att->prefix->end)
- return Token_toString (att->prefix, parser->unicode_state);
+ return guththila_token_to_string (att->prefix, parser->unicode_state);
return NULL;
}
@@ -971,7 +971,7 @@
if (e->attribute)
att = e->attribute;
}
- return Token_toString (att->prefix, parser->unicode_state);
+ return guththila_token_to_string (att->prefix, parser->unicode_state);
}
@@ -994,7 +994,7 @@
if (e->attribute)
att = e->attribute;
}
- return Token_toString (att->name, parser->unicode_state);
+ return guththila_token_to_string (att->name, parser->unicode_state);
}
@@ -1017,7 +1017,7 @@
if (e->attribute)
att = e->attribute;
}
- return Token_toString (att->value, parser->unicode_state);
+ return guththila_token_to_string (att->value, parser->unicode_state);
}
@@ -1025,7 +1025,7 @@
XML_PullParser_getName (XML_PullParser * parser)
{
if (parser->name->end)
- return Token_toString (parser->name, parser->unicode_state);
+ return guththila_token_to_string (parser->name, parser->unicode_state);
return NULL;
}
@@ -1034,7 +1034,7 @@
XML_PullParser_getValue (XML_PullParser * parser)
{
if (parser->value->end)
- return Token_toString (parser->value, parser->unicode_state);
+ return guththila_token_to_string (parser->value, parser->unicode_state);
return NULL;
}
@@ -1043,7 +1043,7 @@
XML_PullParser_getPrefix (XML_PullParser * parser)
{
if (parser->prefix)
- return Token_toString (parser->prefix, parser->unicode_state);
+ return guththila_token_to_string (parser->prefix, parser->unicode_state);
return NULL;
}