Rearrange project files.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include "internal/vase/vase.h"
|
||||
#include "pch.h"
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "buffer/original.h"
|
||||
#include "constants.h"
|
||||
#include "pch.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
struct Shard {
|
||||
enum struct Kind : uint8_t {
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "pch.h"
|
||||
#include "search.h"
|
||||
#include "shard.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
struct Point {
|
||||
uint64_t row;
|
||||
@@ -1,38 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
inline int read_file(const char *path, char **text, uint32_t *len) {
|
||||
FILE *f = fopen(path, "rb");
|
||||
if (!f)
|
||||
return 0;
|
||||
|
||||
fseek(f, 0, SEEK_END);
|
||||
long size = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
|
||||
if (size < 0 || size > UINT32_MAX) {
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*len = (uint32_t)size;
|
||||
|
||||
*text = (char *)malloc(*len + 1);
|
||||
if (!*text) {
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t read = fread(*text, 1, *len, f);
|
||||
fclose(f);
|
||||
|
||||
if (read != *len) {
|
||||
free(*text);
|
||||
*text = nullptr;
|
||||
*len = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user