4 * Line coming from stdin, wrapped in a header.
7 char *content
; /* sent as output and matched by input */
8 char *comment
; /* displayed at the right of the content */
10 int *number
; /* set here as there is no line reordering */
12 struct Line
*prev
; /* doubly linked list structure */
17 * Group of lines from stdin delimited by a header line.
19 * The header lines are identified by a leading 'HEADER' character,
20 * specified on command line. Each header contains a doubly linked list of
23 typedef struct Header
{
24 int count
; /* number of candidates in this header */
26 char *title
; /* displayed in bold for each header */
28 struct Header
*prev
; /* doubly linked list structure */
31 Line
*first
; /* first line within the header */
35 * Buffer containing a doubly linked list of headers
37 typedef struct Buffer
{
38 int total
; /* total number of candidates */
39 int count
; /* total number of filtered candidates */
41 char *input
; /* string from user's keyboard */
42 char *prompt
; /* specified from the command line */
44 Header
*current_h
; /* header containing the selected line */
45 Line
*current
; /* selected line, highlighted */
46 Line
*first
; /* doubly linked list of lines */
51 Buffer
* fill_buffer(char *);
53 Line
* parse_line(char *, char *);
55 Line
* add_line(Buffer
*, int, char *, char *, Line
*);
59 Line
* * filter_lines();
61 void print_line(Line
*);