diff --git a/nostrdb/Makefile b/nostrdb/Makefile index f7328e96..ba4b1db5 100644 --- a/nostrdb/Makefile +++ b/nostrdb/Makefile @@ -1,8 +1,8 @@ CFLAGS = -Wall -Wno-misleading-indentation -Wno-unused-function -Werror -O2 -g -Ideps/secp256k1/include -Ideps/lmdb -Ideps/flatcc/include -HEADERS = sha256.h nostrdb.h cursor.h hex.h jsmn.h config.h sha256.h random.h memchr.h cpu.h $(C_BINDINGS) +HEADERS = src/sha256.h src/nostrdb.h src/cursor.h src/hex.h src/jsmn.h src/config.h src/sha256.h src/random.h src/memchr.h src/cpu.h $(C_BINDINGS) FLATCC_SRCS=deps/flatcc/src/runtime/json_parser.c deps/flatcc/src/runtime/verifier.c deps/flatcc/src/runtime/builder.c deps/flatcc/src/runtime/emitter.c deps/flatcc/src/runtime/refmap.c -BOLT11_SRCS = bolt11/bolt11.c bolt11/bech32.c bolt11/tal.c bolt11/talstr.c bolt11/take.c bolt11/list.c bolt11/utf8.c bolt11/amount.c bolt11/hash_u5.c -SRCS = nostrdb.c sha256.c $(BOLT11_SRCS) $(FLATCC_SRCS) +BOLT11_SRCS = src/bolt11/bolt11.c src/bolt11/bech32.c src/bolt11/tal.c src/bolt11/talstr.c src/bolt11/take.c src/bolt11/list.c src/bolt11/utf8.c src/bolt11/amount.c src/bolt11/hash_u5.c +SRCS = src/nostrdb.c src/sha256.c $(BOLT11_SRCS) $(FLATCC_SRCS) LDS = $(OBJS) $(ARS) OBJS = $(SRCS:.c=.o) DEPS = $(OBJS) $(HEADERS) $(ARS) @@ -11,11 +11,11 @@ LMDB_VER=0.9.31 FLATCC_VER=05dc16dc2b0316e61063bb1fc75426647badce48 PREFIX ?= /usr/local SUBMODULES = deps/secp256k1 -C_BINDINGS_PROFILE=bindings/c/profile_builder.h bindings/c/profile_reader.h bindings/c/profile_verifier.h bindings/c/profile_json_parser.h -C_BINDINGS_META=bindings/c/meta_builder.h bindings/c/meta_reader.h bindings/c/meta_verifier.h bindings/c/meta_json_parser.h -C_BINDINGS_COMMON=bindings/c/flatbuffers_common_builder.h bindings/c/flatbuffers_common_reader.h +BINDINGS=src/bindings +C_BINDINGS_PROFILE=$(BINDINGS)/c/profile_builder.h $(BINDINGS)/c/profile_reader.h $(BINDINGS)/c/profile_verifier.h $(BINDINGS)/c/profile_json_parser.h +C_BINDINGS_META=$(BINDINGS)/c/meta_builder.h $(BINDINGS)/c/meta_reader.h $(BINDINGS)/c/meta_verifier.h $(BINDINGS)/c/meta_json_parser.h +C_BINDINGS_COMMON=$(BINDINGS)/c/flatbuffers_common_builder.h $(BINDINGS)/c/flatbuffers_common_reader.h C_BINDINGS=$(C_BINDINGS_COMMON) $(C_BINDINGS_PROFILE) $(C_BINDINGS_META) -BINDINGS=bindings BIN=ndb CHECKDATA=testdata/db/v0/data.mdb @@ -25,7 +25,7 @@ all: lib ndb lib: benches test ndb: ndb.c $(DEPS) - $(CC) $(CFLAGS) ndb.c $(LDS) -o $@ + $(CC) -Isrc $(CFLAGS) ndb.c $(LDS) -o $@ bindings: bindings-swift bindings-rust bindings-c @@ -53,42 +53,42 @@ config.h: configurator bindings-c: $(C_BINDINGS) -bindings/%/.dir: +src/bindings/%/.dir: mkdir -p $(shell dirname $@) touch $@ -bindings/c/%_builder.h: schemas/%.fbs bindings/c/.dir - flatcc --builder $< -o bindings/c +src/bindings/c/%_builder.h: schemas/%.fbs $(BINDINGS)/c/.dir + flatcc --builder $< -o $(BINDINGS)/c -bindings/c/%_verifier.h bindings/c/%_reader.h: schemas/%.fbs bindings/c/.dir - flatcc --verifier -o bindings/c $< +src/bindings/c/%_verifier.h bindings/c/%_reader.h: schemas/%.fbs $(BINDINGS)/c/.dir + flatcc --verifier -o $(BINDINGS)/c $< -bindings/c/flatbuffers_common_reader.h: bindings/c/.dir - flatcc --common_reader -o bindings/c +src/bindings/c/flatbuffers_common_reader.h: $(BINDINGS)/c/.dir + flatcc --common_reader -o $(BINDINGS)/c -bindings/c/flatbuffers_common_builder.h: bindings/c/.dir - flatcc --common_builder -o bindings/c +src/bindings/c/flatbuffers_common_builder.h: $(BINDINGS)/c/.dir + flatcc --common_builder -o $(BINDINGS)/c -bindings/c/%_json_parser.h: schemas/%.fbs bindings/c/.dir - flatcc --json-parser $< -o bindings/c +src/bindings/c/%_json_parser.h: schemas/%.fbs $(BINDINGS)/c/.dir + flatcc --json-parser $< -o $(BINDINGS)/c -bindings-rust: bindings/rust/ndb_profile.rs bindings/rust/ndb_meta.rs +bindings-rust: $(BINDINGS)/rust/ndb_profile.rs $(BINDINGS)/rust/ndb_meta.rs -bindings/rust/ndb_profile.rs: schemas/profile.fbs bindings/rust +$(BINDINGS)/rust/ndb_profile.rs: schemas/profile.fbs $(BINDINGS)/rust flatc --gen-json-emit --rust $< @mv profile_generated.rs $@ -bindings/rust/ndb_meta.rs: schemas/meta.fbs bindings/swift +$(BINDINGS)/rust/ndb_meta.rs: schemas/meta.fbs $(BINDINGS)/swift flatc --rust $< @mv meta_generated.rs $@ -bindings-swift: bindings/swift/NdbProfile.swift bindings/swift/NdbMeta.swift +bindings-swift: $(BINDINGS)/swift/NdbProfile.swift $(BINDINGS)/swift/NdbMeta.swift -bindings/swift/NdbProfile.swift: schemas/profile.fbs bindings/swift +$(BINDINGS)/swift/NdbProfile.swift: schemas/profile.fbs $(BINDINGS)/swift flatc --gen-json-emit --swift $< @mv profile_generated.swift $@ -bindings/swift/NdbMeta.swift: schemas/meta.fbs bindings/swift +$(BINDINGS)/swift/NdbMeta.swift: schemas/meta.fbs $(BINDINGS)/swift flatc --swift $< @mv meta_generated.swift $@ @@ -135,9 +135,6 @@ deps/secp256k1/config.log: deps/secp256k1/configure deps/lmdb/liblmdb.a: deps/lmdb/lmdb.h $(MAKE) -C deps/lmdb liblmdb.a -bench: bench.c $(DEPS) - $(CC) $(CFLAGS) bench.c $(LDS) -o $@ - testdata/db/ndb-v0.tar.zst: curl https://cdn.jb55.com/s/ndb-v0.tar.zst -o $@ @@ -155,14 +152,14 @@ testdata/many-events.json.zst: testdata/many-events.json: testdata/many-events.json.zst zstd -d $< -bench-ingest-many: bench-ingest-many.c $(DEPS) testdata/many-events.json - $(CC) $(CFLAGS) $< $(LDS) -o $@ +bench: bench-ingest-many.c $(DEPS) testdata/many-events.json + $(CC) -Isrc $(CFLAGS) $< $(LDS) -o $@ testdata/db/.dir: @mkdir -p testdata/db touch testdata/db/.dir test: test.c $(DEPS) testdata/db/.dir - $(CC) $(CFLAGS) test.c $(LDS) -o $@ + $(CC) -Isrc $(CFLAGS) test.c $(LDS) -o $@ .PHONY: tags clean diff --git a/nostrdb/bench.c b/nostrdb/bench.c deleted file mode 100644 index 6dbef99f..00000000 --- a/nostrdb/bench.c +++ /dev/null @@ -1,51 +0,0 @@ - -#include "io.h" -#include "nostrdb.h" -#include -#include -#include - -static int bench_parser(int times, const char *json, int len) -{ - static unsigned char buf[2<<18]; - - struct timespec t1, t2; - int i; - long nanos, ms; - struct ndb_note *note; - - clock_gettime(CLOCK_MONOTONIC, &t1); - for (i = 0; i < times; i++) { - if (!ndb_note_from_json(json, len, ¬e, buf, sizeof(buf))) { - return 0; - } - } - clock_gettime(CLOCK_MONOTONIC, &t2); - - nanos = (t2.tv_sec - t1.tv_sec) * (long)1e9 + (t2.tv_nsec - t1.tv_nsec); - ms = nanos / 1e6; - printf("ns/run\t%ld\nms/run\t%f\nns\t%ld\nms\t%ld\n", - nanos/times, (double)ms/(double)times, nanos, ms); - - return 1; -} - -int main(int argc, char *argv[], char **env) -{ - static const int alloc_size = 2 << 18; - int times = 10000, len = 0; - unsigned char buf[alloc_size]; - - if (!read_file("testdata/contacts.json", buf, alloc_size, &len)) - return 1; - - if (argc >= 2) - times = atoi(argv[1]); - - fprintf(stderr, "benching parser %d times\n", times); - if (!bench_parser(times, (const char*)&buf[0], len)) - return 2; - - return 0; -} - diff --git a/nostrdb/bolt11/libnostrdb.a b/nostrdb/bolt11/libnostrdb.a deleted file mode 100644 index 32e2bc1c..00000000 Binary files a/nostrdb/bolt11/libnostrdb.a and /dev/null differ diff --git a/nostrdb/bindings/c/.dir b/nostrdb/src/bindings/c/.dir similarity index 100% rename from nostrdb/bindings/c/.dir rename to nostrdb/src/bindings/c/.dir diff --git a/nostrdb/bindings/c/flatbuffers_common_builder.h b/nostrdb/src/bindings/c/flatbuffers_common_builder.h similarity index 100% rename from nostrdb/bindings/c/flatbuffers_common_builder.h rename to nostrdb/src/bindings/c/flatbuffers_common_builder.h diff --git a/nostrdb/bindings/c/flatbuffers_common_reader.h b/nostrdb/src/bindings/c/flatbuffers_common_reader.h similarity index 100% rename from nostrdb/bindings/c/flatbuffers_common_reader.h rename to nostrdb/src/bindings/c/flatbuffers_common_reader.h diff --git a/nostrdb/bindings/c/meta_builder.h b/nostrdb/src/bindings/c/meta_builder.h similarity index 100% rename from nostrdb/bindings/c/meta_builder.h rename to nostrdb/src/bindings/c/meta_builder.h diff --git a/nostrdb/bindings/c/meta_json_parser.h b/nostrdb/src/bindings/c/meta_json_parser.h similarity index 100% rename from nostrdb/bindings/c/meta_json_parser.h rename to nostrdb/src/bindings/c/meta_json_parser.h diff --git a/nostrdb/bindings/c/meta_reader.h b/nostrdb/src/bindings/c/meta_reader.h similarity index 100% rename from nostrdb/bindings/c/meta_reader.h rename to nostrdb/src/bindings/c/meta_reader.h diff --git a/nostrdb/bindings/c/meta_verifier.h b/nostrdb/src/bindings/c/meta_verifier.h similarity index 100% rename from nostrdb/bindings/c/meta_verifier.h rename to nostrdb/src/bindings/c/meta_verifier.h diff --git a/nostrdb/bindings/c/profile_builder.h b/nostrdb/src/bindings/c/profile_builder.h similarity index 100% rename from nostrdb/bindings/c/profile_builder.h rename to nostrdb/src/bindings/c/profile_builder.h diff --git a/nostrdb/bindings/c/profile_json_parser.h b/nostrdb/src/bindings/c/profile_json_parser.h similarity index 100% rename from nostrdb/bindings/c/profile_json_parser.h rename to nostrdb/src/bindings/c/profile_json_parser.h diff --git a/nostrdb/bindings/c/profile_reader.h b/nostrdb/src/bindings/c/profile_reader.h similarity index 100% rename from nostrdb/bindings/c/profile_reader.h rename to nostrdb/src/bindings/c/profile_reader.h diff --git a/nostrdb/bindings/c/profile_verifier.h b/nostrdb/src/bindings/c/profile_verifier.h similarity index 100% rename from nostrdb/bindings/c/profile_verifier.h rename to nostrdb/src/bindings/c/profile_verifier.h diff --git a/nostrdb/bindings/rust/.dir b/nostrdb/src/bindings/rust/.dir similarity index 100% rename from nostrdb/bindings/rust/.dir rename to nostrdb/src/bindings/rust/.dir diff --git a/nostrdb/bindings/rust/ndb_meta.rs b/nostrdb/src/bindings/rust/ndb_meta.rs similarity index 100% rename from nostrdb/bindings/rust/ndb_meta.rs rename to nostrdb/src/bindings/rust/ndb_meta.rs diff --git a/nostrdb/bindings/rust/ndb_profile.rs b/nostrdb/src/bindings/rust/ndb_profile.rs similarity index 100% rename from nostrdb/bindings/rust/ndb_profile.rs rename to nostrdb/src/bindings/rust/ndb_profile.rs diff --git a/nostrdb/bindings/swift/NdbMeta.swift b/nostrdb/src/bindings/swift/NdbMeta.swift similarity index 100% rename from nostrdb/bindings/swift/NdbMeta.swift rename to nostrdb/src/bindings/swift/NdbMeta.swift diff --git a/nostrdb/bindings/swift/NdbProfile.swift b/nostrdb/src/bindings/swift/NdbProfile.swift similarity index 100% rename from nostrdb/bindings/swift/NdbProfile.swift rename to nostrdb/src/bindings/swift/NdbProfile.swift diff --git a/nostrdb/bolt11/alignof.h b/nostrdb/src/bolt11/alignof.h similarity index 100% rename from nostrdb/bolt11/alignof.h rename to nostrdb/src/bolt11/alignof.h diff --git a/nostrdb/bolt11/amount.c b/nostrdb/src/bolt11/amount.c similarity index 100% rename from nostrdb/bolt11/amount.c rename to nostrdb/src/bolt11/amount.c diff --git a/nostrdb/bolt11/amount.h b/nostrdb/src/bolt11/amount.h similarity index 100% rename from nostrdb/bolt11/amount.h rename to nostrdb/src/bolt11/amount.h diff --git a/nostrdb/bolt11/array_size.h b/nostrdb/src/bolt11/array_size.h similarity index 100% rename from nostrdb/bolt11/array_size.h rename to nostrdb/src/bolt11/array_size.h diff --git a/nostrdb/bolt11/bech32.c b/nostrdb/src/bolt11/bech32.c similarity index 100% rename from nostrdb/bolt11/bech32.c rename to nostrdb/src/bolt11/bech32.c diff --git a/nostrdb/bolt11/bech32.h b/nostrdb/src/bolt11/bech32.h similarity index 100% rename from nostrdb/bolt11/bech32.h rename to nostrdb/src/bolt11/bech32.h diff --git a/nostrdb/bolt11/bech32_util.c b/nostrdb/src/bolt11/bech32_util.c similarity index 100% rename from nostrdb/bolt11/bech32_util.c rename to nostrdb/src/bolt11/bech32_util.c diff --git a/nostrdb/bolt11/bech32_util.h b/nostrdb/src/bolt11/bech32_util.h similarity index 100% rename from nostrdb/bolt11/bech32_util.h rename to nostrdb/src/bolt11/bech32_util.h diff --git a/nostrdb/bolt11/bolt11.c b/nostrdb/src/bolt11/bolt11.c similarity index 100% rename from nostrdb/bolt11/bolt11.c rename to nostrdb/src/bolt11/bolt11.c diff --git a/nostrdb/bolt11/bolt11.h b/nostrdb/src/bolt11/bolt11.h similarity index 100% rename from nostrdb/bolt11/bolt11.h rename to nostrdb/src/bolt11/bolt11.h diff --git a/nostrdb/bolt11/build_assert.h b/nostrdb/src/bolt11/build_assert.h similarity index 100% rename from nostrdb/bolt11/build_assert.h rename to nostrdb/src/bolt11/build_assert.h diff --git a/nostrdb/bolt11/check_type.h b/nostrdb/src/bolt11/check_type.h similarity index 100% rename from nostrdb/bolt11/check_type.h rename to nostrdb/src/bolt11/check_type.h diff --git a/nostrdb/bolt11/container_of.h b/nostrdb/src/bolt11/container_of.h similarity index 100% rename from nostrdb/bolt11/container_of.h rename to nostrdb/src/bolt11/container_of.h diff --git a/nostrdb/bolt11/cppmagic.h b/nostrdb/src/bolt11/cppmagic.h similarity index 100% rename from nostrdb/bolt11/cppmagic.h rename to nostrdb/src/bolt11/cppmagic.h diff --git a/nostrdb/bolt11/debug.h b/nostrdb/src/bolt11/debug.h similarity index 100% rename from nostrdb/bolt11/debug.h rename to nostrdb/src/bolt11/debug.h diff --git a/nostrdb/bolt11/error.c b/nostrdb/src/bolt11/error.c similarity index 100% rename from nostrdb/bolt11/error.c rename to nostrdb/src/bolt11/error.c diff --git a/nostrdb/bolt11/error.h b/nostrdb/src/bolt11/error.h similarity index 100% rename from nostrdb/bolt11/error.h rename to nostrdb/src/bolt11/error.h diff --git a/nostrdb/bolt11/hash_u5.c b/nostrdb/src/bolt11/hash_u5.c similarity index 100% rename from nostrdb/bolt11/hash_u5.c rename to nostrdb/src/bolt11/hash_u5.c diff --git a/nostrdb/bolt11/hash_u5.h b/nostrdb/src/bolt11/hash_u5.h similarity index 100% rename from nostrdb/bolt11/hash_u5.h rename to nostrdb/src/bolt11/hash_u5.h diff --git a/nostrdb/bolt11/likely.h b/nostrdb/src/bolt11/likely.h similarity index 100% rename from nostrdb/bolt11/likely.h rename to nostrdb/src/bolt11/likely.h diff --git a/nostrdb/bolt11/list.c b/nostrdb/src/bolt11/list.c similarity index 100% rename from nostrdb/bolt11/list.c rename to nostrdb/src/bolt11/list.c diff --git a/nostrdb/bolt11/list.h b/nostrdb/src/bolt11/list.h similarity index 100% rename from nostrdb/bolt11/list.h rename to nostrdb/src/bolt11/list.h diff --git a/nostrdb/bolt11/mem.c b/nostrdb/src/bolt11/mem.c similarity index 100% rename from nostrdb/bolt11/mem.c rename to nostrdb/src/bolt11/mem.c diff --git a/nostrdb/bolt11/mem.h b/nostrdb/src/bolt11/mem.h similarity index 100% rename from nostrdb/bolt11/mem.h rename to nostrdb/src/bolt11/mem.h diff --git a/nostrdb/bolt11/node_id.c b/nostrdb/src/bolt11/node_id.c similarity index 100% rename from nostrdb/bolt11/node_id.c rename to nostrdb/src/bolt11/node_id.c diff --git a/nostrdb/bolt11/node_id.h b/nostrdb/src/bolt11/node_id.h similarity index 100% rename from nostrdb/bolt11/node_id.h rename to nostrdb/src/bolt11/node_id.h diff --git a/nostrdb/bolt11/overflows.h b/nostrdb/src/bolt11/overflows.h similarity index 100% rename from nostrdb/bolt11/overflows.h rename to nostrdb/src/bolt11/overflows.h diff --git a/nostrdb/bolt11/short_types.h b/nostrdb/src/bolt11/short_types.h similarity index 100% rename from nostrdb/bolt11/short_types.h rename to nostrdb/src/bolt11/short_types.h diff --git a/nostrdb/bolt11/str.h b/nostrdb/src/bolt11/str.h similarity index 100% rename from nostrdb/bolt11/str.h rename to nostrdb/src/bolt11/str.h diff --git a/nostrdb/bolt11/str_debug.h b/nostrdb/src/bolt11/str_debug.h similarity index 100% rename from nostrdb/bolt11/str_debug.h rename to nostrdb/src/bolt11/str_debug.h diff --git a/nostrdb/bolt11/structeq.h b/nostrdb/src/bolt11/structeq.h similarity index 100% rename from nostrdb/bolt11/structeq.h rename to nostrdb/src/bolt11/structeq.h diff --git a/nostrdb/bolt11/take.c b/nostrdb/src/bolt11/take.c similarity index 100% rename from nostrdb/bolt11/take.c rename to nostrdb/src/bolt11/take.c diff --git a/nostrdb/bolt11/take.h b/nostrdb/src/bolt11/take.h similarity index 100% rename from nostrdb/bolt11/take.h rename to nostrdb/src/bolt11/take.h diff --git a/nostrdb/bolt11/tal.c b/nostrdb/src/bolt11/tal.c similarity index 100% rename from nostrdb/bolt11/tal.c rename to nostrdb/src/bolt11/tal.c diff --git a/nostrdb/bolt11/tal.h b/nostrdb/src/bolt11/tal.h similarity index 100% rename from nostrdb/bolt11/tal.h rename to nostrdb/src/bolt11/tal.h diff --git a/nostrdb/bolt11/talstr.c b/nostrdb/src/bolt11/talstr.c similarity index 100% rename from nostrdb/bolt11/talstr.c rename to nostrdb/src/bolt11/talstr.c diff --git a/nostrdb/bolt11/talstr.h b/nostrdb/src/bolt11/talstr.h similarity index 100% rename from nostrdb/bolt11/talstr.h rename to nostrdb/src/bolt11/talstr.h diff --git a/nostrdb/bolt11/typesafe_cb.h b/nostrdb/src/bolt11/typesafe_cb.h similarity index 100% rename from nostrdb/bolt11/typesafe_cb.h rename to nostrdb/src/bolt11/typesafe_cb.h diff --git a/nostrdb/bolt11/utf8.c b/nostrdb/src/bolt11/utf8.c similarity index 100% rename from nostrdb/bolt11/utf8.c rename to nostrdb/src/bolt11/utf8.c diff --git a/nostrdb/bolt11/utf8.h b/nostrdb/src/bolt11/utf8.h similarity index 100% rename from nostrdb/bolt11/utf8.h rename to nostrdb/src/bolt11/utf8.h diff --git a/nostrdb/compiler.h b/nostrdb/src/compiler.h similarity index 98% rename from nostrdb/compiler.h rename to nostrdb/src/compiler.h index a9b5aa70..36d141e4 100644 --- a/nostrdb/compiler.h +++ b/nostrdb/src/compiler.h @@ -3,6 +3,12 @@ #define CCAN_COMPILER_H #include "config.h" +#if HAVE_UNALIGNED_ACCESS +#define alignment_ok(p, n) 1 +#else +#define alignment_ok(p, n) ((size_t)(p) % (n) == 0) +#endif + #ifndef COLD #if HAVE_ATTRIBUTE_COLD /** diff --git a/nostrdb/config.h b/nostrdb/src/config.h similarity index 100% rename from nostrdb/config.h rename to nostrdb/src/config.h diff --git a/nostrdb/configurator.c b/nostrdb/src/configurator.c similarity index 100% rename from nostrdb/configurator.c rename to nostrdb/src/configurator.c diff --git a/nostrdb/cpu.h b/nostrdb/src/cpu.h similarity index 100% rename from nostrdb/cpu.h rename to nostrdb/src/cpu.h diff --git a/nostrdb/cursor.h b/nostrdb/src/cursor.h similarity index 100% rename from nostrdb/cursor.h rename to nostrdb/src/cursor.h diff --git a/nostrdb/endian.h b/nostrdb/src/endian.h similarity index 100% rename from nostrdb/endian.h rename to nostrdb/src/endian.h diff --git a/nostrdb/hex.h b/nostrdb/src/hex.h similarity index 100% rename from nostrdb/hex.h rename to nostrdb/src/hex.h diff --git a/nostrdb/io.h b/nostrdb/src/io.h similarity index 100% rename from nostrdb/io.h rename to nostrdb/src/io.h diff --git a/nostrdb/jsmn.h b/nostrdb/src/jsmn.h similarity index 100% rename from nostrdb/jsmn.h rename to nostrdb/src/jsmn.h diff --git a/nostrdb/lmdb_util.h b/nostrdb/src/lmdb_util.h similarity index 100% rename from nostrdb/lmdb_util.h rename to nostrdb/src/lmdb_util.h diff --git a/nostrdb/memchr.h b/nostrdb/src/memchr.h similarity index 100% rename from nostrdb/memchr.h rename to nostrdb/src/memchr.h diff --git a/nostrdb/nostr_bech32.c b/nostrdb/src/nostr_bech32.c similarity index 100% rename from nostrdb/nostr_bech32.c rename to nostrdb/src/nostr_bech32.c diff --git a/nostrdb/nostr_bech32.h b/nostrdb/src/nostr_bech32.h similarity index 100% rename from nostrdb/nostr_bech32.h rename to nostrdb/src/nostr_bech32.h diff --git a/nostrdb/nostrdb.c b/nostrdb/src/nostrdb.c similarity index 100% rename from nostrdb/nostrdb.c rename to nostrdb/src/nostrdb.c diff --git a/nostrdb/nostrdb.h b/nostrdb/src/nostrdb.h similarity index 100% rename from nostrdb/nostrdb.h rename to nostrdb/src/nostrdb.h diff --git a/nostrdb/print_util.h b/nostrdb/src/print_util.h similarity index 100% rename from nostrdb/print_util.h rename to nostrdb/src/print_util.h diff --git a/nostrdb/protected_queue.h b/nostrdb/src/protected_queue.h similarity index 100% rename from nostrdb/protected_queue.h rename to nostrdb/src/protected_queue.h diff --git a/nostrdb/random.h b/nostrdb/src/random.h similarity index 100% rename from nostrdb/random.h rename to nostrdb/src/random.h diff --git a/nostrdb/sha256.c b/nostrdb/src/sha256.c similarity index 100% rename from nostrdb/sha256.c rename to nostrdb/src/sha256.c diff --git a/nostrdb/sha256.h b/nostrdb/src/sha256.h similarity index 100% rename from nostrdb/sha256.h rename to nostrdb/src/sha256.h diff --git a/nostrdb/threadpool.h b/nostrdb/src/threadpool.h similarity index 100% rename from nostrdb/threadpool.h rename to nostrdb/src/threadpool.h diff --git a/nostrdb/typedefs.h b/nostrdb/src/typedefs.h similarity index 100% rename from nostrdb/typedefs.h rename to nostrdb/src/typedefs.h diff --git a/nostrdb/util.h b/nostrdb/src/util.h similarity index 100% rename from nostrdb/util.h rename to nostrdb/src/util.h