commit 9cd4f26d6c41e612c29645d66275962d9debf0ef
parent e6677bad2380fa40a4649560c44d23de6ba8ebaa
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 26 Oct 2020 14:45:02 +0100
First draft of the public API
Diffstat:
| A | src/atrtp.h | | | 79 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 79 insertions(+), 0 deletions(-)
diff --git a/src/atrtp.h b/src/atrtp.h
@@ -0,0 +1,79 @@
+/* Copyright (C) 2020 CNRS
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef ATRTP_H
+#define ATRTP_H
+
+#include <rsys/rsys.h>
+
+/* Library symbol management */
+#if defined(ATRTP_SHARED_BUILD) /* Build shared library */
+ #define ATRTP_API extern EXPORT_SYM
+#elif defined(ATRTP_STATIC) /* Use/build static library */
+ #define ATRTP_API extern LOCAL_SYM
+#else /* Use shared library */
+ #define ATRTP_API extern IMPORT_SYM
+#endif
+
+/* Helper macro that asserts if the invocation of the atrtp function `Func'
+ * returns an error. One should use this macro on sth function calls for
+ * which no explicit error checking is performed */
+#ifndef NDEBUG
+ #define ATRTP(Func) ASSERT(atrtp_ ## Func == RES_OK)
+#else
+ #define ATRTP(Func) atrtp_ ## Func
+#endif
+
+/* Forward declaration of external data types */
+struct logger;
+struct mem_allocator;
+
+/* Forward declaration of opaque data types */
+struct atrtp;
+
+BEGIN_DECLS
+
+/*******************************************************************************
+ * ATRTP API
+ ******************************************************************************/
+ATRTP_API res_T
+atrtp_create
+ (struct logger* logger, /* NULL <=> use default logger */
+ struct mem_allocator* allocator, /* NULL <=> use default allocator */
+ const int verbose, /* Verbosity level */
+ struct atrtp** atrtp);
+
+ATRTP_API res_T
+atrtp_ref_get
+ (struct atrtp* atrtp);
+
+ATRTP_API res_T
+atrtp_ref_put
+ (struct atrtp* attrtp);
+
+ATRTP_API res_T
+atrtp_load
+ (struct atrtp* atrtp,
+ const char* path);
+
+ATRTP_API res_T
+atrtp_load_stream
+ (struct atrtp* atrtp,
+ FILE* stream,
+ const char* stream_name); /* Can be NULL */
+
+END_DECLS
+
+#endif /* ATRTP_H */