diff --git a/dim_plugins/example_c/src/main.c b/dim_plugins/example_c/src/main.c index a45ca4d..9653598 100644 --- a/dim_plugins/example_c/src/main.c +++ b/dim_plugins/example_c/src/main.c @@ -1,6 +1,7 @@ #include #include #include +#include // Only use this define once, cause it defines funcitons #define PLUG_IMPL #include "dim_sdk.h" @@ -38,7 +39,9 @@ int plug_post_reload(void *state) { } int plug_on_msg(plug_msg_t* msg) { - snprintf(p->ctx.buf, BUF_SZ, "Hello from C! (%d)", p->count++); + if (strcmp(msg->name, "poll") == 0) { + snprintf(p->ctx.buf, BUF_SZ, "Hello from C! (%d)", p->count++); + } return 0; }