]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Add change_isupport() to change the value of an ISUPPORT token.
authorWilliam Pitcock <redacted>
Fri, 29 Aug 2008 20:27:34 +0000 (15:27 -0500)
committerWilliam Pitcock <redacted>
Fri, 29 Aug 2008 20:27:34 +0000 (15:27 -0500)
include/supported.h
src/supported.c

index d92c9b1f30bc416458d02b848483d692d6704655..beeb89cc8b375ddc7513d01e8f3173c13b587e67 100644 (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);
index e0f617e496ceb1a0dff71e8b0c71156a13d86741..2f52479330675e9f0924e795d029d299cd77c0db 100644 (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)
 {