MPDC: Multi Party Domain Cryptosystem 1.0.0.0b (A0)
MPDC Interior protocol
|
The MPDC console menu functions. More...
Go to the source code of this file.
Functions | |
MPDC_EXPORT_API const char * | mpdc_menu_get_prompt (mpdc_console_modes mode) |
Returns the console prompt string. | |
MPDC_EXPORT_API void | mpdc_menu_print_error (mpdc_protocol_errors error, mpdc_console_modes mode, const char *host) |
Print an error message to the console. | |
MPDC_EXPORT_API void | mpdc_menu_print_message (const char *message, mpdc_console_modes mode, const char *host) |
Print a message to the console. | |
MPDC_EXPORT_API bool | mpdc_menu_print_message_confirm (const char *message, mpdc_console_modes mode, const char *host) |
Print a message to the console and wait for confirmation. | |
MPDC_EXPORT_API void | mpdc_menu_print_predefined_message (mpdc_application_messages msgnum, mpdc_console_modes mode, const char *host) |
Print a predefined message to the console. | |
MPDC_EXPORT_API bool | mpdc_menu_print_predefined_message_confirm (mpdc_application_messages msgnum, mpdc_console_modes mode, const char *host) |
Print a predefined message to the console and wait for confirmation. | |
MPDC_EXPORT_API void | mpdc_menu_print_prompt (mpdc_console_modes mode, const char *host) |
Print the application prompt. | |
MPDC_EXPORT_API void | mpdc_menu_print_prompt_text (const char *message, mpdc_console_modes mode, const char *host) |
Print a prompt and text with no line terminator. | |
MPDC_EXPORT_API void | mpdc_menu_print_predefined_text (mpdc_application_messages msgnum, mpdc_console_modes mode, const char *host) |
Print a predefined message with no line terminator. | |
MPDC_EXPORT_API void | mpdc_menu_print_text (const char *message) |
Print a text string to the console without a newline. | |
MPDC_EXPORT_API void | mpdc_menu_print_text_line (const char *message) |
Print a text string to the console with a newline. | |
MPDC_EXPORT_API void | mpdc_menu_print_prompt_empty () |
Print the application prompt on an empty line. | |
The MPDC console menu functions.
This module provides functions for printing prompts, messages, and errors to the MPDC console. These functions are used to interact with the user by displaying status messages, predefined texts, and user confirmations.
The functions include:
All messages are printed in plain ASCII. No Unicode characters are used.
Example usage:
MPDC_EXPORT_API const char * mpdc_menu_get_prompt | ( | mpdc_console_modes | mode | ) |
Returns the console prompt string.
This function returns the appropriate prompt string based on the specified console mode. The prompt is selected from an internal array of mode strings.
mode | The current console mode. |
MPDC_EXPORT_API void mpdc_menu_print_error | ( | mpdc_protocol_errors | error, |
mpdc_console_modes | mode, | ||
const char * | host ) |
Print an error message to the console.
This function converts a protocol error code into a descriptive string and prints it to the console. It prints the prompt first (based on the mode and host) and then the error message.
error | The protocol error enumerator. |
mode | The current console mode. |
host | The host name. |
MPDC_EXPORT_API void mpdc_menu_print_message | ( | const char * | message, |
mpdc_console_modes | mode, | ||
const char * | host ) |
Print a message to the console.
This function prints the given message string to the console. It first prints the prompt (using the current mode and host) and then the message on a new line.
message | The message string to print. |
mode | The current console mode. |
host | The host name. |
MPDC_EXPORT_API bool mpdc_menu_print_message_confirm | ( | const char * | message, |
mpdc_console_modes | mode, | ||
const char * | host ) |
Print a message to the console and wait for confirmation.
This function prints a message and then waits for the user to input a single character. If the user enters 'y' or 'Y', the function returns true.
message | The message string. |
mode | The current console mode. |
host | The host name. |
MPDC_EXPORT_API void mpdc_menu_print_predefined_message | ( | mpdc_application_messages | msgnum, |
mpdc_console_modes | mode, | ||
const char * | host ) |
Print a predefined message to the console.
This function prints a message that is predefined in the MPDC application. The message is chosen based on the msgnum parameter.
msgnum | The predefined message enumerator. |
mode | The current console mode. |
host | The host name. |
MPDC_EXPORT_API bool mpdc_menu_print_predefined_message_confirm | ( | mpdc_application_messages | msgnum, |
mpdc_console_modes | mode, | ||
const char * | host ) |
Print a predefined message to the console and wait for confirmation.
This function prints a predefined message and then waits for the user to provide confirmation. A response of 'y' or 'Y' returns true.
msgnum | The predefined message enumerator. |
mode | The current console mode. |
host | The host name. |
MPDC_EXPORT_API void mpdc_menu_print_predefined_text | ( | mpdc_application_messages | msgnum, |
mpdc_console_modes | mode, | ||
const char * | host ) |
Print a predefined message with no line terminator.
This function prints a predefined message (as defined in the MPDC application messages) without a newline at the end.
msgnum | The predefined message enumerator. |
mode | The current console mode. |
host | The host name. |
MPDC_EXPORT_API void mpdc_menu_print_prompt | ( | mpdc_console_modes | mode, |
const char * | host ) |
Print the application prompt.
This function prints the application prompt string to the console using the current console mode and host name.
mode | The current console mode. |
host | The host name. |
MPDC_EXPORT_API void mpdc_menu_print_prompt_empty | ( | ) |
Print the application prompt on an empty line.
This function prints the default application prompt on a new line.
MPDC_EXPORT_API void mpdc_menu_print_prompt_text | ( | const char * | message, |
mpdc_console_modes | mode, | ||
const char * | host ) |
Print a prompt and text with no line terminator.
This function prints a prompt followed by a message string. The message is printed without appending a newline character.
message | The message string to print. |
mode | The current console mode. |
host | The host name. |
MPDC_EXPORT_API void mpdc_menu_print_text | ( | const char * | message | ) |
Print a text string to the console without a newline.
This function prints the specified text string using a safe console print, without appending a newline.
message | The message string to print. |
MPDC_EXPORT_API void mpdc_menu_print_text_line | ( | const char * | message | ) |
Print a text string to the console with a newline.
This function prints the specified text string and then appends a newline.
message | The message string to print. |