Blame src/gl/progname.h

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