VIP: Volume Image Processing
strlist.h
Go to the documentation of this file.
1
/****************************************************************************
2
* PROJECT : V.I.P. Library
3
* MODULE NAME : * TYPE : Header
4
* AUTHOR : * CREATION :
5
* VERSION : * REVISION :
6
* LANGUAGE : C * EXAMPLE :
7
* DEVICE : Linux
8
****************************************************************************
9
*
10
* DESCRIPTION :
11
*
12
****************************************************************************
13
*
14
*
15
****************************************************************************
16
* REVISIONS : DATE | AUTHOR | DESCRIPTION
17
*--------------------|--------------|---------------------------------------
18
* / / | |
19
****************************************************************************/
20
21
#ifndef VIP_UTIL_STRLIST_H
22
#define VIP_UTIL_STRLIST_H
23
24
#include <string.h>
25
26
#ifdef __cplusplus
27
extern
"C"
28
{
29
#endif
30
31
/* A general list class
32
VipStringList is a list of string, simply chained.
33
VipStringListItem is both a storage element and an iterator. It can also
34
be a whole "wick": a list with no size and starting point where you can
35
only go forward.
36
*/
37
38
typedef
struct
VipStringListItem
VipStringListItem
;
39
40
struct
VipStringListItem
41
{
42
char
*
string
;
43
VipStringListItem
*
next
;
44
};
45
46
typedef
struct
VipStringList
VipStringList
;
47
48
struct
VipStringList
49
{
50
size_t
size
;
51
VipStringListItem
*
begin
;
52
VipStringListItem
*
last
;
53
};
54
55
VipStringList
*
VipCreateStringList
();
56
void
VipFreeStringList
(
VipStringList
* strl );
57
/* free a "wick": list without a VipStringList structure */
58
void
VipFreeStringWick
(
VipStringListItem
* first );
59
/* creates a list item and inserts it in a list or wick (list may be NULL).
60
The string is copied. */
61
VipStringListItem
*
VipInsertString
(
VipStringList
* strlist,
62
const
char
*
string
,
63
VipStringListItem
* after );
64
/* Removes from the list (and frees) the element AFTER the "before"
65
argument. If before is NULL, the first element is erased */
66
void
VipEraseStringElement
(
VipStringList
* strlist,
67
VipStringListItem
* before );
68
69
#ifdef __cplusplus
70
}
71
#endif
72
73
#endif
74
VipCreateStringList
VipStringList * VipCreateStringList()
VipFreeStringWick
void VipFreeStringWick(VipStringListItem *first)
VipFreeStringList
void VipFreeStringList(VipStringList *strl)
VipInsertString
VipStringListItem * VipInsertString(VipStringList *strlist, const char *string, VipStringListItem *after)
VipEraseStringElement
void VipEraseStringElement(VipStringList *strlist, VipStringListItem *before)
VipStringListItem
Definition
strlist.h:41
VipStringListItem::string
char * string
Definition
strlist.h:42
VipStringListItem::next
VipStringListItem * next
Definition
strlist.h:43
VipStringList
Definition
strlist.h:49
VipStringList::last
VipStringListItem * last
Definition
strlist.h:52
VipStringList::size
size_t size
Definition
strlist.h:50
VipStringList::begin
VipStringListItem * begin
Definition
strlist.h:51
vip
util
strlist.h
Generated by
1.13.2