7 * Options from the command line, to pass to each function that need some
20 * Line coming from stdin, wrapped in a header.
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 */
29 struct Line
*prev
; /* doubly linked list structure */
34 * Group of lines from stdin delimited by a header line.
36 * The header lines are identified by a leading 'HEADER' character,
37 * specified on command line. Each header contains a doubly linked list of
40 typedef struct Header
{
41 int count
; /* number of candidates in this header */
43 char *title
; /* displayed in bold for each header */
45 struct Header
*prev
; /* doubly linked list structure */
48 Line
*first
; /* first line within the header */
52 * Buffer containing a doubly linked list of headers
54 typedef struct Buffer
{
55 int total
; /* total number of line in buffer */
56 int matching
; /* number lines matching the input */
58 char input
[LINE_SIZE
]; /* string from user's keyboard */
59 char *prompt
; /* specified from the command line */
61 Header
*current_h
; /* header containing the selected line */
63 Line
*empty
; /* empty line, for when needed */
64 Line
*current
; /* selected line, highlighted */
65 Line
*first
; /* boundaries of the linked list */