Commit 602c98da authored by Hanspeter Portner's avatar Hanspeter Portner

Squashed 'ser_atom.lv2/' changes from 1f1e6ad..0c42030

0c42030 add ser_atom_get to API.

git-subtree-dir: ser_atom.lv2
git-subtree-split: 0c42030406c4cbc841dcbe82b7a4d31c456f36de
parent 2bf7767e
......@@ -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