aciplist in config file.

FossilOrigin-Name: 0ae2ea51cbbb8c346b811c5ed15b41fb1445a9e97b574379596be9333f051858
This commit is contained in:
7u83@mail.ru
2015-04-24 05:13:54 +00:00
parent 035e0a38c7
commit 99beef377e
17 changed files with 196 additions and 47 deletions

View File

@ -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;
}