summaryrefslogtreecommitdiff
path: root/7ed.h
blob: 0fdc737dbdfc39df688d92809635926d600ee2f2 (plain)
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
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>

#define BUF_SZ_256 256
#define BUF_SZ_512 512
#define BUF_SZ_1 1024
#define BUF_SZ_2 2048
#define BUF_SZ_4 4096
#define BUF_SZ_8 8192

#define TRUE_7ED 0
#define FALSE_7ED 1

#define FILE_EXISTS 0
#define FILE_NOT_FOUND 1

#define MODE_YES 0
#define MODE_NO 1
#define MODE_NORMAL 2

int count_lines_in_file(char filename[], uint64_t *lines);

int count_lines_in_file_posix(char filename[], size_t *lines);

void confirm();

int choice();

void shuffle(char arr[], int n);

int startmode(char filename[]);

int get_line(char *filename, long focus, char **line, size_t *start);

int editmode(char filename[], uint64_t focus);

int new_line(char filename[], long long new_line_pos_temp);

int remove_line_contents(char filename[], uint64_t focus);

int delete_specified_newline(char filename[], long focus);

int remove_line_contents_and_newline(char *filename, uint64_t focus);