#endif
#include <errno.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
GQueue processingModules= G_QUEUE_INIT;
GQueue matchingModules= G_QUEUE_INIT;
GQueue analysisModules= G_QUEUE_INIT;
+GQueue reductionModules= G_QUEUE_INIT;
GQueue moduleOptions= G_QUEUE_INIT;
{
syncState->processingModule->printProcessingStats(syncState);
}
- if (syncState->matchingModule->printMatchingStats != NULL)
+ if (syncState->matchingModule != NULL &&
+ syncState->matchingModule->printMatchingStats != NULL)
{
syncState->matchingModule->printMatchingStats(syncState);
}
- if (syncState->analysisModule->printAnalysisStats != NULL)
+ if (syncState->analysisModule != NULL &&
+ syncState->analysisModule->printAnalysisStats != NULL)
{
syncState->analysisModule->printAnalysisStats(syncState);
}
+ if (syncState->reductionModule != NULL &&
+ syncState->reductionModule->printReductionStats != NULL)
+ {
+ syncState->reductionModule->printReductionStats(syncState);
+ }
}
}
+/*
+ * A GCompareFunc for g_slist_find_custom()
+ *
+ * Args:
+ * a: ReductionModule*, element's data
+ * b: char*, user data to compare against
+ *
+ * Returns:
+ * 0 if the reduction module a's name is b
+ */
+gint gcfCompareReduction(gconstpointer a, gconstpointer b)
+{
+ const ReductionModule* reductionModule;
+ const char* name;
+
+ reductionModule= (const ReductionModule*) a;
+ name= (const char*) b;
+
+ return strncmp(reductionModule->name, name, strlen(reductionModule->name) +
+ 1);
+}
+
+
/*
* A GFunc for g_queue_foreach()
*
g_string_append((GString*) user_data, ((AnalysisModule*) data)->name);
g_string_append((GString*) user_data, ", ");
}
+
+
+/*
+ * A GFunc for g_queue_foreach()
+ *
+ * Concatenate reduction module names.
+ *
+ * Args:
+ * data: ReductionModule*
+ * user_data: GString*, concatenated names
+ */
+void gfAppendReductionName(gpointer data, gpointer user_data)
+{
+ g_string_append((GString*) user_data, ((ReductionModule*) data)->name);
+ g_string_append((GString*) user_data, ", ");
+}