Added set function.
FossilOrigin-Name: 60afdccc5f962d3b8dd7d468ce8628ff1cbc16661ad76f46be88021be063c1ad
This commit is contained in:
parent
798c1996b7
commit
3b466158a4
@ -37,8 +37,10 @@ struct mbag_typedef{
|
||||
const char *name;
|
||||
void (*del)(void*);
|
||||
int (*to_str)(void*,char *dst);
|
||||
|
||||
struct mbag_item * (*from_str)(const char *src);
|
||||
};
|
||||
|
||||
|
||||
typedef const struct mbag_typedef * mbagtype_t;
|
||||
|
||||
|
||||
@ -99,6 +101,21 @@ struct mbag_item *mbag_item_create(mbag_t s, const char *id);
|
||||
struct mbag_item *mbag_i_item_create(mbag_t s, uint32_t id);
|
||||
|
||||
|
||||
static inline int mbag_set(mbag_t t,mbag_item_t *is)
|
||||
{
|
||||
mavl_del(t,is);
|
||||
mavl_add(t,is);
|
||||
return 1;
|
||||
|
||||
/*
|
||||
struct mbag_item *i = mavl_get(s, is);
|
||||
if (i) {
|
||||
mbag_del_data(i);
|
||||
return i;
|
||||
}
|
||||
mavl_add(t,is);
|
||||
*/
|
||||
}
|
||||
|
||||
static inline int mbag_set_byte(mbag_t s, const char *id, uint8_t byte)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user