diff --git a/include/supported.h b/include/supported.h index d92c9b1..beeb89c 100644 --- a/include/supported.h +++ b/include/supported.h @@ -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); diff --git a/src/supported.c b/src/supported.c index e0f617e..2f52479 100644 --- a/src/supported.c +++ b/src/supported.c @@ -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) {