globus_range_list.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 1999-2006 University of Chicago
00003  * 
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  * 
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00022 #ifndef GLOBUS_RANGE_LIST_H
00023 #define GLOBUS_RANGE_LIST_H
00024 
00025 #include "globus_common_include.h"
00026 /********************************************************************
00027  *
00028  * This file defines the globus_range_list_t type
00029  *
00030  *
00031  ********************************************************************/
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 #define GLOBUS_RANGE_LIST_MAX -1
00038 
00039 typedef enum
00040 {
00041     GLOBUS_RANGE_LIST_ERROR_PARAMETER = -1,
00042     GLOBUS_RANGE_LIST_ERROR_MEMORY = -2
00043 } globus_range_list_error_type_t;
00044 
00045 typedef struct globus_l_range_list_s *  globus_range_list_t;
00046 
00047 
00048 /* destructive merge of two range lists.  will leave the source range
00049  * lists empty.  globus_range_list_destroy() will still need to be called
00050  * on source lists. 
00051  */
00052 int
00053 globus_range_list_merge_destructive(
00054     globus_range_list_t *               dest,
00055     globus_range_list_t                 src1,
00056     globus_range_list_t                 src2);
00057 
00058 int
00059 globus_range_list_merge(
00060     globus_range_list_t *               dest,
00061     globus_range_list_t                 src1,
00062     globus_range_list_t                 src2);
00063 
00064 int
00065 globus_range_list_copy(
00066     globus_range_list_t *               dest,
00067     globus_range_list_t                 src);
00068 
00069 int
00070 globus_range_list_init(
00071     globus_range_list_t *               range_list);
00072 
00073 void
00074 globus_range_list_destroy(
00075     globus_range_list_t                 range_list);
00076 
00077 int
00078 globus_range_list_insert(
00079     globus_range_list_t                 range_list,
00080     globus_off_t                        offset,
00081     globus_off_t                        length);
00082 
00083 int
00084 globus_range_list_remove(
00085     globus_range_list_t                 range_list,
00086     globus_off_t                        offset,
00087     globus_off_t                        length);
00088 
00089 int
00090 globus_range_list_size(
00091     globus_range_list_t                 range_list);
00092 
00093 int
00094 globus_range_list_at(
00095     globus_range_list_t                 range_list,
00096     int                                 ndx,
00097     globus_off_t *                      offset,
00098     globus_off_t *                      length);
00099 
00100 int
00101 globus_range_list_remove_at(
00102     globus_range_list_t                 range_list,
00103     int                                 ndx,
00104     globus_off_t *                      offset,
00105     globus_off_t *                      length);
00106 
00107 #ifdef __cplusplus
00108 }
00109 #endif
00110 
00111 #endif /* GLOBUS_RANGE_LIST_H */

Generated on 17 Mar 2017 for globus_common by  doxygen 1.4.7