New message handler format

FossilOrigin-Name: bb2a1847072e2bf5e381dfdf0c4465b064c3feaab0faf51f93a7f4b8d2bcd999
This commit is contained in:
7u83@mail.ru
2018-03-09 06:44:17 +00:00
parent 06e50e8318
commit 5718781138
33 changed files with 351 additions and 261 deletions

View File

@ -1,6 +1,6 @@
#include "mavl.h"
static struct mavlnode *mavlnode_create(union mavldata *data)
static struct mavlnode *mavlnode_create(const union mavldata *data)
{
struct mavlnode *n = malloc(sizeof(struct mavlnode));
if (!n)
@ -169,16 +169,19 @@ static int mavl_add0(struct mavl *t, struct mavlnode **parent, union mavldata **
* @example mavl_add_example.c
*/
union mavldata *mavl_add(struct mavl *t, const union mavldata *data)
union mavldata *mavl_add(struct mavl *t, union mavldata *data)
{
union mavldata * d;
int rc;
if (t->root == 0) {
if (t->root == NULL) {
t->root = mavlnode_create(data);
if (t->root)
t->count++;
return &t->root->data;
/* return &t->root->data; */
return data;
}
d = data;