Archived
1
Fork 0
This repository has been archived on 2024-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
kilo/include/kilo.h

49 lines
717 B
C
Raw Normal View History

2023-08-31 04:19:35 +00:00
#ifndef KILO_H
#define KILO_H
#include <stdbool.h>
#include <stdint.h>
#include <termios.h>
#include <time.h>
2023-08-31 05:48:27 +00:00
// Stuff I couldn' figure out where else to put
typedef int ERRCODE;
2023-08-31 04:19:35 +00:00
struct editor_state {
char *filename;
int cx, cy;
int rx;
int screenrows, screencols;
int row_off, col_off;
bool running;
struct EROW *rows;
int n_rows;
char message[256];
time_t message_time;
struct termios orig_termios;
};
extern struct editor_state E;
enum KEYS {
TAB = 9,
HOME = 0x100,
DEL,
PG_UP,
PG_DOWN,
END,
ARROW_UP,
ARROW_DOWN,
ARROW_LEFT,
ARROW_RIGHT,
NOP
};
2023-08-31 05:48:27 +00:00
typedef uint16_t KEY;
2023-08-31 04:19:35 +00:00
2023-08-31 05:48:27 +00:00
void die(const char *context);
2023-08-31 04:19:35 +00:00
#endif // KILO_H