OpenCBM
LINUX/getpluginaddress.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version
5  * 2 of the License, or (at your option) any later version.
6  *
7  * Copyright 1999-2005 Michael Klein <michael(dot)klein(at)puffin(dot)lb(dot)shuttle(dot)de>
8  * Copyright 2001-2005,2007 Spiro Trikaliotis
9  *
10 */
11 
20 #include "getpluginaddress.h"
21 
22 #include <stdio.h>
23 #include <dlfcn.h>
24 
32 plugin_load(const char * name)
33 {
34  void * ret = NULL;
35  char * error;
36 
37  if (name != NULL) {
38  ret = dlopen(name, RTLD_NOW);
39  error = dlerror();
40  if (error){
41  fprintf(stderr, "%s\n", error);
42  }
43  }
44  return ret;
45 }
46 
55 void *
56 plugin_get_address(SHARED_OBJECT_HANDLE handle, const char * name)
57 {
58  return dlsym(handle, name);
59 }
60 
67 void
69 {
70  dlclose(handle);
71 }
void * SHARED_OBJECT_HANDLE
@@@
Shared library / DLL for accessing the driver Functions for obtaining the addresses of plugin functio...
SHARED_OBJECT_HANDLE plugin_load(const char *name)
@@@
void plugin_unload(SHARED_OBJECT_HANDLE handle)
@@@
void * plugin_get_address(SHARED_OBJECT_HANDLE handle, const char *name)
@@@