Yet Another eXchange Tool  0.9.0
xt_cover.h
Go to the documentation of this file.
1 
12 /*
13  * Keywords:
14  * Maintainer: Jörg Behrens <behrens@dkrz.de>
15  * Moritz Hanke <hanke@dkrz.de>
16  * Thomas Jahns <jahns@dkrz.de>
17  * URL: https://doc.redmine.dkrz.de/yaxt/html/
18  *
19  * Redistribution and use in source and binary forms, with or without
20  * modification, are permitted provided that the following conditions are
21  * met:
22  *
23  * Redistributions of source code must retain the above copyright notice,
24  * this list of conditions and the following disclaimer.
25  *
26  * Redistributions in binary form must reproduce the above copyright
27  * notice, this list of conditions and the following disclaimer in the
28  * documentation and/or other materials provided with the distribution.
29  *
30  * Neither the name of the DKRZ GmbH nor the names of its contributors
31  * may be used to endorse or promote products derived from this software
32  * without specific prior written permission.
33  *
34  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
35  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
36  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
37  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
38  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
39  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
40  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
41  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
43  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
44  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45  */
46 #ifndef XT_COVERAGE_H
47 #define XT_COVERAGE_H
48 
49 #ifdef HAVE_CONFIG_H
50 #include <config.h>
51 #endif
52 
53 #include <stdbool.h>
54 #include <stdlib.h>
55 
56 #include "xt/xt_core.h"
57 
61 };
62 
63 struct Xt_pos_range {
64  int start, end;
65 };
66 
67 void
68 xt_cover_start(struct Xt_pos_ext_vec *restrict cover,
69  size_t initial_size);
70 
71 void
72 xt_cover_finish(struct Xt_pos_ext_vec *restrict cover);
73 
87 size_t
88 xt_cover_search(struct Xt_pos_ext_vec *restrict cover,
89  struct Xt_pos_range query, bool forward,
90  size_t search_start_pos);
91 
98 void
99 xt_cover_range_append(struct Xt_pos_ext_vec *restrict cover,
100  struct Xt_pos_ext range);
101 
117 size_t
118 xt_cover_insert_or_overlap(struct Xt_pos_ext_vec *restrict cover,
119  struct Xt_pos_range range, bool forward,
120  size_t search_start_pos);
121 
125 bool
127  struct Xt_pos_ext_vec cover);
128 
129 
130 #endif
131 
132 /*
133  * Local Variables:
134  * c-basic-offset: 2
135  * coding: utf-8
136  * indent-tabs-mode: nil
137  * show-trailing-whitespace: t
138  * require-trailing-newline: t
139  * End:
140  */
struct Xt_pos_ext * pos_ext
Definition: xt_cover.h:60
size_t num_pos_ext
Definition: xt_cover.h:59
size_t size_pos_ext
Definition: xt_cover.h:59
base definitions header file
void xt_cover_range_append(struct Xt_pos_ext_vec *restrict cover, struct Xt_pos_ext range)
Definition: xt_cover.c:128
void xt_cover_finish(struct Xt_pos_ext_vec *restrict cover)
Definition: xt_cover.c:69
size_t xt_cover_search(struct Xt_pos_ext_vec *restrict cover, struct Xt_pos_range query, bool forward, size_t search_start_pos)
Definition: xt_cover.c:95
bool xt_idxlist_pos_ext_is_full_cover(Xt_idxlist idxlist, struct Xt_pos_ext_vec cover)
Definition: xt_cover.c:75
size_t xt_cover_insert_or_overlap(struct Xt_pos_ext_vec *restrict cover, struct Xt_pos_range range, bool forward, size_t search_start_pos)
Definition: xt_cover.c:148
void xt_cover_start(struct Xt_pos_ext_vec *restrict cover, size_t initial_size)
Definition: xt_cover.c:60