Make change_isupport() return the old value!!!
This commit is contained in:
parent
17ad49a96a
commit
508c7c41fe
|
@ -36,7 +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 const 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);
|
||||
|
|
|
@ -111,11 +111,12 @@ add_isupport(const char *name, const char *(*func)(const void *), const void *pa
|
|||
rb_dlinkAddTail(item, &item->node, &isupportlist);
|
||||
}
|
||||
|
||||
void
|
||||
const void *
|
||||
change_isupport(const char *name, const char *(*func)(const void *), const void *param)
|
||||
{
|
||||
rb_dlink_node *ptr;
|
||||
struct isupportitem *item;
|
||||
void *oldvalue;
|
||||
|
||||
RB_DLINK_FOREACH(ptr, isupportlist.head)
|
||||
{
|
||||
|
@ -123,6 +124,8 @@ change_isupport(const char *name, const char *(*func)(const void *), const void
|
|||
|
||||
if (!strcmp(item->name, name))
|
||||
{
|
||||
oldvalue = item->param;
|
||||
|
||||
item->name = name;
|
||||
item->func = func;
|
||||
item->param = param;
|
||||
|
@ -130,6 +133,8 @@ change_isupport(const char *name, const char *(*func)(const void *), const void
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return oldvalue;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue