ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/modules.c
(Generate patch)

Comparing ircd-hybrid-8/src/modules.c (file contents):
Revision 1229 by michael, Mon Sep 19 09:38:38 2011 UTC vs.
Revision 1230 by michael, Thu Sep 22 19:41:19 2011 UTC

# Line 208 | Line 208 | mod_clear_paths(void)
208   * output       - NULL if not found or pointer to module
209   * side effects - NONE
210   */
211 < dlink_node *
211 > struct module *
212   findmodule_byname(const char *name)
213   {
214 <  dlink_node *ptr;
215 <  struct module *modp;
214 >  dlink_node *ptr = NULL;
215  
216    DLINK_FOREACH(ptr, mod_list.head)
217    {
218 <    modp = ptr->data;
218 >    struct module *modp = ptr->data;
219  
220      if (strcmp(modp->name, name) == 0)
221 <      return ptr;
221 >      return modp;
222    }
223  
224    return NULL;
# Line 382 | Line 381 | mo_modunload(struct Client *client_p, st
381               int parc, char *parv[])
382   {
383    const char *m_bn = NULL;
384 <  dlink_node *ptr;
386 <  struct module *modp;
384 >  struct module *modp = NULL;
385  
386    if (!HasOFlag(source_p, OPER_FLAG_MODULE))
387    {
# Line 394 | Line 392 | mo_modunload(struct Client *client_p, st
392  
393    m_bn = libio_basename(parv[1]);
394  
395 <  if ((ptr = findmodule_byname(m_bn)) == NULL)
395 >  if ((modp = findmodule_byname(m_bn)) == NULL)
396    {
397      sendto_one(source_p, ":%s NOTICE %s :Module %s is not loaded",
398                 me.name, source_p->name, m_bn);
399      return;
400    }
401  
402 <  modp = ptr->data;
405 <
406 <  if (modp->core == 1)
402 >  if (modp->flags & MODULE_FLAG_CORE)
403    {
404      sendto_one(source_p,
405                 ":%s NOTICE %s :Module %s is a core module and may not be unloaded",
# Line 411 | Line 407 | mo_modunload(struct Client *client_p, st
407      return;
408    }
409  
414  /* XXX might want to simply un dlink it here */
415
410    if (unload_one_module(m_bn, 1) == -1)
411    {
412      sendto_one(source_p, ":%s NOTICE %s :Module %s is not loaded",
# Line 426 | Line 420 | mo_modreload(struct Client *client_p, st
420               int parc, char *parv[])
421   {
422    const char *m_bn = NULL;
423 <  dlink_node *ptr;
430 <  struct module *modp;
423 >  struct module *modp = NULL;
424    int check_core;
425  
426    if (!HasOFlag(source_p, OPER_FLAG_MODULE))
# Line 439 | Line 432 | mo_modreload(struct Client *client_p, st
432  
433    m_bn = libio_basename(parv[1]);
434  
435 <  if ((ptr = findmodule_byname(m_bn)) == NULL)
435 >  if ((modp = findmodule_byname(m_bn)) == NULL)
436    {
437      sendto_one(source_p, ":%s NOTICE %s :Module %s is not loaded",
438                 me.name, source_p->name, m_bn);
439      return;
440    }
441  
442 <  modp = ptr->data;
450 <  check_core = modp->core;
442 >  check_core = (modp->flags & MODULE_FLAG_CORE) != 0;
443  
444    if (unload_one_module(m_bn, 1) == -1)
445    {
# Line 488 | Line 480 | mo_modlist(struct Client *client_p, stru
480  
481      sendto_one(source_p, form_str(RPL_MODLIST), me.name, parv[0],
482                 modp->name, modp->handle,
483 <               modp->version, modp->core?"(core)":"");
483 >               modp->version, (modp->flags & MODULE_FLAG_CORE) ?"(core)":"");
484    }
485  
486    sendto_one(source_p, form_str(RPL_ENDOFMODLIST),

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)