@nxtedition/rocksdb 5.2.40 → 6.0.1

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 (39) hide show
  1. package/BUILDING.md +10 -0
  2. package/binding.cc +63 -31
  3. package/binding.gyp +2 -2
  4. package/deps/rocksdb/rocksdb.gyp +57 -30
  5. package/package.json +1 -1
  6. package/prebuilds/darwin-arm64/node.napi.node +0 -0
  7. package/prebuilds/darwin-x64/node.napi.node +0 -0
  8. package/prebuilds/linux-arm64/node.napi.node +0 -0
  9. package/prebuilds/linux-x64/node.napi.node +0 -0
  10. package/deps/snappy/freebsd/config.h +0 -135
  11. package/deps/snappy/freebsd/snappy-stubs-public.h +0 -100
  12. package/deps/snappy/linux/config.h +0 -135
  13. package/deps/snappy/linux/snappy-stubs-public.h +0 -100
  14. package/deps/snappy/mac/config.h +0 -137
  15. package/deps/snappy/mac/snappy-stubs-public.h +0 -100
  16. package/deps/snappy/openbsd/config.h +0 -135
  17. package/deps/snappy/openbsd/snappy-stubs-public.h +0 -100
  18. package/deps/snappy/snappy-1.1.7/COPYING +0 -54
  19. package/deps/snappy/snappy-1.1.7/README.md +0 -149
  20. package/deps/snappy/snappy-1.1.7/cmake/SnappyConfig.cmake +0 -1
  21. package/deps/snappy/snappy-1.1.7/cmake/config.h.in +0 -62
  22. package/deps/snappy/snappy-1.1.7/snappy-c.cc +0 -90
  23. package/deps/snappy/snappy-1.1.7/snappy-c.h +0 -138
  24. package/deps/snappy/snappy-1.1.7/snappy-internal.h +0 -224
  25. package/deps/snappy/snappy-1.1.7/snappy-sinksource.cc +0 -104
  26. package/deps/snappy/snappy-1.1.7/snappy-sinksource.h +0 -182
  27. package/deps/snappy/snappy-1.1.7/snappy-stubs-internal.cc +0 -42
  28. package/deps/snappy/snappy-1.1.7/snappy-stubs-internal.h +0 -561
  29. package/deps/snappy/snappy-1.1.7/snappy-stubs-public.h.in +0 -94
  30. package/deps/snappy/snappy-1.1.7/snappy-test.cc +0 -612
  31. package/deps/snappy/snappy-1.1.7/snappy-test.h +0 -573
  32. package/deps/snappy/snappy-1.1.7/snappy.cc +0 -1515
  33. package/deps/snappy/snappy-1.1.7/snappy.h +0 -203
  34. package/deps/snappy/snappy-1.1.7/snappy_unittest.cc +0 -1410
  35. package/deps/snappy/snappy.gyp +0 -93
  36. package/deps/snappy/solaris/config.h +0 -135
  37. package/deps/snappy/solaris/snappy-stubs-public.h +0 -100
  38. package/deps/snappy/win32/config.h +0 -29
  39. package/deps/snappy/win32/snappy-stubs-public.h +0 -100
package/BUILDING.md ADDED
@@ -0,0 +1,10 @@
1
+ # LINUX
2
+
3
+ - Run `./configure` in `deps/liburing`.
4
+ - Install and build zstd with `CFLAGS="-O3 -fPIC" make -C lib libzstd.a` and copy to `/usr/lib/x86_64-linux-gnu/libzstd_pic.a`.
5
+ - Put headers at `/usr/lib/x86_64-linux-gnu/include`.
6
+
7
+ # OSX
8
+
9
+ - Run `./configure` in `deps/liburing`.
10
+ - `brew install zstd@1.5.2`
package/binding.cc CHANGED
@@ -598,10 +598,16 @@ NAPI_METHOD(db_open) {
598
598
  const auto location = ToString(env, argv[1]);
599
599
  options.create_if_missing = BooleanProperty(env, argv[2], "createIfMissing").value_or(true);
600
600
  options.error_if_exists = BooleanProperty(env, argv[2], "errorIfExists").value_or(false);
601
- options.compression = BooleanProperty(env, argv[2], "compression").value_or((true)) ? rocksdb::kSnappyCompression
601
+ options.compression = BooleanProperty(env, argv[2], "compression").value_or((true)) ? rocksdb::kZSTD
602
602
  : rocksdb::kNoCompression;
603
- options.use_adaptive_mutex = true;
604
- options.enable_pipelined_write = true;
603
+ if (options.compression == rocksdb::kZSTD) {
604
+ options.compression_opts.max_dict_bytes = 16 * 1024;
605
+ options.compression_opts.zstd_max_train_bytes = 16 * 1024 * 100;
606
+ // options.compression_opts.parallel_threads
607
+ }
608
+
609
+ options.use_adaptive_mutex = BooleanProperty(env, argv[2], "useAdaptiveMutex").value_or(true);
610
+ options.enable_pipelined_write = BooleanProperty(env, argv[2], "enablePipelinedWrite").value_or(true);
605
611
  options.max_background_jobs =
606
612
  Uint32Property(env, argv[2], "maxBackgroundJobs").value_or(std::thread::hardware_concurrency() / 4);
607
613
 
@@ -911,46 +917,72 @@ NAPI_METHOD(db_clear) {
911
917
  const auto lte = StringProperty(env, argv[1], "lte");
912
918
  const auto gt = StringProperty(env, argv[1], "gt");
913
919
  const auto gte = StringProperty(env, argv[1], "gte");
920
+
921
+ if (!reverse && limit == -1 && (lte || lt)) {
922
+ rocksdb::Slice begin;
923
+ if (gte) {
924
+ begin = *gte;
925
+ } else if (gt) {
926
+ begin = *gt + '\0';
927
+ }
914
928
 
915
- // TODO (perf): Use DeleteRange.
929
+ rocksdb::Slice end;
930
+ if (lte) {
931
+ end = *lte + '\0';
932
+ } else if (lt) {
933
+ end = *lt;
934
+ } else {
935
+ assert(false);
936
+ }
916
937
 
917
- BaseIterator it(database, reverse, lt, lte, gt, gte, limit, false);
938
+ if (begin.compare(end) > 0) {
939
+ return ToError(env, rocksdb::Status::OK());
940
+ }
918
941
 
919
- it.SeekToRange();
942
+ rocksdb::WriteOptions options;
943
+ const auto status = database->db_->DeleteRange(options, database->db_->DefaultColumnFamily(), begin, end);
944
+ return ToError(env, status);
945
+ } else {
946
+ // TODO (perf): Use DeleteRange.
920
947
 
921
- // TODO: add option
922
- const uint32_t hwm = 16 * 1024;
948
+ BaseIterator it(database, reverse, lt, lte, gt, gte, limit, false);
923
949
 
924
- rocksdb::WriteBatch batch;
925
- rocksdb::WriteOptions options;
926
- rocksdb::Status status;
950
+ it.SeekToRange();
927
951
 
928
- while (true) {
929
- size_t bytesRead = 0;
952
+ // TODO: add option
953
+ const uint32_t hwm = 16 * 1024;
930
954
 
931
- while (bytesRead <= hwm && it.Valid() && it.Increment()) {
932
- const auto key = it.CurrentKey();
933
- batch.Delete(key);
934
- bytesRead += key.size();
935
- it.Next();
936
- }
955
+ rocksdb::WriteBatch batch;
956
+ rocksdb::WriteOptions options;
957
+ rocksdb::Status status;
937
958
 
938
- status = it.Status();
939
- if (!status.ok() || bytesRead == 0) {
940
- break;
941
- }
959
+ while (true) {
960
+ size_t bytesRead = 0;
942
961
 
943
- status = database->db_->Write(options, &batch);
944
- if (!status.ok()) {
945
- break;
946
- }
962
+ while (bytesRead <= hwm && it.Valid() && it.Increment()) {
963
+ const auto key = it.CurrentKey();
964
+ batch.Delete(key);
965
+ bytesRead += key.size();
966
+ it.Next();
967
+ }
947
968
 
948
- batch.Clear();
949
- }
969
+ status = it.Status();
970
+ if (!status.ok() || bytesRead == 0) {
971
+ break;
972
+ }
950
973
 
951
- it.Close();
974
+ status = database->db_->Write(options, &batch);
975
+ if (!status.ok()) {
976
+ break;
977
+ }
952
978
 
953
- return ToError(env, status);
979
+ batch.Clear();
980
+ }
981
+
982
+ it.Close();
983
+
984
+ return ToError(env, status);
985
+ }
954
986
  }
955
987
 
956
988
  NAPI_METHOD(db_get_property) {
package/binding.gyp CHANGED
@@ -61,7 +61,7 @@
61
61
  "-Wno-ignored-qualifiers"
62
62
  ],
63
63
  "OTHER_CPLUSPLUSFLAGS": [
64
- "-mmacosx-version-min=10.15",
64
+ "-mmacosx-version-min=12.2.1",
65
65
  "-std=c++20",
66
66
  "-fno-omit-frame-pointer",
67
67
  "-momit-leaf-frame-pointer",
@@ -70,7 +70,7 @@
70
70
  ],
71
71
  "GCC_ENABLE_CPP_RTTI": "YES",
72
72
  "GCC_ENABLE_CPP_EXCEPTIONS": "YES",
73
- "MACOSX_DEPLOYMENT_TARGET": "10.15"
73
+ "MACOSX_DEPLOYMENT_TARGET": "12.2.1"
74
74
  }
75
75
  }
76
76
  ]
@@ -5,16 +5,23 @@
5
5
  "target_name": "rocksdb",
6
6
  "type": "static_library",
7
7
  "standalone_static_library": 1,
8
- "dependencies": ["../snappy/snappy.gyp:snappy"],
9
- "direct_dependent_settings": { "include_dirs": ["rocksdb/include/"] },
8
+ "direct_dependent_settings": {
9
+ "include_dirs": ["rocksdb/include/"]
10
+ },
10
11
  "defines": [
11
- "SNAPPY=1",
12
+ "ZSTD=1",
13
+ "ZSTD_STATIC_LINKING_ONLY=1",
14
+ # "ROCKSDB_JEMALLOC=1",
15
+ # "JEMALLOC_NO_DEMANGLE=1",
12
16
  "ROCKSDB_BACKTRACE=1",
13
17
  "ROCKSDB_SUPPORT_THREAD_LOCAL=1",
14
18
  "NIOSTATS_CONTEXT=1",
15
19
  "NPERF_CONTEXT=1"
16
20
  ],
17
- "include_dirs": ["rocksdb/", "rocksdb/include/"],
21
+ "include_dirs": [
22
+ "rocksdb/",
23
+ "rocksdb/include/"
24
+ ],
18
25
  "conditions": [
19
26
  [
20
27
  "OS == 'win'",
@@ -84,8 +91,6 @@
84
91
  "ROCKSDB_RANGESYNC_PRESENT=1",
85
92
  "ROCKSDB_SCHED_GETCPU_PRESENT=1",
86
93
  "ROCKSDB_IOURING_PRESENT=1",
87
- # "ROCKSDB_JEMALLOC=1",
88
- # "JEMALLOC_NO_DEMANGLE=1",
89
94
  "HAVE_SSE42=1",
90
95
  "HAVE_BMI=1",
91
96
  "HAVE_LZCNT=1",
@@ -97,7 +102,19 @@
97
102
  # "NUMA=1",
98
103
  # "TBB=1",
99
104
  ],
100
- "dependencies": ["../liburing/liburing.gyp:liburing"],
105
+ "direct_dependent_settings": {
106
+ "libraries": [
107
+ "/usr/lib/x86_64-linux-gnu/libzstd_pic.a",
108
+ # "/usr/lib/x86_64-linux-gnu/libjemalloc_pic.a",
109
+ ],
110
+ },
111
+ "include_dirs": [
112
+ "/usr/lib/x86_64-linux-gnu/include",
113
+ # "/opt/homebrew/Cellar/jemalloc/5.3.0/include"
114
+ ],
115
+ "dependencies": [
116
+ "../liburing/liburing.gyp:liburing"
117
+ ],
101
118
  "cflags": [
102
119
  "-msse4.2",
103
120
  "-mpclmul",
@@ -109,16 +126,26 @@
109
126
  "ccflags": ["-flto"],
110
127
  "cflags!": ["-fno-exceptions"],
111
128
  "cflags_cc!": ["-fno-exceptions"],
112
- "ldflags": ["-flto", "-fuse-linker-plugin"]
113
- }
129
+ "ldflags": ["-flto", "-fuse-linker-plugin"],
130
+ },
114
131
  ],
115
132
  [
116
133
  "OS == 'mac'",
117
134
  {
118
135
  "defines": ["OS_MACOSX=1"],
136
+ "direct_dependent_settings": {
137
+ "libraries": [
138
+ "/opt/homebrew/Cellar/zstd/1.5.2/lib/libzstd.a",
139
+ # "/opt/homebrew/Cellar/jemalloc/5.3.0/lib/libjemalloc.a"
140
+ ],
141
+ },
142
+ "include_dirs": [
143
+ "/opt/homebrew/Cellar/zstd/1.5.2/include",
144
+ # "/opt/homebrew/Cellar/jemalloc/5.3.0/include"
145
+ ],
119
146
  "xcode_settings": {
120
147
  "OTHER_CPLUSPLUSFLAGS": [
121
- "-mmacosx-version-min=10.15",
148
+ "-mmacosx-version-min=12.2.1",
122
149
  "-std=c++20",
123
150
  "-fno-omit-frame-pointer",
124
151
  "-momit-leaf-frame-pointer",
@@ -127,8 +154,8 @@
127
154
  ],
128
155
  "GCC_ENABLE_CPP_RTTI": "YES",
129
156
  "GCC_ENABLE_CPP_EXCEPTIONS": "YES",
130
- "MACOSX_DEPLOYMENT_TARGET": "10.15"
131
- }
157
+ "MACOSX_DEPLOYMENT_TARGET": "12.2.1"
158
+ },
132
159
  }
133
160
  ]
134
161
  ],
@@ -362,12 +389,12 @@
362
389
  "rocksdb/util/xxhash.cc",
363
390
  "rocksdb/utilities/agg_merge/agg_merge.cc",
364
391
  "rocksdb/utilities/backup/backup_engine.cc",
365
- # "rocksdb/utilities/blob_db/blob_compaction_filter.cc",
366
- # "rocksdb/utilities/blob_db/blob_db.cc",
367
- # "rocksdb/utilities/blob_db/blob_db_impl.cc",
368
- # "rocksdb/utilities/blob_db/blob_db_impl_filesnapshot.cc",
369
- # "rocksdb/utilities/blob_db/blob_dump_tool.cc",
370
- # "rocksdb/utilities/blob_db/blob_file.cc",
392
+ "rocksdb/utilities/blob_db/blob_compaction_filter.cc",
393
+ "rocksdb/utilities/blob_db/blob_db.cc",
394
+ "rocksdb/utilities/blob_db/blob_db_impl.cc",
395
+ "rocksdb/utilities/blob_db/blob_db_impl_filesnapshot.cc",
396
+ "rocksdb/utilities/blob_db/blob_dump_tool.cc",
397
+ "rocksdb/utilities/blob_db/blob_file.cc",
371
398
  "rocksdb/utilities/cache_dump_load.cc",
372
399
  "rocksdb/utilities/cache_dump_load_impl.cc",
373
400
  "rocksdb/utilities/checkpoint/checkpoint_impl.cc",
@@ -375,11 +402,11 @@
375
402
  "rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc",
376
403
  "rocksdb/utilities/counted_fs.cc",
377
404
  "rocksdb/utilities/debug.cc",
378
- # "rocksdb/utilities/env_mirror.cc",
379
- # "rocksdb/utilities/env_timed.cc",
380
- # "rocksdb/utilities/fault_injection_env.cc",
381
- # "rocksdb/utilities/fault_injection_fs.cc",
382
- # "rocksdb/utilities/fault_injection_secondary_cache.cc",
405
+ "rocksdb/utilities/env_mirror.cc",
406
+ "rocksdb/utilities/env_timed.cc",
407
+ "rocksdb/utilities/fault_injection_env.cc",
408
+ "rocksdb/utilities/fault_injection_fs.cc",
409
+ "rocksdb/utilities/fault_injection_secondary_cache.cc",
383
410
  "rocksdb/utilities/leveldb_options/leveldb_options.cc",
384
411
  "rocksdb/utilities/memory/memory_util.cc",
385
412
  "rocksdb/utilities/merge_operators.cc",
@@ -393,13 +420,13 @@
393
420
  "rocksdb/utilities/object_registry.cc",
394
421
  "rocksdb/utilities/option_change_migration/option_change_migration.cc",
395
422
  "rocksdb/utilities/options/options_util.cc",
396
- # "rocksdb/utilities/persistent_cache/block_cache_tier.cc",
397
- # "rocksdb/utilities/persistent_cache/block_cache_tier_file.cc",
398
- # "rocksdb/utilities/persistent_cache/block_cache_tier_metadata.cc",
399
- # "rocksdb/utilities/persistent_cache/persistent_cache_tier.cc",
400
- # "rocksdb/utilities/persistent_cache/volatile_tier_impl.cc",
401
- # "rocksdb/utilities/simulator_cache/cache_simulator.cc",
402
- # "rocksdb/utilities/simulator_cache/sim_cache.cc",
423
+ "rocksdb/utilities/persistent_cache/block_cache_tier.cc",
424
+ "rocksdb/utilities/persistent_cache/block_cache_tier_file.cc",
425
+ "rocksdb/utilities/persistent_cache/block_cache_tier_metadata.cc",
426
+ "rocksdb/utilities/persistent_cache/persistent_cache_tier.cc",
427
+ "rocksdb/utilities/persistent_cache/volatile_tier_impl.cc",
428
+ "rocksdb/utilities/simulator_cache/cache_simulator.cc",
429
+ "rocksdb/utilities/simulator_cache/sim_cache.cc",
403
430
  "rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.cc",
404
431
  "rocksdb/utilities/trace/file_trace_reader_writer.cc",
405
432
  "rocksdb/utilities/trace/replayer_impl.cc",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/rocksdb",
3
- "version": "5.2.40",
3
+ "version": "6.0.1",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
Binary file
Binary file
@@ -1,135 +0,0 @@
1
- /* config.h. Generated from config.h.in by configure. */
2
- /* config.h.in. Generated from configure.ac by autoheader. */
3
-
4
- /* Define if building universal (internal helper macro) */
5
- /* #undef AC_APPLE_UNIVERSAL_BUILD */
6
-
7
- /* Define to 1 if the compiler supports __builtin_ctz and friends. */
8
- #define HAVE_BUILTIN_CTZ 1
9
-
10
- /* Define to 1 if the compiler supports __builtin_expect. */
11
- #define HAVE_BUILTIN_EXPECT 1
12
-
13
- /* Define to 1 if you have the <byteswap.h> header file. */
14
- /* #undef HAVE_BYTESWAP_H */
15
-
16
- /* Define to 1 if you have the <dlfcn.h> header file. */
17
- #define HAVE_DLFCN_H 1
18
-
19
- /* Use the gflags package for command-line parsing. */
20
- /* #undef HAVE_GFLAGS */
21
-
22
- /* Defined when Google Test is available. */
23
- /* #undef HAVE_GTEST */
24
-
25
- /* Define to 1 if you have the <inttypes.h> header file. */
26
- #define HAVE_INTTYPES_H 1
27
-
28
- /* Define to 1 if you have the `fastlz' library (-lfastlz). */
29
- /* #undef HAVE_LIBFASTLZ */
30
-
31
- /* Define to 1 if you have the `lzf' library (-llzf). */
32
- /* #undef HAVE_LIBLZF */
33
-
34
- /* Define to 1 if you have the `lzo2' library (-llzo2). */
35
- /* #undef HAVE_LIBLZO2 */
36
-
37
- /* Define to 1 if you have the `quicklz' library (-lquicklz). */
38
- /* #undef HAVE_LIBQUICKLZ */
39
-
40
- /* Define to 1 if you have the `z' library (-lz). */
41
- #define HAVE_LIBZ 1
42
-
43
- /* Define to 1 if you have the <memory.h> header file. */
44
- #define HAVE_MEMORY_H 1
45
-
46
- /* Define to 1 if you have the <stddef.h> header file. */
47
- #define HAVE_STDDEF_H 1
48
-
49
- /* Define to 1 if you have the <stdint.h> header file. */
50
- #define HAVE_STDINT_H 1
51
-
52
- /* Define to 1 if you have the <stdlib.h> header file. */
53
- #define HAVE_STDLIB_H 1
54
-
55
- /* Define to 1 if you have the <strings.h> header file. */
56
- #define HAVE_STRINGS_H 1
57
-
58
- /* Define to 1 if you have the <string.h> header file. */
59
- #define HAVE_STRING_H 1
60
-
61
- /* Define to 1 if you have the <sys/byteswap.h> header file. */
62
- /* #undef HAVE_SYS_BYTESWAP_H */
63
-
64
- /* Define to 1 if you have the <sys/endian.h> header file. */
65
- #define HAVE_SYS_ENDIAN_H 1
66
-
67
- /* Define to 1 if you have the <sys/mman.h> header file. */
68
- #define HAVE_SYS_MMAN_H 1
69
-
70
- /* Define to 1 if you have the <sys/resource.h> header file. */
71
- #define HAVE_SYS_RESOURCE_H 1
72
-
73
- /* Define to 1 if you have the <sys/stat.h> header file. */
74
- #define HAVE_SYS_STAT_H 1
75
-
76
- /* Define to 1 if you have the <sys/time.h> header file. */
77
- #define HAVE_SYS_TIME_H 1
78
-
79
- /* Define to 1 if you have the <sys/types.h> header file. */
80
- #define HAVE_SYS_TYPES_H 1
81
-
82
- /* Define to 1 if you have the <sys/uio.h> header file. */
83
- #define HAVE_SYS_UIO_H 1
84
-
85
- /* Define to 1 if you have the <unistd.h> header file. */
86
- #define HAVE_UNISTD_H 1
87
-
88
- /* Define to 1 if you have the <windows.h> header file. */
89
- /* #undef HAVE_WINDOWS_H */
90
-
91
- /* Define to the sub-directory in which libtool stores uninstalled libraries.
92
- */
93
- #define LT_OBJDIR ".libs/"
94
-
95
- /* Name of package */
96
- #define PACKAGE "snappy"
97
-
98
- /* Define to the address where bug reports for this package should be sent. */
99
- #define PACKAGE_BUGREPORT ""
100
-
101
- /* Define to the full name of this package. */
102
- #define PACKAGE_NAME "snappy"
103
-
104
- /* Define to the full name and version of this package. */
105
- #define PACKAGE_STRING "snappy 1.1.4"
106
-
107
- /* Define to the one symbol short name of this package. */
108
- #define PACKAGE_TARNAME "snappy"
109
-
110
- /* Define to the version of this package. */
111
- #define PACKAGE_VERSION "1.1.4"
112
-
113
- /* Define to 1 if you have the ANSI C header files. */
114
- #define STDC_HEADERS 1
115
-
116
- /* Version number of package */
117
- #define VERSION "1.1.4"
118
-
119
- /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
120
- significant byte first (like Motorola and SPARC, unlike Intel). */
121
- #if defined AC_APPLE_UNIVERSAL_BUILD
122
- # if defined __BIG_ENDIAN__
123
- # define WORDS_BIGENDIAN 1
124
- # endif
125
- #else
126
- # ifndef WORDS_BIGENDIAN
127
- /* # undef WORDS_BIGENDIAN */
128
- # endif
129
- #endif
130
-
131
- /* Define to `unsigned int' if <sys/types.h> does not define. */
132
- /* #undef size_t */
133
-
134
- /* Define to `int' if <sys/types.h> does not define. */
135
- /* #undef ssize_t */
@@ -1,100 +0,0 @@
1
- // Copyright 2011 Google Inc. All Rights Reserved.
2
- // Author: sesse@google.com (Steinar H. Gunderson)
3
- //
4
- // Redistribution and use in source and binary forms, with or without
5
- // modification, are permitted provided that the following conditions are
6
- // met:
7
- //
8
- // * Redistributions of source code must retain the above copyright
9
- // notice, this list of conditions and the following disclaimer.
10
- // * Redistributions in binary form must reproduce the above
11
- // copyright notice, this list of conditions and the following disclaimer
12
- // in the documentation and/or other materials provided with the
13
- // distribution.
14
- // * Neither the name of Google Inc. nor the names of its
15
- // contributors may be used to endorse or promote products derived from
16
- // this software without specific prior written permission.
17
- //
18
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
- //
30
- // Various type stubs for the open-source version of Snappy.
31
- //
32
- // This file cannot include config.h, as it is included from snappy.h,
33
- // which is a public header. Instead, snappy-stubs-public.h is generated by
34
- // from snappy-stubs-public.h.in at configure time.
35
-
36
- #ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_
37
- #define THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_
38
-
39
- #if 1
40
- #include <stdint.h>
41
- #endif
42
-
43
- #if 1
44
- #include <stddef.h>
45
- #endif
46
-
47
- #if 1
48
- #include <sys/uio.h>
49
- #endif
50
-
51
- #define SNAPPY_MAJOR 1
52
- #define SNAPPY_MINOR 1
53
- #define SNAPPY_PATCHLEVEL 4
54
- #define SNAPPY_VERSION \
55
- ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL)
56
-
57
- #include <string>
58
-
59
- namespace snappy {
60
-
61
- #if 1
62
- typedef int8_t int8;
63
- typedef uint8_t uint8;
64
- typedef int16_t int16;
65
- typedef uint16_t uint16;
66
- typedef int32_t int32;
67
- typedef uint32_t uint32;
68
- typedef int64_t int64;
69
- typedef uint64_t uint64;
70
- #else
71
- typedef signed char int8;
72
- typedef unsigned char uint8;
73
- typedef short int16;
74
- typedef unsigned short uint16;
75
- typedef int int32;
76
- typedef unsigned int uint32;
77
- typedef long long int64;
78
- typedef unsigned long long uint64;
79
- #endif
80
-
81
- typedef std::string string;
82
-
83
- #ifndef DISALLOW_COPY_AND_ASSIGN
84
- #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
85
- TypeName(const TypeName&); \
86
- void operator=(const TypeName&)
87
- #endif
88
-
89
- #if !1
90
- // Windows does not have an iovec type, yet the concept is universally useful.
91
- // It is simple to define it ourselves, so we put it inside our own namespace.
92
- struct iovec {
93
- void* iov_base;
94
- size_t iov_len;
95
- };
96
- #endif
97
-
98
- } // namespace snappy
99
-
100
- #endif // THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_