Commit 8f988948 authored by Hanspeter Portner's avatar Hanspeter Portner

Merge commit '602c98da'

parents 9931cf3d 602c98da
......@@ -49,6 +49,9 @@ ser_atom_funcs(ser_atom_t *ser, ser_atom_realloc_t realloc,
SER_ATOM_API int
ser_atom_reset(ser_atom_t *ser, LV2_Atom_Forge *forge);
SER_ATOM_API LV2_Atom *
ser_atom_get(ser_atom_t *ser);
SER_ATOM_API int
ser_atom_deinit(ser_atom_t *ser);
......@@ -61,7 +64,10 @@ struct _ser_atom_t {
size_t size;
size_t offset;
uint8_t *buf;
union {
uint8_t *buf;
LV2_Atom *atom;
};
};
static LV2_Atom_Forge_Ref
......@@ -169,6 +175,17 @@ ser_atom_reset(ser_atom_t *ser, LV2_Atom_Forge *forge)
return 0;
}
SER_ATOM_API LV2_Atom *
ser_atom_get(ser_atom_t *ser)
{
if(!ser)
{
return NULL;
}
return ser->atom;
}
SER_ATOM_API int
ser_atom_deinit(ser_atom_t *ser)
{
......
......@@ -122,6 +122,9 @@ main(int argc, char **argv)
assert(lv2_atom_forge_deref(&forge, 0) == NULL);
assert(ser_atom_get(NULL) == NULL);
assert(ser_atom_get(&ser) == ser.atom);
assert(ser_atom_deinit(NULL) != 0);
assert(ser_atom_deinit(&ser) == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment