*/
#include "stdinc.h"
-#include "tools.h"
-#include "balloc.h"
#include "s_user.h"
#include "irc_string.h"
*/
void substitution_append_var(rb_dlink_list *varlist, const char *name, const char *value)
{
- struct substitution_variable *tmp = MyMalloc(sizeof(struct substitution_variable));
+ struct substitution_variable *tmp = rb_malloc(sizeof(struct substitution_variable));
- DupString(tmp->name, name);
- DupString(tmp->value, value);
+ tmp->name = rb_strdup(name);
+ tmp->value = rb_strdup(value);
rb_dlinkAddAlloc(tmp, varlist);
}
{
rb_dlink_node *nptr, *nptr2;
- DLINK_FOREACH_SAFE(nptr, nptr2, varlist->head)
+ RB_DLINK_FOREACH_SAFE(nptr, nptr2, varlist->head)
{
struct substitution_variable *tmp = (struct substitution_variable *) nptr->data;
rb_dlinkDelete(nptr, varlist);
- MyFree(tmp->name);
- MyFree(tmp->value);
- MyFree(tmp);
+ rb_free(tmp->name);
+ rb_free(tmp->value);
+ rb_free(tmp);
}
}
/* advance ptr by length of variable */
ptr += (pptr - ptr);
- DLINK_FOREACH(nptr, varlist->head)
+ RB_DLINK_FOREACH(nptr, varlist->head)
{
struct substitution_variable *val = (struct substitution_variable *) nptr->data;