globus_common 18.13
Loading...
Searching...
No Matches
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
21
22#ifndef GLOBUS_RANGE_LIST_H
23#define GLOBUS_RANGE_LIST_H
24
26/********************************************************************
27 *
28 * This file defines the globus_range_list_t type
29 *
30 *
31 ********************************************************************/
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37#define GLOBUS_RANGE_LIST_MAX -1
38
39typedef enum
40{
41 GLOBUS_RANGE_LIST_ERROR_PARAMETER = -1,
42 GLOBUS_RANGE_LIST_ERROR_MEMORY = -2
43} globus_range_list_error_type_t;
44
45typedef 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 */
52int
53globus_range_list_merge_destructive(
54 globus_range_list_t * dest,
55 globus_range_list_t src1,
56 globus_range_list_t src2);
57
58int
59globus_range_list_merge(
60 globus_range_list_t * dest,
61 globus_range_list_t src1,
62 globus_range_list_t src2);
63
64int
65globus_range_list_copy(
66 globus_range_list_t * dest,
67 globus_range_list_t src);
68
69int
70globus_range_list_init(
71 globus_range_list_t * range_list);
72
73void
74globus_range_list_destroy(
75 globus_range_list_t range_list);
76
77int
78globus_range_list_insert(
79 globus_range_list_t range_list,
80 globus_off_t offset,
81 globus_off_t length);
82
83int
84globus_range_list_remove(
85 globus_range_list_t range_list,
86 globus_off_t offset,
87 globus_off_t length);
88
89int
90globus_range_list_size(
91 globus_range_list_t range_list);
92
93int
94globus_range_list_at(
95 globus_range_list_t range_list,
96 int ndx,
97 globus_off_t * offset,
98 globus_off_t * length);
99
100int
101globus_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.