.\" -*-nroff-*- .\" .\" Manual for program name .\" .\" (c) 1999, 2001, 2005, 2009, 2024 Straylight/Edgeware .\" . .\"----- Licensing notice --------------------------------------------------- .\" .\" This file is part of the mLib utilities library. .\" .\" mLib is free software: you can redistribute it and/or modify it under .\" the terms of the GNU Library General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or (at .\" your option) any later version. .\" .\" mLib is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public .\" License for more details. .\" .\" You should have received a copy of the GNU Library General Public .\" License along with mLib. If not, write to the Free Software .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, .\" USA. . .\"-------------------------------------------------------------------------- .so ../defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH quis 3mLib "22 May 1999" "Straylight/Edgeware" "mLib utilities library" .\" @quis .\" @ego .\" @QUIS .\" @pquis . .\"-------------------------------------------------------------------------- .SH NAME quis \- remember the program's name for use in messages . .\"-------------------------------------------------------------------------- .SH SYNOPSIS . .nf .B "#include " .PP .BI "void ego(const char *" p ); .B "const char *quis(void);" .B "const char *QUIS;" .BI "int pquis(FILE *" fp ", const char *" p ); .fi . .\"-------------------------------------------------------------------------- .SH DESCRIPTION . The .B ego function should be called early in your program's initialization sequence, with the value of .B argv[0] as its argument. It will strip away leading path components, and a leading `\-' character (in case the program was called as a login shell), and keep the resulting short name for later. .PP The .B quis function returns the stored program name. There is also a macro .B QUIS which expands to the name of a global variable whose value is the string returned by .BR quis() . .PP Don't ask why it's done this way. There are raisins, but they're mostly hysterical. .PP The function .B pquis is passed a file pointer .I fp and a string .IR p : it writes the string to the file, replacing every lone occurrence of the character .RB ` $ ' by the program name. Pairs .RB (` $$ ') are written as single dollar signs. The return value is zero if everything went OK, or the constant .B EOF if there was an error. .PP The program name is used in the messages produced by the .BR die (3) and .BR moan (3) functions. . .\"-------------------------------------------------------------------------- .SH "SEE ALSO" . .BR report (3), .BR mLib (3). . .\"-------------------------------------------------------------------------- .SH AUTHOR . Mark Wooding, . .\"----- That's all, folks --------------------------------------------------