(file) Return to heap.h CVS log (file) (dir) Up to [OMI] / omi / mof

 1 mike  1.1 /*
 2           **==============================================================================
 3           **
 4           ** Open Management Infrastructure (OMI)
 5           **
 6           ** Copyright (c) Microsoft Corporation
 7           ** 
 8           ** Licensed under the Apache License, Version 2.0 (the "License"); you may not 
 9           ** use this file except in compliance with the License. You may obtain a copy 
10           ** of the License at 
11           **
12           **     http://www.apache.org/licenses/LICENSE-2.0 
13           **
14           ** THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15           ** KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 
16           ** WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 
17           ** MERCHANTABLITY OR NON-INFRINGEMENT. 
18           **
19           ** See the Apache 2 License for the specific language governing permissions 
20           ** and limitations under the License.
21           **
22 mike  1.1 **==============================================================================
23           */
24           
25 mike  1.2 #ifndef _mof_heap_h
26           #define _mof_heap_h
27           
28           #include <stdlib.h>
29           #include <string.h>
30           
31           typedef struct _MOF_Heap
32           {
33               struct _MOF_Block* head;
34           }
35           MOF_Heap;
36           
37           #define MOF_HEAP_INITIALIZER { NULL, NULL }
38           
39           void* MOF_Malloc(MOF_Heap* self, size_t size);
40           
41           void* MOF_Calloc(MOF_Heap* self, size_t count, size_t size);
42           
43           void* MOF_Realloc(MOF_Heap* self, void* ptr, size_t size);
44           
45           void MOF_Free(MOF_Heap* self, void* ptr);
46 mike  1.2 
47           char* MOF_Strdup(MOF_Heap* self, const char* str);
48           
49           void MOF_Release(MOF_Heap* self);
50           
51           #endif /* _mof_heap_h */

ViewCVS 0.9.2