librtree 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/ext/rtree/extconf.rb +18 -3
  4. data/ext/rtree/lib/bindex.c +18 -1
  5. data/ext/rtree/lib/branch.c +2 -2
  6. data/ext/rtree/lib/branches.c +2 -2
  7. data/ext/rtree/lib/bsrt.c +6 -7
  8. data/ext/rtree/lib/csv.c +3 -2
  9. data/ext/rtree/lib/error.c +3 -3
  10. data/ext/rtree/lib/json.c +6 -5
  11. data/ext/rtree/lib/mk/Hdr.mk +9 -3
  12. data/ext/rtree/lib/node.c +5 -6
  13. data/ext/rtree/lib/package.c +1 -1
  14. data/ext/rtree/lib/page.c +1 -1
  15. data/ext/rtree/lib/postscript.c +6 -6
  16. data/ext/rtree/lib/{bindex.h → private/bindex.h} +3 -8
  17. data/ext/rtree/lib/{bounds.h → private/bounds.h} +3 -3
  18. data/ext/rtree/lib/{branch.h → private/branch.h} +10 -9
  19. data/ext/rtree/lib/{branches.h → private/branches.h} +8 -14
  20. data/ext/rtree/lib/{bsrt.h → private/bsrt.h} +5 -5
  21. data/ext/rtree/lib/{constants.h → private/constants.h} +3 -3
  22. data/ext/rtree/lib/{csv.h → private/csv.h} +6 -6
  23. data/ext/rtree/lib/{endianness.h → private/endianness.h} +4 -8
  24. data/ext/rtree/lib/{json.h → private/json.h} +5 -5
  25. data/ext/rtree/lib/{node.h → private/node.h} +6 -4
  26. data/ext/rtree/lib/private/page.h +13 -0
  27. data/ext/rtree/lib/private/postscript.h +17 -0
  28. data/ext/rtree/lib/{rect.h → private/rect.h} +7 -7
  29. data/ext/rtree/lib/{rtree → private}/rectf.h +3 -14
  30. data/ext/rtree/lib/private/rtree.h +20 -0
  31. data/ext/rtree/lib/{search.h → private/search.h} +7 -8
  32. data/ext/rtree/lib/private/split.h +15 -0
  33. data/ext/rtree/lib/{spvol.h → private/spvol.h} +3 -3
  34. data/ext/rtree/lib/{state.h → private/state.h} +11 -10
  35. data/ext/rtree/lib/rect.c +3 -2
  36. data/ext/rtree/lib/rectf.c +1 -1
  37. data/ext/rtree/lib/rtree/node.h +0 -1
  38. data/ext/rtree/lib/rtree/postscript.h +9 -12
  39. data/ext/rtree/lib/rtree/state.h +0 -1
  40. data/ext/rtree/lib/rtree-base.c +8 -8
  41. data/ext/rtree/lib/rtree.h +0 -6
  42. data/ext/rtree/lib/search.c +4 -5
  43. data/ext/rtree/lib/split.c +9 -8
  44. data/ext/rtree/lib/spvol.c +1 -1
  45. data/ext/rtree/lib/state.c +7 -7
  46. data/ext/rtree/rtree.c +9 -10
  47. data/lib/rtree.rb +62 -37
  48. metadata +21 -20
  49. data/ext/rtree/lib/page.h +0 -13
  50. data/ext/rtree/lib/rtree/branch.h +0 -19
  51. data/ext/rtree/lib/split.h +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97e18073b1466bdc07ddba6d4b06cfa850c3531240920ab4bd391a1896def24f
4
- data.tar.gz: 0a57abcf15c8dd21e3ec7ee26fdb2f5d98ae8ec06838297eb00b05f5ebaae70d
3
+ metadata.gz: b945bd1abd981557382119ef56ebde1c6bd1f3e75dfa0ca4656b43a59c99d833
4
+ data.tar.gz: 9af9d2d1317582970d0b27fd43c2947472d66be2383f29bdb7f3d8d19743a897
5
5
  SHA512:
6
- metadata.gz: e633393e0fc75958fae7ee302a0a1e51e42ce41f86ec887da9c41bf74c2bb1657b4c06d4e690939c83945092ba4531901050f537bef6c48c73ddeea28a272a69
7
- data.tar.gz: 25b6456ab526e41afd095157c96715118cdadbb9a15c2c863197fda329a61f5d6f8adda1e78aeb8733f8e74d54faf4bba193103e81aff3db7bfebcc8e54c2052
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("-DWITH_BSRT")
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("-DWITH_JSON")
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("rtree")
60
+ create_makefile('rtree')
@@ -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)
@@ -2,8 +2,8 @@
2
2
  #include "config.h"
3
3
  #endif
4
4
 
5
- #include "branch.h"
6
- #include "state.h"
5
+ #include "private/branch.h"
6
+ #include "private/state.h"
7
7
 
8
8
  #include <stddef.h>
9
9
  #include <stdalign.h>
@@ -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 epected to do this check themselves
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 "bsrt.h"
6
-
7
- #include "node.h"
8
- #include "branch.h"
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
@@ -2,8 +2,9 @@
2
2
  #include "config.h"
3
3
  #endif
4
4
 
5
- #include "csv.h"
6
- #include "state.h"
5
+ #include "private/csv.h"
6
+ #include "private/rtree.h"
7
+ #include "private/state.h"
7
8
 
8
9
  #include "rtree/error.h"
9
10
  #include "rtree/types.h"
@@ -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
- { RTREE_ERR_NOJSON, "Compiled without BSRT support" },
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 "json.h"
6
- #include "bounds.h"
7
- #include "node.h"
8
- #include "branch.h"
9
- #include "branches.h"
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
 
@@ -1,3 +1,9 @@
1
- HDR := rtree/branch.h rtree/branches.h rtree/error.h rtree/extent.h \
2
- rtree/node.h rtree/package.h rtree/postscript.h rtree/rect.h \
3
- rtree/rectf.h rtree/search.h rtree/state.h rtree/types.h rtree.h
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 "node.h"
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>
@@ -5,7 +5,7 @@
5
5
 
6
6
  #include "rtree/package.h"
7
7
 
8
- const char rtree_package_version[] = "1.2.0";
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
@@ -2,7 +2,7 @@
2
2
  #include "config.h"
3
3
  #endif
4
4
 
5
- #include "page.h"
5
+ #include "private/page.h"
6
6
 
7
7
  #ifdef HAVE_UNISTD_H
8
8
  #include <unistd.h>
@@ -2,18 +2,18 @@
2
2
  #include "config.h"
3
3
  #endif
4
4
 
5
- #include "rtree/postscript.h"
6
-
7
- #include "node.h"
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 BINDEX_H
7
- #define BINDEX_H
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,10 +1,10 @@
1
1
  /*
2
- bounds.h
2
+ private/bounds.h
3
3
  Copyright (c) J.J. Green 2022
4
4
  */
5
5
 
6
- #ifndef BOUNDS_H
7
- #define BOUNDS_H
6
+ #ifndef PRIVATE_BOUNDS_H
7
+ #define PRIVATE_BOUNDS_H
8
8
 
9
9
  #ifndef RTREE_DIMS_MAX
10
10
  #define RTREE_DIMS_MAX 256
@@ -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 BRANCH_H
7
- #define BRANCH_H
6
+ #ifndef PRIVATE_BRANCH_H
7
+ #define PRIVATE_BRANCH_H
8
8
 
9
- #include <stdlib.h>
9
+ typedef struct branch_t branch_t;
10
10
 
11
- #include "rtree/branch.h"
11
+ #include <private/rect.h>
12
+ #include <private/node.h>
13
+ #include <private/state.h>
12
14
 
13
- #include "rect.h"
14
- #include "rtree/types.h"
15
- #include "rtree/state.h"
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 BRANCHES_H
7
- #define BRANCHES_H
6
+ #ifndef PRIVATE_BRANCHES_H
7
+ #define PRIVATE_BRANCHES_H
8
8
 
9
- #ifdef __cplusplus
10
- extern "C" {
11
- #endif
9
+ #include <private/state.h>
10
+ #include <private/branch.h>
11
+
12
+ #include <rtree/error.h>
12
13
 
13
- #include <stdlib.h>
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 BSRT_H
7
- #define BSRT_H
6
+ #ifndef PRIVATE_BSRT_H
7
+ #define PRIVATE_BSRT_H
8
8
 
9
- #include <stdio.h>
9
+ #include <private/rtree.h>
10
10
 
11
- #include "rtree.h"
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,10 +1,10 @@
1
1
  /*
2
- constants.h
2
+ private/constants.h
3
3
  Copyright (c) J.J. Green 2019
4
4
  */
5
5
 
6
- #ifndef CONSTANTS_H
7
- #define CONSTANTS_H
6
+ #ifndef PRIVATE_CONSTANTS_H
7
+ #define PRIVATE_CONSTANTS_H
8
8
 
9
9
  #include <math.h>
10
10
 
@@ -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 CSV_H
7
- #define CSV_H
6
+ #ifndef PRIVATE_CSV_H
7
+ #define PRIVATE_CSV_H
8
8
 
9
- #include <stdio.h>
9
+ #include <rtree.h>
10
+ #include <rtree/state.h>
10
11
 
11
- #include "rtree.h"
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
- endian.h
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 ENDIANNESS_H
23
- #define ENDIANNESS_H
18
+ #ifndef PRIVATE_ENDIANNESS_H
19
+ #define PRIVATE_ENDIANNESS_H
24
20
 
25
21
  #ifdef HAVE_CONFIG_H
26
- #include "config.h"
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 JSON_H
7
- #define JSON_H
6
+ #ifndef PRIVATE_JSON_H
7
+ #define PRIVATE_JSON_H
8
8
 
9
- #include <stdio.h>
9
+ #include <rtree.h>
10
10
 
11
- #include "rtree.h"
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
- #include "rtree/node.h"
20
+ typedef struct node_t node_t;
21
21
 
22
- #include "rtree/types.h"
23
- #include "rtree/state.h"
24
- #include "rtree/branch.h"
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,13 @@
1
+ /*
2
+ private/page.h
3
+ Copyright (c) J.J. Green 2019
4
+ */
5
+
6
+ #ifndef PRIVATE_PAGE_H
7
+ #define PRIVATE_PAGE_H
8
+
9
+ #include <stddef.h>
10
+
11
+ int page_size(size_t*);
12
+
13
+ #endif
@@ -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 RECT_H
7
- #define RECT_H
6
+ #ifndef PRIVATE_RECT_H
7
+ #define PRIVATE_RECT_H
8
8
 
9
- #include <stdlib.h>
10
- #include <stdbool.h>
9
+ #include <private/state.h>
10
+ #include <rtree/types.h>
11
11
 
12
- #include "rtree/state.h"
13
- #include "rtree/types.h"
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
- rtree/rectf.h
2
+ private/rectf.h
3
3
  Copyright (c) J.J. Green 2022
4
4
  */
5
5
 
6
- #ifndef RTREE_RECTF_H
7
- #define RTREE_RECTF_H
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 SEARCH_H
7
- #define SEARCH_H
6
+ #ifndef PRIVATE_SEARCH_H
7
+ #define PRIVATE_SEARCH_H
8
8
 
9
- #include "rtree/search.h"
10
-
11
- #include "rtree/node.h"
12
- #include "rtree/types.h"
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*,