1
0

initial commit

This commit is contained in:
2025-05-27 11:36:06 +03:00
commit 4ba42acfea
14 changed files with 1584 additions and 0 deletions

43
overlay-common.hh Normal file
View File

@@ -0,0 +1,43 @@
/* SPDX-License-Identifier: Apache-2.0
* (c) 2025, Konstantin Demin
*/
#ifndef INCLUDE_OVERLAY_COMMON_HH
#define INCLUDE_OVERLAY_COMMON_HH 1
#include <vector>
extern "C" {
#include <dirent.h>
}
constexpr unsigned int ovl_name_max = sizeof(dirent::d_name);
constexpr unsigned int ovl_path_max = (PATH_MAX);
/*
constexpr unsigned int ovl_path_max =
#ifdef PATH_MAX
#if (PATH_MAX > 0) && (PATH_MAX <= 8192)
(PATH_MAX);
#else
8192;
#endif
#else
4096;
#endif
*/
constexpr unsigned int ovl_path_name_ratio = ovl_path_max / ovl_name_max;
constexpr unsigned int ovl_depth_max = ovl_path_name_ratio - 1;
struct ovl_name_t {
size_t len;
char str[ovl_name_max];
};
struct ovl_path_t {
size_t len;
char str[ovl_path_max];
};
typedef std::vector<ovl_path_t> ovl_path_vec;
#endif /* INCLUDE_OVERLAY_COMMON_HH */