2
3
4
5
6
7
8
14
16#define _XOPEN_SOURCE_EXTENDED 1
17#define NCURSES_WIDECHAR 1
18#include <ncursesw/ncurses.h>
30#define MAX_WIDE_LEN 1024
32#define PICK_MAX_ARG_LEN 256
33#define MAX_PICK_OBJS 1024
34#define ACCEPT_PROMPT_CHAR '_'
36#define MENU_HELP_FILE "menu.help"
37#define FORM_HELP_FILE "form.help"
38#define PICK_HELP_FILE "pick.help"
39#define VIEW_HELP_FILE "view.help"
40#define VIEW_PRT_FILE "prtout"
41#define DEFAULTEDITOR "vi"
43#define MINITRC ".minitrc"
45#define MAPP_DIR "~/menuapp"
46#define PRINTCMD "lp -c -s"
56 int main(int argc, char **argv) {
58 capture_shell_tioctl();
59 Init *init = new_init(argc, argv);
61 mapp_initialization(init);
64 capture_curses_tioctl();
67#define destroy_cmenu()
102
103
104
105
106
121
131
133
192extern Form *
new_form(Init *,
int,
char **,
int,
int);
193extern Pick *
new_pick(Init *,
int,
char **,
int,
int);
194extern Menu *
new_menu(Init *,
int,
char **,
int,
int);
195extern int popup_menu(Init *,
int,
char **,
int,
int);
196extern int popup_form(Init *,
int,
char **,
int,
int);
197extern int popup_pick(Init *,
int,
char **,
int,
int);
198extern int popup_view(Init *,
int,
char **,
int,
int,
int,
int);
212extern int init_form(Init *,
int,
char **,
int,
int);
213extern int init_pick(Init *,
int,
char **,
int,
int);
int cmd_processor(Init *)
int popup_form(Init *, int, char **, int, int)
int popup_menu(Init *, int, char **, int, int)
int popup_view(Init *, int, char **, int, int, int, int)
int parse_opt_args(Init *, int, char **)
int popup_pick(Init *, int, char **, int, int)
volatile sig_atomic_t sig_received
bool handle_signal(sig_atomic_t)
#define __atexit
This macro registers the end_pgm function to be called when the program exits.
int popup_ckeys()
Display Curses Keys Responds to curses keys and mouse events, displaying the key code and description...
int win_new(int, int, int, int, char *, int)
Create a new window with optional box and title.
WINDOW * win_del()
Delete the current window and its associated box window.
int Perror(char *)
Display a simple error message window or print to stderr.
int display_error(char *em0, char *em1, char *em2, char *em3)
Display an error message window or print to stderr.
int init_form(Init *, int, char **, int, int)
Initialize form data structure and parse description file.
size_t strnz__cpy(char *, const char *, size_t)
safer alternative to strncpy
size_t strnz__cat(char *, const char *, size_t)
safer alternative to strncat
bool derive_file_spec(char *, char *, char *)
Derive full file specification from directory and file name.
int write_config(Init *)
Write the current configuration to a file specified in init->minitrc.
void mapp_initialization(Init *, int, char **)
Main initialization function for MAPP - Menu Application.
void zero_opt_args(Init *)
Initialize optional arguments in the Init struct to default values.
int init_view_full_screen(Init *)
Initialize C-Menu View in full screen mode.
int init_view_boxwin(Init *, char *)
Initialize the C-Menu View in box window mode.
int view_init_input(View *, char *)
Initialize the input for a C-Menu View.
View * destroy_view(Init *init)
Destroy View structure.
Form * new_form(Init *, int, char **, int, int)
Create and initialize Form structure.
bool init_menu_files(Init *, int, char **)
Initialize Menu file specifications.
Init * new_init(int, char **)
Create and initialize Init structure.
Menu * new_menu(Init *, int, char **, int, int)
Create and initialize Menu structure.
Menu * destroy_menu(Init *init)
Destroy Menu structure.
Form * destroy_form(Init *init)
Destroy Form structure.
View * new_view(Init *)
Create and initialize View structure.
Pick * new_pick(Init *, int, char **, int, int)
Create and initialize Pick structure.
Init * destroy_init(Init *init)
Destroy Init structure.
Pick * destroy_pick(Init *init)
Destroy Pick structure.
unsigned int menu_engine(Init *)
The main loop of the menu system.
unsigned int parse_menu_description(Init *)
Parse menu description file and create Menu.
int init_pick(Init *, int, char **, int, int)
Initializes pick structure and opens pick input file or pipe.
int pick_engine(Init *)
Initializes pick interface, calculates window size and position, and enters picker loop.
int open_pick_win(Init *)
Initializes the pick window based on the parameters specified in the Pick structure.
int view_file(Init *)
Start view.
char receiver_cmd[MAXLEN]
char provider_cmd[MAXLEN]