removes the difference in compiled in and plugin interfaces. * All interfaces are now defined with LUMIERA_EXPORT(...) * The definition of LUMIERA_PLUGIN at compile time takes action to compile as plugin which gets automatically managed. * compiled in (core) interfaces need still be registered, this is simplified with the LUMIERA_INTERFACE_REGISTEREXPORTED and LUMIERA_INTERFACE_UNREGISTEREXPORTED macros which become no-ops for plugins.
127 lines
7.7 KiB
C
127 lines
7.7 KiB
C
#include <stdio.h>
|
|
|
|
#include "hello_interface.h"
|
|
#include "backend/interfacedescriptor.h"
|
|
|
|
int myopen(void)
|
|
{
|
|
printf("opened\n");
|
|
return 0;
|
|
}
|
|
|
|
int myclose(void)
|
|
{
|
|
printf("closed\n");
|
|
return 0;
|
|
}
|
|
|
|
void hallo(void)
|
|
{
|
|
printf("Hallo Welt!\n");
|
|
}
|
|
|
|
void tschuess(const char* m)
|
|
{
|
|
printf("Tschuess %s\n", m);
|
|
}
|
|
|
|
void hello(void)
|
|
{
|
|
printf("Hello World!\n");
|
|
}
|
|
|
|
void bye(const char* m)
|
|
{
|
|
printf("Bye %s\n", m);
|
|
}
|
|
|
|
|
|
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_EXPORT(
|
|
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)
|
|
)
|
|
)
|