Reinstantiated the first test plugin

This commit is contained in:
Christian Thaeter 2008-10-26 22:04:58 +01:00
parent b242f3359b
commit 0dc8a68afb
3 changed files with 106 additions and 17 deletions

View file

@ -48,11 +48,6 @@ test_luid_SOURCES = $(tests_srcdir)/library/test-luid.c
test_luid_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror
test_luid_LDADD = liblumiera.a $(NOBUGMT_LUMIERA_LIBS) -lm
check_PROGRAMS += test-interfaces
test_interfaces_SOURCES = $(tests_srcdir)/backend/test-interfaces.c
test_interfaces_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror
test_interfaces_LDADD = liblumibackend.a liblumiera.a $(NOBUGMT_LUMIERA_LIBS) -lm
check_PROGRAMS += test-filedescriptors
test_filedescriptors_SOURCES = $(tests_srcdir)/backend/test-filedescriptors.c
test_filedescriptors_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror
@ -68,4 +63,15 @@ test_config_SOURCES = $(tests_srcdir)/backend/test-config.c
test_config_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/src/
test_config_LDADD = liblumibackend.a liblumiera.a $(NOBUGMT_LUMIERA_LIBS) -lm
check_LTLIBRARIES += examplepluginc.la
examplepluginc_la_SOURCES = $(tests_srcdir)/backend/example_plugin.c
examplepluginc_la_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/src/
examplepluginc_la_LDFLAGS = -module -avoid-version -no-undefined -rpath /dev/null
check_PROGRAMS += test-interfaces
test_interfaces_SOURCES = $(tests_srcdir)/backend/test-interfaces.c
test_interfaces_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror
test_interfaces_LDADD = liblumibackend.a liblumiera.a $(NOBUGMT_LUMIERA_LIBS) -lm
test_interfaces_DEPENDENCIES = examplepluginc.la
TESTS = $(tests_srcdir)/test.sh

View file

@ -1,6 +1,7 @@
#include <stdio.h>
#include "hello_interface.h"
#include "backend/interfacedescriptor.h"
int myopen(void)
{
@ -34,12 +35,94 @@ void bye(const char* m)
printf("Bye %s\n", m);
}
LUMIERA_INTERFACE_IMPLEMENT(hello, 1, german, myopen, myclose,
hallo,
tschuess
LUMIERA_INTERFACE_INSTANCE (lumieraorg_interfacedescriptor, 0,
lumieraorg_exampleplugin_descriptor,
NULL, NULL, NULL,
LUMIERA_INTERFACE_INLINE (name, "\003\307\005\305\201\304\175\377\120\105\332\016\136\354\251\022",
const char*, (LumieraInterface iface),
{return "LumieraTest";}
),
LUMIERA_INTERFACE_INLINE (brief, "\303\047\265\010\242\210\365\340\024\030\350\310\067\171\170\260",
const char*, (LumieraInterface iface),
{return "Lumiera Test suite examples";}
),
LUMIERA_INTERFACE_INLINE (homepage, "\363\125\352\312\056\255\274\322\351\245\051\350\120\024\115\263",
const char*, (LumieraInterface iface),
{return "http://www.lumiera.org/develompent.html";}
),
LUMIERA_INTERFACE_INLINE (version, "\114\043\133\175\354\011\232\002\117\240\107\141\234\157\217\176",
const char*, (LumieraInterface iface),
{return "No Version";}
),
LUMIERA_INTERFACE_INLINE (author, "\313\300\055\156\126\320\144\247\140\023\261\002\270\367\017\267",
const char*, (LumieraInterface iface),
{return "Christian Thaeter";}
),
LUMIERA_INTERFACE_INLINE (email, "\163\051\312\276\137\317\267\305\237\274\133\012\276\006\255\160",
const char*, (LumieraInterface iface),
{return "ct@pipapo.org";}
),
LUMIERA_INTERFACE_INLINE (copyright, "\160\246\161\204\123\262\375\351\157\276\333\073\355\036\062\341",
const char*, (LumieraInterface iface),
{
return
"Copyright (C) Lumiera.org\n"
" 2008 Christian Thaeter <ct@pipapo.org>";
}
),
LUMIERA_INTERFACE_INLINE (license, "\007\311\044\214\064\223\201\326\331\111\233\356\055\264\211\201",
const char*, (LumieraInterface iface),
{
return
"This program is free software; you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as published by\n"
"the Free Software Foundation; either version 2 of the License, or\n"
"(at your option) any later version.\n"
"\n"
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
"GNU General Public License for more details.\n"
"\n"
"You should have received a copy of the GNU General Public License\n"
"along with this program; if not, write to the Free Software\n"
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA";
}
),
LUMIERA_INTERFACE_INLINE (state, "\331\353\126\162\067\376\340\242\232\175\167\105\122\177\306\354",
int, (LumieraInterface iface),
{return LUMIERA_INTERFACE_EXPERIMENTAL;}
),
LUMIERA_INTERFACE_INLINE (versioncmp, "\363\145\363\224\325\104\177\057\344\023\367\111\376\221\152\135",
int, (const char* a, const char* b),
{return 0;}
)
);
LUMIERA_INTERFACE_IMPLEMENT(hello, 1, english, myopen, myclose,
hello,
bye
);
LUMIERA_PLUGIN (NULL, NULL,
"\046\150\040\062\077\110\134\143\236\244\346\365\072\377\371\263",
LUMIERA_INTERFACE_DEFINE (lumieraorg_testhello, 0,
lumieraorg_hello_german,
LUMIERA_INTERFACE_REF (lumieraorg_interfacedescriptor, 0, lumieraorg_exampleplugin_descriptor),
NULL,
NULL,
LUMIERA_INTERFACE_MAP (hello, "\167\012\306\023\031\151\006\362\026\003\125\017\170\022\100\333",
hallo),
LUMIERA_INTERFACE_MAP (goodbye, "\324\267\214\166\340\213\155\053\157\125\064\264\167\235\020\223",
tschuess)
),
LUMIERA_INTERFACE_DEFINE (lumieraorg_testhello, 0,
lumieraorg_hello_english,
LUMIERA_INTERFACE_REF (lumieraorg_interfacedescriptor, 0, lumieraorg_exampleplugin_descriptor),
NULL,
NULL,
LUMIERA_INTERFACE_MAP (hello, "\326\247\370\247\032\103\223\357\262\007\356\042\051\330\073\116",
hello),
LUMIERA_INTERFACE_MAP (goodbye, "\365\141\371\047\101\230\050\106\071\231\022\235\325\112\354\241",
bye)
)
)

View file

@ -1,6 +1,6 @@
#include "lib/plugin.h"
#include "backend/interface.h"
LUMIERA_INTERFACE(hello, 1,
LUMIERA_INTERFACE_PROTO(void, hello, (void))
LUMIERA_INTERFACE_PROTO(void, goodbye, (const char*))
);
LUMIERA_INTERFACE_DECLARE (lumieraorg_testhello, 0,
LUMIERA_INTERFACE_SLOT (void, hello, (void)),
LUMIERA_INTERFACE_SLOT (void, goodbye, (const char*)),
);