Add change_isupport() to change the value of an ISUPPORT token.

This commit is contained in:
William Pitcock 2008-08-29 15:27:34 -05:00
parent 9ac19244c0
commit 17ad49a96a
2 changed files with 22 additions and 0 deletions

View File

@ -36,6 +36,7 @@
#define INCLUDED_supported_h
extern void add_isupport(const char *, const char *(*)(const void *), const void *);
extern void change_isupport(const char *, const char *(*)(const void *), const void *);
extern void delete_isupport(const char *);
extern void show_isupport(struct Client *);
extern void init_isupport(void);

View File

@ -111,6 +111,27 @@ add_isupport(const char *name, const char *(*func)(const void *), const void *pa
rb_dlinkAddTail(item, &item->node, &isupportlist);
}
void
change_isupport(const char *name, const char *(*func)(const void *), const void *param)
{
rb_dlink_node *ptr;
struct isupportitem *item;
RB_DLINK_FOREACH(ptr, isupportlist.head)
{
item = ptr->data;
if (!strcmp(item->name, name))
{
item->name = name;
item->func = func;
item->param = param;
break;
}
}
}
void
delete_isupport(const char *name)
{