Checkpoint file split.

This commit is contained in:
2025-11-28 02:27:19 -08:00
parent 4db6077738
commit a0d760c7d2
11 changed files with 960 additions and 775 deletions

17
core.h
View File

@@ -1,11 +1,13 @@
#ifndef KE_CORE_H
#define KE_CORE_H
#define calloc1(sz) calloc(1, sz)
#include <stddef.h>
#define calloc1(sz) calloc(1, sz)
#define INITIAL_CAPACITY 8
typedef enum key_press {
TAB_KEY = 9,
ESC_KEY = 27,
@@ -21,14 +23,19 @@ typedef enum key_press {
PG_DN = 1008,
} key_press;
#ifndef strnstr
char *strnstr(const char *s, const char *find, size_t slen);
#define INCLUDE_STRNSTR
#endif
void kwrite(int fd, const char *buf, int len);
void die(const char *s);
char nibble_to_hex(char c);
void swap_int(int *first, int *second);
int next_power_of_2(int n);
int cap_growth(int cap, int sz);
size_t kstrnlen(const char *buf, size_t max);
void kwrite(int fd, const char *buf, int len);
void die(const char *s);
#endif