Merge branch 'db/rev'
[plumiferos.git] / intern / memutil / MEM_RefCountedC-Api.h
blobeb3498ac523d4705bd8fa1c37d53e296d1a8d35a
1 /**
2 * $Id: MEM_RefCountedC-Api.h 247 2002-12-30 12:11:03Z maarten $
3 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version. The Blender
9 * Foundation also sells licenses for use in proprietary software under
10 * the Blender License. See http://www.blender.org/BL/ for information
11 * about this.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
23 * All rights reserved.
25 * The Original Code is: all of this file.
27 * Contributor(s): none yet.
29 * ***** END GPL/BL DUAL LICENSE BLOCK *****
31 /**
32 * @file MEM_RefCountedC-Api.h
33 * Interface for C access to functionality relating to shared objects in the foundation library.
36 #ifndef _H_MEM_REF_COUNTED_C_API
37 #define _H_MEM_REF_COUNTED_C_API
39 /** A pointer to a private object. */
40 typedef struct MEM_TOpaqueObject* MEM_TObjectPtr;
41 /** A pointer to a shared object. */
42 typedef MEM_TObjectPtr MEM_TRefCountedObjectPtr;
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
50 /**
51 * Returns the reference count of this object.
52 * @param shared The object to query.
53 * @return The current reference count.
55 extern int MEM_RefCountedGetRef(MEM_TRefCountedObjectPtr shared);
57 /**
58 * Increases the reference count of this object.
59 * @param shared The object to query.
60 * @return The new reference count.
62 extern int MEM_RefCountedIncRef(MEM_TRefCountedObjectPtr shared);
64 /**
65 * Decreases the reference count of this object.
66 * If the the reference count reaches zero, the object self-destructs.
67 * @param shared The object to query.
68 * @return The new reference count.
70 extern int MEM_RefCountedDecRef(MEM_TRefCountedObjectPtr shared);
73 #ifdef __cplusplus
75 #endif
77 #endif // _H_MEM_REF_COUNTED_C_API