Module development
Troy Heron <[email protected]> Thu, 9 Aug 2012 10:53:59 +1000
| Newsgroups | gmane.network.irc.irssi.devel |
|---|---|
| Message-ID | <CAMy2XzDQygFa5DWCLTvRpNJ7QW5CMG6GLSHPBuOT-5NBBbRz4A@mail.gmail.com> |
--f46d0438936fb44af004c6caa9f1
Content-Type: text/plain; charset=ISO-8859-1
Hello,
I'm trying to find documentation and/or examples of irssi modules. The only
examples I can find seem to be too large and complex. As it stands I'm
trying to at least get a basic test module to load in irssi without sucess.
I get the following error every time I try to load it:
10:38 -!- Irssi: test/test isn't Irssi module
The test.c file contains only the following:
#include "common.h"
#include "printtext.h"
#include "levels.h"
#include "modules.h"
#define MODULE_NAME "test"
void test_init()
{
module_register(MODULE_NAME, "core");
printtext_string(NULL, NULL, MSGLEVEL_CLIENTCRAP, "init");
}
void test_deinit()
{
printtext_string(NULL, NULL, MSGLEVEL_CLIENTCRAP, "test");
}
And is compiled with the following commands:
gcc -fPIC -Wall -g -DHAVE_CONFIG_H -c test.c
gcc -fPIC -Wall -g -DHAVE_CONFIG_H -avoid_version -module -shared test.o -o
libtest.so
The include paths have been removed for clarity.
Thanks,
Troy
--f46d0438936fb44af004c6caa9f1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hello,<div><br></div><div>I'm trying to find documentation and/or examp=
les of irssi modules. The only examples I can find seem to be too large and=
complex. As it stands I'm trying to at least get a basic test module t=
o load in irssi without sucess. I get the following error every time I try =
to load it:</div>
<div><br></div><div><div>10:38 -!- Irssi: test/test isn't Irssi module<=
/div></div><div><br></div><div>The test.c file contains only the following:=
</div><div><br></div><div><div>#include "common.h"</div><div>
#include "printtext.h"</div><div>#include "levels.h"</d=
iv><div>#include "modules.h"</div><div><br></div><div>#define MOD=
ULE_NAME "test"</div><div><br></div><div>void test_init()</div>
<div>{</div><div>=A0 module_register(MODULE_NAME, "core");</div><=
div>=A0=A0</div><div>=A0 printtext_string(NULL, NULL, MSGLEVEL_CLIENTCRAP, =
"init");</div><div>=A0=A0</div><div>}</div><div><br></div><div>vo=
id test_deinit()</div>
<div>{</div><div>=A0 printtext_string(NULL, NULL, MSGLEVEL_CLIENTCRAP, &quo=
t;test");</div><div>}</div><div><br></div><div>And is compiled with th=
e following commands:</div></div><div><br></div><div>gcc -fPIC -Wall -g -DH=
AVE_CONFIG_H -c test.c</div>
<div>gcc -fPIC -Wall -g -DHAVE_CONFIG_H -avoid_version -module -shared test=
.o -o libtest.so</div><div><br></div><div>The include paths have been remov=
ed for clarity.</div><div><br></div><div>Thanks,</div><div>Troy</div>
--f46d0438936fb44af004c6caa9f1--