blob: d198ed799424b3400bb3bac4998aca7f250e09b8 (
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
|
/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2001-2002 NaN Holding BV. All rights reserved. */
/** \file
* \ingroup intern_memutil
*
* Interface for C access to functionality relating to shared objects in the foundation library.
*/
#ifndef __MEM_REFCOUNTEDC_API_H__
#define __MEM_REFCOUNTEDC_API_H__
/** A pointer to a private object. */
typedef struct MEM_TOpaqueObject *MEM_TObjectPtr;
/** A pointer to a shared object. */
typedef MEM_TObjectPtr MEM_TRefCountedObjectPtr;
#ifdef __cplusplus
extern "C" {
#endif
/**
* Returns the reference count of this object.
* \param shared: The object to query.
* \return The current reference count.
*/
extern int MEM_RefCountedGetRef(MEM_TRefCountedObjectPtr shared);
/**
* Increases the reference count of this object.
* \param shared: The object to query.
* \return The new reference count.
*/
extern int MEM_RefCountedIncRef(MEM_TRefCountedObjectPtr shared);
/**
* Decreases the reference count of this object.
* If the reference count reaches zero, the object self-destructs.
* \param shared: The object to query.
* \return The new reference count.
*/
extern int MEM_RefCountedDecRef(MEM_TRefCountedObjectPtr shared);
#ifdef __cplusplus
}
#endif
#endif // __MEM_REFCOUNTEDC_API_H__
|