mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
705a946882
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.
32 lines
594 B
C
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);
|
|
}
|
|
|
|
|