From 99d273dba0c9d657e0cd174174bba576ff8e5d43 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 10 Aug 2012 20:23:41 +0000 Subject: Add LV2_ATOM_CONTENTS_CONST and LV2_ATOM_BODY_CONST. --- lv2/lv2plug.in/ns/ext/atom/atom.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lv2/lv2plug.in/ns/ext/atom/atom.h') diff --git a/lv2/lv2plug.in/ns/ext/atom/atom.h b/lv2/lv2plug.in/ns/ext/atom/atom.h index 37a3e6c..8169167 100644 --- a/lv2/lv2plug.in/ns/ext/atom/atom.h +++ b/lv2/lv2plug.in/ns/ext/atom/atom.h @@ -79,12 +79,23 @@ typedef char lv2_atom_assert_double_fits_in_64_bits[ #define LV2_ATOM_CONTENTS(type, atom) \ ((void*)((uint8_t*)(atom) + sizeof(type))) +/** + Const version of LV2_ATOM_CONTENTS. +*/ +#define LV2_ATOM_CONTENTS_CONST(type, atom) \ + ((const void*)((const uint8_t*)(atom) + sizeof(type))) + /** Return a pointer to the body of an Atom. The "body" of an atom is the data just past the LV2_Atom head (i.e. the same offset for all types). */ #define LV2_ATOM_BODY(atom) LV2_ATOM_CONTENTS(LV2_Atom, atom) +/** + Const version of LV2_ATOM_BODY. +*/ +#define LV2_ATOM_BODY_CONST(atom) LV2_ATOM_CONTENTS_CONST(LV2_Atom, atom) + /** The header of an atom:Atom. */ typedef struct { uint32_t size; /**< Size in bytes, not including type and size. */ -- cgit v1.2.1