TaPAS  0.2
ccl-poset.h
Go to the documentation of this file.
1 /*
2  * ccl-poset.h -- A generic Partially Ordered Set
3  *
4  * This file is a part of the C Common Library (CCL) project.
5  *
6  * Copyright (C) 2010 CNRS UMR 5800 & Université Bordeaux I (see AUTHORS file).
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the AltaRica Public License that comes with this
10  * package.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  */
16 
22 #ifndef __CCL_POSET_H__
23 # define __CCL_POSET_H__
24 
25 # include <ccl/ccl-list.h>
26 
27 BEGIN_C_DECLS
28 
29 typedef struct ccl_poset_st ccl_poset;
30 
31 extern ccl_poset *
32 ccl_poset_create (int accept_redundant_edges, ccl_duplicate_func *dup,
34 
35 extern ccl_poset *
36 ccl_poset_add_reference (ccl_poset *poset);
37 
38 extern void
39 ccl_poset_del_reference (ccl_poset *poset);
40 
41 extern int
42 ccl_poset_get_set_size (ccl_poset *poset);
43 
44 extern void
45 ccl_poset_add (ccl_poset *poset, void *ev);
46 
47 extern int
48 ccl_poset_has (ccl_poset *poset, void *ev);
49 
50 extern int
51 ccl_poset_has_path (ccl_poset *poset, void *ev1, void *ev2);
52 
53 extern void*
54 ccl_poset_get_object (ccl_poset *poset, void *obj);
55 
56 extern int
57 ccl_poset_add_pair (ccl_poset *poset, void *greater, void *least);
58 
59 extern int
60 ccl_poset_add_poset (ccl_poset *poset, ccl_poset *other);
61 
62 extern int
63 ccl_poset_add_lt (ccl_poset *poset, ccl_poset *poset1, ccl_poset *poset2);
64 
65 extern void
66 ccl_poset_reverse (ccl_poset *poset);
67 
68 extern ccl_list *
69 ccl_poset_get_greater_objects (ccl_poset *poset, void *ev);
70 
71 extern ccl_pointer_iterator *
72 ccl_poset_get_objects (ccl_poset *poset);
73 
74 extern ccl_list *
75 ccl_poset_get_top_to_down_objects (ccl_poset *poset);
76 
77 extern ccl_list *
78 ccl_poset_get_down_to_top_objects (ccl_poset *poset);
79 
80 extern int
81 ccl_poset_is_empty (ccl_poset *poset);
82 
83 extern void
84 ccl_poset_log (ccl_log_type log, ccl_poset *poset,
85  void (*logproc)(ccl_log_type log, void *obj, void *data),
86  void *data);
87 
88 extern void
89 ccl_poset_log_as_dot (ccl_log_type log, ccl_poset *poset,
90  void (*logproc)(ccl_log_type log, void *obj, void *data),
91  void *data);
92 
93 
94 extern ccl_poset *
95 ccl_poset_dup (ccl_poset *poset);
96 
97 END_C_DECLS
98 
99 #endif /* ! __CCL_POSET_H__ */
Generic simple linked list.
int ccl_compare_func(const void *ptr1, const void *ptr2)
Prototype of functions used to order two objects pointed respectively by ptr1 and ptr2...
Definition: ccl-protos.h:73
struct ccl_list_st ccl_list
Type of a generic list.
Definition: ccl-list.h:33
void ccl_delete_proc(void *ptr)
Prototype of procedures used to release the resources allocated to the object pointed by ptr...
Definition: ccl-protos.h:44
void * ccl_duplicate_func(void *ptr)
Prototype of functions used to duplicate an object pointed by ptr.
Definition: ccl-protos.h:89
enum ccl_log_type_enum ccl_log_type
Enum that indicates which kind of message has to be displayed. Each kind of message can be displayed ...
Definition: ccl-log.h:50