~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to intern/memutil/MEM_CacheLimiterC-Api.h

  • Committer: Bazaar Package Importer
  • Author(s): Lukas Fittl
  • Date: 2006-09-20 01:57:27 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060920015727-gmoqlxwstx9wwqs3
Tags: 2.42a-1ubuntu1
* Merge from Debian unstable (Closes: Malone #55903). Remaining changes:
  - debian/genpot: Add python scripts from Lee June <blender@eyou.com> to
    generate a reasonable PO template from the sources. Since gettext is used
    in a highly nonstandard way, xgettext does not work for this job.
  - debian/rules: Call the scripts, generate po/blender.pot, and clean it up
    in the clean target.
  - Add a proper header to the generated PO template.
* debian/control: Build depend on libavformat-dev >= 3:0.cvs20060823-3.1,
  otherwise this package will FTBFS

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 *
 
3
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
 
4
 *
 
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.
 
12
 *
 
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.
 
17
 *
 
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.
 
21
 *
 
22
 * Contributor(s): Peter Schlaile <peter@schlaile.de> 2005
 
23
 *
 
24
 * ***** END GPL/BL DUAL LICENSE BLOCK *****
 
25
 */
 
26
 
 
27
#ifndef __MEM_cache_limiter_c_api_h_included__
 
28
#define __MEM_cache_limiter_c_api_h_included__ 1
 
29
 
 
30
#ifdef __cplusplus
 
31
extern "C" {
 
32
#endif
 
33
        
 
34
struct MEM_CacheLimiter_s;
 
35
struct MEM_CacheLimiterHandle_s;
 
36
 
 
37
typedef struct MEM_CacheLimiter_s MEM_CacheLimiterC;
 
38
typedef struct MEM_CacheLimiterHandle_s MEM_CacheLimiterHandleC;
 
39
 
 
40
#ifndef __MEM_cache_limiter_h_included__
 
41
extern void MEM_CacheLimiter_set_maximum(int m);
 
42
extern int MEM_CacheLimiter_get_maximum();
 
43
#endif
 
44
/** 
 
45
 * Create new MEM_CacheLimiter object 
 
46
 * managed objects are destructed with the data_destructor
 
47
 *
 
48
 * @param data_destructor
 
49
 * @return A new MEM_CacheLimter object
 
50
 */
 
51
 
 
52
extern MEM_CacheLimiterC * new_MEM_CacheLimiter(
 
53
        void (*data_destructor) (void * data));
 
54
 
 
55
/** 
 
56
 * Delete MEM_CacheLimiter
 
57
 * 
 
58
 * Frees the memory of the CacheLimiter but does not touch managed objects!
 
59
 *
 
60
 * @param This "This" pointer
 
61
 */
 
62
 
 
63
extern void delete_MEM_CacheLimiter(MEM_CacheLimiterC * This);
 
64
 
 
65
/** 
 
66
 * Manage object
 
67
 * 
 
68
 * @param This "This" pointer, data data object to manage
 
69
 * @return CacheLimiterHandle to ref, unref, touch the managed object
 
70
 */
 
71
        
 
72
extern MEM_CacheLimiterHandleC * MEM_CacheLimiter_insert(
 
73
        MEM_CacheLimiterC * This, void * data);
 
74
 
 
75
/** 
 
76
 * Free objects until memory constraints are satisfied
 
77
 * 
 
78
 * @param This "This" pointer
 
79
 */
 
80
 
 
81
extern void MEM_CacheLimiter_enforce_limits(MEM_CacheLimiterC * This);
 
82
 
 
83
/** 
 
84
 * Unmanage object previously inserted object. 
 
85
 * Does _not_ delete managed object!
 
86
 * 
 
87
 * @param This "This" pointer, handle of object
 
88
 */
 
89
        
 
90
extern void MEM_CacheLimiter_unmanage(MEM_CacheLimiterHandleC * handle);
 
91
 
 
92
 
 
93
/** 
 
94
 * Raise priority of object (put it at the tail of the deletion chain)
 
95
 * 
 
96
 * @param handle of object
 
97
 */
 
98
        
 
99
extern void MEM_CacheLimiter_touch(MEM_CacheLimiterHandleC * handle);
 
100
 
 
101
/** 
 
102
 * Increment reference counter. Objects with reference counter != 0 are _not_
 
103
 * deleted.
 
104
 * 
 
105
 * @param handle of object
 
106
 */
 
107
        
 
108
extern void MEM_CacheLimiter_ref(MEM_CacheLimiterHandleC * handle);
 
109
 
 
110
/** 
 
111
 * Decrement reference counter. Objects with reference counter != 0 are _not_
 
112
 * deleted.
 
113
 * 
 
114
 * @param handle of object
 
115
 */
 
116
        
 
117
extern void MEM_CacheLimiter_unref(MEM_CacheLimiterHandleC * handle);
 
118
 
 
119
/** 
 
120
 * Get reference counter.
 
121
 * 
 
122
 * @param This "This" pointer, handle of object
 
123
 */
 
124
        
 
125
extern int MEM_CacheLimiter_get_refcount(MEM_CacheLimiterHandleC * handle);
 
126
 
 
127
/** 
 
128
 * Get pointer to managed object
 
129
 * 
 
130
 * @param handle of object
 
131
 */
 
132
        
 
133
extern void * MEM_CacheLimiter_get(MEM_CacheLimiterHandleC * handle);
 
134
 
 
135
#ifdef __cplusplus
 
136
}
 
137
#endif
 
138
 
 
139
 
 
140
#endif
 
141