Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_range_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 
22 #ifndef GLOBUS_RANGE_LIST_H
23 #define GLOBUS_RANGE_LIST_H
24 
25 #include "globus_common_include.h"
26 /********************************************************************
27  *
28  * This file defines the globus_range_list_t type
29  *
30  *
31  ********************************************************************/
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #define GLOBUS_RANGE_LIST_MAX -1
38 
39 typedef enum
40 {
41  GLOBUS_RANGE_LIST_ERROR_PARAMETER = -1,
42  GLOBUS_RANGE_LIST_ERROR_MEMORY = -2
43 } globus_range_list_error_type_t;
44 
45 typedef struct globus_l_range_list_s * globus_range_list_t;
46 
47 
48 /* destructive merge of two range lists. will leave the source range
49  * lists empty. globus_range_list_destroy() will still need to be called
50  * on source lists.
51  */
52 int
53 globus_range_list_merge_destructive(
54  globus_range_list_t * dest,
55  globus_range_list_t src1,
56  globus_range_list_t src2);
57 
58 int
59 globus_range_list_merge(
60  globus_range_list_t * dest,
61  globus_range_list_t src1,
62  globus_range_list_t src2);
63 
64 int
65 globus_range_list_copy(
66  globus_range_list_t * dest,
67  globus_range_list_t src);
68 
69 int
70 globus_range_list_init(
71  globus_range_list_t * range_list);
72 
73 void
74 globus_range_list_destroy(
75  globus_range_list_t range_list);
76 
77 int
78 globus_range_list_insert(
79  globus_range_list_t range_list,
80  globus_off_t offset,
81  globus_off_t length);
82 
83 int
84 globus_range_list_remove(
85  globus_range_list_t range_list,
86  globus_off_t offset,
87  globus_off_t length);
88 
89 int
90 globus_range_list_size(
91  globus_range_list_t range_list);
92 
93 int
94 globus_range_list_at(
95  globus_range_list_t range_list,
96  int ndx,
97  globus_off_t * offset,
98  globus_off_t * length);
99 
100 int
101 globus_range_list_remove_at(
102  globus_range_list_t range_list,
103  int ndx,
104  globus_off_t * offset,
105  globus_off_t * length);
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif /* GLOBUS_RANGE_LIST_H */
Include System Headers.