Compile fixes.
[SquirrelJME.git] / nanocoat / include / sjme / cleanup.h
blobe6d8cc36649a84f78cd0e8becb12ffffd755be33
1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // -------------------------------------------------------------------------*/
10 /**
11 * Cleaning functions.
13 * @since 2024/08/09
16 #ifndef SQUIRRELJME_CLEANUP_H
17 #define SQUIRRELJME_CLEANUP_H
19 #include "sjme/nvm/nvm.h"
20 #include "sjme/alloc.h"
22 /* Anti-C++. */
23 #ifdef __cplusplus
24 #ifndef SJME_CXX_IS_EXTERNED
25 #define SJME_CXX_IS_EXTERNED
26 #define SJME_CXX_SQUIRRELJME_CLEANUP_H
27 extern "C"
29 #endif /* #ifdef SJME_CXX_IS_EXTERNED */
30 #endif /* #ifdef __cplusplus */
32 /*--------------------------------------------------------------------------*/
34 /** Special enqueue data that represents this is an identity. */
35 #define SJME_NVM_ENQUEUE_IDENTITY ((sjme_pointer)(0x1234))
37 /**
38 * Handler for any weak references which have been enqueued.
40 * @param weak The weak reference.
41 * @param data The data for the enqueue.
42 * @param isBlockFree Is this a block free or a weak free?
43 * @return Any resultant error, if any.
44 * @since 2024/08/08
46 sjme_errorCode sjme_nvm_enqueueHandler(
47 sjme_attrInNotNull sjme_alloc_weak weak,
48 sjme_attrInNullable sjme_pointer data,
49 sjme_attrInValue sjme_jboolean isBlockFree);
51 /**
52 * Initializes the given object.
54 * @param inCommon The object.
55 * @param inType The type of object this is.
56 * @return Any resultant error, if any.
57 * @since 2024/08/10
59 sjme_errorCode sjme_nvm_objectInit(
60 sjme_attrInNotNull sjme_nvm_common inCommon,
61 sjme_attrInValue sjme_nvm_structType inType);
63 /*--------------------------------------------------------------------------*/
65 /* Anti-C++. */
66 #ifdef __cplusplus
67 #ifdef SJME_CXX_SQUIRRELJME_CLEANUP_H
69 #undef SJME_CXX_SQUIRRELJME_CLEANUP_H
70 #undef SJME_CXX_IS_EXTERNED
71 #endif /* #ifdef SJME_CXX_SQUIRRELJME_CLEANUP_H */
72 #endif /* #ifdef __cplusplus */
74 #endif /* SQUIRRELJME_CLEANUP_H */