diff options
author | vvvv <vvvv@ydb.tech> | 2023-07-31 20:07:26 +0300 |
---|---|---|
committer | vvvv <vvvv@ydb.tech> | 2023-07-31 20:07:26 +0300 |
commit | f9e4743508b7930e884714cc99985ac45f84ed98 (patch) | |
tree | a1290261a4915a6f607e110e2cc27aee4c205f85 /library/cpp/microbdb/microbdb.h | |
parent | 5cf9beeab3ea847da0b6c414fcb5faa9cb041317 (diff) | |
download | ydb-f9e4743508b7930e884714cc99985ac45f84ed98.tar.gz |
Use UDFs from YDB
Diffstat (limited to 'library/cpp/microbdb/microbdb.h')
-rw-r--r-- | library/cpp/microbdb/microbdb.h | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/library/cpp/microbdb/microbdb.h b/library/cpp/microbdb/microbdb.h deleted file mode 100644 index 75218873374..00000000000 --- a/library/cpp/microbdb/microbdb.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -#include <util/folder/dirut.h> - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable : 4706) /*assignment within conditional expression*/ -#pragma warning(disable : 4267) /*conversion from 'size_t' to 'type', possible loss of data*/ -#endif - -#include "align.h" -#include "extinfo.h" -#include "header.h" -#include "reader.h" -#include "heap.h" -#include "file.h" -#include "sorter.h" -#include "input.h" -#include "output.h" -#include "sorterdef.h" - -inline int MakeSorterTempl(char path[/*FILENAME_MAX*/], const char* prefix) { - int ret = MakeTempDir(path, prefix); - if (!ret && strlcat(path, "%06d", FILENAME_MAX) > FILENAME_MAX - 100) - ret = EINVAL; - if (ret) - path[0] = 0; - return ret; -} - -inline int GetMeta(TFile& file, TDatMetaPage* meta) { - ui8 buf[METASIZE], *ptr = buf; - ssize_t size = sizeof(buf), ret; - while (size && (ret = file.Read(ptr, size)) > 0) { - size -= ret; - ptr += ret; - } - if (size) - return MBDB_BAD_FILE_SIZE; - ptr = buf; // gcc 4.4 warning fix - *meta = *(TDatMetaPage*)ptr; - return (meta->MetaSig == METASIG) ? 0 : MBDB_BAD_METAPAGE; -} - -template <class TRec> -inline bool IsDatFile(const char* fname) { - TDatMetaPage meta; - TFile f(fname, RdOnly); - return !GetMeta(f, &meta) && meta.RecordSig == TRec::RecordSig; -} - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif |