#include <curses.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "misc.h"
#include "main.h"
#include "listparse.h"
#include "tty.h"
Defines | |
#define | MIN(a, b) ((a) < (b)) ? (a) : (b) |
Functions | |
void | curses_init () |
void | curses_display () |
int | curses_getch () |
void | p_dir (struct parse_list *head) |
void | curses_end () |
void | fatalerror (char *msg) |
void | e_prompt (char *msg, char *input, int becho) |
char | c_prompt (char *msg) |
void | set_line (int set) |
int | get_line () |
int | inc_line () |
int | dec_line () |
void | error (char *msg) |
void | status (char *msg) |
void | header (char *msg) |
Variables | |
char | l_header [81] |
char | l_error [81] |
char | l_status [81] |
int | hi_line = 0 |
#define MIN | ( | a, | |||
b | ) | ((a) < (b)) ? (a) : (b) |
Finds the minimum of two numbers.
char c_prompt | ( | char * | msg | ) |
Prompts the user with a message, but only waits for one character.
msg | The message to prompt. |
void curses_display | ( | ) |
Display the window.
void curses_end | ( | ) |
Destroy the curses window.
int curses_getch | ( | ) |
Wrapper function for outside usage.
void curses_init | ( | ) |
Simple curses initialization.
int dec_line | ( | ) |
See inc_line().
void e_prompt | ( | char * | msg, | |
char * | input, | |||
int | becho | |||
) |
Prompts the user with a message, and waits for newline. Then it returns the input without the trailing newline.
msg | The prompt message. | |
input | Used to store the user's input. | |
becho | Is the input echoed or not? |
void error | ( | char * | msg | ) |
A non-fatal error; simply output msg to the error line and update the display.
msg | Our new error message. |
void fatalerror | ( | char * | msg | ) |
A "fatal" error; exit the program and print msg.
msg | The msg to print. |
int get_line | ( | ) |
void header | ( | char * | msg | ) |
Output a message to the header line and update display.
msg | Our new header message. |
int inc_line | ( | ) |
Increments the line counter.
/return 0 normally, 1 if out of bounds.
void p_dir | ( | struct parse_list * | head | ) |
Prints the directory listing starting from the head.
head | The beginning of the directory listing. |
void set_line | ( | int | set | ) |
Sets the highlighted line to set.
set | Which line? |
void status | ( | char * | msg | ) |
Output a message to the status line and update display.
msg | Our new status message. |
int hi_line = 0 |
Which line shall we highlight?
char l_error[81] |
The error line.
char l_header[81] |
The header.
char l_status[81] |
The status line.