1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00
profanity/plugins/test-c-plugin/test-c-plugin.c
Artem Shinkarov 705a946882 Adding plugin interface for C files.
Implementation of hooks using C interface basedon dlfcn.  Added test
plugin and makefile to build it.  In order to test it add the followin
into your profrc:
    [plugins]
    load=test-c-plugin.so
and execute profanity piping stderr to some file.  The file should
contain all entries whenever the plugin function is triggered.  It seem
to be workin but some parts are missing.
2013-08-18 03:55:20 +01:00

32 lines
594 B
C

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
static FILE * f = NULL;
void
prof_init (const char * const version, const char * const status)
{
fprintf (stderr, "called %s with args=<%s, %s>\n", __func__, version, status);
}
void
prof_on_start (void)
{
fprintf (stderr, "called %s with no args\n", __func__);
}
void
prof_on_connect (void)
{
fprintf (stderr, "called %s with no args\n", __func__);
}
void
c_on_message_received (const char * const jid, const char * const message)
{
fprintf (stderr, "called %s with args=<%s, %s>\n", __func__, jid, message);
}