actube/src/cw/mavl_replace.c
7u83@mail.ru d8c8bd022e Work on ansi and clean Makefiles
FossilOrigin-Name: 0805f78d34219a2aac597a313081ce869c389e6b5d471c65c7f43d0906c0a400
2018-02-28 08:05:45 +00:00

13 lines
209 B
C

#include "mavl.h"
void *mavl_replace(struct mavl *t,void *data){
struct mavlnode * node = mavl_get_node(t,data);
if (node){
t->del(node->data);
return node->data=data;
}
return mavl_add(t,data);
}