@ohos-ports/lmdb 2.5.3 → 2.8.5-beta.0

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 (124) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +72 -28
  3. package/SECURITY.md +12 -12
  4. package/bin/download-prebuilds.js +15 -0
  5. package/binding.gyp +115 -111
  6. package/build/Release/lmdb.node +0 -0
  7. package/caching.js +212 -156
  8. package/dependencies/lmdb/libraries/liblmdb/COPYRIGHT +20 -20
  9. package/dependencies/lmdb/libraries/liblmdb/Doxyfile +1631 -1631
  10. package/dependencies/lmdb/libraries/liblmdb/LICENSE +47 -47
  11. package/dependencies/lmdb/libraries/liblmdb/Makefile +136 -136
  12. package/dependencies/lmdb/libraries/liblmdb/chacha8.c +183 -183
  13. package/dependencies/lmdb/libraries/liblmdb/chacha8.h +14 -14
  14. package/dependencies/lmdb/libraries/liblmdb/crypto.c +121 -121
  15. package/dependencies/lmdb/libraries/liblmdb/intro.doc +192 -192
  16. package/dependencies/lmdb/libraries/liblmdb/lmdb.h +28 -3
  17. package/dependencies/lmdb/libraries/liblmdb/mdb.c +157 -31
  18. package/dependencies/lmdb/libraries/liblmdb/mdb_copy.1 +74 -74
  19. package/dependencies/lmdb/libraries/liblmdb/mdb_copy.c +106 -106
  20. package/dependencies/lmdb/libraries/liblmdb/mdb_drop.1 +53 -53
  21. package/dependencies/lmdb/libraries/liblmdb/mdb_drop.c +154 -154
  22. package/dependencies/lmdb/libraries/liblmdb/mdb_dump.1 +94 -94
  23. package/dependencies/lmdb/libraries/liblmdb/mdb_dump.c +333 -333
  24. package/dependencies/lmdb/libraries/liblmdb/mdb_load.1 +97 -97
  25. package/dependencies/lmdb/libraries/liblmdb/mdb_load.c +530 -530
  26. package/dependencies/lmdb/libraries/liblmdb/mdb_stat.1 +83 -83
  27. package/dependencies/lmdb/libraries/liblmdb/mdb_stat.c +276 -276
  28. package/dependencies/lmdb/libraries/liblmdb/midl-sparse.c +452 -0
  29. package/dependencies/lmdb/libraries/liblmdb/midl.c +452 -452
  30. package/dependencies/lmdb/libraries/liblmdb/midl.h +208 -208
  31. package/dependencies/lmdb/libraries/liblmdb/module.c +101 -101
  32. package/dependencies/lmdb/libraries/liblmdb/module.h +16 -16
  33. package/dependencies/lmdb/libraries/liblmdb/mtest.c +178 -178
  34. package/dependencies/lmdb/libraries/liblmdb/mtest2.c +124 -124
  35. package/dependencies/lmdb/libraries/liblmdb/mtest3.c +133 -133
  36. package/dependencies/lmdb/libraries/liblmdb/mtest4.c +168 -168
  37. package/dependencies/lmdb/libraries/liblmdb/mtest5.c +135 -135
  38. package/dependencies/lmdb/libraries/liblmdb/mtest6.c +141 -141
  39. package/dependencies/lmdb/libraries/liblmdb/mtest_enc.c +190 -190
  40. package/dependencies/lmdb/libraries/liblmdb/mtest_enc2.c +189 -189
  41. package/dependencies/lmdb/libraries/liblmdb/mtest_remap.c +177 -177
  42. package/dependencies/lmdb/libraries/liblmdb/sample-bdb.txt +73 -73
  43. package/dependencies/lmdb/libraries/liblmdb/sample-mdb.txt +62 -62
  44. package/dependencies/lmdb/libraries/liblmdb/tooltag +27 -27
  45. package/dependencies/lmdb-data-v1/libraries/liblmdb/CHANGES +266 -0
  46. package/dependencies/lmdb-data-v1/libraries/liblmdb/COPYRIGHT +20 -20
  47. package/dependencies/lmdb-data-v1/libraries/liblmdb/Doxyfile +1631 -1631
  48. package/dependencies/lmdb-data-v1/libraries/liblmdb/LICENSE +47 -47
  49. package/dependencies/lmdb-data-v1/libraries/liblmdb/intro.doc +192 -192
  50. package/dependencies/lmdb-data-v1/libraries/liblmdb/lmdb.h +1608 -1653
  51. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb.c +10320 -11359
  52. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_copy.1 +55 -61
  53. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_copy.c +82 -84
  54. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_dump.1 +75 -81
  55. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_dump.c +319 -319
  56. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_load.1 +84 -84
  57. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_load.c +496 -492
  58. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_stat.1 +64 -70
  59. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_stat.c +263 -264
  60. package/dependencies/lmdb-data-v1/libraries/liblmdb/midl.c +359 -421
  61. package/dependencies/lmdb-data-v1/libraries/liblmdb/midl.h +186 -200
  62. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest.c +177 -177
  63. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest2.c +124 -124
  64. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest3.c +133 -133
  65. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest4.c +168 -168
  66. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest5.c +135 -135
  67. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest6.c +141 -141
  68. package/dependencies/lmdb-data-v1/libraries/liblmdb/sample-bdb.txt +73 -73
  69. package/dependencies/lmdb-data-v1/libraries/liblmdb/sample-mdb.txt +62 -62
  70. package/dependencies/lmdb-data-v1/libraries/liblmdb/tooltag +22 -27
  71. package/dependencies/lz4/LICENSE +11 -11
  72. package/dependencies/lz4/lib/LICENSE +24 -24
  73. package/dependencies/lz4/lib/Makefile +225 -0
  74. package/dependencies/lz4/lib/README.md +169 -137
  75. package/dependencies/lz4/lib/dll/example/Makefile +63 -0
  76. package/dependencies/lz4/lib/dll/example/README.md +69 -69
  77. package/dependencies/lz4/lib/dll/liblz4.def +62 -62
  78. package/dependencies/lz4/lib/liblz4-dll.rc.in +35 -35
  79. package/dependencies/lz4/lib/liblz4.pc.in +14 -14
  80. package/dependencies/lz4/lib/lz4.c +2722 -2495
  81. package/dependencies/lz4/lib/lz4.h +842 -774
  82. package/dependencies/lz4/lib/lz4file.c +311 -0
  83. package/dependencies/lz4/lib/lz4file.h +93 -0
  84. package/dependencies/lz4/lib/lz4frame.c +2078 -1899
  85. package/dependencies/lz4/lib/lz4frame.h +692 -623
  86. package/dependencies/lz4/lib/lz4frame_static.h +47 -47
  87. package/dependencies/lz4/lib/lz4hc.c +1631 -1615
  88. package/dependencies/lz4/lib/lz4hc.h +413 -413
  89. package/dependencies/lz4/lib/xxhash.c +1030 -1030
  90. package/dependencies/lz4/lib/xxhash.h +328 -328
  91. package/dependencies/v8/v8-fast-api-calls-v16.h +790 -790
  92. package/dependencies/v8/v8-fast-api-calls.h +784 -888
  93. package/dist/index.cjs +1050 -584
  94. package/dist/index.cjs.map +1 -1
  95. package/index.d.cts +420 -0
  96. package/index.d.ts +450 -385
  97. package/index.js +38 -37
  98. package/keys.js +116 -102
  99. package/level.js +26 -26
  100. package/native.js +8 -5
  101. package/node-index.js +21 -17
  102. package/open.js +51 -17
  103. package/package.json +63 -21
  104. package/read.js +338 -95
  105. package/src/compression.cpp +12 -9
  106. package/src/cursor.cpp +82 -31
  107. package/src/dbi.cpp +78 -40
  108. package/src/env.cpp +336 -68
  109. package/src/lmdb-js.cpp +64 -64
  110. package/src/lmdb-js.h +83 -49
  111. package/src/misc.cpp +297 -28
  112. package/src/ordered-binary.cpp +46 -46
  113. package/src/txn.cpp +210 -257
  114. package/src/v8-functions.cpp +170 -166
  115. package/src/windows.c +34 -34
  116. package/src/writer.cpp +169 -84
  117. package/util/RangeIterable.js +112 -17
  118. package/util/set-optional-deps.cjs +14 -10
  119. package/util/when.js +8 -8
  120. package/write.js +145 -121
  121. package/dependencies/lmdb-data-v1/libraries/liblmdb/Makefile +0 -118
  122. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_drop.1 +0 -40
  123. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_drop.c +0 -135
  124. package/rollup.config.js +0 -12
@@ -1,137 +1,169 @@
1
- LZ4 - Library Files
2
- ================================
3
-
4
- The `/lib` directory contains many files, but depending on project's objectives,
5
- not all of them are necessary.
6
-
7
- #### Minimal LZ4 build
8
-
9
- The minimum required is **`lz4.c`** and **`lz4.h`**,
10
- which provides the fast compression and decompression algorithms.
11
- They generate and decode data using the [LZ4 block format].
12
-
13
-
14
- #### High Compression variant
15
-
16
- For more compression ratio at the cost of compression speed,
17
- the High Compression variant called **lz4hc** is available.
18
- Add files **`lz4hc.c`** and **`lz4hc.h`**.
19
- This variant also compresses data using the [LZ4 block format],
20
- and depends on regular `lib/lz4.*` source files.
21
-
22
-
23
- #### Frame support, for interoperability
24
-
25
- In order to produce compressed data compatible with `lz4` command line utility,
26
- it's necessary to use the [official interoperable frame format].
27
- This format is generated and decoded automatically by the **lz4frame** library.
28
- Its public API is described in `lib/lz4frame.h`.
29
- In order to work properly, lz4frame needs all other modules present in `/lib`,
30
- including, lz4 and lz4hc, and also **xxhash**.
31
- So it's necessary to include all `*.c` and `*.h` files present in `/lib`.
32
-
33
-
34
- #### Advanced / Experimental API
35
-
36
- Definitions which are not guaranteed to remain stable in future versions,
37
- are protected behind macros, such as `LZ4_STATIC_LINKING_ONLY`.
38
- As the name strongly implies, these definitions should only be invoked
39
- in the context of static linking ***only***.
40
- Otherwise, dependent application may fail on API or ABI break in the future.
41
- The associated symbols are also not exposed by the dynamic library by default.
42
- Should they be nonetheless needed, it's possible to force their publication
43
- by using build macros `LZ4_PUBLISH_STATIC_FUNCTIONS`
44
- and `LZ4F_PUBLISH_STATIC_FUNCTIONS`.
45
-
46
-
47
- #### Build macros
48
-
49
- The following build macro can be selected to adjust source code behavior at compilation time :
50
-
51
- - `LZ4_FAST_DEC_LOOP` : this triggers a speed optimized decompression loop, more powerful on modern cpus.
52
- This loop works great on `x86`, `x64` and `aarch64` cpus, and is automatically enabled for them.
53
- It's also possible to enable or disable it manually, by passing `LZ4_FAST_DEC_LOOP=1` or `0` to the preprocessor.
54
- For example, with `gcc` : `-DLZ4_FAST_DEC_LOOP=1`,
55
- and with `make` : `CPPFLAGS+=-DLZ4_FAST_DEC_LOOP=1 make lz4`.
56
-
57
- - `LZ4_DISTANCE_MAX` : control the maximum offset that the compressor will allow.
58
- Set to 65535 by default, which is the maximum value supported by lz4 format.
59
- Reducing maximum distance will reduce opportunities for LZ4 to find matches,
60
- hence will produce a worse compression ratio.
61
- However, a smaller max distance can allow compatibility with specific decoders using limited memory budget.
62
- This build macro only influences the compressed output of the compressor.
63
-
64
- - `LZ4_DISABLE_DEPRECATE_WARNINGS` : invoking a deprecated function will make the compiler generate a warning.
65
- This is meant to invite users to update their source code.
66
- Should this be a problem, it's generally possible to make the compiler ignore these warnings,
67
- for example with `-Wno-deprecated-declarations` on `gcc`,
68
- or `_CRT_SECURE_NO_WARNINGS` for Visual Studio.
69
- This build macro offers another project-specific method
70
- by defining `LZ4_DISABLE_DEPRECATE_WARNINGS` before including the LZ4 header files.
71
-
72
- - `LZ4_USER_MEMORY_FUNCTIONS` : replace calls to <stdlib>'s `malloc`, `calloc` and `free`
73
- by user-defined functions, which must be called `LZ4_malloc()`, `LZ4_calloc()` and `LZ4_free()`.
74
- User functions must be available at link time.
75
-
76
- - `LZ4_FORCE_SW_BITCOUNT` : by default, the compression algorithm tries to determine lengths
77
- by using bitcount instructions, generally implemented as fast single instructions in many cpus.
78
- In case the target cpus doesn't support it, or compiler intrinsic doesn't work, or feature bad performance,
79
- it's possible to use an optimized software path instead.
80
- This is achieved by setting this build macros .
81
- In most cases, it's not expected to be necessary,
82
- but it can be legitimately considered for less common platforms.
83
-
84
- - `LZ4_ALIGN_TEST` : alignment test ensures that the memory area
85
- passed as argument to become a compression state is suitably aligned.
86
- This test can be disabled if it proves flaky, by setting this value to 0.
87
-
88
-
89
- #### Amalgamation
90
-
91
- lz4 source code can be amalgamated into a single file.
92
- One can combine all source code into `lz4_all.c` by using following command:
93
- ```
94
- cat lz4.c lz4hc.c lz4frame.c > lz4_all.c
95
- ```
96
- (`cat` file order is important) then compile `lz4_all.c`.
97
- All `*.h` files present in `/lib` remain necessary to compile `lz4_all.c`.
98
-
99
-
100
- #### Windows : using MinGW+MSYS to create DLL
101
-
102
- DLL can be created using MinGW+MSYS with the `make liblz4` command.
103
- This command creates `dll\liblz4.dll` and the import library `dll\liblz4.lib`.
104
- To override the `dlltool` command when cross-compiling on Linux, just set the `DLLTOOL` variable. Example of cross compilation on Linux with mingw-w64 64 bits:
105
- ```
106
- make BUILD_STATIC=no CC=x86_64-w64-mingw32-gcc DLLTOOL=x86_64-w64-mingw32-dlltool OS=Windows_NT
107
- ```
108
- The import library is only required with Visual C++.
109
- The header files `lz4.h`, `lz4hc.h`, `lz4frame.h` and the dynamic library
110
- `dll\liblz4.dll` are required to compile a project using gcc/MinGW.
111
- The dynamic library has to be added to linking options.
112
- It means that if a project that uses LZ4 consists of a single `test-dll.c`
113
- file it should be linked with `dll\liblz4.dll`. For example:
114
- ```
115
- $(CC) $(CFLAGS) -Iinclude/ test-dll.c -o test-dll dll\liblz4.dll
116
- ```
117
- The compiled executable will require LZ4 DLL which is available at `dll\liblz4.dll`.
118
-
119
-
120
- #### Miscellaneous
121
-
122
- Other files present in the directory are not source code. They are :
123
-
124
- - `LICENSE` : contains the BSD license text
125
- - `Makefile` : `make` script to compile and install lz4 library (static and dynamic)
126
- - `liblz4.pc.in` : for `pkg-config` (used in `make install`)
127
- - `README.md` : this file
128
-
129
- [official interoperable frame format]: ../doc/lz4_Frame_format.md
130
- [LZ4 block format]: ../doc/lz4_Block_format.md
131
-
132
-
133
- #### License
134
-
135
- All source material within __lib__ directory are BSD 2-Clause licensed.
136
- See [LICENSE](LICENSE) for details.
137
- The license is also reminded at the top of each source file.
1
+ LZ4 - Library Files
2
+ ================================
3
+
4
+ The `/lib` directory contains many files, but depending on project's objectives,
5
+ not all of them are required.
6
+ Limited systems may want to reduce the nb of source files to include
7
+ as a way to reduce binary size and dependencies.
8
+
9
+ Capabilities are added at the "level" granularity, detailed below.
10
+
11
+ #### Level 1 : Minimal LZ4 build
12
+
13
+ The minimum required is **`lz4.c`** and **`lz4.h`**,
14
+ which provides the fast compression and decompression algorithms.
15
+ They generate and decode data using the [LZ4 block format].
16
+
17
+
18
+ #### Level 2 : High Compression variant
19
+
20
+ For more compression ratio at the cost of compression speed,
21
+ the High Compression variant called **lz4hc** is available.
22
+ Add files **`lz4hc.c`** and **`lz4hc.h`**.
23
+ This variant also compresses data using the [LZ4 block format],
24
+ and depends on regular `lib/lz4.*` source files.
25
+
26
+
27
+ #### Level 3 : Frame support, for interoperability
28
+
29
+ In order to produce compressed data compatible with `lz4` command line utility,
30
+ it's necessary to use the [official interoperable frame format].
31
+ This format is generated and decoded automatically by the **lz4frame** library.
32
+ Its public API is described in `lib/lz4frame.h`.
33
+ In order to work properly, lz4frame needs all other modules present in `/lib`,
34
+ including, lz4 and lz4hc, and also **xxhash**.
35
+ So it's necessary to also include `xxhash.c` and `xxhash.h`.
36
+
37
+
38
+ #### Level 4 : File compression operations
39
+
40
+ As a helper around file operations,
41
+ the library has been recently extended with `lz4file.c` and `lz4file.h`
42
+ (still considered experimental at the time of this writing).
43
+ These helpers allow opening, reading, writing, and closing files
44
+ using transparent LZ4 compression / decompression.
45
+ As a consequence, using `lz4file` adds a dependency on `<stdio.h>`.
46
+
47
+ `lz4file` relies on `lz4frame` in order to produce compressed data
48
+ conformant to the [LZ4 Frame format] specification.
49
+ Consequently, to enable this capability,
50
+ it's necessary to include all `*.c` and `*.h` files from `lib/` directory.
51
+
52
+
53
+ #### Advanced / Experimental API
54
+
55
+ Definitions which are not guaranteed to remain stable in future versions,
56
+ are protected behind macros, such as `LZ4_STATIC_LINKING_ONLY`.
57
+ As the name suggests, these definitions should only be invoked
58
+ in the context of static linking ***only***.
59
+ Otherwise, dependent application may fail on API or ABI break in the future.
60
+ The associated symbols are also not exposed by the dynamic library by default.
61
+ Should they be nonetheless needed, it's possible to force their publication
62
+ by using build macros `LZ4_PUBLISH_STATIC_FUNCTIONS`
63
+ and `LZ4F_PUBLISH_STATIC_FUNCTIONS`.
64
+
65
+
66
+ #### Build macros
67
+
68
+ The following build macro can be selected to adjust source code behavior at compilation time :
69
+
70
+ - `LZ4_FAST_DEC_LOOP` : this triggers a speed optimized decompression loop, more powerful on modern cpus.
71
+ This loop works great on `x86`, `x64` and `aarch64` cpus, and is automatically enabled for them.
72
+ It's also possible to enable or disable it manually, by passing `LZ4_FAST_DEC_LOOP=1` or `0` to the preprocessor.
73
+ For example, with `gcc` : `-DLZ4_FAST_DEC_LOOP=1`,
74
+ and with `make` : `CPPFLAGS+=-DLZ4_FAST_DEC_LOOP=1 make lz4`.
75
+
76
+ - `LZ4_DISTANCE_MAX` : control the maximum offset that the compressor will allow.
77
+ Set to 65535 by default, which is the maximum value supported by lz4 format.
78
+ Reducing maximum distance will reduce opportunities for LZ4 to find matches,
79
+ hence will produce a worse compression ratio.
80
+ Setting a smaller max distance could allow compatibility with specific decoders with limited memory budget.
81
+ This build macro only influences the compressed output of the compressor.
82
+
83
+ - `LZ4_DISABLE_DEPRECATE_WARNINGS` : invoking a deprecated function will make the compiler generate a warning.
84
+ This is meant to invite users to update their source code.
85
+ Should this be a problem, it's generally possible to make the compiler ignore these warnings,
86
+ for example with `-Wno-deprecated-declarations` on `gcc`,
87
+ or `_CRT_SECURE_NO_WARNINGS` for Visual Studio.
88
+ This build macro offers another project-specific method
89
+ by defining `LZ4_DISABLE_DEPRECATE_WARNINGS` before including the LZ4 header files.
90
+
91
+ - `LZ4_FORCE_SW_BITCOUNT` : by default, the compression algorithm tries to determine lengths
92
+ by using bitcount instructions, generally implemented as fast single instructions in many cpus.
93
+ In case the target cpus doesn't support it, or compiler intrinsic doesn't work, or feature bad performance,
94
+ it's possible to use an optimized software path instead.
95
+ This is achieved by setting this build macros.
96
+ In most cases, it's not expected to be necessary,
97
+ but it can be legitimately considered for less common platforms.
98
+
99
+ - `LZ4_ALIGN_TEST` : alignment test ensures that the memory area
100
+ passed as argument to become a compression state is suitably aligned.
101
+ This test can be disabled if it proves flaky, by setting this value to 0.
102
+
103
+ - `LZ4_USER_MEMORY_FUNCTIONS` : replace calls to `<stdlib,h>`'s `malloc()`, `calloc()` and `free()`
104
+ by user-defined functions, which must be named `LZ4_malloc()`, `LZ4_calloc()` and `LZ4_free()`.
105
+ User functions must be available at link time.
106
+
107
+ - `LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION` :
108
+ Remove support of dynamic memory allocation.
109
+ For more details, see description of this macro in `lib/lz4.c`.
110
+
111
+ - `LZ4_FREESTANDING` : by setting this build macro to 1,
112
+ LZ4/HC removes dependencies on the C standard library,
113
+ including allocation functions and `memmove()`, `memcpy()`, and `memset()`.
114
+ This build macro is designed to help use LZ4/HC in restricted environments
115
+ (embedded, bootloader, etc).
116
+ For more details, see description of this macro in `lib/lz4.h`.
117
+
118
+
119
+
120
+ #### Amalgamation
121
+
122
+ lz4 source code can be amalgamated into a single file.
123
+ One can combine all source code into `lz4_all.c` by using following command:
124
+ ```
125
+ cat lz4.c lz4hc.c lz4frame.c > lz4_all.c
126
+ ```
127
+ (`cat` file order is important) then compile `lz4_all.c`.
128
+ All `*.h` files present in `/lib` remain necessary to compile `lz4_all.c`.
129
+
130
+
131
+ #### Windows : using MinGW+MSYS to create DLL
132
+
133
+ DLL can be created using MinGW+MSYS with the `make liblz4` command.
134
+ This command creates `dll\liblz4.dll` and the import library `dll\liblz4.lib`.
135
+ To override the `dlltool` command when cross-compiling on Linux, just set the `DLLTOOL` variable. Example of cross compilation on Linux with mingw-w64 64 bits:
136
+ ```
137
+ make BUILD_STATIC=no CC=x86_64-w64-mingw32-gcc DLLTOOL=x86_64-w64-mingw32-dlltool OS=Windows_NT
138
+ ```
139
+ The import library is only required with Visual C++.
140
+ The header files `lz4.h`, `lz4hc.h`, `lz4frame.h` and the dynamic library
141
+ `dll\liblz4.dll` are required to compile a project using gcc/MinGW.
142
+ The dynamic library has to be added to linking options.
143
+ It means that if a project that uses LZ4 consists of a single `test-dll.c`
144
+ file it should be linked with `dll\liblz4.dll`. For example:
145
+ ```
146
+ $(CC) $(CFLAGS) -Iinclude/ test-dll.c -o test-dll dll\liblz4.dll
147
+ ```
148
+ The compiled executable will require LZ4 DLL which is available at `dll\liblz4.dll`.
149
+
150
+
151
+ #### Miscellaneous
152
+
153
+ Other files present in the directory are not source code. They are :
154
+
155
+ - `LICENSE` : contains the BSD license text
156
+ - `Makefile` : `make` script to compile and install lz4 library (static and dynamic)
157
+ - `liblz4.pc.in` : for `pkg-config` (used in `make install`)
158
+ - `README.md` : this file
159
+
160
+ [official interoperable frame format]: ../doc/lz4_Frame_format.md
161
+ [LZ4 Frame format]: ../doc/lz4_Frame_format.md
162
+ [LZ4 block format]: ../doc/lz4_Block_format.md
163
+
164
+
165
+ #### License
166
+
167
+ All source material within __lib__ directory are BSD 2-Clause licensed.
168
+ See [LICENSE](LICENSE) for details.
169
+ The license is also reminded at the top of each source file.
@@ -0,0 +1,63 @@
1
+ # ##########################################################################
2
+ # LZ4 programs - Makefile
3
+ # Copyright (C) Yann Collet 2016-2020
4
+ #
5
+ # GPL v2 License
6
+ #
7
+ # This program is free software; you can redistribute it and/or modify
8
+ # it under the terms of the GNU General Public License as published by
9
+ # the Free Software Foundation; either version 2 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU General Public License along
18
+ # with this program; if not, write to the Free Software Foundation, Inc.,
19
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
+ #
21
+ # You can contact the author at :
22
+ # - LZ4 homepage : http://www.lz4.org
23
+ # - LZ4 source repository : https://github.com/lz4/lz4
24
+ # ##########################################################################
25
+
26
+ VOID := /dev/null
27
+ LZ4DIR := ../include
28
+ LIBDIR := ../static
29
+ DLLDIR := ../dll
30
+
31
+ CFLAGS ?= -O3 # can select custom flags. For example : CFLAGS="-O2 -g" make
32
+ CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \
33
+ -Wdeclaration-after-statement -Wstrict-prototypes \
34
+ -Wpointer-arith -Wstrict-aliasing=1
35
+ CFLAGS += $(MOREFLAGS)
36
+ CPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_
37
+ FLAGS := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
38
+
39
+
40
+ # Define *.exe as extension for Windows systems
41
+ ifneq (,$(filter Windows%,$(OS)))
42
+ EXT =.exe
43
+ else
44
+ EXT =
45
+ endif
46
+
47
+ .PHONY: default fullbench-dll fullbench-lib
48
+
49
+
50
+ default: all
51
+
52
+ all: fullbench-dll fullbench-lib
53
+
54
+
55
+ fullbench-lib: fullbench.c xxhash.c
56
+ $(CC) $(FLAGS) $^ -o $@$(EXT) $(LIBDIR)/liblz4_static.lib
57
+
58
+ fullbench-dll: fullbench.c xxhash.c
59
+ $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(DLLDIR)/liblz4.dll
60
+
61
+ clean:
62
+ @$(RM) fullbench-dll$(EXT) fullbench-lib$(EXT) \
63
+ @echo Cleaning completed
@@ -1,69 +1,69 @@
1
- LZ4 Windows binary package
2
- ====================================
3
-
4
- #### The package contents
5
-
6
- - `lz4.exe` : Command Line Utility, supporting gzip-like arguments
7
- - `dll\liblz4.dll` : The DLL of LZ4 library
8
- - `dll\liblz4.lib` : The import library of LZ4 library for Visual C++
9
- - `example\` : The example of usage of LZ4 library
10
- - `include\` : Header files required with LZ4 library
11
- - `static\liblz4_static.lib` : The static LZ4 library
12
-
13
-
14
- #### Usage of Command Line Interface
15
-
16
- Command Line Interface (CLI) supports gzip-like arguments.
17
- By default CLI takes an input file and compresses it to an output file:
18
- ```
19
- Usage: lz4 [arg] [input] [output]
20
- ```
21
- The full list of commands for CLI can be obtained with `-h` or `-H`. The ratio can
22
- be improved with commands from `-3` to `-16` but higher levels also have slower
23
- compression. CLI includes in-memory compression benchmark module with compression
24
- levels starting from `-b` and ending with `-e` with iteration time of `-i` seconds.
25
- CLI supports aggregation of parameters i.e. `-b1`, `-e18`, and `-i1` can be joined
26
- into `-b1e18i1`.
27
-
28
-
29
- #### The example of usage of static and dynamic LZ4 libraries with gcc/MinGW
30
-
31
- Use `cd example` and `make` to build `fullbench-dll` and `fullbench-lib`.
32
- `fullbench-dll` uses a dynamic LZ4 library from the `dll` directory.
33
- `fullbench-lib` uses a static LZ4 library from the `lib` directory.
34
-
35
-
36
- #### Using LZ4 DLL with gcc/MinGW
37
-
38
- The header files from `include\` and the dynamic library `dll\liblz4.dll`
39
- are required to compile a project using gcc/MinGW.
40
- The dynamic library has to be added to linking options.
41
- It means that if a project that uses LZ4 consists of a single `test-dll.c`
42
- file it should be linked with `dll\liblz4.dll`. For example:
43
- ```
44
- gcc $(CFLAGS) -Iinclude\ test-dll.c -o test-dll dll\liblz4.dll
45
- ```
46
- The compiled executable will require LZ4 DLL which is available at `dll\liblz4.dll`.
47
-
48
-
49
- #### The example of usage of static and dynamic LZ4 libraries with Visual C++
50
-
51
- Open `example\fullbench-dll.sln` to compile `fullbench-dll` that uses a
52
- dynamic LZ4 library from the `dll` directory. The solution works with Visual C++
53
- 2010 or newer. When one will open the solution with Visual C++ newer than 2010
54
- then the solution will upgraded to the current version.
55
-
56
-
57
- #### Using LZ4 DLL with Visual C++
58
-
59
- The header files from `include\` and the import library `dll\liblz4.lib`
60
- are required to compile a project using Visual C++.
61
-
62
- 1. The header files should be added to `Additional Include Directories` that can
63
- be found in project properties `C/C++` then `General`.
64
- 2. The import library has to be added to `Additional Dependencies` that can
65
- be found in project properties `Linker` then `Input`.
66
- If one will provide only the name `liblz4.lib` without a full path to the library
67
- the directory has to be added to `Linker\General\Additional Library Directories`.
68
-
69
- The compiled executable will require LZ4 DLL which is available at `dll\liblz4.dll`.
1
+ LZ4 Windows binary package
2
+ ====================================
3
+
4
+ #### The package contents
5
+
6
+ - `lz4.exe` : Command Line Utility, supporting gzip-like arguments
7
+ - `dll\msys-lz4-1.dll` : The DLL of LZ4 library, compiled by msys
8
+ - `dll\liblz4.dll.a` : The import library of LZ4 library for Visual C++
9
+ - `example\` : The example of usage of LZ4 library
10
+ - `include\` : Header files required with LZ4 library
11
+ - `static\liblz4_static.lib` : The static LZ4 library
12
+
13
+
14
+ #### Usage of Command Line Interface
15
+
16
+ Command Line Interface (CLI) supports gzip-like arguments.
17
+ By default CLI takes an input file and compresses it to an output file:
18
+ ```
19
+ Usage: lz4 [arg] [input] [output]
20
+ ```
21
+ The full list of commands for CLI can be obtained with `-h` or `-H`. The ratio can
22
+ be improved with commands from `-3` to `-16` but higher levels also have slower
23
+ compression. CLI includes in-memory compression benchmark module with compression
24
+ levels starting from `-b` and ending with `-e` with iteration time of `-i` seconds.
25
+ CLI supports aggregation of parameters i.e. `-b1`, `-e18`, and `-i1` can be joined
26
+ into `-b1e18i1`.
27
+
28
+
29
+ #### The example of usage of static and dynamic LZ4 libraries with gcc/MinGW
30
+
31
+ Use `cd example` and `make` to build `fullbench-dll` and `fullbench-lib`.
32
+ `fullbench-dll` uses a dynamic LZ4 library from the `dll` directory.
33
+ `fullbench-lib` uses a static LZ4 library from the `lib` directory.
34
+
35
+
36
+ #### Using LZ4 DLL with gcc/MinGW
37
+
38
+ The header files from `include\` and the dynamic library `dll\msys-lz4-1.dll`
39
+ are required to compile a project using gcc/MinGW.
40
+ The dynamic library has to be added to linking options.
41
+ It means that if a project that uses LZ4 consists of a single `test-dll.c`
42
+ file it should be linked with `dll\msys-lz4-1.dll`. For example:
43
+ ```
44
+ gcc $(CFLAGS) -Iinclude\ test-dll.c -o test-dll dll\msys-lz4-1.dll
45
+ ```
46
+ The compiled executable will require LZ4 DLL which is available at `dll\msys-lz4-1.dll`.
47
+
48
+
49
+ #### The example of usage of static and dynamic LZ4 libraries with Visual C++
50
+
51
+ Open `example\fullbench-dll.sln` to compile `fullbench-dll` that uses a
52
+ dynamic LZ4 library from the `dll` directory. The solution works with Visual C++
53
+ 2010 or newer. When one will open the solution with Visual C++ newer than 2010
54
+ then the solution will be upgraded to the current version.
55
+
56
+
57
+ #### Using LZ4 DLL with Visual C++
58
+
59
+ The header files from `include\` and the import library `dll\liblz4.dll.a`
60
+ are required to compile a project using Visual C++.
61
+
62
+ 1. The header files should be added to `Additional Include Directories` that can
63
+ be found in project properties `C/C++` then `General`.
64
+ 2. The import library has to be added to `Additional Dependencies` that can
65
+ be found in project properties `Linker` then `Input`.
66
+ If one will provide only the name `liblz4.dll.a` without a full path to the library
67
+ the directory has to be added to `Linker\General\Additional Library Directories`.
68
+
69
+ The compiled executable will require LZ4 DLL which is available at `dll\msys-lz4-1.dll`.
@@ -1,62 +1,62 @@
1
- LIBRARY liblz4.dll
2
- EXPORTS
3
- LZ4F_compressBegin
4
- LZ4F_compressBound
5
- LZ4F_compressEnd
6
- LZ4F_compressFrame
7
- LZ4F_compressFrameBound
8
- LZ4F_compressUpdate
9
- LZ4F_createCompressionContext
10
- LZ4F_createDecompressionContext
11
- LZ4F_decompress
12
- LZ4F_flush
13
- LZ4F_freeCompressionContext
14
- LZ4F_freeDecompressionContext
15
- LZ4F_getErrorName
16
- LZ4F_getFrameInfo
17
- LZ4F_getVersion
18
- LZ4F_isError
19
- LZ4_compress
20
- LZ4_compressBound
21
- LZ4_compressHC
22
- LZ4_compressHC_continue
23
- LZ4_compressHC_limitedOutput
24
- LZ4_compressHC_limitedOutput_continue
25
- LZ4_compressHC_limitedOutput_withStateHC
26
- LZ4_compressHC_withStateHC
27
- LZ4_compress_HC
28
- LZ4_compress_HC_continue
29
- LZ4_compress_HC_extStateHC
30
- LZ4_compress_continue
31
- LZ4_compress_default
32
- LZ4_compress_destSize
33
- LZ4_compress_fast
34
- LZ4_compress_fast_continue
35
- LZ4_compress_fast_extState
36
- LZ4_compress_limitedOutput
37
- LZ4_compress_limitedOutput_continue
38
- LZ4_compress_limitedOutput_withState
39
- LZ4_compress_withState
40
- LZ4_createStream
41
- LZ4_createStreamDecode
42
- LZ4_createStreamHC
43
- LZ4_decompress_fast
44
- LZ4_decompress_fast_continue
45
- LZ4_decompress_fast_usingDict
46
- LZ4_decompress_safe
47
- LZ4_decompress_safe_continue
48
- LZ4_decompress_safe_partial
49
- LZ4_decompress_safe_usingDict
50
- LZ4_freeStream
51
- LZ4_freeStreamDecode
52
- LZ4_freeStreamHC
53
- LZ4_loadDict
54
- LZ4_loadDictHC
55
- LZ4_resetStream
56
- LZ4_resetStreamHC
57
- LZ4_saveDict
58
- LZ4_saveDictHC
59
- LZ4_setStreamDecode
60
- LZ4_sizeofState
61
- LZ4_sizeofStateHC
62
- LZ4_versionNumber
1
+ LIBRARY liblz4.dll
2
+ EXPORTS
3
+ LZ4F_compressBegin
4
+ LZ4F_compressBound
5
+ LZ4F_compressEnd
6
+ LZ4F_compressFrame
7
+ LZ4F_compressFrameBound
8
+ LZ4F_compressUpdate
9
+ LZ4F_createCompressionContext
10
+ LZ4F_createDecompressionContext
11
+ LZ4F_decompress
12
+ LZ4F_flush
13
+ LZ4F_freeCompressionContext
14
+ LZ4F_freeDecompressionContext
15
+ LZ4F_getErrorName
16
+ LZ4F_getFrameInfo
17
+ LZ4F_getVersion
18
+ LZ4F_isError
19
+ LZ4_compress
20
+ LZ4_compressBound
21
+ LZ4_compressHC
22
+ LZ4_compressHC_continue
23
+ LZ4_compressHC_limitedOutput
24
+ LZ4_compressHC_limitedOutput_continue
25
+ LZ4_compressHC_limitedOutput_withStateHC
26
+ LZ4_compressHC_withStateHC
27
+ LZ4_compress_HC
28
+ LZ4_compress_HC_continue
29
+ LZ4_compress_HC_extStateHC
30
+ LZ4_compress_continue
31
+ LZ4_compress_default
32
+ LZ4_compress_destSize
33
+ LZ4_compress_fast
34
+ LZ4_compress_fast_continue
35
+ LZ4_compress_fast_extState
36
+ LZ4_compress_limitedOutput
37
+ LZ4_compress_limitedOutput_continue
38
+ LZ4_compress_limitedOutput_withState
39
+ LZ4_compress_withState
40
+ LZ4_createStream
41
+ LZ4_createStreamDecode
42
+ LZ4_createStreamHC
43
+ LZ4_decompress_fast
44
+ LZ4_decompress_fast_continue
45
+ LZ4_decompress_fast_usingDict
46
+ LZ4_decompress_safe
47
+ LZ4_decompress_safe_continue
48
+ LZ4_decompress_safe_partial
49
+ LZ4_decompress_safe_usingDict
50
+ LZ4_freeStream
51
+ LZ4_freeStreamDecode
52
+ LZ4_freeStreamHC
53
+ LZ4_loadDict
54
+ LZ4_loadDictHC
55
+ LZ4_resetStream
56
+ LZ4_resetStreamHC
57
+ LZ4_saveDict
58
+ LZ4_saveDictHC
59
+ LZ4_setStreamDecode
60
+ LZ4_sizeofState
61
+ LZ4_sizeofStateHC
62
+ LZ4_versionNumber