| 1 | .\" -*-nroff-*- |
| 2 | .TH quis 3 "22 May 1999" mLib |
| 3 | .SH NAME |
| 4 | quis \- remember the program's name for use in messages |
| 5 | .\" @quis |
| 6 | .\" @ego |
| 7 | .\" @QUIS |
| 8 | .SH SYNOPSIS |
| 9 | .nf |
| 10 | .B "#include <mLib/quis.h>" |
| 11 | |
| 12 | .BI "void ego(const char *" p ); |
| 13 | .B "const char *quis(void);" |
| 14 | .B "const char *QUIS;" |
| 15 | .fi |
| 16 | .SH DESCRIPTION |
| 17 | The |
| 18 | .B ego |
| 19 | function should be called early in your program's initialization |
| 20 | sequence, with the value of |
| 21 | .B argv[0] |
| 22 | as its argument. It will strip away leading path components, and a |
| 23 | leading `\-' character (in case the program was called as a login |
| 24 | shell), and keep the resulting short name for later. |
| 25 | .PP |
| 26 | The |
| 27 | .B quis |
| 28 | function returns the stored program name. There is also a macro |
| 29 | .B QUIS |
| 30 | which expands to the name of a global variable whose value is the string |
| 31 | returned by |
| 32 | .BR quis() . |
| 33 | .PP |
| 34 | Don't ask why it's done this way. There are raisins, but they're mostly |
| 35 | hysterical. |
| 36 | .PP |
| 37 | The program name is used in the messages produced by the |
| 38 | .BR die (3) |
| 39 | and |
| 40 | .BR moan (3) |
| 41 | functions. |
| 42 | .SH "SEE ALSO" |
| 43 | .BR report (3), |
| 44 | .BR mLib (3). |
| 45 | .SH AUTHOR |
| 46 | Mark Wooding, <mdw@nsict.org> |