librtree 1.0.3 → 1.0.4

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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/ext/rtree/extconf.rb +18 -3
  4. data/ext/rtree/lib/bindex.c +2 -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 +2 -2
  10. data/ext/rtree/lib/json.c +6 -5
  11. data/ext/rtree/lib/mk/Hdr.mk +3 -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 +5 -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. metadata +21 -20
  47. data/ext/rtree/lib/page.h +0 -13
  48. data/ext/rtree/lib/rtree/branch.h +0 -19
  49. 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: 0b253861945be28133a07d5041b080939164dc3725a4b5b458319899d1ad9b66
4
+ data.tar.gz: 56704611278f67678693ce56e4cec85ae436ba41d534803e0fb8694c39d5b45b
5
5
  SHA512:
6
- metadata.gz: e633393e0fc75958fae7ee302a0a1e51e42ce41f86ec887da9c41bf74c2bb1657b4c06d4e690939c83945092ba4531901050f537bef6c48c73ddeea28a272a69
7
- data.tar.gz: 25b6456ab526e41afd095157c96715118cdadbb9a15c2c863197fda329a61f5d6f8adda1e78aeb8733f8e74d54faf4bba193103e81aff3db7bfebcc8e54c2052
6
+ metadata.gz: 904eacdcbbe518f91ccc41d2c03da9191591a0af6e17be87874be1d74525707a10815e68ed0c9c3dacf91afe70384f982723487f3b6434241ec51097745f0f3e
7
+ data.tar.gz: 8be9c36a56b92d1bea25a2ef352cb1e3062b1d197983c92cd11d0f753451573b454b3af22327c05fa300d52f3036561555bd1464faa79ea304d87811ddd4acd2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  Changelog
2
2
  ---------
3
3
 
4
+ ### 1.0.4, 30-10-2023
5
+
6
+ - Check for `__builtin_ctzl` (and use if found)
7
+
4
8
  ### 1.0.3, 16-10-2023
5
9
 
6
10
  - 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>
@@ -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";
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,3 @@
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/branch.h rtree/error.h rtree/extent.h rtree/node.h \
2
+ rtree/package.h rtree/postscript.h rtree/rectf.h rtree/search.h \
3
+ rtree/state.h rtree/types.h rtree.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.0";
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,14 +2,13 @@
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>
@@ -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*,
@@ -0,0 +1,15 @@
1
+ /*
2
+ private/split.h
3
+ Copyright (c) J.J. Green 2020
4
+ */
5
+
6
+ #ifndef PRIVATE_SPLIT_H
7
+ #define PRIVATE_SPLIT_H
8
+
9
+ #include <private/branch.h>
10
+ #include <private/node.h>
11
+ #include <private/state.h>
12
+
13
+ node_t* split_node(const state_t*, node_t*, branch_t*);
14
+
15
+ #endif
@@ -1,10 +1,10 @@
1
1
  /*
2
- spvol.h
2
+ private/spvol.h
3
3
  Copyright (c) J.J. Green 2020
4
4
  */
5
5
 
6
- #ifndef SPVOL_H
7
- #define SPVOL_H
6
+ #ifndef PRIVATE_SPVOL_H
7
+ #define PRIVATE_SPVOL_H
8
8
 
9
9
  #include <stddef.h>
10
10
 
@@ -1,19 +1,20 @@
1
1
  /*
2
- state.h
2
+ private/state.h
3
3
  Copyright (c) J.J. Green 2023
4
4
  */
5
5
 
6
- #ifndef STATE_H
7
- #define STATE_H
6
+ #ifndef PRIVATE_STATE_H
7
+ #define PRIVATE_STATE_H
8
8
 
9
- #include <stdlib.h>
10
- #include <stdbool.h>
9
+ #include <private/rectf.h>
10
+
11
+ #include <rtree/state.h>
12
+ #include <rtree/types.h>
11
13
 
12
- #include "rtree/state.h"
13
- #include "rtree/types.h"
14
- #include "rtree/rectf.h"
14
+ #include <stddef.h>
15
+ #include <stdbool.h>
15
16
 
16
- struct state_t
17
+ typedef struct
17
18
  {
18
19
  size_t dims, factor;
19
20
  rtree_coord_t volume;
@@ -25,7 +26,7 @@ struct state_t
25
26
  rectf_rc_t *combine;
26
27
  } rectf;
27
28
  state_flags_t flags;
28
- };
29
+ } state_t;
29
30
 
30
31
  state_t* state_new(size_t, state_flags_t);
31
32
  state_t* state_clone(const state_t*);
data/ext/rtree/lib/rect.c CHANGED
@@ -2,8 +2,8 @@
2
2
  #include "config.h"
3
3
  #endif
4
4
 
5
- #include "rect.h"
6
- #include "state.h"
5
+ #include "private/rect.h"
6
+ #include "private/state.h"
7
7
 
8
8
  #include "rtree/error.h"
9
9
 
@@ -19,6 +19,7 @@
19
19
 
20
20
  #include <string.h>
21
21
  #include <errno.h>
22
+ #include <stdlib.h>
22
23
 
23
24
  int rect_init(const state_t *state, rtree_coord_t *rect)
24
25
  {
@@ -2,7 +2,7 @@
2
2
  #include "config.h"
3
3
  #endif
4
4
 
5
- #include "rtree/rectf.h"
5
+ #include "private/rectf.h"
6
6
 
7
7
  #ifdef HAVE_TGMATH_H
8
8
  #include <tgmath.h>
@@ -12,7 +12,6 @@ extern "C" {
12
12
 
13
13
  #include <rtree/types.h>
14
14
 
15
- typedef struct node_t node_t;
16
15
  typedef int (rtree_update_t)(rtree_id_t, rtree_coord_t*, void*);
17
16
 
18
17
  #ifdef __cplusplus
@@ -10,16 +10,16 @@
10
10
  extern "C" {
11
11
  #endif
12
12
 
13
- typedef struct rtree_postscript_t rtree_postscript_t;
13
+ #include <rtree/extent.h>
14
14
 
15
15
  #include <stdio.h>
16
- #include <rtree/node.h>
17
- #include <rtree/state.h>
18
- #include <rtree/extent.h>
19
16
 
20
- typedef enum
21
- { model_none, model_grey, model_rgb, model_cmyk }
22
- postscript_colour_model_t;
17
+ typedef enum {
18
+ model_none,
19
+ model_grey,
20
+ model_rgb,
21
+ model_cmyk
22
+ } postscript_colour_model_t;
23
23
 
24
24
  typedef struct {
25
25
  postscript_colour_model_t model;
@@ -48,17 +48,14 @@ typedef struct {
48
48
  postscript_style_t* postscript_style_read(FILE*);
49
49
  void postscript_style_destroy(postscript_style_t*);
50
50
 
51
- struct rtree_postscript_t
51
+ typedef struct rtree_postscript_t
52
52
  {
53
53
  const postscript_style_t *style;
54
54
  extent_axis_t axis;
55
55
  float extent;
56
56
  float margin;
57
57
  const char *title;
58
- };
59
-
60
- int postscript_write(const state_t*, const node_t*,
61
- const rtree_postscript_t*, FILE*);
58
+ } rtree_postscript_t;
62
59
 
63
60
  #ifdef __cplusplus
64
61
  }
@@ -18,7 +18,6 @@ extern "C" {
18
18
  #include <stdint.h>
19
19
 
20
20
  typedef uint32_t state_flags_t;
21
- typedef struct state_t state_t;
22
21
 
23
22
  #define RTREE_DEFAULT 0
24
23
 
@@ -2,15 +2,15 @@
2
2
  #include "config.h"
3
3
  #endif
4
4
 
5
- #include "rtree.h"
6
-
7
- #include "csv.h"
8
- #include "json.h"
9
- #include "bsrt.h"
10
- #include "node.h"
11
- #include "search.h"
12
- #include "state.h"
5
+ #include "private/bsrt.h"
6
+ #include "private/csv.h"
7
+ #include "private/json.h"
8
+ #include "private/node.h"
9
+ #include "private/postscript.h"
10
+ #include "private/search.h"
11
+ #include "private/state.h"
13
12
 
13
+ #include "rtree.h"
14
14
  #include "rtree/error.h"
15
15
 
16
16
  #include <errno.h>
@@ -24,12 +24,6 @@ typedef uint16_t rtree_height_t;
24
24
  #include <rtree/search.h>
25
25
  #include <rtree/error.h>
26
26
 
27
- struct rtree_t
28
- {
29
- state_t *state;
30
- node_t *root;
31
- };
32
-
33
27
  rtree_t* rtree_alloc(void);
34
28
  int rtree_init(rtree_t*, size_t, state_flags_t);
35
29
  rtree_t* rtree_new(size_t, state_flags_t);
@@ -2,14 +2,13 @@
2
2
  #include "config.h"
3
3
  #endif
4
4
 
5
- #include "search.h"
6
- #include "node.h"
7
- #include "branch.h"
8
- #include "rect.h"
5
+ #include "private/search.h"
6
+ #include "private/node.h"
7
+ #include "private/branch.h"
8
+ #include "private/rect.h"
9
9
 
10
10
  #include "rtree/error.h"
11
11
 
12
-
13
12
  typedef struct
14
13
  {
15
14
  rtree_search_t *callback;
@@ -2,8 +2,17 @@
2
2
  #include "config.h"
3
3
  #endif
4
4
 
5
+ #include "private/bindex.h"
6
+ #include "private/branch.h"
7
+ #include "private/branches.h"
8
+ #include "private/node.h"
9
+ #include "private/split.h"
10
+
11
+ #include "rtree/error.h"
12
+
5
13
  #include <float.h>
6
14
  #include <errno.h>
15
+ #include <stdlib.h>
7
16
 
8
17
  #ifdef HAVE_TGMATH_H
9
18
  #include <tgmath.h>
@@ -11,14 +20,6 @@
11
20
  #include <math.h>
12
21
  #endif
13
22
 
14
- #include "rtree/error.h"
15
-
16
- #include "branches.h"
17
- #include "branch.h"
18
- #include "split.h"
19
- #include "bindex.h"
20
- #include "node.h"
21
-
22
23
  typedef struct
23
24
  {
24
25
  bindex_t *choice, *taken;
@@ -1,6 +1,6 @@
1
1
  /* Autogenerated by spvol.py, do not edit */
2
2
 
3
- #include "spvol.h"
3
+ #include "private/spvol.h"
4
4
 
5
5
  int spvol(size_t dim, double *val)
6
6
  {
@@ -2,16 +2,16 @@
2
2
  #include "config.h"
3
3
  #endif
4
4
 
5
- #include "state.h"
6
-
7
- #include "branch.h"
8
- #include "page.h"
9
- #include "constants.h"
10
- #include "spvol.h"
11
- #include "node.h"
5
+ #include "private/branch.h"
6
+ #include "private/constants.h"
7
+ #include "private/node.h"
8
+ #include "private/page.h"
9
+ #include "private/spvol.h"
10
+ #include "private/state.h"
12
11
 
13
12
  #include <errno.h>
14
13
  #include <string.h>
14
+ #include <stdlib.h>
15
15
 
16
16
  #ifdef HAVE_TGMATH_H
17
17
  #include <tgmath.h>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: librtree
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.J. Green
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-16 00:00:00.000000000 Z
11
+ date: 2023-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -151,53 +151,54 @@ files:
151
151
  - ext/rtree/extconf.rb
152
152
  - ext/rtree/lib/README.md
153
153
  - ext/rtree/lib/bindex.c
154
- - ext/rtree/lib/bindex.h
155
- - ext/rtree/lib/bounds.h
156
154
  - ext/rtree/lib/branch.c
157
- - ext/rtree/lib/branch.h
158
155
  - ext/rtree/lib/branches.c
159
- - ext/rtree/lib/branches.h
160
156
  - ext/rtree/lib/bsrt.c
161
- - ext/rtree/lib/bsrt.h
162
- - ext/rtree/lib/constants.h
163
157
  - ext/rtree/lib/csv.c
164
- - ext/rtree/lib/csv.h
165
- - ext/rtree/lib/endianness.h
166
158
  - ext/rtree/lib/error.c
167
159
  - ext/rtree/lib/json.c
168
- - ext/rtree/lib/json.h
169
160
  - ext/rtree/lib/mk/Hdr.mk
170
161
  - ext/rtree/lib/mk/MakeDepend
171
162
  - ext/rtree/lib/mk/Obj.mk
172
163
  - ext/rtree/lib/node.c
173
- - ext/rtree/lib/node.h
174
164
  - ext/rtree/lib/package.c
175
165
  - ext/rtree/lib/page.c
176
- - ext/rtree/lib/page.h
177
166
  - ext/rtree/lib/postscript.c
167
+ - ext/rtree/lib/private/bindex.h
168
+ - ext/rtree/lib/private/bounds.h
169
+ - ext/rtree/lib/private/branch.h
170
+ - ext/rtree/lib/private/branches.h
171
+ - ext/rtree/lib/private/bsrt.h
172
+ - ext/rtree/lib/private/constants.h
173
+ - ext/rtree/lib/private/csv.h
174
+ - ext/rtree/lib/private/endianness.h
175
+ - ext/rtree/lib/private/json.h
176
+ - ext/rtree/lib/private/node.h
177
+ - ext/rtree/lib/private/page.h
178
+ - ext/rtree/lib/private/postscript.h
179
+ - ext/rtree/lib/private/rect.h
180
+ - ext/rtree/lib/private/rectf.h
181
+ - ext/rtree/lib/private/rtree.h
182
+ - ext/rtree/lib/private/search.h
183
+ - ext/rtree/lib/private/split.h
184
+ - ext/rtree/lib/private/spvol.h
185
+ - ext/rtree/lib/private/state.h
178
186
  - ext/rtree/lib/rect.c
179
- - ext/rtree/lib/rect.h
180
187
  - ext/rtree/lib/rectf.c
181
188
  - ext/rtree/lib/rtree-base.c
182
189
  - ext/rtree/lib/rtree.h
183
- - ext/rtree/lib/rtree/branch.h
184
190
  - ext/rtree/lib/rtree/error.h
185
191
  - ext/rtree/lib/rtree/extent.h
186
192
  - ext/rtree/lib/rtree/node.h
187
193
  - ext/rtree/lib/rtree/package.h
188
194
  - ext/rtree/lib/rtree/postscript.h
189
- - ext/rtree/lib/rtree/rectf.h
190
195
  - ext/rtree/lib/rtree/search.h
191
196
  - ext/rtree/lib/rtree/state.h
192
197
  - ext/rtree/lib/rtree/types.h
193
198
  - ext/rtree/lib/search.c
194
- - ext/rtree/lib/search.h
195
199
  - ext/rtree/lib/split.c
196
- - ext/rtree/lib/split.h
197
200
  - ext/rtree/lib/spvol.c
198
- - ext/rtree/lib/spvol.h
199
201
  - ext/rtree/lib/state.c
200
- - ext/rtree/lib/state.h
201
202
  - ext/rtree/rtree.c
202
203
  - lib/rtree.rb
203
204
  homepage: https://gitlab.com/jjg/librtree-ruby
data/ext/rtree/lib/page.h DELETED
@@ -1,13 +0,0 @@
1
- /*
2
- page.h
3
- Copyright (c) J.J. Green 2019
4
- */
5
-
6
- #ifndef PAGE_H
7
- #define PAGE_H
8
-
9
- #include <stdlib.h>
10
-
11
- int page_size(size_t*);
12
-
13
- #endif
@@ -1,19 +0,0 @@
1
- /*
2
- rtree/branch.h
3
- Copyright (c) J.J. Green 2019
4
- */
5
-
6
- #ifndef RTREE_BRANCH_H
7
- #define RTREE_BRANCH_H
8
-
9
- #ifdef __cplusplus
10
- extern "C" {
11
- #endif
12
-
13
- typedef struct branch_t branch_t;
14
-
15
- #ifdef __cplusplus
16
- }
17
- #endif
18
-
19
- #endif
@@ -1,15 +0,0 @@
1
- /*
2
- split.h
3
- Copyright (c) J.J. Green 2020
4
- */
5
-
6
- #ifndef SPLIT_H
7
- #define SPLIT_H
8
-
9
- #include "rtree/state.h"
10
- #include "rtree/branch.h"
11
- #include "rtree/node.h"
12
-
13
- node_t* split_node(const state_t*, node_t*, branch_t*);
14
-
15
- #endif