Commit 233bd0d3 authored by Hanspeter Portner's avatar Hanspeter Portner

move atom_ser_t definition to moony.h

parent 19911587
Pipeline #4229385 passed with stages
in 5 minutes and 7 seconds
......@@ -23,16 +23,8 @@
#include <api_atom.h>
#include <api_forge.h>
typedef struct _atom_ser_t atom_ser_t;
typedef struct _lstash_t lstash_t;
struct _atom_ser_t {
moony_t *moony; // use rt-memory pool?
uint32_t size;
uint8_t *buf;
uint32_t offset;
};
struct _lstash_t {
union {
latom_t latom;
......
......@@ -396,4 +396,13 @@ _sink(LV2_Atom_Forge_Sink_Handle handle, const void *buf, uint32_t size);
LV2_Atom *
_deref(LV2_Atom_Forge_Sink_Handle handle, LV2_Atom_Forge_Ref ref);
typedef struct _atom_ser_t atom_ser_t;
struct _atom_ser_t {
moony_t *moony; // use rt-memory pool?
uint32_t size;
uint8_t *buf;
uint32_t offset;
};
#endif // _MOONY_H
......@@ -275,7 +275,7 @@ static inline cJSON *
_jsatom_encode_fallback(jsatom_t *jsatom, uint32_t size, LV2_URID type, const void *body)
{
const char *uri = jsatom->unmap->unmap(jsatom->unmap->handle, type);
return _jsatom_encode_base64(jsatom, size, uri, body);
return uri ? _jsatom_encode_base64(jsatom, size, uri, body) : NULL;
}
static inline cJSON *
......@@ -348,7 +348,8 @@ jsatom_encode(jsatom_t *jsatom, uint32_t size, LV2_URID type, const void *body)
{
cJSON *obj = _jsatom_encode_raw(jsatom, size, type, body);
cJSON *arr = cJSON_CreateArray();
cJSON_AddItemToArray(arr, obj);
if(obj)
cJSON_AddItemToArray(arr, obj);
return arr;
}
......
......@@ -25,7 +25,6 @@
#include <libwebsockets.h>
#include <moony.h>
#include <api_stash.h>
#include <private_ui.h>
#include <jsatom.h>
......
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