libcmo21/LibCmo/VTUtils.cpp

31 lines
754 B
C++
Raw Normal View History

2023-02-25 22:58:28 +08:00
#include "VTUtils.hpp"
namespace LibCmo {
2023-08-23 16:04:58 +08:00
2023-08-25 21:57:22 +08:00
void LibPanic(int line, const char* file, const char* errmsg) {
fprintf(stderr, "LIBCMO PANIC:%s (%s:L%d)\n",
errmsg ? errmsg : "", file, line);
std::abort();
}
2023-08-28 21:21:40 +08:00
//namespace StreamHelper {
2023-02-25 22:58:28 +08:00
2023-08-28 21:21:40 +08:00
// static constexpr const size_t CHUNK_SIZE = 10240;
// void CopyStream(const void* src, FILE* dest, size_t len) {
// fwrite(src, sizeof(char), len, dest);
// }
// void CopyStream(FILE* src, void* dest, size_t len) {
// size_t expected_size = 0u;
// char* p = reinterpret_cast<char*>(dest);
2023-02-25 22:58:28 +08:00
2023-08-28 21:21:40 +08:00
// while (len != 0) {
// expected_size = len < CHUNK_SIZE ? len : CHUNK_SIZE;
// fread(p, sizeof(char), expected_size, src);
// p += expected_size;
// len -= expected_size;
// }
// }
2023-02-25 22:58:28 +08:00
2023-08-28 21:21:40 +08:00
//}
2023-02-25 22:58:28 +08:00
}