Grid Community Toolkit  6.2.1566487665 (tag: v6.2.20190829)
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 
27 #ifndef GLOBUS_LIST_H
28 #define GLOBUS_LIST_H
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
44 typedef struct globus_list
45 {
46  void * volatile datum;
47  struct globus_list * volatile next;
48  int malloced;
50 
68 typedef int (*globus_list_pred_t) (void *datum, void *arg);
69 
91 typedef int (*globus_list_relation_t) (void *low_datum, void *high_datum,
92  void *relation_arg);
93 int
94 globus_i_list_pre_activate(void);
95 
96 extern int
97 globus_list_int_less (void * low_datum, void * high_datum,
98  void * ignored);
99 
100 extern int
102 
104 globus_list_concat(
105  globus_list_t * front_list,
106  globus_list_t * back_list);
107 
108 extern void *
110 
111 extern globus_list_t *
113 
114 extern globus_list_t **
115 globus_list_rest_ref (globus_list_t * head);
116 
117 extern int
119 
120 extern void *
121 globus_list_replace_first (globus_list_t * head, void *datum);
122 
123 extern globus_list_t *
124 globus_list_search (globus_list_t * head, void * datum);
125 
126 extern globus_list_t *
128  globus_list_pred_t predicate,
129  void * pred_args);
130 
131 extern globus_list_t *
133  globus_list_relation_t relation,
134  void * relation_args);
135 
136 extern globus_list_t *
137 globus_list_sort_destructive (globus_list_t * head,
138  globus_list_relation_t relation,
139  void *relation_args);
140 
141 extern void
142 globus_list_halves_destructive (globus_list_t * head,
143  globus_list_t * volatile * left_halfp,
144  globus_list_t * volatile * right_halfp);
145 
146 extern globus_list_t *
147 globus_list_sort_merge_destructive (globus_list_t *left,
148  globus_list_t *right,
149  globus_list_relation_t relation,
150  void * relation_args);
151 
152 extern globus_list_t *
154  globus_list_relation_t relation,
155  void *relation_args);
156 
157 extern int
158 globus_list_insert (globus_list_t * volatile *headp, void *datum);
159 
160 extern globus_list_t *
161 globus_list_cons (void * datum, globus_list_t *list);
162 
163 extern globus_list_t *
165 
166 extern void *
167 globus_list_remove (globus_list_t * volatile *headp, globus_list_t *entry);
168 
169 extern void
171 
172 void globus_list_destroy_all(
173  globus_list_t * head,
174  void (*data_free)(void *));
175 
176 extern globus_list_t *
177 globus_list_from_string(
178  const char * in_string,
179  int delim,
180  const char * ignored);
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 #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:91
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:44
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:68