Grid Community Toolkit  6.2.1541705016
globus_list.h
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2006 University of Chicago
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
26 #ifndef GLOBUS_LIST_H
27 #define GLOBUS_LIST_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
43 typedef struct globus_list
44 {
45  void * volatile datum;
46  struct globus_list * volatile next;
47  int malloced;
49 
67 typedef int (*globus_list_pred_t) (void *datum, void *arg);
68 
90 typedef int (*globus_list_relation_t) (void *low_datum, void *high_datum,
91  void *relation_arg);
92 int
93 globus_i_list_pre_activate(void);
94 
95 extern int
96 globus_list_int_less (void * low_datum, void * high_datum,
97  void * ignored);
98 
99 extern int
101 
103 globus_list_concat(
104  globus_list_t * front_list,
105  globus_list_t * back_list);
106 
107 extern void *
109 
110 extern globus_list_t *
112 
113 extern globus_list_t **
114 globus_list_rest_ref (globus_list_t * head);
115 
116 extern int
118 
119 extern void *
120 globus_list_replace_first (globus_list_t * head, void *datum);
121 
122 extern globus_list_t *
123 globus_list_search (globus_list_t * head, void * datum);
124 
125 extern globus_list_t *
127  globus_list_pred_t predicate,
128  void * pred_args);
129 
130 extern globus_list_t *
132  globus_list_relation_t relation,
133  void * relation_args);
134 
135 extern globus_list_t *
136 globus_list_sort_destructive (globus_list_t * head,
137  globus_list_relation_t relation,
138  void *relation_args);
139 
140 extern void
141 globus_list_halves_destructive (globus_list_t * head,
142  globus_list_t * volatile * left_halfp,
143  globus_list_t * volatile * right_halfp);
144 
145 extern globus_list_t *
146 globus_list_sort_merge_destructive (globus_list_t *left,
147  globus_list_t *right,
148  globus_list_relation_t relation,
149  void * relation_args);
150 
151 extern globus_list_t *
153  globus_list_relation_t relation,
154  void *relation_args);
155 
156 extern int
157 globus_list_insert (globus_list_t * volatile *headp, void *datum);
158 
159 extern globus_list_t *
160 globus_list_cons (void * datum, globus_list_t *list);
161 
162 extern globus_list_t *
164 
165 extern void *
166 globus_list_remove (globus_list_t * volatile *headp, globus_list_t *entry);
167 
168 extern void
170 
171 void globus_list_destroy_all(
172  globus_list_t * head,
173  void (*data_free)(void *));
174 
175 extern globus_list_t *
176 globus_list_from_string(
177  const char * in_string,
178  int delim,
179  const char * ignored);
180 
181 #ifdef __cplusplus
182 }
183 #endif
184 
185 #endif /* GLOBUS_LIST_H */
globus_list_t * globus_list_search_pred(globus_list_t *head, globus_list_pred_t predicate, void *pred_args)
Search a list with a predicate.
Definition: globus_list.c:280
int(* globus_list_relation_t)(void *low_datum, void *high_datum, void *relation_arg)
Relation predicate.
Definition: globus_list.h:90
globus_list_t * globus_list_min(globus_list_t *head, globus_list_relation_t relation, void *relation_args)
Find the minimum value of a list.
Definition: globus_list.c:345
globus_list_t * globus_list_search(globus_list_t *head, void *datum)
Search a list for a datum.
Definition: globus_list.c:236
void * globus_list_remove(globus_list_t *volatile *headp, globus_list_t *entry)
Remove a datum from a list.
Definition: globus_list.c:628
globus_list_t * globus_list_sort(globus_list_t *head, globus_list_relation_t relation, void *relation_args)
Sort a list.
Definition: globus_list.c:484
int globus_list_empty(globus_list_t *head)
List empty predicate.
Definition: globus_list.c:139
List data type.
Definition: globus_list.h:43
struct globus_list globus_list_t
List data type.
globus_list_t * globus_list_copy(globus_list_t *head)
Copy constructor.
Definition: globus_list.c:583
void globus_list_free(globus_list_t *head)
Free a list.
Definition: globus_list.c:689
void * globus_list_first(globus_list_t *head)
Retrieve head datum.
Definition: globus_list.c:96
globus_list_t * globus_list_cons(void *datum, globus_list_t *list)
List constructor.
Definition: globus_list.c:554
globus_list_t * globus_list_rest(globus_list_t *head)
Get the remainder of the list.
Definition: globus_list.c:116
void * globus_list_replace_first(globus_list_t *head, void *datum)
Replace first datum.
Definition: globus_list.c:210
int globus_list_size(globus_list_t *head)
Get the number of elements in a list.
Definition: globus_list.c:156
int globus_list_insert(globus_list_t *volatile *headp, void *datum)
Insert an item in a list.
Definition: globus_list.c:510
int(* globus_list_pred_t)(void *datum, void *arg)
List search predicate.
Definition: globus_list.h:67