|
|
#include <pfmt.h>int setlabel(const char *label);
label is a character string up to 25 characters long.
No label is defined before setlabel( ) is called. A null pointer or an empty string passed as argument resets the definition of the label.
Set the label at the beginning of a utility and leave it constant.
getopt(S) has been modified to report errors using the standard message format. If setlabel( ) is called before getopt( ), getopt( ) uses the label. Otherwise, getopt( ) uses the name of the utility.
pfmt(stderr, MM_ERROR, "test:2:Cannot open file\n"); setlabel("SCO:test"); pfmt(stderr, MM_ERROR, "test:2:Cannot open file\n");produces the following output:
ERROR: Cannot open file SCO:test: ERROR: Cannot open file