projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bind lasy
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
module.c
diff --git
a/ltt/branches/poly/lttv/module.c
b/ltt/branches/poly/lttv/module.c
index ccb2bddedb888976bc83a96d1c71d03454aec3eb..44ce77d0fef0cdd6d9897121015d496b1de37289 100644
(file)
--- a/
ltt/branches/poly/lttv/module.c
+++ b/
ltt/branches/poly/lttv/module.c
@@
-59,7
+59,7
@@
void lttv_module_path_add(const char *name)
}
}
-static LttvModule
Info
*
+static LttvModule *
module_load(const char *name, int argc, char **argv)
{
GModule *gm;
module_load(const char *name, int argc, char **argv)
{
GModule *gm;
@@
-69,6
+69,8
@@
module_load(const char *name, int argc, char **argv)
int i;
char *pathname;
int i;
char *pathname;
+
+ const char *module_name;
LttvModuleInit init_function;
LttvModuleInit init_function;
@@
-76,7
+78,9
@@
module_load(const char *name, int argc, char **argv)
for(i = 0 ; i < modulesPaths->len ; i++) {
pathname = g_module_build_path(modulesPaths->pdata[i],name);
for(i = 0 ; i < modulesPaths->len ; i++) {
pathname = g_module_build_path(modulesPaths->pdata[i],name);
- gm = g_module_open(pathname,0);
+ gm = g_module_open(pathname,G_MODULE_BIND_LAZY);
+ g_critical("module : %s", pathname);
+ g_critical("erreur : %s", g_module_error());
g_free(pathname);
if(gm != NULL) break;
g_free(pathname);
if(gm != NULL) break;
@@
-86,37
+90,39
@@
module_load(const char *name, int argc, char **argv)
if(gm == NULL) {
pathname = g_module_build_path(NULL,name);
if(gm == NULL) {
pathname = g_module_build_path(NULL,name);
- gm = g_module_open(pathname,0);
+ gm = g_module_open(pathname,G_MODULE_BIND_LAZY);
+ g_critical("module : %s", pathname);
g_free(pathname);
}
/* Module cannot be found */
g_free(pathname);
}
/* Module cannot be found */
-
+ if(gm==NULL)
+ g_critical("module est null");
if(gm == NULL) return NULL;
/* Check if the module was already opened using the hopefully canonical name
returned by g_module_name. */
if(gm == NULL) return NULL;
/* Check if the module was already opened using the hopefully canonical name
returned by g_module_name. */
-
path
name = g_module_name(gm);
+
module_
name = g_module_name(gm);
- m = g_hash_table_lookup(modules,
path
name);
+ m = g_hash_table_lookup(modules,
module_
name);
if(m == NULL) {
/* Module loaded for the first time. Insert it in the table and call the
init function if any. */
if(m == NULL) {
/* Module loaded for the first time. Insert it in the table and call the
init function if any. */
- m = g_new(LttvModule);
+ m = g_new(LttvModule
, 1
);
m->module = gm;
m->ref_count = 0;
m->load_count = 0;
m->dependents = g_ptr_array_new();
m->module = gm;
m->ref_count = 0;
m->load_count = 0;
m->dependents = g_ptr_array_new();
- g_hash_table_insert(modules,
path
name, m);
+ g_hash_table_insert(modules,
(gpointer)module_
name, m);
if(!g_module_symbol(gm, "init", (gpointer)&init_function)) {
g_warning("module %s (%s) has no init function", name, pathname);
}
if(!g_module_symbol(gm, "init", (gpointer)&init_function)) {
g_warning("module %s (%s) has no init function", name, pathname);
}
- else init_
Function(argc,
argv);
+ else init_
function(m, argc,
argv);
}
else {
}
else {
@@
-132,11
+138,10
@@
module_load(const char *name, int argc, char **argv)
}
}
-LttvModule
Info
*
+LttvModule *
lttv_module_load(const char *name, int argc, char **argv)
{
LttvModule *m = module_load(name, argc, argv);
lttv_module_load(const char *name, int argc, char **argv)
{
LttvModule *m = module_load(name, argc, argv);
-
if(m != NULL) m->load_count++;
return m;
}
if(m != NULL) m->load_count++;
return m;
}
@@
-159,7
+164,7
@@
static void module_unload(LttvModule *m)
char *pathname;
char *pathname;
- guint len;
+ guint
i,
len;
/* Decrement the reference count */
/* Decrement the reference count */
@@
-261,7
+266,7
@@
lttv_module_unload_all()
g_hash_table_foreach(modules, list_independent, independent_modules);
for(i = 0 ; i < independent_modules->len ; i++) {
g_hash_table_foreach(modules, list_independent, independent_modules);
for(i = 0 ; i < independent_modules->len ; i++) {
- m = (LttvModule)independent_modules->pdata[i];
+ m = (LttvModule
*
)independent_modules->pdata[i];
while(m->load_count > 0) lttv_module_unload(m);
}
while(m->load_count > 0) lttv_module_unload(m);
}
This page took
0.026233 seconds
and
4
git commands to generate.