ATLAS Offline Software
slist.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2005-2008, Simon Howard
4 
5 Permission to use, copy, modify, and/or distribute this software
6 for any purpose with or without fee is hereby granted, provided
7 that the above copyright notice and this permission notice appear
8 in all copies.
9 
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
14 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
16 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
17 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 
19  */
20 
66 #ifndef ALGORITHM_SLIST_H
67 #define ALGORITHM_SLIST_H
68 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
80 typedef struct _SListEntry SListEntry;
81 
86 typedef struct _SListIterator SListIterator;
87 
92 typedef void *SListValue;
93 
101 };
102 
107 #define SLIST_NULL ((void *) 0)
108 
117 typedef int (*SListCompareFunc)(SListValue value1, SListValue value2);
118 
127 typedef int (*SListEqualFunc)(SListValue value1, SListValue value2);
128 
136 
147 
158 
167 
176 
186 
197 
206 
218 
229 
242  SListValue data);
243 
252 
267  SListValue data);
268 
278 
289 
299 
308 
309 #ifdef __cplusplus
310 }
311 #endif
312 
313 #endif /* #ifndef ALGORITHM_SLIST_H */
314 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
slist_iterate
void slist_iterate(SListEntry **list, SListIterator *iter)
Initialise a SListIterator structure to iterate over a list.
SListCompareFunc
int(* SListCompareFunc)(SListValue value1, SListValue value2)
Callback function used to compare values in a list when sorting.
Definition: slist.h:117
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
slist_find_data
SListEntry * slist_find_data(SListEntry *list, SListEqualFunc callback, SListValue data)
Find the entry for a particular value in a list.
slist_remove_data
int slist_remove_data(SListEntry **list, SListEqualFunc callback, SListValue data)
Remove all occurrences of a particular value from a list.
slist_nth_data
SListValue slist_nth_data(SListEntry *list, int n)
Retrieve the value stored at a specified index in the list.
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
slist_iter_next
SListValue slist_iter_next(SListIterator *iterator)
Using a list iterator, retrieve the next value from the list.
_SListIterator::current
SListEntry * current
Definition: slist.h:100
slist_free
void slist_free(SListEntry *list)
Free an entire list.
slist_prepend
SListEntry * slist_prepend(SListEntry **list, SListValue data)
Prepend a value to the start of a list.
runLayerRecalibration.callback
callback
Definition: runLayerRecalibration.py:64
slist_append
SListEntry * slist_append(SListEntry **list, SListValue data)
Append a value to the end of a list.
SListEqualFunc
int(* SListEqualFunc)(SListValue value1, SListValue value2)
Callback function used to determine of two values in a list are equal.
Definition: slist.h:127
slist_iter_has_more
int slist_iter_has_more(SListIterator *iterator)
Determine if there are more values in the list to iterate over.
_SListIterator::prev_next
SListEntry ** prev_next
Definition: slist.h:99
slist_data
SListValue slist_data(SListEntry *listentry)
Retrieve the value stored at a list entry.
slist_remove_entry
int slist_remove_entry(SListEntry **list, SListEntry *entry)
Remove an entry from a list.
slist_next
SListEntry * slist_next(SListEntry *listentry)
Retrieve the next entry in a list.
beamspotman.n
n
Definition: beamspotman.py:731
slist_length
int slist_length(SListEntry *list)
Find the length of a list.
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
SListValue
void * SListValue
Value stored in a list.
Definition: slist.h:92
SListEntry
struct _SListEntry SListEntry
Represents an entry in a singly-linked list.
Definition: slist.h:80
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
slist_nth_entry
SListEntry * slist_nth_entry(SListEntry *list, int n)
Retrieve the entry at a specified index in a list.
slist_iter_remove
void slist_iter_remove(SListIterator *iterator)
Delete the current entry in the list (the value last returned from slist_iter_next)
_SListIterator
Definition of a SListIterator.
Definition: slist.h:98
slist_to_array
SListValue * slist_to_array(SListEntry *list)
Create a C array containing the contents of a list.
slist_sort
void slist_sort(SListEntry **list, SListCompareFunc compare_func)
Sort a list.