File: tixSmpLs.c

package info (click to toggle)
tix 8.4.3-10
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, sid
  • size: 9,080 kB
  • ctags: 7,129
  • sloc: ansic: 28,082; tcl: 22,774; python: 7,577; makefile: 331; cs: 253; sh: 210; perl: 128
file content (124 lines) | stat: -rw-r--r-- 2,890 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

/*	$Id: tixSmpLs.c,v 1.1.1.1 2000/05/17 11:08:42 idiscovery Exp $	*/

/* 
 * tixSmpLs.c --
 *
 *	To implement simple link lists (next is always the first
 *	member of the list).
 *
 * Copyright (c) 1996, Expert Interface Technologies
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 */

#include <tixPort.h>
#include <tixInt.h>

static Tix_ListInfo simpleListInfo = {
    0,
    TIX_UNDEFINED,
};

void Tix_SimpleListInit(lPtr)
    Tix_LinkList * lPtr;
{
    Tix_LinkListInit(lPtr);
}


void
Tix_SimpleListAppend(lPtr, itemPtr, flags)
    Tix_LinkList * lPtr;
    char * itemPtr;
    int flags;
{
    Tix_LinkListAppend(&simpleListInfo, lPtr, itemPtr, flags);
}

void Tix_SimpleListIteratorInit(liPtr)
    Tix_ListIterator * liPtr;
{
    Tix_LinkListIteratorInit(liPtr);
}

void Tix_SimpleListStart(lPtr, liPtr)
    Tix_LinkList * lPtr;
    Tix_ListIterator * liPtr;
{
    Tix_LinkListStart(&simpleListInfo, lPtr, liPtr);
}

void Tix_SimpleListNext(lPtr, liPtr)
    Tix_LinkList * lPtr;
    Tix_ListIterator * liPtr;
{
    Tix_LinkListNext(&simpleListInfo, lPtr, liPtr);
}

/*
 * To delete consecutive elements, you must delete, next, delete, next ...
 */
void Tix_SimpleListDelete(lPtr, liPtr)
    Tix_LinkList * lPtr;
    Tix_ListIterator * liPtr;
{
    Tix_LinkListDelete(&simpleListInfo, lPtr, liPtr);
}

/*----------------------------------------------------------------------
 *  Tix_SimpleListInsert --
 *
 *	Insert the item at the position indicated by liPtr
 *----------------------------------------------------------------------
 */
void Tix_SimpleListInsert(lPtr, itemPtr, liPtr)
    Tix_LinkList * lPtr;
    char * itemPtr;
    Tix_ListIterator * liPtr;
{
    Tix_LinkListInsert(&simpleListInfo, lPtr, itemPtr, liPtr);
}

/*----------------------------------------------------------------------
 * Tix_SimpleListFindAndDelete --
 *
 *	Find an element and delete it.
 *
 * liPtr:
 *	Can be zero.
 *	If non-zero, the search will start from the current entry indexed
 *	by liPtr;
 *
 * Return value:
 *	1 if element is found and deleted
 *	0 if element is not found
 *----------------------------------------------------------------------
 */
int Tix_SimpleListFindAndDelete(lPtr, itemPtr, liPtr)
    Tix_LinkList * lPtr;
    char * itemPtr;
    Tix_ListIterator * liPtr;
{
    return Tix_LinkListFindAndDelete(&simpleListInfo, lPtr, itemPtr, liPtr);
}

int Tix_SimpleListDeleteRange(lPtr, fromPtr, toPtr, liPtr)
    Tix_LinkList * lPtr;
    char * fromPtr;
    char * toPtr;
    Tix_ListIterator * liPtr;
{
    return Tix_LinkListDeleteRange(&simpleListInfo, lPtr,
	fromPtr, toPtr, liPtr);
}

int Tix_SimpleListFind(lPtr, itemPtr, liPtr)
    Tix_LinkList * lPtr;
    char * itemPtr;
    Tix_ListIterator * liPtr;
{
    return Tix_LinkListFind(&simpleListInfo, lPtr, itemPtr, liPtr);
}