Author: ArcRiley Date: 2009-03-03 23:34:41 -0500 (Tue, 03 Mar 2009) New Revision: 1539
Modified: trunk/concordance/include/concordance.h trunk/concordance/src/_core/step.c Log: minor renaming, bumped type#'s up one so 0 = None for return value expected Modified: trunk/concordance/include/concordance.h =================================================================== --- trunk/concordance/include/concordance.h 2009-02-28 04:16:32 UTC (rev 1538) +++ trunk/concordance/include/concordance.h 2009-03-04 04:34:41 UTC (rev 1539) @@ -58,12 +58,13 @@ typedef struct { PyObject* self; gchar* method; - GAsyncQueue* queueReturn; /* callback return queue */ + GAsyncQueue* returnQueue; /* callback return queue */ union { - gint type0; /* type == 0 */ - GString* type1; /* type == 1 */ + gint type1; /* type == 1 */ + GString* type2; /* type == 2 */ } message; gint message_type; /* message type (see above) */ + gint return_type; /* type response needs to be */ } concordQueueMsg; #endif Modified: trunk/concordance/src/_core/step.c =================================================================== --- trunk/concordance/src/_core/step.c 2009-02-28 04:16:32 UTC (rev 1538) +++ trunk/concordance/src/_core/step.c 2009-03-04 04:34:41 UTC (rev 1539) @@ -30,8 +30,8 @@ void g_free (gpointer mem); */ g_free(msg->method); - if (msg->message_type == 1) { - g_string_free(msg->message.type1, TRUE); + if (msg->message_type == 2) { + g_string_free(msg->message.type2, TRUE); } g_free(msg); } @@ -88,18 +88,18 @@ C string pointer is NULL, the length is ignored and None is returned. */ switch (popped->message_type) { - case 0 : { + case 1 : { /* int message */ output = PyEval_CallMethod(popped->self, popped->method, "Oi", - popped->self, popped->message.type0); + popped->self, popped->message.type1); break; } - case 1 : { + case 2 : { /* str message */ output = PyEval_CallMethod(popped->self, popped->method, "OU#", popped->self, - popped->message.type1->str, - popped->message.type1->len); + popped->message.type2->str, + popped->message.type2->len); break; } } @@ -145,7 +145,7 @@ GString* g_string_assign (GString *string, const gchar *rval); */ - popped->message.type1 = g_string_assign(popped->message.type1, + popped->message.type2 = g_string_assign(popped->message.type2, concordPyUnicodeToUTF8(output)); /* send response with the included self-addressed stamped envelope @@ -153,7 +153,7 @@ void g_async_queue_push (GAsyncQueue *queue, gpointer data); */ - g_async_queue_push(popped->queueReturn, popped); + g_async_queue_push(popped->returnQueue, popped); } else /* free message struct since we didn't use it */ _______________________________________________ PySoy-SVN mailing list PySoy-SVN@pysoy.org http://www.pysoy.org/mailman/listinfo/pysoy-svn