-
Notifications
You must be signed in to change notification settings - Fork 2
/
input.h
58 lines (48 loc) · 960 Bytes
/
input.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
#pragma once
/*
quIRC - simple terminal-based IRC client
Copyright (C) 2010-13 Edward Cree
See quirc.c for license information
input: handle input routines
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include <sys/time.h>
typedef struct
{
char *data;
size_t l;
size_t i;
}
ichar;
typedef struct
{
ichar left;
ichar right;
}
iline;
typedef struct
{
int nlines;
int ptr;
int scroll;
bool filled;
char **line;
}
ibuffer;
#include "names.h"
extern bool ttab;
void inputchar(iline *inp, int *state);
char * slash_dequote(char *inp);
int cmd_handle(char *inp, char **qmsg, fd_set *master, int *fdmax);
void initibuf(ibuffer *i);
void addtoibuf(ibuffer *i, char *data);
void freeibuf(ibuffer *i);
char back_ichar(ichar *buf); // returns the deleted char
char front_ichar(ichar *buf); // returns the deleted char
void ifree(iline *buf);
void i_home(iline *inp);
void i_end(iline *inp);