| 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 | .\" @pquis |
| 9 | .SH SYNOPSIS |
| 10 | .nf |
| 11 | .B "#include <mLib/quis.h>" |
| 12 | |
| 13 | .BI "void ego(const char *" p ); |
| 14 | .B "const char *quis(void);" |
| 15 | .B "const char *QUIS;" |
| 16 | .BI "int pquis(FILE *" fp ", const char *" p ); |
| 17 | .fi |
| 18 | .SH DESCRIPTION |
| 19 | The |
| 20 | .B ego |
| 21 | function should be called early in your program's initialization |
| 22 | sequence, with the value of |
| 23 | .B argv[0] |
| 24 | as its argument. It will strip away leading path components, and a |
| 25 | leading `\-' character (in case the program was called as a login |
| 26 | shell), and keep the resulting short name for later. |
| 27 | .PP |
| 28 | The |
| 29 | .B quis |
| 30 | function returns the stored program name. There is also a macro |
| 31 | .B QUIS |
| 32 | which expands to the name of a global variable whose value is the string |
| 33 | returned by |
| 34 | .BR quis() . |
| 35 | .PP |
| 36 | Don't ask why it's done this way. There are raisins, but they're mostly |
| 37 | hysterical. |
| 38 | .PP |
| 39 | The function |
| 40 | .B pquis |
| 41 | is passed a file pointer |
| 42 | .I fp |
| 43 | and a string |
| 44 | .IR p : |
| 45 | it writes the string to the file, replacing every lone occurrence of the |
| 46 | character |
| 47 | .RB ` $ ' |
| 48 | by the program name. Pairs |
| 49 | .RB (` $$ ') |
| 50 | are written as single dollar signs. The return value is zero if |
| 51 | everything went OK, or the constant |
| 52 | .B EOF |
| 53 | if there was an error. |
| 54 | .PP |
| 55 | The program name is used in the messages produced by the |
| 56 | .BR die (3) |
| 57 | and |
| 58 | .BR moan (3) |
| 59 | functions. |
| 60 | .SH "SEE ALSO" |
| 61 | .BR report (3), |
| 62 | .BR mLib (3). |
| 63 | .SH AUTHOR |
| 64 | Mark Wooding, <mdw@nsict.org> |