Make change_isupport() return the old value!!!
This commit is contained in:
parent
474b0d3515
commit
5d47bdca0f
2 changed files with 7 additions and 2 deletions
|
@ -36,7 +36,7 @@
|
||||||
#define INCLUDED_supported_h
|
#define INCLUDED_supported_h
|
||||||
|
|
||||||
extern void add_isupport(const char *, const char *(*)(const void *), const void *);
|
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 delete_isupport(const char *);
|
||||||
extern void show_isupport(struct Client *);
|
extern void show_isupport(struct Client *);
|
||||||
extern void init_isupport(void);
|
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);
|
rb_dlinkAddTail(item, &item->node, &isupportlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
const void *
|
||||||
change_isupport(const char *name, const char *(*func)(const void *), const void *param)
|
change_isupport(const char *name, const char *(*func)(const void *), const void *param)
|
||||||
{
|
{
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
struct isupportitem *item;
|
struct isupportitem *item;
|
||||||
|
void *oldvalue;
|
||||||
|
|
||||||
RB_DLINK_FOREACH(ptr, isupportlist.head)
|
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))
|
if (!strcmp(item->name, name))
|
||||||
{
|
{
|
||||||
|
oldvalue = item->param;
|
||||||
|
|
||||||
item->name = name;
|
item->name = name;
|
||||||
item->func = func;
|
item->func = func;
|
||||||
item->param = param;
|
item->param = param;
|
||||||
|
@ -130,6 +133,8 @@ change_isupport(const char *name, const char *(*func)(const void *), const void
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return oldvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue