-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
74 lines (64 loc) · 1.46 KB
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef __HEADER_MAIN_H__
#define __HEADER_MAIN_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#include <signal.h>
#include <ncurses.h>
#include "mystring.h"
#include "parsers.h"
#include "commands.h"
#include "utils.h"
extern String buf;
extern String inpbuf;
extern String outbuf;
extern String clip;
extern String pipebuf;
#define SCR_HEIGHT 55
#define SCR_WIDTH 203
#define TABSIZE 4
#define KEY_ESC 27
#define MODE_COLOR 1
#define FILENAME_COLOR 2
#define LINENO_COLOR 3
#define ERROR_COLOR 4
#define BRACE_COLOR 5
#define SQBRACE_COLOR 6
#define CRBRACE_COLOR 7
#define SELECTION_COLOR 8
#define MAX_CMD_LEN 1024
#define MAX_FILENAME 1024
typedef enum
{
NORMAL = 0,
INSERT = 1,
VISUAL = 2
} Mode;
void print_msg(char *msg);
void clearline(int num);
int saveas_file(char *rtpath);
void save_file(void);
char get_prompt(char *msg);
void close_file(void);
void init_new_buf(String *buf);
void open_file(char *path);
void print_msg(char *msg);
void print_mode_filename(void);
void print_line_numbers(void);
void print_buffer(String *buf);
void draw_window(void);
void command_mode(char start_char);
int input_loop(void);
void sigint_handler(int signum);
void cursor_calc_lpos(void);
void remove_selection(void);
void copy_selection(void);
void refresh_buffer_vars(String *buf);
void create_backup_buf(void);
void undo_buf(void);
void graphical_find(char *pat);
#endif // __HEADER_MAIN_H__