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 #ifndef _omi_stringarray_h
26 #define _omi_stringarray_h
27
28 #include "config.h"
29 #include <common.h>
30 #include <stdio.h>
31 #include "batch.h"
32
33 BEGIN_EXTERNC
34
35 /*
36 **==============================================================================
37 **
38 ** StringArray
39 **
40 ** Manages a null-terminated array of strings.
41 **
42 **==============================================================================
43 mike 1.1 */
44
45 typedef struct _StringArray
46 {
47 Batch* batch;
48 MI_Char** data;
49 size_t size;
50 size_t capacity;
51 }
52 StringArray;
53
54 MI_Result StringArray_Init(
55 StringArray* self,
56 size_t capacity,
57 Batch* batch);
58
59 MI_Result StringArray_Add(
60 StringArray* self,
61 const MI_Char* str);
62
63 void StringArray_Print(
64 mike 1.1 const StringArray* self,
65 FILE* os);
66
67 END_EXTERNC
68
69 #endif /* _omi_stringarray_h */
|