Fixing iomenu not resetting the terminal on cancel
[iomenu.git] / main.h
blob59c87a4be94e2c5f48f345c4cd30117ae40eb622
1 #include "config.h"
3 #ifndef MAIN_H
4 #define MAIN_H
6 /*
7 * Options from the command line, to pass to each function that need some
8 */
9 typedef struct Opt {
10 int line_numbers;
11 int complete;
12 int print_numbers;
13 char validate_key;
14 char *separator;
15 int lines;
16 char *prompt;
17 } Opt;
20 * Line coming from stdin, wrapped in a header.
22 typedef struct Line {
23 char *content; /* sent as output and matched by input */
24 char *comment; /* displayed at the right of the content */
26 int number; /* set here as order will not change */
27 int matches; /* whether it matches buffer's input */
28 int header; /* whether the line is a header */
30 struct Line *prev; /* doubly linked list structure */
31 struct Line *next;
32 } Line;
35 * Group of lines from stdin delimited by a header line.
37 * The header lines are identified by a leading 'HEADER' character,
38 * specified on command line. Each header contains a doubly linked list of
39 * lines.
43 * Buffer containing a doubly linked list of headers
45 typedef struct Buffer {
46 int total; /* total number of line in buffer */
47 int matching; /* number lines matching the input */
49 char input[LINE_SIZE]; /* string from user's keyboard */
50 char *prompt; /* specified from the command line */
52 Line *empty; /* empty line, for when needed */
53 Line *current; /* selected line, highlighted */
54 Line *first; /* boundaries of the linked list */
55 Line *last;
56 } Buffer;
58 #endif