/* -TimeMr14C:
* I have moved the dl* function definitions and
* the two functions (load_a_module / unload_a_module) to the
- * file dynlink.c
+ * file dynlink.c
* And also made the necessary changes to those functions
* to comply with shl_load and friends.
- * In this file, to keep consistency with the makefile,
+ * In this file, to keep consistency with the makefile,
* I added the ability to load *.sl files, too.
* 27/02/2002
*/
* output - none
* side effects - returns a module path from path
*/
-static struct module_path *
+static char *
mod_find_path(const char *path)
{
rb_dlink_node *ptr;
- struct module_path *mpath;
+ char *mpath;
RB_DLINK_FOREACH(ptr, mod_paths.head)
{
mpath = ptr->data;
- if(!strcmp(path, mpath->path))
+ if(!strcmp(path, mpath))
return mpath;
}
/* mod_add_path
*
* input - path
- * ouput -
+ * ouput -
* side effects - adds path to list
*/
void
mod_add_path(const char *path)
{
- struct module_path *pathst;
+ char *pathst;
if(mod_find_path(path))
return;
- pathst = rb_malloc(sizeof(struct module_path));
-
- strcpy(pathst->path, path);
+ pathst = rb_strdup(path);
rb_dlinkAddAlloc(pathst, &mod_paths);
}
{
char modpath[PATH_MAX];
rb_dlink_node *pathst;
- struct module_path *mpath;
+ const char *mpath;
struct stat statbuf;
if (server_state_foreground == 1)
- inotice("loading module %s ...", path);
+ inotice("loading module %s ...", path);
RB_DLINK_FOREACH(pathst, mod_paths.head)
{
mpath = pathst->data;
- rb_snprintf(modpath, sizeof(modpath), "%s/%s", mpath->path, path);
+ rb_snprintf(modpath, sizeof(modpath), "%s/%s", mpath, path);
if((strstr(modpath, "../") == NULL) && (strstr(modpath, "/..") == NULL))
{
if(stat(modpath, &statbuf) == 0)
sendto_one(source_p, form_str(RPL_MODLIST),
me.name, source_p->name,
modlist[i]->name,
- modlist[i]->address,
+ (unsigned long)(uintptr_t)modlist[i]->address,
modlist[i]->version, modlist[i]->core ? "(core)" : "");
}
}
{
sendto_one(source_p, form_str(RPL_MODLIST),
me.name, source_p->name, modlist[i]->name,
- modlist[i]->address, modlist[i]->version,
+ (unsigned long)(uintptr_t)modlist[i]->address,
+ modlist[i]->version,
modlist[i]->core ? "(core)" : "");
}
}
/*
** XXX - The type system in C does not allow direct conversion between
** data and function pointers, but as it happens, most C compilers will
- ** safely do this, however it is a theoretical overlow to cast as we
- ** must do here. I have library functions to take care of this, but
- ** despite being more "correct" for the C language, this is more
+ ** safely do this, however it is a theoretical overlow to cast as we
+ ** must do here. I have library functions to take care of this, but
+ ** despite being more "correct" for the C language, this is more
** practical. Removing the abuse of the ability to cast ANY pointer
** to and from an integer value here will break some compilers.
** -jmallett