2
* Copyright (C) 2001 Alan Robertson <alanr@unix.sh>
3
* This software licensed under the GNU LGPL.
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
#include <lha_internal.h>
23
#include <pils/generic.h>
25
#define MOD "/home/alanr/modules"
27
GHashTable* test1functions = NULL;
34
static int TestCallBack
35
( GenericPILCallbackType t
42
static PILGenericIfMgmtRqst RegRqsts [] =
43
{ {"test", &test1functions, &one, TestCallBack, &two},
44
{NULL, NULL, NULL, NULL, NULL}
48
main(int argc, char ** argv)
55
u = NewPILPluginUniv(MOD);
56
/* PILSetDebugLevel(u, NULL, NULL, 0); */
60
if ((rc = PILLoadPlugin(u, "InterfaceMgr", "generic", &RegRqsts))
62
fprintf(stderr, "generic plugin load Error = [%s]\n"
66
/* PILSetDebugLevel(u, NULL, NULL, 0); */
68
for (j=0; j < 10; ++j) {
70
fprintf(stderr, "****Loading plugin test/test\n");
71
if ((rc = PILLoadPlugin(u, "test", "test", NULL)) != PIL_OK) {
72
printf("ERROR: test plugin load error = [%d/%s]\n"
76
fprintf(stderr, "****UN-loading plugin test/test\n");
77
if ((rc = PILIncrIFRefCount(u, "test", "test", -1))!= PIL_OK){
78
printf("ERROR: test plugin UNload error = [%d/%s]\n"
83
DelPILPluginUniv(u); u = NULL;
92
( GenericPILCallbackType t
102
snprintf(cbbuf, sizeof(cbbuf), "PIL_REGISTER");
106
snprintf(cbbuf, sizeof(cbbuf), "PIL_UNREGISTER");
110
snprintf(cbbuf, sizeof(cbbuf), "type [%d?]", t);
114
fprintf(stderr, "Callback: (%s, univ: 0x%lx, module: %s/%s, user ptr: 0x%lx (%ld))\n"
116
, (unsigned long) univ
118
, (unsigned long)userptr
119
, (*((long *)userptr)));