-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwag.h
55 lines (32 loc) · 1.09 KB
/
wag.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
#include <stdint.h>
//file containing function prototypes and data structures
#define EVENT_SIZE (sizeof(struct inotify_event))
#define EVENT_BUF_LEN (1024 * ( EVENT_SIZE + 16 ))
#define NUM_FORMAT_OPTIONS 3
#define LOG_BUFFER_SIZE 10000
#define NUM_INIT_LINES 100
#define MOD(x, y) (x % y < 0 ? x % y + y : x % y)
struct circbuffer {
char buffer[LOG_BUFFER_SIZE]; /*Actual buffer of buffer size*/
uint32_t readPos; /*read index of buffer*/
uint32_t writePos; /*write index of buffer*/
uint32_t size;
};
struct circbuffer logBuffer;
int main(int argc, char * argv[]);
int swapFilename(int fd, int wd, char * oldFilename, char * newFilename);
void onboarding(void);
void intHandler(int nil);
void winchHandler(int nil);
void refillMain(void);
void fullWinRefresh(void);
void gracefulExit(void);
void drawMainWindow(void);
void toggleSearchWindow(void);
void drawSearchWindow(void);
void search(void);
int searchFile(char * fileName, char * search);
bool updateLogBufferC(char c);
bool updateLogBuffer(char * string);
void print_last_lines(FILE * fd, int n);
void track(void);