|
C-Menu 0.2.9
A User Interface Toolkit
|
Capture Data from the Environment, Command Line, and Configuration File and Populate the Init and SIO Data Structures. More...
Functions | |
| void | mapp_initialization (Init *init, int argc, char **argv) |
| Main initialization function for MAPP - Menu Application. | |
| void | zero_opt_args (Init *init) |
| Initialize optional arguments in the Init struct to default values. | |
| int | parse_config (Init *init) |
| parse the configuration file specified in init->minitrc and set Init struct values accordingly | |
| int | write_config (Init *init) |
| Write the current configuration to a file specified in init->minitrc. | |
| bool | derive_file_spec (char *file_spec, char *dir, char *file_name) |
| Derive full file specification from directory and file name. | |
| void | display_version () |
| Display the version information of the application. | |
| void | opt_prt_char (const char *o, const char *name, const char *value) |
| Print an option and its value in a formatted manner. | |
| void | opt_prt_str (const char *o, const char *name, const char *value) |
| Print an option and its value in a formatted manner for integer values. | |
| void | opt_prt_int (const char *o, const char *name, int value) |
| Print an option and its value in a formatted manner for integer values. | |
| void | opt_prt_double (const char *o, const char *name, double value) |
| Print an option and its value in a formatted manner for double values. | |
| void | opt_prt_bool (const char *o, const char *name, bool value) |
| Print an option and its value in a formatted manner for boolean values. | |
| void | dump_config (Init *init, char *msg) |
| Dump the current configuration to stdout for debugging purposes. | |
Capture Data from the Environment, Command Line, and Configuration File and Populate the Init and SIO Data Structures.
SIO Struct for screen I/O settings (colors, gamma, etc.)
Init Struct for application settings (file paths, commands, flags, etc.)
| bool derive_file_spec | ( | char * | file_spec, |
| char * | dir, | ||
| char * | file_name ) |
Derive full file specification from directory and file name.
| file_spec | - output full file specification |
| dir | - directory path |
| file_name | - file name |
Definition at line 821 of file init.c.
References strnz__cat(), strnz__cpy(), and trim_path().
| void display_version | ( | ) |
| void dump_config | ( | Init * | init, |
| char * | msg ) |
Dump the current configuration to stdout for debugging purposes.
| init | - pointer to Init struct containing the current configuration |
| msg | - string to print before dumping the configuration to stdout in a readable format, prefixed by the provided title string. |
Definition at line 919 of file init.c.
References SIO::bblack, SIO::bblue, SIO::bcyan, Init::begx, Init::begy, SIO::bg_clr_x, SIO::bgreen, SIO::black, SIO::blue, SIO::blue_gamma, SIO::bmagenta, SIO::bo_clr_x, SIO::borange, Init::brackets, SIO::bred, SIO::bwhite, SIO::byellow, Init::cmd, Init::cmd_all, Init::cols, SIO::cyan, Init::editor, Init::f_erase_remainder, Init::f_ignore_case, Init::f_ln, Init::f_squeeze, Init::f_strip_ansi, SIO::fg_clr_x, Init::fill_char, SIO::gray_gamma, SIO::green, SIO::green_gamma, Init::help_spec, Init::in_spec, Init::lines, SIO::ln_bg_clr_x, SIO::ln_clr_x, SIO::magenta, Init::mapp_data, Init::mapp_help, Init::mapp_home, Init::mapp_msrc, Init::mapp_spec, Init::mapp_user, Init::minitrc, opt_prt_bool(), opt_prt_double(), opt_prt_int(), opt_prt_str(), SIO::orange, Init::out_spec, Init::parent_cmd, Init::provider_cmd, Init::receiver_cmd, SIO::red, SIO::red_gamma, Init::select_max, Init::sio, Init::tab_stop, Init::title, wait_timeout, SIO::white, and SIO::yellow.
Referenced by mapp_initialization().
| void mapp_initialization | ( | Init * | init, |
| int | argc, | ||
| char ** | argv ) |
Main initialization function for MAPP - Menu Application.
| init | - pointer to Init struct to be initialized |
| argc | - argument count from main() |
| argv | - argument vector from main() 1. Read environment variables and set defaults
2. Parse configuration file
3. Parse command-line options
4. Set up SIO struct with colors and other settings
5. Handle special options like help and version
|
< background color
< foreground color
< bold color
< line number olor
< line number background
< erase remainder on enter
< field enclosure brackets
< field fill character
< menu specification file
Definition at line 324 of file init.c.
References abend(), Init::argc, SIO::bg_clr_x, SIO::bo_clr_x, Init::brackets, dump_config(), Init::editor, expand_tilde(), f_dump_config, Init::f_erase_remainder, f_write_config, SIO::fg_clr_x, Init::fill_char, SIO::ln_bg_clr_x, SIO::ln_clr_x, Init::mapp_data, Init::mapp_help, Init::mapp_home, Init::mapp_msrc, Init::mapp_spec, Init::mapp_user, Init::minitrc, parse_config(), Init::sio, ssnprintf(), strnz__cpy(), verify_dir(), and write_config().
Referenced by main().
| void opt_prt_bool | ( | const char * | o, |
| const char * | name, | ||
| bool | value ) |
Print an option and its value in a formatted manner for boolean values.
| o | - option flag (e.g., "-z") |
| name | - option name (e.g., "f_squeeze") |
| value | - boolean option value to print |
Definition at line 910 of file init.c.
Referenced by dump_config().
| void opt_prt_char | ( | const char * | o, |
| const char * | name, | ||
| const char * | value ) |
Print an option and its value in a formatted manner.
| o | - option flag (e.g., "-a:") |
| name | - option name (e.g., "--minitrc") |
| value | - option value to print |
Definition at line 865 of file init.c.
| void opt_prt_double | ( | const char * | o, |
| const char * | name, | ||
| double | value ) |
Print an option and its value in a formatted manner for double values.
| o | - option flag (e.g., "-r:") |
| name | - option name (e.g., "red_gamma") |
| value | - double option value to print |
Definition at line 898 of file init.c.
Referenced by dump_config().
| void opt_prt_int | ( | const char * | o, |
| const char * | name, | ||
| int | value ) |
Print an option and its value in a formatted manner for integer values.
| o | - option flag (e.g., "-C:") |
| name | - option name (e.g., "--cols") |
| value | - integer option value to print |
Definition at line 887 of file init.c.
Referenced by dump_config().
| void opt_prt_str | ( | const char * | o, |
| const char * | name, | ||
| const char * | value ) |
Print an option and its value in a formatted manner for integer values.
| o | - option flag (e.g., "-C:") |
| name | - option name (e.g., "--cols") |
| value | - integer option value to print |
Definition at line 876 of file init.c.
Referenced by dump_config().
| int parse_config | ( | Init * | init | ) |
parse the configuration file specified in init->minitrc and set Init struct values accordingly
Definition at line 438 of file init.c.
References SIO::bblack, SIO::bblue, SIO::bcyan, Init::begx, Init::begy, SIO::bg, SIO::bg_clr_x, SIO::bgreen, SIO::black, SIO::blue, SIO::blue_gamma, SIO::bmagenta, SIO::bo_clr_x, SIO::borange, Init::brackets, SIO::bred, SIO::bwhite, SIO::byellow, Init::cmd, Init::cmd_all, Init::cols, SIO::cyan, Init::editor, expand_tilde(), Init::f_at_end_remove, Init::f_erase_remainder, Init::f_ignore_case, Init::f_ln, Init::f_squeeze, Init::f_strip_ansi, SIO::fg_clr_x, Init::fill_char, SIO::gray_gamma, SIO::green, SIO::green_gamma, Init::lines, SIO::ln_bg_clr_x, SIO::ln_clr_x, SIO::magenta, Init::mapp_data, Init::mapp_help, Init::mapp_home, Init::mapp_msrc, Init::mapp_spec, Init::mapp_user, Init::minitrc, SIO::orange, Init::parent_cmd, Init::provider_cmd, Init::receiver_cmd, SIO::red, SIO::red_gamma, Init::select_max, Init::sio, str_to_bool(), str_to_double(), strnz__cpy(), Init::tab_stop, Init::title, wait_timeout, SIO::white, and SIO::yellow.
Referenced by mapp_initialization().
| int write_config | ( | Init * | init | ) |
Write the current configuration to a file specified in init->minitrc.
| init | - pointer to Init struct containing current configuration |
Definition at line 723 of file init.c.
References SIO::bblack, SIO::bblue, SIO::bcyan, Init::begx, Init::begy, SIO::bg_clr_x, SIO::bgreen, SIO::black, SIO::blue, SIO::blue_gamma, SIO::bmagenta, SIO::bo_clr_x, Init::brackets, SIO::bred, SIO::bwhite, SIO::byellow, Init::cmd, Init::cmd_all, Init::cols, SIO::cyan, Init::editor, Init::f_erase_remainder, Init::f_ignore_case, Init::f_ln, Init::f_squeeze, Init::f_strip_ansi, SIO::fg_clr_x, Init::fill_char, SIO::gray_gamma, SIO::green, SIO::green_gamma, Init::help_spec, Init::in_spec, Init::lines, SIO::ln_bg_clr_x, SIO::ln_clr_x, SIO::magenta, Init::mapp_data, Init::mapp_help, Init::mapp_home, Init::mapp_msrc, Init::mapp_spec, Init::mapp_user, Init::out_spec, Init::parent_cmd, Perror(), Init::provider_cmd, Init::receiver_cmd, SIO::red, SIO::red_gamma, Init::select_max, Init::sio, strnz__cat(), strnz__cpy(), Init::tab_stop, Init::title, wait_timeout, SIO::white, and SIO::yellow.
Referenced by mapp_initialization(), and menu_cmd_processor().
| void zero_opt_args | ( | Init * | init | ) |
Initialize optional arguments in the Init struct to default values.
| init | - pointer to Init struct to be initialized This function sets all optional argument fields in the Init struct to their default values before parsing command-line options or configuration file. This ensures that any fields not specified by the user will have known default values. |
Definition at line 408 of file init.c.
References Init::cmd, Init::cmd_all, Init::f_help_spec, Init::f_in_spec, Init::f_mapp_desc, Init::f_mapp_spec, Init::f_out_spec, Init::f_provider_cmd, Init::f_receiver_cmd, Init::f_title, Init::help_spec, Init::in_spec, Init::mapp_spec, Init::out_spec, Init::parent_cmd, Init::provider_cmd, Init::receiver_cmd, and Init::title.
Referenced by menu_cmd_processor(), popup_form(), popup_menu(), popup_pick(), and popup_view().