The function you pass to g_idle_add needs to have a signature matching the GSourceFunc type, which means it has to take exactly one pointer argument. You'll have to allocate a structure on the heap (NOT the stack as a commenter has suggested, that will only be valid for as long as the function creating it runs) containing the information you need. Something like this:
struct checker_arguments {
gpointer plugin;
int toggle;
};
static gboolean checker(gpointer data) {
struct checker_arguments *args = data;
/* Do stuff with args->plugin and args->toggle */
g_slice_free1(args, sizeof(*args));
return FALSE;
}
struct checker_arguments *args = g_slice_alloc(sizeof(*args));
args->plugin = plugin;
args->toggle = 0;
g_idle_add(checker, args);
Because you're concerned with memory consumption, I used slice allocation in this example rather than the normal heap allocation. Slice allocation is more efficient for objects of fixed size.