librtree 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/ext/rtree/extconf.rb +18 -3
- data/ext/rtree/lib/bindex.c +18 -1
- data/ext/rtree/lib/branch.c +2 -2
- data/ext/rtree/lib/branches.c +2 -2
- data/ext/rtree/lib/bsrt.c +6 -7
- data/ext/rtree/lib/csv.c +3 -2
- data/ext/rtree/lib/error.c +3 -3
- data/ext/rtree/lib/json.c +6 -5
- data/ext/rtree/lib/mk/Hdr.mk +9 -3
- data/ext/rtree/lib/node.c +5 -6
- data/ext/rtree/lib/package.c +1 -1
- data/ext/rtree/lib/page.c +1 -1
- data/ext/rtree/lib/postscript.c +6 -6
- data/ext/rtree/lib/{bindex.h → private/bindex.h} +3 -8
- data/ext/rtree/lib/{bounds.h → private/bounds.h} +3 -3
- data/ext/rtree/lib/{branch.h → private/branch.h} +10 -9
- data/ext/rtree/lib/{branches.h → private/branches.h} +8 -14
- data/ext/rtree/lib/{bsrt.h → private/bsrt.h} +5 -5
- data/ext/rtree/lib/{constants.h → private/constants.h} +3 -3
- data/ext/rtree/lib/{csv.h → private/csv.h} +6 -6
- data/ext/rtree/lib/{endianness.h → private/endianness.h} +4 -8
- data/ext/rtree/lib/{json.h → private/json.h} +5 -5
- data/ext/rtree/lib/{node.h → private/node.h} +6 -4
- data/ext/rtree/lib/private/page.h +13 -0
- data/ext/rtree/lib/private/postscript.h +17 -0
- data/ext/rtree/lib/{rect.h → private/rect.h} +7 -7
- data/ext/rtree/lib/{rtree → private}/rectf.h +3 -14
- data/ext/rtree/lib/private/rtree.h +20 -0
- data/ext/rtree/lib/{search.h → private/search.h} +7 -8
- data/ext/rtree/lib/private/split.h +15 -0
- data/ext/rtree/lib/{spvol.h → private/spvol.h} +3 -3
- data/ext/rtree/lib/{state.h → private/state.h} +11 -10
- data/ext/rtree/lib/rect.c +3 -2
- data/ext/rtree/lib/rectf.c +1 -1
- data/ext/rtree/lib/rtree/node.h +0 -1
- data/ext/rtree/lib/rtree/postscript.h +9 -12
- data/ext/rtree/lib/rtree/state.h +0 -1
- data/ext/rtree/lib/rtree-base.c +8 -8
- data/ext/rtree/lib/rtree.h +0 -6
- data/ext/rtree/lib/search.c +4 -5
- data/ext/rtree/lib/split.c +9 -8
- data/ext/rtree/lib/spvol.c +1 -1
- data/ext/rtree/lib/state.c +7 -7
- data/ext/rtree/rtree.c +9 -10
- data/lib/rtree.rb +62 -37
- metadata +21 -20
- data/ext/rtree/lib/page.h +0 -13
- data/ext/rtree/lib/rtree/branch.h +0 -19
- data/ext/rtree/lib/split.h +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b945bd1abd981557382119ef56ebde1c6bd1f3e75dfa0ca4656b43a59c99d833
|
4
|
+
data.tar.gz: 9af9d2d1317582970d0b27fd43c2947472d66be2383f29bdb7f3d8d19743a897
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 752765087a236c6ae456475af539ffafb72f02ba13521ff75c094e997c367b717f6d3166e97146a9bc45f2b58581ec6b292aea1faaababf18e6f57d2b8cbc705
|
7
|
+
data.tar.gz: 6aa633e4d38ca15f6a4dc6392870cb0ec8d3713bb15b53a9142b06a00a8e7d295eb5a5f57494eb72cdfdf2b9f8098b86e4703f310a9b3382b39d47df971f29d0
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
Changelog
|
2
2
|
---------
|
3
3
|
|
4
|
+
### 1.0.5, 16-01-2024
|
5
|
+
|
6
|
+
- All methods which take a `File` object (i.e., a stream), now
|
7
|
+
also accept a `String` or `Pathname` to the file instead.
|
8
|
+
|
9
|
+
### 1.0.4, 30-10-2023
|
10
|
+
|
11
|
+
- Check for `__builtin_ctzl` (and use if found)
|
12
|
+
|
4
13
|
### 1.0.3, 16-10-2023
|
5
14
|
|
6
15
|
- Update to librtree 1.3.0
|
data/ext/rtree/extconf.rb
CHANGED
@@ -17,7 +17,7 @@ if have_header('endian.h') ||
|
|
17
17
|
have_header('libkern/OSByteOrder.h') ||
|
18
18
|
have_header('winsock2.h')
|
19
19
|
then
|
20
|
-
append_cflags(
|
20
|
+
append_cflags('-DWITH_BSRT')
|
21
21
|
else
|
22
22
|
warn('cannot determine endianness, no BSRT support')
|
23
23
|
end
|
@@ -25,7 +25,7 @@ end
|
|
25
25
|
if have_header('jansson.h') &&
|
26
26
|
have_library('jansson', 'json_pack')
|
27
27
|
then
|
28
|
-
append_cflags(
|
28
|
+
append_cflags('-DWITH_JSON')
|
29
29
|
else
|
30
30
|
warn('cannot find jansson, no JSON support')
|
31
31
|
end
|
@@ -41,5 +41,20 @@ end
|
|
41
41
|
|
42
42
|
have_header('features.h')
|
43
43
|
|
44
|
+
if have_macro('__has_builtin') then
|
45
|
+
src = <<~EOF
|
46
|
+
#if __has_builtin(__builtin_ctzl)
|
47
|
+
#else
|
48
|
+
#error no __builtin_ctzl
|
49
|
+
#endif
|
50
|
+
EOF
|
51
|
+
checking_for(checking_message('__builtin_ctzl')) do
|
52
|
+
if result = try_compile(src) then
|
53
|
+
$defs.push('-DHAVE___BUILTIN_CTZL')
|
54
|
+
result
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
44
59
|
create_header('config.h')
|
45
|
-
create_makefile(
|
60
|
+
create_makefile('rtree')
|
data/ext/rtree/lib/bindex.c
CHANGED
@@ -8,7 +8,8 @@
|
|
8
8
|
#include "config.h"
|
9
9
|
#endif
|
10
10
|
|
11
|
-
#include "bindex.h"
|
11
|
+
#include "private/bindex.h"
|
12
|
+
|
12
13
|
#include "rtree/error.h"
|
13
14
|
|
14
15
|
#include <errno.h>
|
@@ -19,6 +20,22 @@
|
|
19
20
|
#define UL_BYTES sizeof(unsigned long)
|
20
21
|
#define UL_BITS (UL_BYTES << 3)
|
21
22
|
|
23
|
+
/*
|
24
|
+
config.h may contain HAVE___BUILTIN_CTZL defined from an autoconf
|
25
|
+
check (for the standalone C library, there will be such a check),
|
26
|
+
but in the embedded case, performing that check may be tricky, so
|
27
|
+
in that case we fall-back onto the __has_builtin macro which has
|
28
|
+
been present in clang for many years, and in gcc since version 10.
|
29
|
+
*/
|
30
|
+
|
31
|
+
#ifndef HAVE___BUILTIN_CTZL
|
32
|
+
#ifdef __has_builtin
|
33
|
+
#if __has_builtin(__builtin_ctzl)
|
34
|
+
#define HAVE___BUILTIN_CTZL 1
|
35
|
+
#endif
|
36
|
+
#endif
|
37
|
+
#endif
|
38
|
+
|
22
39
|
/* see note on branch_sizeof in branch.c */
|
23
40
|
|
24
41
|
static size_t bindex_sizeof(size_t n)
|
data/ext/rtree/lib/branch.c
CHANGED
data/ext/rtree/lib/branches.c
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
not known until runtime, so we have to perform those calculations
|
5
5
|
ourselves. Note that we just do the arithmatic here, no error
|
6
6
|
checking -- so a over-sized index to branches_get() will lead to
|
7
|
-
a memory error, the caller is
|
7
|
+
a memory error, the caller is expected to do this check themselves
|
8
8
|
*/
|
9
9
|
|
10
10
|
#ifdef HAVE_CONFIG_H
|
11
11
|
#include "config.h"
|
12
12
|
#endif
|
13
13
|
|
14
|
-
#include "branches.h"
|
14
|
+
#include "private/branches.h"
|
15
15
|
|
16
16
|
extern branch_t* branches_get(const state_t*, void*, size_t);
|
17
17
|
extern void branches_set(const state_t*, void*, size_t, const branch_t*);
|
data/ext/rtree/lib/bsrt.c
CHANGED
@@ -2,11 +2,10 @@
|
|
2
2
|
#include "config.h"
|
3
3
|
#endif
|
4
4
|
|
5
|
-
#include "
|
6
|
-
|
7
|
-
#include "
|
8
|
-
#include "
|
9
|
-
#include "branches.h"
|
5
|
+
#include "private/branch.h"
|
6
|
+
#include "private/branches.h"
|
7
|
+
#include "private/bsrt.h"
|
8
|
+
#include "private/node.h"
|
10
9
|
|
11
10
|
#include "rtree/error.h"
|
12
11
|
|
@@ -15,8 +14,8 @@
|
|
15
14
|
|
16
15
|
#ifdef WITH_BSRT
|
17
16
|
|
18
|
-
#include "endianness.h"
|
19
|
-
#include "bounds.h"
|
17
|
+
#include "private/endianness.h"
|
18
|
+
#include "private/bounds.h"
|
20
19
|
|
21
20
|
#define BSRT_MAGIC "BSRt"
|
22
21
|
#define BSRT_FOOTER "fin"
|
data/ext/rtree/lib/csv.c
CHANGED
data/ext/rtree/lib/error.c
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
#include "config.h"
|
3
3
|
#endif
|
4
4
|
|
5
|
-
#include <stdlib.h>
|
6
|
-
|
7
5
|
#include "rtree/error.h"
|
8
6
|
|
7
|
+
#include <stdlib.h>
|
8
|
+
|
9
9
|
const char* strerror_rtree(int err)
|
10
10
|
{
|
11
11
|
static const char nomsg[] = "unimplemented message";
|
@@ -23,7 +23,7 @@ const char* strerror_rtree(int err)
|
|
23
23
|
{ RTREE_ERR_NOCSV, "Compiled without CSV support" },
|
24
24
|
{ RTREE_ERR_JANSSON, "Error from the Jansson library" },
|
25
25
|
{ RTREE_ERR_NOJSON, "Compiled without JSON support" },
|
26
|
-
{
|
26
|
+
{ RTREE_ERR_NOBSRT, "Compiled without BSRT support" },
|
27
27
|
{ RTREE_ERR_GETBRANCH, "Error getting branch" },
|
28
28
|
{ RTREE_ERR_GETCHILD, "Error getting child node" },
|
29
29
|
{ RTREE_ERR_NODECLONE, "Error cloning node" },
|
data/ext/rtree/lib/json.c
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
#include "config.h"
|
3
3
|
#endif
|
4
4
|
|
5
|
-
#include "
|
6
|
-
#include "
|
7
|
-
#include "
|
8
|
-
#include "
|
9
|
-
#include "
|
5
|
+
#include "private/bounds.h"
|
6
|
+
#include "private/branch.h"
|
7
|
+
#include "private/branches.h"
|
8
|
+
#include "private/json.h"
|
9
|
+
#include "private/node.h"
|
10
|
+
#include "private/rtree.h"
|
10
11
|
|
11
12
|
#include "rtree/error.h"
|
12
13
|
|
data/ext/rtree/lib/mk/Hdr.mk
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
-
HDR := rtree
|
2
|
-
rtree/
|
3
|
-
rtree/
|
1
|
+
HDR := rtree.h \
|
2
|
+
rtree/error.h \
|
3
|
+
rtree/extent.h \
|
4
|
+
rtree/node.h \
|
5
|
+
rtree/package.h \
|
6
|
+
rtree/postscript.h \
|
7
|
+
rtree/search.h \
|
8
|
+
rtree/state.h \
|
9
|
+
rtree/types.h
|
data/ext/rtree/lib/node.c
CHANGED
@@ -2,15 +2,14 @@
|
|
2
2
|
#include "config.h"
|
3
3
|
#endif
|
4
4
|
|
5
|
-
#include "
|
5
|
+
#include "private/branch.h"
|
6
|
+
#include "private/branches.h"
|
7
|
+
#include "private/node.h"
|
8
|
+
#include "private/rect.h"
|
9
|
+
#include "private/split.h"
|
6
10
|
|
7
11
|
#include "rtree/error.h"
|
8
12
|
|
9
|
-
#include "branch.h"
|
10
|
-
#include "branches.h"
|
11
|
-
#include "rect.h"
|
12
|
-
#include "split.h"
|
13
|
-
|
14
13
|
#include <stdbool.h>
|
15
14
|
#include <stddef.h>
|
16
15
|
#include <string.h>
|
data/ext/rtree/lib/package.c
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
#include "rtree/package.h"
|
7
7
|
|
8
|
-
const char rtree_package_version[] = "1.
|
8
|
+
const char rtree_package_version[] = "1.3.1";
|
9
9
|
const char rtree_package_name[] = "librtree";
|
10
10
|
const char rtree_package_url[] = "https://gitlab.com/jjg/librtree";
|
11
11
|
const char rtree_package_bugreport[] = "j.j.green@gmx.co.uk";
|
data/ext/rtree/lib/page.c
CHANGED
data/ext/rtree/lib/postscript.c
CHANGED
@@ -2,18 +2,18 @@
|
|
2
2
|
#include "config.h"
|
3
3
|
#endif
|
4
4
|
|
5
|
-
#include "
|
6
|
-
|
7
|
-
#include "
|
8
|
-
#include "branch.h"
|
9
|
-
#include "state.h"
|
5
|
+
#include "private/branch.h"
|
6
|
+
#include "private/node.h"
|
7
|
+
#include "private/state.h"
|
10
8
|
|
11
|
-
#include "rtree/package.h"
|
12
9
|
#include "rtree/error.h"
|
10
|
+
#include "rtree/package.h"
|
11
|
+
#include "rtree/postscript.h"
|
13
12
|
|
14
13
|
#include <time.h>
|
15
14
|
#include <errno.h>
|
16
15
|
#include <stdbool.h>
|
16
|
+
#include <stdlib.h>
|
17
17
|
|
18
18
|
#ifdef HAVE_TGMATH_H
|
19
19
|
#include <tgmath.h>
|
@@ -1,14 +1,10 @@
|
|
1
1
|
/*
|
2
|
-
bindex.h
|
2
|
+
private/bindex.h
|
3
3
|
Copyright (c) J.J. Green 2020
|
4
4
|
*/
|
5
5
|
|
6
|
-
#ifndef
|
7
|
-
#define
|
8
|
-
|
9
|
-
#ifdef HAVE_CONFIG_H
|
10
|
-
#include "config.h"
|
11
|
-
#endif
|
6
|
+
#ifndef PRIVATE_BINDEX_H
|
7
|
+
#define PRIVATE_BINDEX_H
|
12
8
|
|
13
9
|
#include <stddef.h>
|
14
10
|
|
@@ -27,5 +23,4 @@ int bindex_set(bindex_t*, size_t, size_t);
|
|
27
23
|
size_t bindex_first_unset(const bindex_t*);
|
28
24
|
size_t bindex_next_unset(const bindex_t*, size_t);
|
29
25
|
|
30
|
-
|
31
26
|
#endif
|
@@ -1,19 +1,20 @@
|
|
1
1
|
/*
|
2
|
-
branch.h
|
2
|
+
private/branch.h
|
3
3
|
Copyright (c) J.J. Green 2023
|
4
4
|
*/
|
5
5
|
|
6
|
-
#ifndef
|
7
|
-
#define
|
6
|
+
#ifndef PRIVATE_BRANCH_H
|
7
|
+
#define PRIVATE_BRANCH_H
|
8
8
|
|
9
|
-
|
9
|
+
typedef struct branch_t branch_t;
|
10
10
|
|
11
|
-
#include
|
11
|
+
#include <private/rect.h>
|
12
|
+
#include <private/node.h>
|
13
|
+
#include <private/state.h>
|
12
14
|
|
13
|
-
#include
|
14
|
-
|
15
|
-
#include
|
16
|
-
#include "rtree/node.h"
|
15
|
+
#include <rtree/types.h>
|
16
|
+
|
17
|
+
#include <stddef.h>
|
17
18
|
|
18
19
|
/*
|
19
20
|
The union is either a pointer to the child-node in the tree, or
|
@@ -1,22 +1,20 @@
|
|
1
1
|
/*
|
2
|
-
branches.h
|
2
|
+
private/branches.h
|
3
3
|
Copyright (c) J.J. Green 2020
|
4
4
|
*/
|
5
5
|
|
6
|
-
#ifndef
|
7
|
-
#define
|
6
|
+
#ifndef PRIVATE_BRANCHES_H
|
7
|
+
#define PRIVATE_BRANCHES_H
|
8
8
|
|
9
|
-
#
|
10
|
-
|
11
|
-
|
9
|
+
#include <private/state.h>
|
10
|
+
#include <private/branch.h>
|
11
|
+
|
12
|
+
#include <rtree/error.h>
|
12
13
|
|
13
|
-
#include <
|
14
|
+
#include <stddef.h>
|
14
15
|
#include <errno.h>
|
15
16
|
#include <string.h>
|
16
17
|
|
17
|
-
#include "state.h"
|
18
|
-
#include "rtree/branch.h"
|
19
|
-
#include "rtree/error.h"
|
20
18
|
|
21
19
|
inline branch_t* branches_get(const state_t *state, void *buffer, size_t i)
|
22
20
|
{
|
@@ -31,8 +29,4 @@ inline void branches_set(const state_t *state, void *buffer, size_t i,
|
|
31
29
|
memcpy(branches_get(state, buffer, i), src, state_branch_size(state));
|
32
30
|
}
|
33
31
|
|
34
|
-
#ifdef __cplusplus
|
35
|
-
}
|
36
|
-
#endif
|
37
|
-
|
38
32
|
#endif
|
@@ -1,14 +1,14 @@
|
|
1
1
|
/*
|
2
|
-
bsrt.h
|
2
|
+
private/bsrt.h
|
3
3
|
Copyright (c) J.J. Green 2019
|
4
4
|
*/
|
5
5
|
|
6
|
-
#ifndef
|
7
|
-
#define
|
6
|
+
#ifndef PRIVATE_BSRT_H
|
7
|
+
#define PRIVATE_BSRT_H
|
8
8
|
|
9
|
-
#include <
|
9
|
+
#include <private/rtree.h>
|
10
10
|
|
11
|
-
#include
|
11
|
+
#include <stdio.h>
|
12
12
|
|
13
13
|
int bsrt_rtree_write(const rtree_t*, FILE*);
|
14
14
|
rtree_t* bsrt_rtree_read(FILE*);
|
@@ -1,15 +1,15 @@
|
|
1
1
|
/*
|
2
|
-
csv.h
|
2
|
+
private/csv.h
|
3
3
|
Copyright (c) J.J. Green 2020
|
4
4
|
*/
|
5
5
|
|
6
|
-
#ifndef
|
7
|
-
#define
|
6
|
+
#ifndef PRIVATE_CSV_H
|
7
|
+
#define PRIVATE_CSV_H
|
8
8
|
|
9
|
-
#include <
|
9
|
+
#include <rtree.h>
|
10
|
+
#include <rtree/state.h>
|
10
11
|
|
11
|
-
#include
|
12
|
-
#include "rtree/state.h"
|
12
|
+
#include <stdio.h>
|
13
13
|
|
14
14
|
rtree_t* csv_rtree_read(FILE*, size_t, state_flags_t);
|
15
15
|
|
@@ -1,9 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
|
3
|
-
|
4
|
-
This is an "internal" header, it is not used by any public headers
|
5
|
-
and not installed; it handles the messing around that you need to
|
6
|
-
do to get endinannes functions even close to portable.
|
2
|
+
private/endianness.h
|
7
3
|
|
8
4
|
This is largely from https://github.com/mikepb/endian.h which is
|
9
5
|
based on a Gist by Mathias Panzenböck, those are both released into
|
@@ -19,11 +15,11 @@
|
|
19
15
|
Copyright (c) J.J. Green 2020
|
20
16
|
*/
|
21
17
|
|
22
|
-
#ifndef
|
23
|
-
#define
|
18
|
+
#ifndef PRIVATE_ENDIANNESS_H
|
19
|
+
#define PRIVATE_ENDIANNESS_H
|
24
20
|
|
25
21
|
#ifdef HAVE_CONFIG_H
|
26
|
-
#include
|
22
|
+
#include <config.h>
|
27
23
|
#endif
|
28
24
|
|
29
25
|
#if defined HAVE_ENDIAN_H
|
@@ -1,14 +1,14 @@
|
|
1
1
|
/*
|
2
|
-
json.h
|
2
|
+
private/json.h
|
3
3
|
Copyright (c) J.J. Green 2019
|
4
4
|
*/
|
5
5
|
|
6
|
-
#ifndef
|
7
|
-
#define
|
6
|
+
#ifndef PRIVATE_JSON_H
|
7
|
+
#define PRIVATE_JSON_H
|
8
8
|
|
9
|
-
#include <
|
9
|
+
#include <rtree.h>
|
10
10
|
|
11
|
-
#include
|
11
|
+
#include <stdio.h>
|
12
12
|
|
13
13
|
int json_rtree_write(const rtree_t*, FILE*);
|
14
14
|
rtree_t* json_rtree_read(FILE*);
|
@@ -17,11 +17,13 @@ typedef uint16_t node_height_t;
|
|
17
17
|
#define NODE_LEVEL_MAX UINT16_MAX
|
18
18
|
#define NODE_COUNT_MAX UINT16_MAX
|
19
19
|
|
20
|
-
|
20
|
+
typedef struct node_t node_t;
|
21
21
|
|
22
|
-
#include
|
23
|
-
#include
|
24
|
-
|
22
|
+
#include <private/branch.h>
|
23
|
+
#include <private/state.h>
|
24
|
+
|
25
|
+
#include <rtree/node.h>
|
26
|
+
#include <rtree/types.h>
|
25
27
|
|
26
28
|
struct node_t
|
27
29
|
{
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/*
|
2
|
+
private/postscript.h
|
3
|
+
Copyright (c) J.J. Green 2023
|
4
|
+
*/
|
5
|
+
|
6
|
+
#ifndef PRIVATE_POSTSCRIPT_H
|
7
|
+
#define PRIVATE_POSTSCRIPT_H
|
8
|
+
|
9
|
+
#include <private/node.h>
|
10
|
+
#include <private/state.h>
|
11
|
+
|
12
|
+
#include <rtree/postscript.h>
|
13
|
+
|
14
|
+
int postscript_write(const state_t*, const node_t*,
|
15
|
+
const rtree_postscript_t*, FILE*);
|
16
|
+
|
17
|
+
#endif
|
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
|
-
rect.h
|
2
|
+
private/rect.h
|
3
3
|
Copyright (c) J.J. Green 2019
|
4
4
|
*/
|
5
5
|
|
6
|
-
#ifndef
|
7
|
-
#define
|
6
|
+
#ifndef PRIVATE_RECT_H
|
7
|
+
#define PRIVATE_RECT_H
|
8
8
|
|
9
|
-
#include <
|
10
|
-
#include <
|
9
|
+
#include <private/state.h>
|
10
|
+
#include <rtree/types.h>
|
11
11
|
|
12
|
-
#include
|
13
|
-
#include
|
12
|
+
#include <stddef.h>
|
13
|
+
#include <stdbool.h>
|
14
14
|
|
15
15
|
int rect_init(const state_t*, rtree_coord_t*);
|
16
16
|
|
@@ -1,26 +1,18 @@
|
|
1
1
|
/*
|
2
|
-
|
2
|
+
private/rectf.h
|
3
3
|
Copyright (c) J.J. Green 2022
|
4
4
|
*/
|
5
5
|
|
6
|
-
#ifndef
|
7
|
-
#define
|
8
|
-
|
9
|
-
#ifdef __cplusplus
|
10
|
-
extern "C" {
|
11
|
-
#endif
|
6
|
+
#ifndef PRIVATE_RECTF_H
|
7
|
+
#define PRIVATE_RECTF_H
|
12
8
|
|
13
9
|
#include <rtree/types.h>
|
14
10
|
#include <stddef.h>
|
15
11
|
|
16
|
-
/* rect-spherical-volume */
|
17
|
-
|
18
12
|
typedef rtree_coord_t (rectf_rsv_t)(size_t, const rtree_coord_t*);
|
19
13
|
|
20
14
|
rectf_rsv_t* rectf_spherical_volume(size_t);
|
21
15
|
|
22
|
-
/* rect-combine */
|
23
|
-
|
24
16
|
typedef void (rectf_rc_t)(size_t,
|
25
17
|
const rtree_coord_t*,
|
26
18
|
const rtree_coord_t*,
|
@@ -28,7 +20,4 @@ typedef void (rectf_rc_t)(size_t,
|
|
28
20
|
|
29
21
|
rectf_rc_t* rectf_combine(size_t);
|
30
22
|
|
31
|
-
#ifdef __cplusplus
|
32
|
-
}
|
33
|
-
#endif
|
34
23
|
#endif
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/*
|
2
|
+
private/rtree.h
|
3
|
+
Copyright (c) J.J. Green 2023
|
4
|
+
*/
|
5
|
+
|
6
|
+
#ifndef PRIVATE_RTREE_H
|
7
|
+
#define PRIVATE_RTREE_H
|
8
|
+
|
9
|
+
#include <private/state.h>
|
10
|
+
#include <private/node.h>
|
11
|
+
|
12
|
+
#include <rtree.h>
|
13
|
+
|
14
|
+
struct rtree_t
|
15
|
+
{
|
16
|
+
state_t *state;
|
17
|
+
node_t *root;
|
18
|
+
};
|
19
|
+
|
20
|
+
#endif
|
@@ -1,16 +1,15 @@
|
|
1
1
|
/*
|
2
|
-
search.h
|
2
|
+
private/search.h
|
3
3
|
Copyright (c) J.J. Green 2023
|
4
4
|
*/
|
5
5
|
|
6
|
-
#ifndef
|
7
|
-
#define
|
6
|
+
#ifndef PRIVATE_SEARCH_H
|
7
|
+
#define PRIVATE_SEARCH_H
|
8
8
|
|
9
|
-
#include
|
10
|
-
|
11
|
-
#include
|
12
|
-
#include
|
13
|
-
#include "rtree/state.h"
|
9
|
+
#include <private/node.h>
|
10
|
+
#include <private/state.h>
|
11
|
+
#include <rtree/search.h>
|
12
|
+
#include <rtree/types.h>
|
14
13
|
|
15
14
|
int search(const state_t*,
|
16
15
|
const rtree_coord_t*,
|