mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 06:55:50 +00:00
Make includes relative, change namespace, support unity build
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "util/arena.h"
|
||||
#include "arena.h"
|
||||
#include <assert.h>
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
static const int kBlockSize = 4096;
|
||||
|
||||
@@ -65,4 +65,4 @@ char* Arena::AllocateNewBlock(size_t block_bytes) {
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#ifndef STORAGE_LEVELDB_UTIL_ARENA_H_
|
||||
#define STORAGE_LEVELDB_UTIL_ARENA_H_
|
||||
#ifndef STORAGE_HYPERLEVELDB_UTIL_ARENA_H_
|
||||
#define STORAGE_HYPERLEVELDB_UTIL_ARENA_H_
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
class Arena {
|
||||
public:
|
||||
@@ -63,6 +63,6 @@ inline char* Arena::Allocate(size_t bytes) {
|
||||
return AllocateFallback(bytes);
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
#endif // STORAGE_LEVELDB_UTIL_ARENA_H_
|
||||
#endif // STORAGE_HYPERLEVELDB_UTIL_ARENA_H_
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "util/arena.h"
|
||||
#include "arena.h"
|
||||
|
||||
#include "util/random.h"
|
||||
#include "util/testharness.h"
|
||||
#include "random.h"
|
||||
#include "testharness.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
class ArenaTest { };
|
||||
|
||||
@@ -61,7 +61,7 @@ TEST(ArenaTest, Simple) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return leveldb::test::RunAllTests();
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "hyperleveldb/filter_policy.h"
|
||||
#include "../hyperleveldb/filter_policy.h"
|
||||
|
||||
#include "hyperleveldb/slice.h"
|
||||
#include "util/hash.h"
|
||||
#include "../hyperleveldb/slice.h"
|
||||
#include "hash.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
namespace {
|
||||
static uint32_t BloomHash(const Slice& key) {
|
||||
@@ -92,4 +92,4 @@ const FilterPolicy* NewBloomFilterPolicy(int bits_per_key) {
|
||||
return new BloomFilterPolicy(bits_per_key);
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "hyperleveldb/filter_policy.h"
|
||||
#include "../hyperleveldb/filter_policy.h"
|
||||
|
||||
#include "util/coding.h"
|
||||
#include "util/logging.h"
|
||||
#include "util/testharness.h"
|
||||
#include "util/testutil.h"
|
||||
#include "coding.h"
|
||||
#include "logging.h"
|
||||
#include "testharness.h"
|
||||
#include "testutil.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
static const int kVerbose = 1;
|
||||
|
||||
@@ -153,7 +153,7 @@ TEST(BloomTest, VaryingLengths) {
|
||||
|
||||
// Different bits-per-byte
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return leveldb::test::RunAllTests();
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "hyperleveldb/cache.h"
|
||||
#include "port/port.h"
|
||||
#include "util/hash.h"
|
||||
#include "util/mutexlock.h"
|
||||
#include "../hyperleveldb/cache.h"
|
||||
#include "../port/port.h"
|
||||
#include "hash.h"
|
||||
#include "mutexlock.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
Cache::~Cache() {
|
||||
}
|
||||
@@ -322,4 +322,4 @@ Cache* NewLRUCache(size_t capacity) {
|
||||
return new ShardedLRUCache(capacity);
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "hyperleveldb/cache.h"
|
||||
#include "../hyperleveldb/cache.h"
|
||||
|
||||
#include <vector>
|
||||
#include "util/coding.h"
|
||||
#include "util/testharness.h"
|
||||
#include "coding.h"
|
||||
#include "testharness.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
// Conversions between numeric keys/values and the types expected by Cache.
|
||||
static std::string EncodeKey(int k) {
|
||||
@@ -179,7 +179,7 @@ TEST(CacheTest, NewId) {
|
||||
ASSERT_NE(a, b);
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return leveldb::test::RunAllTests();
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "util/coding.h"
|
||||
#include "coding.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
void EncodeFixed32(char* buf, uint32_t value) {
|
||||
if (port::kLittleEndian) {
|
||||
@@ -191,4 +191,4 @@ bool GetLengthPrefixedSlice(Slice* input, Slice* result) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
// * In addition we support variable length "varint" encoding
|
||||
// * Strings are encoded prefixed by their length in varint format
|
||||
|
||||
#ifndef STORAGE_LEVELDB_UTIL_CODING_H_
|
||||
#define STORAGE_LEVELDB_UTIL_CODING_H_
|
||||
#ifndef STORAGE_HYPERLEVELDB_UTIL_CODING_H_
|
||||
#define STORAGE_HYPERLEVELDB_UTIL_CODING_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include "hyperleveldb/slice.h"
|
||||
#include "port/port.h"
|
||||
#include "../hyperleveldb/slice.h"
|
||||
#include "../port/port.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
// Standard Put... routines append to a string
|
||||
extern void PutFixed32(std::string* dst, uint32_t value);
|
||||
@@ -99,6 +99,6 @@ inline const char* GetVarint32Ptr(const char* p,
|
||||
return GetVarint32PtrFallback(p, limit, value);
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
#endif // STORAGE_LEVELDB_UTIL_CODING_H_
|
||||
#endif // STORAGE_HYPERLEVELDB_UTIL_CODING_H_
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "util/coding.h"
|
||||
#include "coding.h"
|
||||
|
||||
#include "util/testharness.h"
|
||||
#include "testharness.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
class Coding { };
|
||||
|
||||
@@ -189,7 +189,7 @@ TEST(Coding, Strings) {
|
||||
ASSERT_EQ("", input.ToString());
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return leveldb::test::RunAllTests();
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <stdint.h>
|
||||
#include "hyperleveldb/comparator.h"
|
||||
#include "hyperleveldb/slice.h"
|
||||
#include "port/port.h"
|
||||
#include "util/logging.h"
|
||||
#include "../hyperleveldb/comparator.h"
|
||||
#include "../hyperleveldb/slice.h"
|
||||
#include "../port/port.h"
|
||||
#include "logging.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
Comparator::~Comparator() { }
|
||||
|
||||
@@ -66,7 +66,7 @@ class BytewiseComparatorImpl : public Comparator {
|
||||
};
|
||||
} // namespace
|
||||
|
||||
static port::OnceType once = LEVELDB_ONCE_INIT;
|
||||
static port::OnceType onceComparator = LEVELDB_ONCE_INIT;
|
||||
static const Comparator* bytewise;
|
||||
|
||||
static void InitModule() {
|
||||
@@ -74,8 +74,8 @@ static void InitModule() {
|
||||
}
|
||||
|
||||
const Comparator* BytewiseComparator() {
|
||||
port::InitOnce(&once, InitModule);
|
||||
port::InitOnce(&onceComparator, InitModule);
|
||||
return bytewise;
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
// A portable implementation of crc32c, optimized to handle
|
||||
// four bytes at a time.
|
||||
|
||||
#include "util/crc32c.h"
|
||||
#include "crc32c.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include "util/coding.h"
|
||||
#include "coding.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
namespace crc32c {
|
||||
|
||||
static const uint32_t table0_[256] = {
|
||||
@@ -329,4 +329,4 @@ uint32_t Extend(uint32_t crc, const char* buf, size_t size) {
|
||||
}
|
||||
|
||||
} // namespace crc32c
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#ifndef STORAGE_LEVELDB_UTIL_CRC32C_H_
|
||||
#define STORAGE_LEVELDB_UTIL_CRC32C_H_
|
||||
#ifndef STORAGE_HYPERLEVELDB_UTIL_CRC32C_H_
|
||||
#define STORAGE_HYPERLEVELDB_UTIL_CRC32C_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
namespace crc32c {
|
||||
|
||||
// Return the crc32c of concat(A, data[0,n-1]) where init_crc is the
|
||||
@@ -40,6 +40,6 @@ inline uint32_t Unmask(uint32_t masked_crc) {
|
||||
}
|
||||
|
||||
} // namespace crc32c
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
#endif // STORAGE_LEVELDB_UTIL_CRC32C_H_
|
||||
#endif // STORAGE_HYPERLEVELDB_UTIL_CRC32C_H_
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "util/crc32c.h"
|
||||
#include "util/testharness.h"
|
||||
#include "crc32c.h"
|
||||
#include "testharness.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
namespace crc32c {
|
||||
|
||||
class CRC { };
|
||||
@@ -65,7 +65,7 @@ TEST(CRC, Mask) {
|
||||
}
|
||||
|
||||
} // namespace crc32c
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return leveldb::test::RunAllTests();
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "hyperleveldb/env.h"
|
||||
#include "../hyperleveldb/env.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
Env::~Env() {
|
||||
}
|
||||
@@ -93,4 +93,4 @@ Status ReadFileToString(Env* env, const std::string& fname, std::string* data) {
|
||||
EnvWrapper::~EnvWrapper() {
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
#if defined(LEVELDB_PLATFORM_ANDROID)
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#include "hyperleveldb/env.h"
|
||||
#include "hyperleveldb/slice.h"
|
||||
#include "port/port.h"
|
||||
#include "util/logging.h"
|
||||
#include "util/mutexlock.h"
|
||||
#include "util/posix_logger.h"
|
||||
#include "../hyperleveldb/env.h"
|
||||
#include "../hyperleveldb/slice.h"
|
||||
#include "../port/port.h"
|
||||
#include "logging.h"
|
||||
#include "mutexlock.h"
|
||||
#include "posix_logger.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -686,13 +686,13 @@ void PosixEnv::StartThread(void (*function)(void* arg), void* arg) {
|
||||
|
||||
} // namespace
|
||||
|
||||
static pthread_once_t once = PTHREAD_ONCE_INIT;
|
||||
static pthread_once_t oncePosix = PTHREAD_ONCE_INIT;
|
||||
static Env* default_env;
|
||||
static void InitDefaultEnv() { default_env = new PosixEnv; }
|
||||
|
||||
Env* Env::Default() {
|
||||
pthread_once(&once, InitDefaultEnv);
|
||||
pthread_once(&oncePosix, InitDefaultEnv);
|
||||
return default_env;
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "hyperleveldb/env.h"
|
||||
#include "../hyperleveldb/env.h"
|
||||
|
||||
#include "port/port.h"
|
||||
#include "util/testharness.h"
|
||||
#include "../port/port.h"
|
||||
#include "testharness.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
static const int kDelayMicros = 100000;
|
||||
|
||||
@@ -97,7 +97,7 @@ TEST(EnvPosixTest, StartThread) {
|
||||
ASSERT_EQ(state.val, 3);
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return leveldb::test::RunAllTests();
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "hyperleveldb/filter_policy.h"
|
||||
#include "../hyperleveldb/filter_policy.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
FilterPolicy::~FilterPolicy() { }
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include <string.h>
|
||||
#include "util/coding.h"
|
||||
#include "util/hash.h"
|
||||
#include "coding.h"
|
||||
#include "hash.h"
|
||||
|
||||
// The FALLTHROUGH_INTENDED macro can be used to annotate implicit fall-through
|
||||
// between switch labels. The real definition should be provided externally.
|
||||
@@ -13,7 +13,7 @@
|
||||
#define FALLTHROUGH_INTENDED do { } while (0)
|
||||
#endif
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
uint32_t Hash(const char* data, size_t n, uint32_t seed) {
|
||||
// Similar to murmur hash
|
||||
@@ -49,4 +49,4 @@ uint32_t Hash(const char* data, size_t n, uint32_t seed) {
|
||||
}
|
||||
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
//
|
||||
// Simple hash function used for internal data structures
|
||||
|
||||
#ifndef STORAGE_LEVELDB_UTIL_HASH_H_
|
||||
#define STORAGE_LEVELDB_UTIL_HASH_H_
|
||||
#ifndef STORAGE_HYPERLEVELDB_UTIL_HASH_H_
|
||||
#define STORAGE_HYPERLEVELDB_UTIL_HASH_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
extern uint32_t Hash(const char* data, size_t n, uint32_t seed);
|
||||
|
||||
}
|
||||
|
||||
#endif // STORAGE_LEVELDB_UTIL_HASH_H_
|
||||
#endif // STORAGE_HYPERLEVELDB_UTIL_HASH_H_
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include "port/port.h"
|
||||
#include "util/histogram.h"
|
||||
#include "../port/port.h"
|
||||
#include "histogram.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
const double Histogram::kBucketLimit[kNumBuckets] = {
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 25, 30, 35, 40, 45,
|
||||
@@ -136,4 +136,4 @@ std::string Histogram::ToString() const {
|
||||
return r;
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#ifndef STORAGE_LEVELDB_UTIL_HISTOGRAM_H_
|
||||
#define STORAGE_LEVELDB_UTIL_HISTOGRAM_H_
|
||||
#ifndef STORAGE_HYPERLEVELDB_UTIL_HISTOGRAM_H_
|
||||
#define STORAGE_HYPERLEVELDB_UTIL_HISTOGRAM_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
class Histogram {
|
||||
public:
|
||||
@@ -37,6 +37,6 @@ class Histogram {
|
||||
double StandardDeviation() const;
|
||||
};
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
#endif // STORAGE_LEVELDB_UTIL_HISTOGRAM_H_
|
||||
#endif // STORAGE_HYPERLEVELDB_UTIL_HISTOGRAM_H_
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "hyperleveldb/env.h"
|
||||
#include "hyperleveldb/slice.h"
|
||||
#include "../hyperleveldb/env.h"
|
||||
#include "../hyperleveldb/slice.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
void AppendNumberTo(std::string* str, uint64_t num) {
|
||||
char buf[30];
|
||||
@@ -78,4 +78,4 @@ bool ConsumeDecimalNumber(Slice* in, uint64_t* val) {
|
||||
return (digits > 0);
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
// Must not be included from any .h files to avoid polluting the namespace
|
||||
// with macros.
|
||||
|
||||
#ifndef STORAGE_LEVELDB_UTIL_LOGGING_H_
|
||||
#define STORAGE_LEVELDB_UTIL_LOGGING_H_
|
||||
#ifndef STORAGE_HYPERLEVELDB_UTIL_LOGGING_H_
|
||||
#define STORAGE_HYPERLEVELDB_UTIL_LOGGING_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include "port/port.h"
|
||||
#include "../port/port.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
class Slice;
|
||||
class WritableFile;
|
||||
@@ -42,6 +42,6 @@ extern bool ConsumeChar(Slice* in, char c);
|
||||
// unspecified state.
|
||||
extern bool ConsumeDecimalNumber(Slice* in, uint64_t* val);
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
#endif // STORAGE_LEVELDB_UTIL_LOGGING_H_
|
||||
#endif // STORAGE_HYPERLEVELDB_UTIL_LOGGING_H_
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#ifndef STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_
|
||||
#define STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_
|
||||
#ifndef STORAGE_HYPERLEVELDB_UTIL_MUTEXLOCK_H_
|
||||
#define STORAGE_HYPERLEVELDB_UTIL_MUTEXLOCK_H_
|
||||
|
||||
#include "port/port.h"
|
||||
#include "port/thread_annotations.h"
|
||||
#include "../port/port.h"
|
||||
#include "../port/thread_annotations.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
// Helper class that locks a mutex on construction and unlocks the mutex when
|
||||
// the destructor of the MutexLock object is invoked.
|
||||
@@ -35,7 +35,7 @@ class SCOPED_LOCKABLE MutexLock {
|
||||
void operator=(const MutexLock&);
|
||||
};
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
|
||||
#endif // STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_
|
||||
#endif // STORAGE_HYPERLEVELDB_UTIL_MUTEXLOCK_H_
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "hyperleveldb/options.h"
|
||||
#include "../hyperleveldb/options.h"
|
||||
|
||||
#include "hyperleveldb/comparator.h"
|
||||
#include "hyperleveldb/env.h"
|
||||
#include "../hyperleveldb/comparator.h"
|
||||
#include "../hyperleveldb/env.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
Options::Options()
|
||||
: comparator(BytewiseComparator()),
|
||||
@@ -26,4 +26,4 @@ Options::Options()
|
||||
}
|
||||
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
// Logger implementation that can be shared by all environments
|
||||
// where enough posix functionality is available.
|
||||
|
||||
#ifndef STORAGE_LEVELDB_UTIL_POSIX_LOGGER_H_
|
||||
#define STORAGE_LEVELDB_UTIL_POSIX_LOGGER_H_
|
||||
#ifndef STORAGE_HYPERLEVELDB_UTIL_POSIX_LOGGER_H_
|
||||
#define STORAGE_HYPERLEVELDB_UTIL_POSIX_LOGGER_H_
|
||||
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include "hyperleveldb/env.h"
|
||||
#include "../hyperleveldb/env.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
class PosixLogger : public Logger {
|
||||
private:
|
||||
@@ -93,6 +93,6 @@ class PosixLogger : public Logger {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
#endif // STORAGE_LEVELDB_UTIL_POSIX_LOGGER_H_
|
||||
#endif // STORAGE_HYPERLEVELDB_UTIL_POSIX_LOGGER_H_
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#ifndef STORAGE_LEVELDB_UTIL_RANDOM_H_
|
||||
#define STORAGE_LEVELDB_UTIL_RANDOM_H_
|
||||
#ifndef STORAGE_HYPERLEVELDB_UTIL_RANDOM_H_
|
||||
#define STORAGE_HYPERLEVELDB_UTIL_RANDOM_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
// A very simple random number generator. Not especially good at
|
||||
// generating truly random bits, but good enough for our needs in this
|
||||
@@ -54,6 +54,6 @@ class Random {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
#endif // STORAGE_LEVELDB_UTIL_RANDOM_H_
|
||||
#endif // STORAGE_HYPERLEVELDB_UTIL_RANDOM_H_
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include <stdio.h>
|
||||
#include "port/port.h"
|
||||
#include "hyperleveldb/status.h"
|
||||
#include "../port/port.h"
|
||||
#include "../hyperleveldb/status.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
|
||||
const char* Status::CopyState(const char* state) {
|
||||
uint32_t size;
|
||||
@@ -72,4 +72,4 @@ std::string Status::ToString() const {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "util/testharness.h"
|
||||
#include "testharness.h"
|
||||
|
||||
#include <string>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
namespace test {
|
||||
|
||||
namespace {
|
||||
@@ -74,4 +74,4 @@ int RandomSeed() {
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#ifndef STORAGE_LEVELDB_UTIL_TESTHARNESS_H_
|
||||
#define STORAGE_LEVELDB_UTIL_TESTHARNESS_H_
|
||||
#ifndef STORAGE_HYPERLEVELDB_UTIL_TESTHARNESS_H_
|
||||
#define STORAGE_HYPERLEVELDB_UTIL_TESTHARNESS_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sstream>
|
||||
#include "hyperleveldb/env.h"
|
||||
#include "hyperleveldb/slice.h"
|
||||
#include "util/random.h"
|
||||
#include "../hyperleveldb/env.h"
|
||||
#include "../hyperleveldb/slice.h"
|
||||
#include "random.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
namespace test {
|
||||
|
||||
// Run some of the tests registered by the TEST() macro. If the
|
||||
@@ -133,6 +133,6 @@ extern bool RegisterTest(const char* base, const char* name, void (*func)());
|
||||
|
||||
|
||||
} // namespace test
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
#endif // STORAGE_LEVELDB_UTIL_TESTHARNESS_H_
|
||||
#endif // STORAGE_HYPERLEVELDB_UTIL_TESTHARNESS_H_
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "util/testutil.h"
|
||||
#include "testutil.h"
|
||||
|
||||
#include "util/random.h"
|
||||
#include "random.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
namespace test {
|
||||
|
||||
Slice RandomString(Random* rnd, int len, std::string* dst) {
|
||||
@@ -48,4 +48,4 @@ extern Slice CompressibleString(Random* rnd, double compressed_fraction,
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#ifndef STORAGE_LEVELDB_UTIL_TESTUTIL_H_
|
||||
#define STORAGE_LEVELDB_UTIL_TESTUTIL_H_
|
||||
#ifndef STORAGE_HYPERLEVELDB_UTIL_TESTUTIL_H_
|
||||
#define STORAGE_HYPERLEVELDB_UTIL_TESTUTIL_H_
|
||||
|
||||
#include "hyperleveldb/env.h"
|
||||
#include "hyperleveldb/slice.h"
|
||||
#include "util/random.h"
|
||||
#include "../hyperleveldb/env.h"
|
||||
#include "../hyperleveldb/slice.h"
|
||||
#include "random.h"
|
||||
|
||||
namespace leveldb {
|
||||
namespace hyperleveldb {
|
||||
namespace test {
|
||||
|
||||
// Store in *dst a random string of length "len" and return a Slice that
|
||||
@@ -48,6 +48,6 @@ class ErrorEnv : public EnvWrapper {
|
||||
};
|
||||
|
||||
} // namespace test
|
||||
} // namespace leveldb
|
||||
} // namespace hyperleveldb
|
||||
|
||||
#endif // STORAGE_LEVELDB_UTIL_TESTUTIL_H_
|
||||
#endif // STORAGE_HYPERLEVELDB_UTIL_TESTUTIL_H_
|
||||
|
||||
Reference in New Issue
Block a user