00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _NEBMODULES_H
00027 #define _NEBMODULES_H
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033
00034
00035 #define NEB_API_VERSION(x) int __neb_api_version = x;
00036 #define CURRENT_NEB_API_VERSION 3
00037
00038
00039
00040
00041
00042 #define NEBMODULE_MODINFO_NUMITEMS 6
00043 #define NEBMODULE_MODINFO_TITLE 0
00044 #define NEBMODULE_MODINFO_AUTHOR 1
00045 #define NEBMODULE_MODINFO_COPYRIGHT 2
00046 #define NEBMODULE_MODINFO_VERSION 3
00047 #define NEBMODULE_MODINFO_LICENSE 4
00048 #define NEBMODULE_MODINFO_DESC 5
00049
00050
00051
00052
00053
00054 #define NEBMODULE_NORMAL_LOAD 0
00055 #define NEBMODULE_REQUEST_UNLOAD 0
00056 #define NEBMODULE_FORCE_UNLOAD 1
00057
00058
00059
00060
00061
00062 #define NEBMODULE_NEB_SHUTDOWN 1
00063 #define NEBMODULE_NEB_RESTART 2
00064 #define NEBMODULE_ERROR_NO_INIT 3
00065 #define NEBMODULE_ERROR_BAD_INIT 4
00066 #define NEBMODULE_ERROR_API_VERSION 5
00067
00068
00069
00070
00071
00072
00073 typedef struct nebmodule_struct{
00074 char *filename;
00075 char *args;
00076 char *info[NEBMODULE_MODINFO_NUMITEMS];
00077 int should_be_loaded;
00078 int is_currently_loaded;
00079 #ifdef USE_LTDL
00080 lt_dlhandle module_handle;
00081 lt_ptr init_func;
00082 lt_ptr deinit_func;
00083 #else
00084 void *module_handle;
00085 void *init_func;
00086 void *deinit_func;
00087 #endif
00088 #ifdef HAVE_PTHREAD_H
00089 pthread_t thread_id;
00090 #endif
00091 struct nebmodule_struct *next;
00092 }nebmodule;
00093
00094
00095
00096
00097 int neb_set_module_info(void *,int,char *);
00098
00099 #ifdef __cplusplus
00100 }
00101 #endif
00102
00103 #endif