MSGC(1) | General Commands Manual | MSGC(1) |
#include "msg_defs.h"
void
msg_window(WINDOW *window);
const char *
msg_string(msg msg_no);
void
msg_clear(void);
void
msg_standout(void);
void
msg_standend(void);
void
msg_display(msg msg_no, ...);
void
msg_display_add(msg msg_no, ...);
void
msg_prompt(msg msg_no, const char *def, char *val, int max_chars, ...);
void
msg_prompt_add(msg msg_no, const char *def, char *val, int max_chars, ...);
void
msg_prompt_win(msg msg_no, WINDOW *win, const char *def, char *val, int max_chars, ...);
void
msg_prompt_noecho(msg msg_no, const char *def, char *val, int max_chars, ...);
int
msg_row(void);
void
msg_table_add(msg msg_no, ...);
All variable argument lists in the functions are used as are arguments to sprintf(3). The messages may have sprintf(3) conversions in them and the corresponding parameters should match. Messages are identified by name using the notation ‘MSG_name' where “name” is the name in the message source file. (The definitions are accessed by including the generated .h file into a source file wanting to use the message routines.)
The function msg_string() just returns a pointer to the actual message string. The functions msg_clear(), msg_standout() and msg_standend() respectively clear the message window, set standout mode and clear standout mode.
The functions msg_display() and msg_display_add() cause a defined message to be displayed in the message window and does the requested conversions before printing. The difference is that msg_display() clears the window before displaying the message. These functions fill paragraphs for readability. The msg_table_add() function behaves like msg_display_add() but does not fill text.
The remaining functions deal with a prompt facility. A prompt message is either taken from the message directory or from a given string. The message is processed with sprintf(3) and then displayed. If the parameter def is non-NULL and not a string of zero length, a default value is printed in brackets. The user is allowed to type in a response. If the user types just the newline character, the default is returned in the value. The parameter max_chars is the length of the parameter val, where the results are stored. The parameters def and val may point to the same character array. If the default is chosen, the character array is not changed. The functions msg_echo() and msg_noecho() control whether the prompt routine echo or don't echo the input that is typed by the user.
msg_prompt_win() uses the specified curses window instead of the default one.
msg_row() return the current row - i.e.: getcury(msg_win) + getbegy(msg_win).
September 25, 2003 | NetBSD 6.1 |