Author: ArcRiley Date: 2009-01-11 18:12:04 -0500 (Sun, 11 Jan 2009) New Revision: 1464
Modified: trunk/concordance/src/Core.c trunk/concordance/src/utils.c trunk/concordance/src/utils.h Log: renamed utility functions corcord* Modified: trunk/concordance/src/Core.c =================================================================== --- trunk/concordance/src/Core.c 2009-01-11 05:31:04 UTC (rev 1463) +++ trunk/concordance/src/Core.c 2009-01-11 23:12:04 UTC (rev 1464) @@ -376,7 +376,7 @@ gpointer data); */ popped->message = g_string_assign(popped->message, - conPyUnicodeToUTF8(output)); + concordPyUnicodeToUTF8(output)); g_async_queue_push(self->queueSend, popped); } else @@ -503,15 +503,15 @@ /* create channel and add it to our context watchlist - GIOChannel* conAddSocket (gint fd, + GIOChannel* concordAddSocket (gint fd, GIOCondition condition, GSourceFunc callback, gpointer data, GMainContext* context); */ - sock->chan = conAddSocket(sock->sock, G_IO_IN, - (GSourceFunc)conCore_listenNew, - (gpointer) self, self->context); + sock->chan = concordAddSocket(sock->sock, G_IO_IN, + (GSourceFunc)conCore_listenNew, + (gpointer) self, self->context); ret = TRUE; } else { @@ -565,14 +565,15 @@ /* add a watch to send more when the channel is ready for it - gint conAddWatch (GIOChannel* channel, + gint concordAddWatch (GIOChannel* channel, GIOCondition condition, GSourceFunc callback, gpointer data, GMainContext* context) */ - conAddWatch(session->chan, G_IO_OUT, (GSourceFunc)conCore_sessionWrite, - (gpointer) session->core, session->core->context); + concordAddWatch(session->chan, G_IO_OUT, + (GSourceFunc)conCore_sessionWrite, + (gpointer) session->core, session->core->context); } } else @@ -726,7 +727,7 @@ /* create channel and add it to our context watchlist - GIOChannel* conAddSocket (gint fd, + GIOChannel* concordAddSocket (gint fd, GIOCondition condition, GSourceFunc callback, gpointer data, @@ -737,9 +738,9 @@ void g_io_channel_set_buffered(GIOChannel *channel, gboolean buffered); */ - newSession->chan = conAddSocket(fd, G_IO_IN | G_IO_HUP, - (GSourceFunc)conCore_sessionRead, - (gpointer) self, self->context); + newSession->chan = concordAddSocket(fd, G_IO_IN | G_IO_HUP, + (GSourceFunc)conCore_sessionRead, + (gpointer) self, self->context); g_io_channel_set_encoding(newSession->chan, NULL, NULL); g_io_channel_set_buffered(newSession->chan, FALSE); @@ -1109,10 +1110,10 @@ GString* g_string_assign (GString *string, const gchar *rval); */ - if (!(attr = conSearchAttributes(atts, "to"))) + if (!(attr = concordSearchAttributes(atts, "to"))) attr = ""; session->eto = g_string_assign(session->eto, attr); - if (!(attr = conSearchAttributes(atts, "from"))) + if (!(attr = concordSearchAttributes(atts, "from"))) attr = ""; session->efrom = g_string_assign(session->efrom, attr); printf("--------- from: %s to: %s\n", @@ -1141,7 +1142,7 @@ if (g_ascii_strcasecmp(element[0], "urn:ietf:params:xml:ns:xmpp-sasl") == 0) { if (g_ascii_strcasecmp(element[1], "auth") == 0) { - gchar* mech = conSearchAttributes(atts, "mechanism"); + gchar* mech = concordSearchAttributes(atts, "mechanism"); if (mech && gsasl_server_support_p(self->saslCntx, mech)) { /* initiate server session Modified: trunk/concordance/src/utils.c =================================================================== --- trunk/concordance/src/utils.c 2009-01-11 05:31:04 UTC (rev 1463) +++ trunk/concordance/src/utils.c 2009-01-11 23:12:04 UTC (rev 1464) @@ -22,8 +22,8 @@ #include "utils.h" GIOChannel* -conAddSocket(gint fd, GIOCondition condition, GSourceFunc callback, - gpointer data, GMainContext* context) { /*\ +concordAddSocket(gint fd, GIOCondition condition, GSourceFunc callback, + gpointer data, GMainContext* context) { /*\ cdef : \*/ GIOChannel* channel; @@ -39,15 +39,16 @@ #endif /* See below */ - conAddWatch(channel, condition, callback, data, context); + concordAddWatch(channel, condition, callback, data, context); return channel; } gint -conAddWatch(GIOChannel* channel, GIOCondition condition, GSourceFunc callback, - gpointer data, GMainContext* context) { /*\ +concordAddWatch(GIOChannel* channel, GIOCondition condition, + GSourceFunc callback, gpointer data, + GMainContext* context) { /*\ cdef : \*/ GSource* source; guint id; @@ -74,7 +75,7 @@ } gchar* -conSearchAttributes(const gchar** attrs, const gchar* key) { /*\ +concordSearchAttributes(const gchar** attrs, const gchar* key) { /*\ cdef : \*/ gint i; @@ -96,7 +97,7 @@ } gchar* -conPyUnicodeToUTF8(PyObject* unicode) { /*\ +concordPyUnicodeToUTF8(PyObject* unicode) { /*\ cdef : \*/ PY_UNICODE_TYPE* uni; Py_ssize_t len; Modified: trunk/concordance/src/utils.h =================================================================== --- trunk/concordance/src/utils.h 2009-01-11 05:31:04 UTC (rev 1463) +++ trunk/concordance/src/utils.h 2009-01-11 23:12:04 UTC (rev 1464) @@ -19,20 +19,32 @@ # $Id$ */ -#ifndef CONUTILS_H -#define CONUTILS_H +#ifndef CONCORD_UTILS_H +#define CONCORD_UTILS_H #include "Python.h" #include "glib.h" +#include "gsasl.h" +#include "expat.h" -GIOChannel* conAddSocket (gint fd, GIOCondition condition, +#ifdef MS_WINDOWS + #include <ws2tcpip.h> + #include <Winsock2.h> + WSADATA wsaData; + gboolean wsaInit; +#else + #include <sys/socket.h> + #include <netdb.h> +#endif + +GIOChannel* concordAddSocket (gint fd, GIOCondition condition, GSourceFunc callback, gpointer data, GMainContext* context); -gint conAddWatch (GIOChannel* channel, +gint concordAddWatch (GIOChannel* channel, GIOCondition condition, GSourceFunc callback, gpointer data, GMainContext* context); -gchar* conSearchAttributes (const gchar**, const gchar*); -gchar* conPyUnicodeToUTF8 (PyObject* unicode); +gchar* concordSearchAttributes (const gchar**, const gchar*); +gchar* concordPyUnicodeToUTF8 (PyObject* unicode); #endif _______________________________________________ PySoy-SVN mailing list PySoy-SVN@pysoy.org http://www.pysoy.org/mailman/listinfo/pysoy-svn