annotate lib/progname.h @ 4739:04758f7475fd

Merge changes from glibc.
author Paul Eggert <eggert@cs.ucla.edu>
date Fri, 26 Sep 2003 07:35:01 +0000
parents c9a4a6444f3a
children d088e155d8f6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4603
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Program name management.
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 Copyright (C) 2001-2003 Free Software Foundation, Inc.
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 Written by Bruno Haible <haible@clisp.cons.org>, 2001.
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 the Free Software Foundation; either version 2, or (at your option)
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 any later version.
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 GNU General Public License for more details.
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 along with this program; if not, write to the Free Software Foundation,
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #ifndef _PROGNAME_H
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 #define _PROGNAME_H
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #include <stdbool.h>
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23
4605
c9a4a6444f3a Tweak comments.
Bruno Haible <bruno@clisp.org>
parents: 4603
diff changeset
24 /* Programs using this file should do the following in main():
4603
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 set_program_name (argv[0]);
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 */
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 /* String containing name the program is called with. */
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 extern const char *program_name;
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 /* Set program_name, based on argv[0]. */
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 extern void set_program_name (const char *argv0);
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 #if ENABLE_RELOCATABLE
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 /* Set program_name, based on argv[0], and original installation prefix and
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 directory, for relocatability. */
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 extern void set_program_name_and_installdir (const char *argv0,
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 const char *orig_installprefix,
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 const char *orig_installdir);
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 #define set_program_name(ARG0) \
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR)
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 /* Return the full pathname of the current executable, based on the earlier
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 call to set_program_name_and_installdir. Return NULL if unknown. */
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 extern char *get_full_program_name (void);
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 #endif
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49
fae2e3155b7a New module 'progname'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 #endif /* _PROGNAME_H */