pmt: initial 2.9.1 update

This commit is contained in:
2024-10-02 21:37:57 +03:00
parent 82bd2939cd
commit 7259d451c4
459 changed files with 86355 additions and 2404 deletions

View File

@@ -16,8 +16,7 @@
* limitations under the License.
*/
#ifndef __PMT_DEPRECATES_H
#define __PMT_DEPRECATES_H
#pragma once
#define deprecated_opt 1
#define changed_opt 2
@@ -40,7 +39,8 @@
#define v260 "2.6.0"
#define v270 "2.7.0"
#define v280 "2.8.0"
#define vUNK NULL
#define v290 "2.9.0"
#define vUNK nullptr
struct pmt_deprecates {
int depr_type;
@@ -57,15 +57,16 @@ static struct pmt_deprecates depr_table[] = {
{deprecated_opt, 'r', not_changed, "format", not_changed_long, v210},
{deprecated_opt, 'L', not_changed, "license", not_changed_long, v250},
{changed_opt, 'D', 'p', "list", not_changed_long, v210},
{changed_opt, 'c', 'P', "context", "search-path", v290},
{end_depr_pointer, not_changed, not_changed, not_changed_long, not_changed_long, vUNK}
};
static void
__deprecated_opt_handle(int opt, const string opt_long, const char* depr_msg)
__process_deprecated_opts(int opt, const string& opt_long, const char* depr_msg)
{
static string long_e_msg;
if (opt_long == "")
if (opt_long.empty())
long_e_msg = PartitionManager::Display::UsingDispString->not_changed_opt;
else
long_e_msg = opt_long;
@@ -91,12 +92,10 @@ __deprecated_opt_handle(int opt, const string opt_long, const char* depr_msg)
}
}
}
}
#define DEPR_HANDLE(x, y, z) __deprecated_opt_handle(x, y, z)
#endif /* __PMT_DEPRECATES_H */
#define DEPR_HANDLE(x, y, z) \
__process_deprecated_opts(x, y, z)
/* end of code */

View File

@@ -0,0 +1,25 @@
/* By YZBruh */
/*
* Copyright 2024 Partition Manager
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
extern "C" {
int mke2fs_main(int argc, char* argv[]);
}
/* end of code */

View File

@@ -16,8 +16,7 @@
* limitations under the License.
*/
#ifndef __PMT_HELP_MSGS_H
#define __PMT_HELP_MSGS_H
#pragma once
namespace PartitionManager {
namespace Functions {
@@ -25,6 +24,4 @@ namespace PartitionManager {
}
}
#endif
/* end */

View File

@@ -0,0 +1,26 @@
/* By YZBruh */
/**
* Copyright 2024 Partition Manager
*
* Licensed under the Apache License, Version 2.0 (the "License";
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#define VIEW_AS_BYTE 1
#define VIEW_AS_KIB 2
#define VIEW_AS_MIB 3
#define VIEW_AS_GIB 4
/* end of code */

View File

@@ -16,12 +16,11 @@
* limitations under the License.
*/
#if !defined(__clang__) && !defined(__NDK_BUILD)
#error "Your compiler is NOT clang. Please build with LLVM clang."
#endif
#pragma once
#ifndef __PMT_H_
#define __PMT_H_
#if !defined(__clang__) && !defined(__NDK_BUILD)
#error "Your compiler is NOT clang. Please build with (LLVM) clang."
#endif
#ifdef INC_MAIN_LIBS
#include <iostream>
@@ -30,8 +29,10 @@
#include <string>
#include <cstring>
#include <cstdarg>
#include <clocale>
#ifdef IS_MAIN
#include <clocale>
#endif
#if !defined(HELP) || !defined(VERSIONING)
#include <cstdlib>
#include <unistd.h>
@@ -52,7 +53,9 @@
#include <cerrno>
#endif
#ifdef INC_TOOLS_REQS
#include <sys/statvfs.h>
#include <sys/vfs.h>
typedef unsigned short ushort_t;
#endif
#ifdef INC_LIBGEN
#include <libgen.h>
@@ -68,16 +71,17 @@ typedef enum {
LOG_LEVEL_DEBUG
} LogLevel;
/* fast error processing without errno entry
/**
* Fast error processing without errno entry
* but errno can be given in the entrance
*/
char* strqerror(int errno_macro = errno);
extern "C" char* strqerror(int errno_macro = errno);
/* create a special namespace */
namespace PartitionManager {
namespace Strings {
extern string OutputName;
extern string CustomContext;
extern string CustomSearchPath;
extern string TargetPartition;
extern string TargetFlashFile;
extern string TargetFormatFS;
@@ -86,19 +90,24 @@ namespace PartitionManager {
extern string CurrentLanguage;
} /* namespace Strings */
namespace Integers {
extern int PartSizeViewType;
} /* namespace Integers */
namespace Booleans {
extern bool UseLogical;
extern bool UseCustomContext;
extern bool UseCustomSearchPath;
extern bool UsesSlots;
extern bool UsesLogical;
extern bool OnlyViewSize;
extern bool SilentEnabled;
extern bool FlashMode;
extern bool BackupMode;
extern bool FormatMode;
extern bool PartSizeViewMode;
extern bool ForceMode;
extern bool VerboseMode;
extern bool InstalledOnTermux;
extern bool ActivateRoot;
} /* namespace Booleans */
namespace Display {
@@ -135,6 +144,7 @@ namespace PartitionManager {
#define LOGD(fmt, ...) \
PartitionManager::Functions::DisplayLog(LOG_LEVEL_DEBUG, fmt, ##__VA_ARGS__)
/* verbose logging macros */
#define VLOGF(fmt, ...) \
PartitionManager::Functions::DisplayVerboseLog(LOG_LEVEL_FATAL, fmt, ##__VA_ARGS__)
#define VLOGE(fmt, ...) \
@@ -144,6 +154,4 @@ namespace PartitionManager {
#define VLOGD(fmt, ...) \
PartitionManager::Functions::DisplayVerboseLog(LOG_LEVEL_DEBUG, fmt, ##__VA_ARGS__)
#endif
/* end of code */

View File

@@ -16,8 +16,7 @@
* limitations under the License.
*/
#ifndef __PMT_STRINGKEYS_
#define __PMT_STRINGKEYS_
#pragma once
/* The struct is a very good option for setting the languages of texts etc. */
struct langdb_general {
@@ -38,9 +37,10 @@ struct langdb_general {
const char* _Nonnull expected_backup_arg;
const char* _Nonnull expected_flash_arg;
const char* _Nonnull expected_format_arg;
const char* _Nonnull expected_partsz_arg;
const char* _Nonnull missing_operand;
const char* _Nonnull multiple_wiewers;
const char* _Nonnull common_symbol_rule;
const char* _Nonnull symbol_rule;
const char* _Nonnull req_part_name;
const char* _Nonnull part_not_found;
const char* _Nonnull unsupported_fs;
@@ -48,16 +48,19 @@ struct langdb_general {
const char* _Nonnull ffile_more_part;
const char* _Nonnull cannot_get_bsz;
const char* _Nonnull format_fail;
const char* _Nonnull fail_get_psize;
const char* _Nonnull depr_backup_opt;
const char* _Nonnull depr_flash_opt;
const char* _Nonnull depr_format_opt;
const char* _Nonnull depr_Vlicense_opt;
const char* _Nonnull depr_ch_list_opt;
const char* _Nonnull depr_ch_sp_opt;
const char* _Nonnull not_spec_opt;
const char* _Nonnull some_spec;
const char* _Nonnull logical_warn;
const char* _Nonnull ab_warn;
const char* _Nonnull out_not_spec;
const char* _Nonnull no_found_on_process;
const char* _Nonnull please_rerun;
const char* _Nonnull part_disk_sz;
const char* _Nonnull flash_file_sz;
@@ -74,6 +77,7 @@ struct langdb_general {
const char* _Nonnull warn;
const char* _Nonnull fatal;
const char* _Nonnull is_requires_arg;
const char* _Nonnull only_partsz_args;
const char* _Nonnull unknw_arg;
const char* _Nonnull switching_lang;
const char* _Nonnull welcome;
@@ -88,9 +92,13 @@ struct langdb_general {
const char* _Nonnull compiler_str;
const char* _Nonnull version_str;
const char* _Nonnull bin_str;
const char* _Nonnull part_name;
const char* _Nonnull part_type;
const char* _Nonnull fs_str;
const char* _Nonnull unknw_str;
const char* _Nonnull by_str;
const char* _Nonnull yes;
const char* _Nonnull no;
};
/* docs etc. */
@@ -110,10 +118,15 @@ struct langdb_docs {
const char* _Nonnull docs_strs_l13;
const char* _Nonnull docs_strs_l14;
const char* _Nonnull docs_strs_l15;
const char* _Nonnull docs_strs_l16;
const char* _Nonnull docs_strs_l17;
const char* _Nonnull docs_strs_l18;
const char* _Nonnull docs_strs_l19;
const char* _Nonnull docs_strs_l20;
const char* _Nonnull docs_strs_l21;
const char* _Nonnull docs_strs_l22;
const char* _Nonnull or_str;
const char* _Nonnull usage_docstr;
};
#endif /* __PMT_STRINGKEYS_ */
/* end of code */

View File

@@ -16,18 +16,18 @@
* limitations under the License.
*/
#ifndef __PMT_VERSIONING_H
#define __PMT_VERSIONING_H
#pragma once
#ifdef __NDK_BUILD
#include <android/ndk-version.h>
#include <PartitionManager/generated/clang-version.h>
#endif
#include <e2fsprogs/version.h>
/* versioning */
#define PMT_MAJOR 2
#define PMT_MINOR 8
#define PMT_PATCHLEVEL 0
#define PMT_MINOR 9
#define PMT_PATCHLEVEL 1
namespace PartitionManager {
namespace Functions {
@@ -35,6 +35,4 @@ namespace PartitionManager {
}
}
#endif
/* end */