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