This repository has been archived by the owner on Jan 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.h
46 lines (37 loc) · 1.45 KB
/
ui.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
/**
* Provide text-based user interface for task-managment system.
* @todo add menus
*/
#ifndef INTERFACE_H
#define INTERFACE_H
#include <stdio.h>
#include <conio.h>
#include <stdarg.h>
#include "task.h"
#include "utils.h"
// ---------------------------------------------------------------------------
// Module constants
#define ITEMS_PER_PAGE 8 /* items per page for display_tasks function */
#define TABLE_FORMAT "%-6.4s%-26.24s%-18.16s%-8.6s%-11.9s%-10.8s\n"
// ---------------------------------------------------------------------------
// Function prototypes
// I/O sub-functions
void display_error(const char *error_text, const char *action);
int input_integer(const char *format, ...);
int input_yes_no(const char *format, ...);
int input_task_ui(Task *task);
time_t input_date_time(time_t *t);
long int display_tasks(long int *page_number_ptr,
const char *file_name,
int as_choices);
// Menus
void main_menu(const char *user_name);
void task_menu(const char *file_name);
void subset_task_menu(const char *title,
const char *file_name,
const char *tmp_file_name,
int (*filter_func)(const char *, const char *));
void add_task_menu(const char *file_name);
void view_task_menu(long int *page_number_ptr, const char *file_name);
void remove_task_menu(long int *page_number_ptr, const char *file_name);
#endif