aboutsummaryrefslogtreecommitdiff
path: root/api_stash.h
blob: 96e7750e3384eee25782bb75f5a107b88ad2fc60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
 *
 * This is free software: you can redistribute it and/or modify
 * it under the terms of the Artistic License 2.0 as published by
 * The Perl Foundation.
 *
 * This source is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * Artistic License 2.0 for more details.
 *
 * You should have received a copy of the Artistic License 2.0
 * along the source as a COPYING file. If not, obtain it from
 * http://www.perlfoundation.org/artistic_license_2_0.
 */

#ifndef _MOONY_API_STASH_H
#define _MOONY_API_STASH_H

#include <moony.h>

#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;
		lforge_t lforge;
	};

	atom_ser_t ser;
	LV2_Atom_Forge forge;
};

int
_lstash(lua_State *L);
int
_lstash__gc(lua_State *L);
int
_lstash_write(lua_State *L);
int
_lstash_read(lua_State *L);

extern const luaL_Reg lstash_mt [];

#endif