~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to extern/rangetree/range_tree_c_api.cc

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This program is free software; you can redistribute it and/or
 
2
   modify it under the terms of the GNU General Public License as
 
3
   published by the Free Software Foundation; either version 2 of the
 
4
   License, or (at your option) any later version.
 
5
 
 
6
   This program is distributed in the hope that it will be useful, but
 
7
   WITHOUT ANY WARRANTY; without even the implied warranty of
 
8
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
9
   General Public License for more details.
 
10
 
 
11
   You should have received a copy of the GNU General Public License
 
12
   along with this program; if not, write to the Free Software
 
13
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
14
   02110-1301, USA.
 
15
*/
 
16
 
 
17
#include "range_tree.hh"
 
18
 
 
19
/* Give RangeTreeUInt a real type rather than the opaque struct type
 
20
   defined for external use. */
 
21
#define RANGE_TREE_C_API_INTERNAL
 
22
typedef RangeTree<unsigned> RangeTreeUInt;
 
23
 
 
24
#include "range_tree_c_api.h"
 
25
 
 
26
RangeTreeUInt *range_tree_uint_alloc(unsigned min, unsigned max)
 
27
{
 
28
        return new RangeTreeUInt(min, max);
 
29
}
 
30
 
 
31
RangeTreeUInt *range_tree_uint_copy(RangeTreeUInt *src)
 
32
{
 
33
        return new RangeTreeUInt(*src);
 
34
}
 
35
 
 
36
void range_tree_uint_free(RangeTreeUInt *rt)
 
37
{
 
38
        delete rt;
 
39
}
 
40
 
 
41
void range_tree_uint_take(RangeTreeUInt *rt, unsigned v)
 
42
{
 
43
        rt->take(v);
 
44
}
 
45
 
 
46
unsigned range_tree_uint_take_any(RangeTreeUInt *rt)
 
47
{
 
48
        return rt->take_any();
 
49
}
 
50
 
 
51
void range_tree_uint_release(RangeTreeUInt *rt, unsigned v)
 
52
{
 
53
        rt->release(v);
 
54
}
 
55
 
 
56
int range_tree_uint_has(const RangeTreeUInt *rt, unsigned v)
 
57
{
 
58
        return rt->has(v);
 
59
}
 
60
 
 
61
int range_tree_uint_has_range(const RangeTreeUInt *rt,
 
62
                                                          unsigned vmin,
 
63
                                                          unsigned vmax)
 
64
{
 
65
        return rt->has_range(vmin, vmax);
 
66
}
 
67
 
 
68
int range_tree_uint_empty(const RangeTreeUInt *rt)
 
69
{
 
70
        return rt->empty();
 
71
}
 
72
 
 
73
unsigned range_tree_uint_size(const RangeTreeUInt *rt)
 
74
{
 
75
        return rt->size();
 
76
}
 
77
 
 
78
void range_tree_uint_print(const RangeTreeUInt *rt)
 
79
{
 
80
        rt->print();
 
81
}
 
82
 
 
83
unsigned int range_tree_uint_allocation_lower_bound(const RangeTreeUInt *rt)
 
84
{
 
85
        return rt->allocation_lower_bound();
 
86
}