aciplist in config file.
FossilOrigin-Name: 0ae2ea51cbbb8c346b811c5ed15b41fb1445a9e97b574379596be9333f051858
This commit is contained in:
@ -279,6 +279,16 @@ static inline int mbag_set_avltree(mbag_t s, uint32_t id, struct avltree *t)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int mbag_set_mavl(mbag_t s, uint32_t id, mavl_t t)
|
||||
{
|
||||
struct mbag_item *i = mbag_item_create(s, id);
|
||||
if (!i)
|
||||
return 0;
|
||||
i->type = MBAG_AVLTREE;
|
||||
i->data = t;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static inline struct avltree *mbag_get_avltree_c(mbag_t s, uint32_t id,
|
||||
struct avltree *(creator) ())
|
||||
@ -296,6 +306,22 @@ static inline struct avltree *mbag_get_avltree_c(mbag_t s, uint32_t id,
|
||||
}
|
||||
|
||||
|
||||
static inline mavl_t mbag_get_mavl(mbag_t s, uint32_t id,
|
||||
mavl_t (creator) ())
|
||||
{
|
||||
struct mbag_item *i = mbag_get(s, id);
|
||||
if (i)
|
||||
return i->data;
|
||||
|
||||
if (!creator)
|
||||
return NULL;
|
||||
mavl_t avltree = creator();
|
||||
if (!avltree)
|
||||
return NULL;
|
||||
mbag_set_mavl(s, id, avltree);
|
||||
return avltree;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user