/*
   <p>A Linux equivalent of OS/9's <i>_prgname()</i> function.</p>

   <kbd>
   <b>environ - C programming support functions</b><br>
   Copyright (C) 2005  Martin C Gregorie
   
   This program is free software; you can redistribute it and/or
   modify it under the terms of the Lesser GNU General Public License.
   
   This program 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 General Public License for more details.
  
   You should have received a copy of the Lesser GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
   </kbd>
  
   <p>Contact Martin Gregorie at <i>martin@gregorie.org</i></p>
*/

#include "environ.h"

char *_prog = "UNSET";

/*
   Retrieve the program name stored by <i>setprog()</i>.
   If it wasn't called "UNSET" is retrieved by default.
   This is a means of passing the program name to diagnostic,
   warning and error mesages without having to pass them down
   a function stack.

   <b>See also:</b> <i>setprog()</i>
*/
char *progname(void)
{
	return _prog;
}

/*
   Set the program name retrieved by <i>progname()</i>.
   This is a means of passing the program name to diagnostic,
   warning and error mesages without having to pass them down
   a function stack.

   <b>See also:</b> <i>setprog()</i>
*/
void setprog(char *name)
{
	_prog = name;
}
