Loading...
Searching...
No Matches
globus_list.h
Go to the documentation of this file.
/*
* Copyright 1999-2006 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef GLOBUS_LIST_H
#define GLOBUS_LIST_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct globus_list
{
void * volatile datum;
struct globus_list * volatile next;
int malloced;
} globus_list_t;
typedef int (*globus_list_pred_t) (void *datum, void *arg);
typedef int (*globus_list_relation_t) (void *low_datum, void *high_datum,
void *relation_arg);
int
globus_i_list_pre_activate(void);
extern int
globus_list_int_less (void * low_datum, void * high_datum,
void * ignored);
extern int
globus_list_empty (globus_list_t * head);
globus_list_t *
globus_list_concat(
globus_list_t * front_list,
globus_list_t * back_list);
extern void *
globus_list_first (globus_list_t * head);
extern globus_list_t *
globus_list_rest (globus_list_t * head);
extern globus_list_t **
globus_list_rest_ref (globus_list_t * head);
extern int
globus_list_size (globus_list_t * head);
extern void *
globus_list_replace_first (globus_list_t * head, void *datum);
extern globus_list_t *
globus_list_search (globus_list_t * head, void * datum);
extern globus_list_t *
globus_list_search_pred (globus_list_t * head,
globus_list_pred_t predicate,
void * pred_args);
extern globus_list_t *
globus_list_min (globus_list_t * head,
globus_list_relation_t relation,
void * relation_args);
extern globus_list_t *
globus_list_sort_destructive (globus_list_t * head,
globus_list_relation_t relation,
void *relation_args);
extern void
globus_list_halves_destructive (globus_list_t * head,
globus_list_t * volatile * left_halfp,
globus_list_t * volatile * right_halfp);
extern globus_list_t *
globus_list_sort_merge_destructive (globus_list_t *left,
globus_list_t *right,
globus_list_relation_t relation,
void * relation_args);
extern globus_list_t *
globus_list_sort (globus_list_t *head,
globus_list_relation_t relation,
void *relation_args);
extern int
globus_list_insert (globus_list_t * volatile *headp, void *datum);
extern globus_list_t *
globus_list_cons (void * datum, globus_list_t *list);
extern globus_list_t *
globus_list_copy (globus_list_t *head);
extern void *
globus_list_remove (globus_list_t * volatile *headp, globus_list_t *entry);
extern void
globus_list_free (globus_list_t *head);
void globus_list_destroy_all(
globus_list_t * head,
void (*data_free)(void *));
extern globus_list_t *
globus_list_from_string(
const char * in_string,
int delim,
const char * ignored);
#ifdef __cplusplus
}
#endif
#endif /* GLOBUS_LIST_H */
globus_list_t
struct globus_list globus_list_t
List data type.
globus_list_copy
globus_list_t * globus_list_copy(globus_list_t *head)
Copy constructor.
Definition globus_list.c:583
globus_list_first
void * globus_list_first(globus_list_t *head)
Retrieve head datum.
Definition globus_list.c:96
globus_list_free
void globus_list_free(globus_list_t *head)
Free a list.
Definition globus_list.c:689
globus_list_pred_t
int(* globus_list_pred_t)(void *datum, void *arg)
List search predicate.
Definition globus_list.h:68
globus_list_size
int globus_list_size(globus_list_t *head)
Get the number of elements in a list.
Definition globus_list.c:156
globus_list_search_pred
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
globus_list_remove
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_search
globus_list_t * globus_list_search(globus_list_t *head, void *datum)
Search a list for a datum.
Definition globus_list.c:236
globus_list_rest
globus_list_t * globus_list_rest(globus_list_t *head)
Get the remainder of the list.
Definition globus_list.c:116
globus_list_relation_t
int(* globus_list_relation_t)(void *low_datum, void *high_datum, void *relation_arg)
Relation predicate.
Definition globus_list.h:91
globus_list_cons
globus_list_t * globus_list_cons(void *datum, globus_list_t *list)
List constructor.
Definition globus_list.c:554
globus_list_empty
int globus_list_empty(globus_list_t *head)
List empty predicate.
Definition globus_list.c:139
globus_list_replace_first
void * globus_list_replace_first(globus_list_t *head, void *datum)
Replace first datum.
Definition globus_list.c:210
globus_list_sort
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
globus_list_min
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_insert
int globus_list_insert(globus_list_t *volatile *headp, void *datum)
Insert an item in a list.
Definition globus_list.c:510
globus_list
List data type.
Definition globus_list.h:45