Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm_object.h
1/*
2 * SPDX-FileCopyrightText: © 2020 Alexandros Theodotou <alex@zrythm.org>
3 *
4 * SPDX-License-Identifier: LicenseRef-ZrythmLicense
5 */
6
7#ifndef __UTILS_ZRYTHM_OBJECT_H__
8#define __UTILS_ZRYTHM_OBJECT_H__
9
16#define ZRYTHM_OBJECT_MAGIC 4111481
17#define IS_ZRYTHM_OBJECT(_p) \
18 ((_p) && ((ZrythmObject *) (_p))->magic == ZRYTHM_OBJECT_MAGIC)
19
23typedef struct ZrythmObject
24{
25 const char * file;
26 const char * func;
27 int line;
28 int magic;
30
31#define zrythm_object_init(x) \
32 ((ZrythmObject *) x)->file = __FILE__; \
33 ((ZrythmObject *) x)->func = __func__; \
34 ((ZrythmObject *) x)->line = __LINE__; \
35 ((ZrythmObject *) x)->magic = ZRYTHM_OBJECT_MAGIC
36
41#endif
Base object for debugging.