globus_common  17.10
globus_range_list.h
Go to the documentation of this file.
1 
7 #ifndef GLOBUS_RANGE_LIST_H
8 #define GLOBUS_RANGE_LIST_H
9 
10 #include "globus_common_include.h"
11 /********************************************************************
12  *
13  * This file defines the globus_range_list_t type
14  *
15  *
16  ********************************************************************/
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #define GLOBUS_RANGE_LIST_MAX -1
23 
24 typedef enum
25 {
26  GLOBUS_RANGE_LIST_ERROR_PARAMETER = -1,
27  GLOBUS_RANGE_LIST_ERROR_MEMORY = -2
28 } globus_range_list_error_type_t;
29 
30 typedef struct globus_l_range_list_s * globus_range_list_t;
31 
32 
33 /* destructive merge of two range lists. will leave the source range
34  * lists empty. globus_range_list_destroy() will still need to be called
35  * on source lists.
36  */
37 int
38 globus_range_list_merge_destructive(
39  globus_range_list_t * dest,
40  globus_range_list_t src1,
41  globus_range_list_t src2);
42 
43 int
44 globus_range_list_merge(
45  globus_range_list_t * dest,
46  globus_range_list_t src1,
47  globus_range_list_t src2);
48 
49 int
50 globus_range_list_copy(
51  globus_range_list_t * dest,
52  globus_range_list_t src);
53 
54 int
55 globus_range_list_init(
56  globus_range_list_t * range_list);
57 
58 void
59 globus_range_list_destroy(
60  globus_range_list_t range_list);
61 
62 int
63 globus_range_list_insert(
64  globus_range_list_t range_list,
65  globus_off_t offset,
66  globus_off_t length);
67 
68 int
69 globus_range_list_remove(
70  globus_range_list_t range_list,
71  globus_off_t offset,
72  globus_off_t length);
73 
74 int
75 globus_range_list_size(
76  globus_range_list_t range_list);
77 
78 int
79 globus_range_list_at(
80  globus_range_list_t range_list,
81  int ndx,
82  globus_off_t * offset,
83  globus_off_t * length);
84 
85 int
86 globus_range_list_remove_at(
87  globus_range_list_t range_list,
88  int ndx,
89  globus_off_t * offset,
90  globus_off_t * length);
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #endif /* GLOBUS_RANGE_LIST_H */
Include System Headers.