Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setlabel(3C) — svr4 — mips UMIPS RISC/os 5.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getopt(3C)

lfmt(3C)

pfmt(3C)



SETLABEL(3C-SVR4)   RISC/os Reference Manual    SETLABEL(3C-SVR4)



NAME
     setlabel - define the label for pfmt() and lfmt().

SYNOPSIS
     #include <pfmt.h>

     int setlabel(const char *label);

DESCRIPTION
     The routine setlabel() defines the label for messages pro-
     duced in standard format by subsequent calls to pfmt() and
     lfmt().

     label is a character string no more than 25 characters in
     length.

     No label is defined before setlabel() is called.  A NULL
     pointer or an empty string passed as argument will reset the
     definition of the label.

RETURN VALUE
     setlabel() returns 0 in case of success, non-zero otherwise.

EXAMPLE
     The following code (without previous call to setlabel()):

          pfmt(stderr, MM_ERROR, "test:2:Cannot open file\n");
          setlabel("UX:test");
          pfmt(stderr, MM_ERROR, "test:2:Cannot open file\n");

     will produce the following output:
          ERROR: Cannot open file
          UX:test: ERROR: Cannot open file

USAGE
     The label should be set once at the beginning of a utility
     and remain constant.

     getopt() has been modified to report errors using the stan-
     dard message format.  if setlabel() is called before
     getopt(), getopt() will use that label.  Otherwise, getopt()
     will use the name of the utility.

SEE ALSO
     getopt(3C), lfmt(3C), pfmt(3C).










                        Printed 11/19/92                   Page 1



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026