globus_list.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 1999-2006 University of Chicago
00003  * 
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  * 
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00026 #ifndef GLOBUS_LIST_H
00027 #define GLOBUS_LIST_H
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00043 typedef struct globus_list 
00044 {
00045     void * volatile                        datum;
00046     struct globus_list * volatile          next;
00047     int                                    malloced;
00048 } globus_list_t;
00049 
00067 typedef int (*globus_list_pred_t) (void *datum, void *arg);
00068 
00090 typedef int (*globus_list_relation_t) (void *low_datum, void *high_datum,
00091                                        void *relation_arg);
00092 int
00093 globus_i_list_pre_activate(void);
00094 
00095 extern int
00096 globus_list_int_less (void * low_datum, void * high_datum,
00097                       void * ignored);
00098 
00099 extern int 
00100 globus_list_empty (globus_list_t * head);
00101 
00102 globus_list_t *
00103 globus_list_concat(
00104     globus_list_t *                     front_list,
00105     globus_list_t *                     back_list);
00106 
00107 extern void *
00108 globus_list_first (globus_list_t * head);
00109 
00110 extern globus_list_t *
00111 globus_list_rest (globus_list_t * head);
00112 
00113 extern globus_list_t **
00114 globus_list_rest_ref (globus_list_t * head);
00115 
00116 extern int 
00117 globus_list_size (globus_list_t * head);
00118 
00119 extern void *
00120 globus_list_replace_first (globus_list_t * head, void *datum);
00121 
00122 extern globus_list_t *
00123 globus_list_search (globus_list_t * head, void * datum);
00124 
00125 extern globus_list_t *
00126 globus_list_search_pred (globus_list_t * head, 
00127                          globus_list_pred_t predicate,
00128                          void * pred_args);
00129 
00130 extern globus_list_t *
00131 globus_list_min (globus_list_t * head,
00132                  globus_list_relation_t relation,
00133                  void * relation_args);
00134 
00135 extern globus_list_t *
00136 globus_list_sort_destructive (globus_list_t * head,
00137                               globus_list_relation_t relation,
00138                               void *relation_args);
00139 
00140 extern void
00141 globus_list_halves_destructive (globus_list_t * head,
00142                                 globus_list_t * volatile * left_halfp,
00143                                 globus_list_t * volatile * right_halfp);
00144 
00145 extern globus_list_t *
00146 globus_list_sort_merge_destructive (globus_list_t *left,
00147                                     globus_list_t *right,
00148                                     globus_list_relation_t relation,
00149                                     void * relation_args);
00150 
00151 extern globus_list_t *
00152 globus_list_sort (globus_list_t *head,
00153                   globus_list_relation_t relation,
00154                   void *relation_args);
00155 
00156 extern int 
00157 globus_list_insert (globus_list_t * volatile *headp, void *datum);
00158 
00159 extern globus_list_t *
00160 globus_list_cons (void * datum, globus_list_t *list);
00161 
00162 extern globus_list_t *
00163 globus_list_copy (globus_list_t *head);
00164 
00165 extern void *
00166 globus_list_remove (globus_list_t * volatile *headp, globus_list_t *entry);
00167 
00168 extern void
00169 globus_list_free (globus_list_t *head);
00170 
00171 void globus_list_destroy_all(
00172     globus_list_t *                     head,
00173     void                                (*data_free)(void *));
00174 
00175 extern globus_list_t *
00176 globus_list_from_string(
00177     const char *                        in_string,
00178     int                                 delim,
00179     const char *                        ignored);
00180 
00181 #ifdef __cplusplus
00182 }
00183 #endif
00184 
00185 #endif /* GLOBUS_LIST_H */

Generated on 20 Jun 2015 for globus_common by  doxygen 1.4.7