xref: /AOO41X/main/xml2cmp/source/inc/lst_str.h (revision 514f4c20bcebc1639918b6975cc4300e4484c27c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef CPV_LST_STR_H
25 #define CPV_LST_STR_H
26 
27 #include "str.h"
28 
29 
30 typedef struct LSElem
31 {
32     Cstring *           pData;
33     struct LSElem * pNext;
34 } LSElem;
35 
36 
37 typedef struct LSIterator
38 {
39     LSElem *        pElement;
40 } LSIterator;
41 
42 
43 typedef struct ListCstring
44 {
45     LSElem *            dpStart;
46     LSElem *            pEnd;
47     Bool                bAutoDeleteData;
48 } ListCstring;
49 
50 
51 #define ListCstring_THIS    ListCstring * pThis
52 #define LSIterator_THIS LSIterator * pThis
53 #define LSElem_THIS     LSElem * pThis
54 
55 
56 
57 void                ListCstring_CTOR( ListCstring_THIS,
58                         Bool                i_bAutoDeleteData );
59 void                ListCstring_DTOR( ListCstring_THIS );
60 
61 void                LS_Add( ListCstring_THIS,
62                         Cstring *           i_pData );
63 void                LS_Empty( ListCstring_THIS,
64                         Bool                i_bDeleteData );
65 void                LS_Append( ListCstring_THIS,
66                         char *              i_sStrings[],
67                         intt                i_nNrOfStrings );
68 Bool                LS_IsEmpty( ListCstring_THIS );
69 
70 LSIterator          LS_Begin( ListCstring_THIS );
71 
72 
73 void                LSIterator_CTOR( LSIterator_THIS,
74                         LSElem *            i_pElement );
75 void                LSI_opp( LSIterator_THIS );     /** operator++() */
76 
77 Bool                LSI_obool( LSIterator_THIS );
78 Cstring *           LSI_optr( LSIterator_THIS );    /** operator->() */
79 
80 
81 void                LSElem_CTOR( LSElem_THIS,
82                         Cstring *           i_pData );
83 void                LSElem_DTOR( LSElem_THIS );
84 
85 Cstring *           LSE_Data( LSElem_THIS );
86 LSElem *            LSE_Next( LSElem_THIS );
87 
88 void                LSE_SetNext( LSElem_THIS,
89                         LSElem *            i_pNext );
90 void                LSE_DeleteData( LSElem_THIS );
91 
92 
93 
94 #endif
95 
96