2N/A/* Program name management.
2N/A Copyright (C) 2001-2004, 2006, 2009-2010 Free Software Foundation, Inc.
2N/A Written by Bruno Haible <bruno@clisp.org>, 2001.
2N/A
2N/A This program is free software: you can redistribute it and/or modify
2N/A it under the terms of the GNU General Public License as published by
2N/A the Free Software Foundation; either version 3 of the License, or
2N/A (at your option) any later version.
2N/A
2N/A This program is distributed in the hope that it will be useful,
2N/A but WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2N/A GNU General Public License for more details.
2N/A
2N/A You should have received a copy of the GNU General Public License
2N/A along with this program. If not, see <http://www.gnu.org/licenses/>. */
2N/A
2N/A#ifndef _PROGNAME_H
2N/A#define _PROGNAME_H
2N/A
2N/A/* Programs using this file should do the following in main():
2N/A set_program_name (argv[0]);
2N/A */
2N/A
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A
2N/A/* String containing name the program is called with. */
2N/Aextern const char *program_name;
2N/A
2N/A/* Set program_name, based on argv[0].
2N/A argv0 must be a string allocated with indefinite extent, and must not be
2N/A modified after this call. */
2N/Aextern void set_program_name (const char *argv0);
2N/A
2N/A#if ENABLE_RELOCATABLE
2N/A
2N/A/* Set program_name, based on argv[0], and original installation prefix and
2N/A directory, for relocatability. */
2N/Aextern void set_program_name_and_installdir (const char *argv0,
2N/A const char *orig_installprefix,
2N/A const char *orig_installdir);
2N/A#undef set_program_name
2N/A#define set_program_name(ARG0) \
2N/A set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR)
2N/A
2N/A/* Return the full pathname of the current executable, based on the earlier
2N/A call to set_program_name_and_installdir. Return NULL if unknown. */
2N/Aextern char *get_full_program_name (void);
2N/A
2N/A#endif
2N/A
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A
2N/A#endif /* _PROGNAME_H */