(file) Return to ptrarray.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_ptrarray_h
26           #define _mof_ptrarray_h
27           
28           #ifndef MI_CHAR_TYPE
29           # define MI_CHAR_TYPE 1
30           #endif
31           
32           #include <MI.h>
33           #include <stddef.h>
34           
35           /*
36           **==============================================================================
37           **
38           ** PtrArray
39           **
40           **     This type manages an array of pointers. PtrArray.data is the array of
41           **     pointers and PtrArray.size is the number of pointers in the array.
42           **     Functions are provided for prepending and appending pointers to the
43           **     array. The array of pointers is null terminated.
44           **
45           **==============================================================================
46 mike  1.2 */
47           
48           typedef struct PtrArray
49           {
50               void** data;
51               MI_Uint32 size;
52           }
53           PtrArray;
54           
55           #define PTRARRAY_INITIALIZER { NULL, 0 }
56           
57           extern int PtrArray_Append(PtrArray* self, void* ptr);
58           
59           extern int PtrArray_Prepend(PtrArray* self, void* ptr);
60           
61           #endif /* _mof_ptrarray_h */

ViewCVS 0.9.2