C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
menu.c File Reference

Command line start-up for C-Menu components. More...

#include <common.h>
#include <string.h>
Include dependency graph for menu.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Detailed Description

Command line start-up for C-Menu components.

Author
Bill Waller Copyright (c) 2025 MIT License billx.nosp@m.wall.nosp@m.er@gm.nosp@m.ail..nosp@m.com
Date
2026-02-09

Definition in file menu.c.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 43 of file menu.c.

43 {
44 int rc;
45 char pgm_name[MAXLEN];
47 init = new_init(argc, argv);
48 SIO *sio = init->sio;
49 mapp_initialization(init, argc, argv);
50 rc = atexit(end_pgm);
51 if (rc != 0) {
52 fprintf(stderr, "\nCannot set exit function\n");
53 exit(EXIT_FAILURE);
54 }
59 base_name(pgm_name, argv[0]);
60 if (!strcmp(pgm_name, "menu")) {
61 new_menu(init, init->argc, init->argv, LINES / 14, COLS / 14);
62 menu = init->menu;
64 } else if (!strcmp(pgm_name, "form")) {
65 init_form(init, init->argc, init->argv, LINES / 14, COLS / 14);
66 } else if (!strcmp(pgm_name, "pick")) {
67 init_pick(init, init->argc, init->argv, 0, 0);
68 } else if (!strcmp(pgm_name, "view")) {
70 if (init->lines > 0 || init->cols > 0) {
71 if (!init_view_boxwin(init, init->title)) {
73 }
74 } else if (!init_view_full_screen(init)) {
76 }
77 } else if (!strcmp(pgm_name, "ckeys"))
79 // end_pgm();
80}
Init * init
Definition init.c:74
Menu * menu
Definition mem.c:45
View * view
Definition mem.c:48
int popup_ckeys()
Display Curses Keys Responds to curses keys and mouse events, displaying the key code and description...
Definition curskeys.c:23
#define MAXLEN
Definition curskeys.c:15
SIO * sio
Definition dwin.c:80
bool open_curses(SIO *)
Initialize NCurses and color settings.
Definition dwin.c:192
void win_init_attrs()
Initialize window attributes.
Definition dwin.c:176
int init_form(Init *, int, char **, int, int)
Initialize form data structure and parse description file.
Definition form_engine.c:60
bool base_name(char *, char *)
Returns the base name of a file specification.
Definition futil.c:984
void mapp_initialization(Init *, int, char **)
Main initialization function for MAPP - Menu Application.
Definition init.c:328
int init_view_full_screen(Init *)
Initialize C-Menu View in full screen mode.
Definition init_view.c:45
int init_view_boxwin(Init *, char *)
Initialize the C-Menu View in box window mode.
Definition init_view.c:172
Init * new_init(int, char **)
Create and initialize Init structure.
Definition mem.c:70
Menu * new_menu(Init *, int, char **, int, int)
Create and initialize Menu structure.
Definition mem.c:148
View * new_view(Init *)
Create and initialize View structure.
Definition mem.c:313
unsigned int menu_engine(Init *)
The main loop of the menu system.
Definition menu_engine.c:38
int init_pick(Init *, int, char **, int, int)
Initializes pick structure and opens pick input file or pipe.
Definition pick_engine.c:60
bool capture_shell_tioctl()
capture_shell_tioctl() - capture shell terminal settings
Definition scriou.c:43
bool capture_curses_tioctl()
capture_curses_tioctl() - capture curses terminal settings
Definition scriou.c:68
void sig_prog_mode()
Set up signal handlers for interrupt signals.
Definition sig.c:62
int view_file(Init *)
Start view.
The SIO structure encapsulates various aspects of the terminal's state and configuration,...
Definition cm.h:696

References Init::argc, Init::argv, base_name(), capture_curses_tioctl(), capture_shell_tioctl(), Init::cols, init, init_form(), init_pick(), init_view_boxwin(), init_view_full_screen(), Init::lines, mapp_initialization(), Init::menu, menu, menu_engine(), new_init(), new_menu(), new_view(), open_curses(), popup_ckeys(), sig_prog_mode(), Init::sio, Init::title, view, view_file(), and win_init_attrs().

Here is the call graph for this function: