1
0
mirror of https://github.com/fumiama/base16384.git synced 2026-06-08 12:10:26 +08:00
* fix typo

* fix: 32bit be decoding

* chore: add Rust alternative (#18)

* Update C# Link (#20)

* 尝试修复#19

- 移除未使用的参数 int blen
- 完善文档、注释
- 完善文件名错误检测
- 修复 encbuf, decbuf 处理逻辑

* fix: disable mmap in windows

* fix: encode bufsz (#19)

* v2.2.5

* Update Swift Link (#21)

---------

Co-authored-by: 忘忧北萱草 <wybxc@qq.com>
Co-authored-by: LC <64722907+lc6464@users.noreply.github.com>
Co-authored-by: oboard <oboard@outlook.com>
This commit is contained in:
源文雨
2024-03-26 01:52:27 +09:00
committed by GitHub
parent d2e6426c58
commit 65512e2dcd
8 changed files with 82 additions and 66 deletions

View File

@@ -1,6 +1,6 @@
/* base16384.c
* This file is part of the base16384 distribution (https://github.com/fumiama/base16384).
* Copyright (c) 2022 Fumiama Minamoto.
* Copyright (c) 2022-2023 Fumiama Minamoto.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@ unsigned long get_start_ms() {
#endif
static void print_usage() {
puts("Copyright (c) 2022-2023 Fumiama Minamoto.\nBase16384 2.2.3 (May 18th 2023). Usage:");
puts("Copyright (c) 2022-2023 Fumiama Minamoto.\nBase16384 2.2.5 (August 26th 2023). Usage:");
puts("base16384 [-edt] [inputfile] [outputfile]");
puts(" -e\t\tencode");
puts(" -d\t\tdecode");
@@ -97,15 +97,18 @@ int main(int argc, char** argv) {
printf("spend time: %lums\n", get_start_ms() - t);
#endif
}
#define print_base16384_err(n) case base16384_err_##n: perror("base16384_err_"#n); break
if(exitstat) switch(exitstat) {
case base16384_err_get_file_size: perror("base16384_err_get_file_size"); break;
case base16384_err_fopen_output_file: perror("base16384_err_fopen_output_file"); break;
case base16384_err_fopen_input_file: perror("base16384_err_fopen_input_file"); break;
case base16384_err_write_file: perror("base16384_err_write_file"); break;
case base16384_err_open_input_file: perror("base16384_err_open_input_file"); break;
case base16384_err_map_input_file: perror("base16384_err_map_input_file"); break;
case base16384_err_read_file: perror("base16384_err_read_file"); break;
print_base16384_err(get_file_size);
print_base16384_err(fopen_output_file);
print_base16384_err(fopen_input_file);
print_base16384_err(write_file);
print_base16384_err(open_input_file);
print_base16384_err(map_input_file);
print_base16384_err(read_file);
print_base16384_err(invalid_file_name);
default: perror("base16384"); break;
}
#undef print_base16384_err
return exitstat;
}