* bootstrap.conf (gnulib_modules): Add progname.
* src/*.c (program_name): Remove declaration.
* (main): Call set_program_name rather than setting program_name.
* src/nice.c (main): Cast program_name to "(char *)".
* src/prog-fprintf.c: Include "system.h"
* src/system.h: Include "progname.h".
* maint.mk (sc_program_name): Adjust rule.
Suggestion from Eric Blake.
posix-shell
posixtm
posixver
+ progname
propername
putenv
quote quotearg raise readlink areadlink-with-size
fi
# Ensure that each .c file containing a "main" function also
-# declares "char *program_name", with or without "const".
+# calls set_program_name.
sc_program_name:
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
files=$$(grep -l '^main *(' $$($(VC_LIST_EXCEPT) | grep '\.c$$')); \
- grep -EL '^(char const|(const )?char) \*program_name;' $$files \
+ grep -LE 'set_program_name *\(m?argv\[0\]\);' $$files \
| grep . && \
- { echo '$(ME): the above files do not declare program_name' \
+ { echo '$(ME): the above files do not call set_program_name' \
1>&2; exit 1; } || :; \
else :; \
fi
#define AUTHORS proper_name ("Simon Josefsson")
-/* The invocation name of this program. */
-char const *program_name;
-
static const struct option long_options[] = {
{"decode", no_argument, 0, 'd'},
{"wrap", required_argument, 0, 'w'},
uintmax_t wrap_column = 76;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("FIXME unknown")
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
char *name;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#undef max
#define max(h,i) ((h) > (i) ? (h) : (i))
-/* Name under which this program was invoked. */
-char const *program_name;
-
/* Name of input file. May be "-". */
static char const *infile;
};
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
V_off
};
-/* The name the program was run with. */
-char const *program_name;
-
/* If nonzero, and the systems has support for it, change the context
of symbolic links rather than any files they point to. */
static bool affect_symlink_referent;
int optc;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
# define endgrent() ((void) 0)
#endif
-/* The name the program was run with. */
-char const *program_name;
-
/* The argument to the --reference option. Use the group ID of this file.
This file must exist. */
static char *reference_file;
int optc;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
V_off
};
-/* The name the program was run with. */
-char const *program_name;
-
/* The desired change to the mode. */
static struct mode_change *change;
int c;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
proper_name ("David MacKenzie"), \
proper_name ("Jim Meyering")
-/* The name the program was run with. */
-char const *program_name;
-
/* The argument to the --reference option. Use the owner and group IDs
of this file. This file must exist. */
static char *reference_file;
int optc;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("Roland McGrath")
-/* The name this program was run with, for error messages. */
-char const *program_name;
-
void
usage (int status)
{
main (int argc, char **argv)
{
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Number of bytes to read at once. */
# define BUFLEN (1 << 16)
-/* The name this program was run with. */
-char const *program_name;
-
static uint_fast32_t const crctab[256] =
{
0x00000000,
bool ok;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#undef min
#define min(x, y) ((x) < (y) ? (x) : (y))
-/* The name this program was run with. */
-char const *program_name;
-
/* True if the LC_COLLATE locale is hard. */
static bool hard_LC_COLLATE;
int c;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static char const *top_level_src_name;
static char const *top_level_dst_name;
-/* The invocation name of this program. */
-extern char *program_name;
-
/* FIXME: describe */
/* FIXME: rewrite this to use a hash table so we avoid the quadratic
performance hit that's probably noticeable only on trees deeper
/* Initial number of entries in the inode hash table. */
#define INITIAL_ENTRY_TAB_SIZE 70
-/* The invocation name of this program. */
-char const *program_name;
-
/* True if the kernel is SELinux enabled. */
static bool selinux_enabled;
bool no_target_directory = false;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static void save_line_to_file (const struct cstring *line);
void usage (int status);
-/* The name this program was run with. */
-char const *program_name;
-
/* Start of buffer list. */
static struct buffer_record *head = NULL;
unsigned long int val;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
field_mode
};
-/* The name this program was run with. */
-char const *program_name;
-
static enum operating_mode operating_mode;
/* If true do not output lines containing no delimeter characters.
char *spec_list_string IF_LINT(= NULL);
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* A format suitable for Internet RFC 2822. */
static char const rfc_2822_format[] = "%a, %d %b %Y %H:%M:%S %z";
-/* The name this program was run with, for error messages. */
-char const *program_name;
-
/* For long options that have no equivalent short option, use a
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
int option_specified_date;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
STATUS_NOXFER = 01
};
-/* The name this program was run with. */
-char const *program_name;
-
/* The name of the input file, or NULL for the standard input. */
static char const *input_file = NULL;
off_t offset;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
proper_name ("David MacKenzie"), \
proper_name ("Paul Eggert")
-/* Name this program was run with. */
-char const *program_name;
-
/* If true, show inode information. */
static bool inode_format;
struct stat *stats IF_LINT (= 0);
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
{NULL, 0, NULL, 0}
};
-char const *program_name;
-
void
usage (int status)
{
bool print_database = false;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
proper_name ("David MacKenzie"), \
proper_name ("Jim Meyering")
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
size_t len;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
struct duinfo subdir;
};
-/* Name under which this program was invoked. */
-char const *program_name;
-
/* If true, display counts for all files, not just directories. */
static bool opt_all = false;
cwd_only[1] = NULL;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
enum { DEFAULT_ECHO_TO_XPG = false };
#endif
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
bool do_v9 = DEFAULT_ECHO_TO_XPG;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
extern char **environ;
-/* The name by which this program was run. */
-char const *program_name;
-
static struct option const longopts[] =
{
{"ignore-environment", no_argument, NULL, 'i'},
bool ignore_environment = false;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
allocated for the output line. */
#define OUTPUT_BLOCK 256
-/* The name this program was run with. */
-char const *program_name;
-
/* If true, convert blanks even after nonblank characters have been
read on the line. */
static bool convert_entire_line;
int c;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* The arguments given to the program, minus the program name. */
static char **args;
-/* The name this program was run with. */
-char const *program_name;
-
static VALUE *eval (bool);
static bool nomoreargs (void);
static bool null (VALUE *v);
VALUE *v;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define WHEEL_START (wheel_tab + WHEEL_SIZE)
#define WHEEL_END (wheel_tab + (sizeof wheel_tab / sizeof wheel_tab[0]))
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
bool ok;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static void put_word (WORD *w);
static void put_space (int space);
-/* The name this program was run with. */
-char const *program_name;
-
/* Option values. */
/* If true, first 2 lines may have different indent (default false). */
char const *max_width_option = NULL;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("David MacKenzie")
-/* The name this program was run with. */
-char const *program_name;
-
/* If nonzero, try to break on whitespace. */
static bool break_spaces;
bool ok;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#include "error.h"
#include "group-list.h"
-/* The name this program was run with. */
-char const *program_name;
-
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "groups"
uid_t ruid;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
multiple_files, always, never
};
-/* The name this program was run with. */
-char const *program_name;
-
/* Have we ever read standard input? */
static bool have_read_stdin;
char const *const *file_list;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("Jim Meyering")
-/* The name this program was run with, for error messages. */
-char const *program_name;
-
void
usage (int status)
{
unsigned int id;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
# define HAVE_SETHOSTNAME 1 /* Now we have it... */
#endif
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
char *hostname;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static void print_user (uid_t uid);
static void print_full_info (const char *username);
-/* The name this program was run with. */
-char const *program_name;
-
/* If true, output user/group name instead of ID number. -n */
static bool use_name = false;
bool just_user = false;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
void *options);
void usage (int status);
-/* The name this program was run with, for error messages. */
-char const *program_name;
-
/* The user name that will own the files, or NULL to make the owner
the current user ID. */
static char *owner_name;
selinux_enabled = (0 < is_selinux_enabled ());
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
struct line *lines;
};
-/* The name this program was run with. */
-char const *program_name;
-
/* The previous line read from each file. */
static struct line *prevline[2];
int i;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
# endif
#endif
\f
-/* The name this program was run with, for error messages. */
-char const *program_name;
-
static char const short_options[] =
"0::1::2::3::4::5::6::7::8::9::"
"A::B::C::D::E::F::G::H::I::J::K::L::M::"
char signame[SIG2STR_MAX];
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("Michael Stone")
-/* Name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
main (int argc, char **argv)
{
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
lstat (File, Stat_buf)
#endif
-/* The name by which the program was run, for error messages. */
-char const *program_name;
-
/* FIXME: document */
static enum backup_type backup_type;
char **file;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("FIXME: unknown")
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
char *cp;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static void parse_ls_color (void);
void usage (int status);
-/* The name this program was run with. */
-char const *program_name;
-
/* Initial size of hash table.
Most hierarchies are likely to be shallower than this. */
#define INITIAL_TABLE_SIZE 30
#endif
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* With --check, suppress the "OK" printed for each verified file. */
static bool quiet = false;
-/* The name this program was run with. */
-char const *program_name;
-
/* For long options that have no equivalent short option, use a
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
/* Setting values of global variables. */
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("David MacKenzie")
-/* The name this program was run with. */
-char const *program_name;
-
static struct option const longopts[] =
{
{GETOPT_SELINUX_CONTEXT_OPTION_DECL},
options.created_directory_format = NULL;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("David MacKenzie")
-/* The name this program was run with. */
-char const *program_name;
-
static struct option const longopts[] =
{
{GETOPT_SELINUX_CONTEXT_OPTION_DECL},
security_context_t scontext = NULL;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("David MacKenzie")
-/* The name this program was run with. */
-char const *program_name;
-
static struct option const longopts[] =
{
{GETOPT_SELINUX_CONTEXT_OPTION_DECL},
security_context_t scontext = NULL;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static const char *default_template = "tmp.XXXXXXXXXX";
-/* The name this program was run with. */
-char const *program_name;
-
/* For long options that have no equivalent short option, use a
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
char *dest_name;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
STRIP_TRAILING_SLASHES_OPTION
};
-/* The name this program was run with. */
-char const *program_name;
-
/* Remove any trailing slashes from each SOURCE argument. */
static bool remove_trailing_slashes;
char **file;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
# define NZERO 20
#endif
-/* The name this program was run with. */
-char const *program_name;
-
static struct option const longopts[] =
{
{"adjustment", required_argument, NULL, 'n'},
int i;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
char **fake_argv = argv + (i - 1);
/* Ensure that any getopt diagnostics use the right name. */
- fake_argv[0] = program_name;
+ fake_argv[0] = (char *) program_name;
/* Initialize getopt_long's internal state. */
optind = 0;
Header, Body, Footer, Text
};
-/* The name this program was run with. */
-char const *program_name;
-
/* Format of body lines (-b). */
static char const *body_type = "t";
bool ok = true;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
NOHUP_FAILURE = 127
};
-char const *program_name;
-
void
usage (int status)
{
bool redirecting_stderr;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
int field_width;
};
-/* The name this program was run with. */
-char const *program_name;
-
/* Convert the number of 8-bit bytes of a binary representation to
the number of characters (digits + sign if the type is signed)
required to represent the same quantity in the specified base/type.
uintmax_t pseudo_start IF_LINT (= 0);
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Indicates that no delimiter should be added in the current position. */
#define EMPTY_DELIM '\0'
-/* Name this program was run with. */
-char const *program_name;
-
/* If nonzero, we have read standard input at some point. */
static bool have_read_stdin;
char const *delim_arg = "\t";
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static bool validate_file_name (char *, bool, bool);
-/* The name this program was run with. */
-char const *program_name;
-
/* For long options that have no equivalent short option, use a
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
int optc;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
char *ttyname ();
-/* The name this program was run with. */
-char const *program_name;
-
/* If true, display the hours:minutes since each user has touched
the keyboard, or blank if within the last minute, or days followed
by a 'd' if not within the last day. */
int n_users;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static void print_sep_string (void);
static void separator_string (const char *optarg_S);
-/* The name under which this program was invoked. */
-char const *program_name;
-
/* All of the columns to print. */
static COLUMN *column_vector;
size_t n_alloc = 0;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
proper_name ("David MacKenzie"), \
proper_name ("Richard Mlynarik")
-/* The name this program was run with. */
-char const *program_name;
-
extern char **environ;
void
bool ok;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static char const *const cfcc_msg =
N_("warning: %s: character(s) following character constant have been ignored");
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
int args_used;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#include <stdarg.h>
#include <sys/types.h>
-#include "prog-fprintf.h"
+#include "system.h"
-extern char *program_name;
+#include "prog-fprintf.h"
/* Display program name followed by variable list.
Used for e.g. verbose output */
/* Imported from "regex.c". */
#define Sword 1
-/* The name this program was run with. */
-char const *program_name;
-
/* Program options. */
enum Format
/* Decode program options. */
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
char *start;
};
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
char *wd;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("Dmitry V. Levin")
-/* Name this program was run with. */
-char const *program_name;
-
/* If true, do not output the trailing newline. */
static bool no_newline;
int optc;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
# define DT_LNK 2
#endif
-extern char *program_name;
-
struct dirstack_state
{
/* The name of the directory (starting with and relative to a command
proper_name ("Richard M. Stallman"), \
proper_name ("Jim Meyering")
-/* Name this program was run with. */
-char const *program_name;
-
/* For long options that have no equivalent short option, use a
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
int c;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("David MacKenzie")
-/* The name this program was run with. */
-char const *program_name;
-
/* If true, remove empty parent directories. */
static bool remove_empty_parents;
int optc;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
{NULL, 0, NULL, 0}
};
-/* The name the program was run with. */
-char const *program_name;
-
void
usage (int status)
{
context_t con;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* If true print all number with equal width. */
static bool equal_width;
-/* The name that this program was run with. */
-char const *program_name;
-
/* The string used to separate two numbers. */
static char const *separator;
char const *format_str = NULL;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define SETUIDGID_FAILURE 111
-char const *program_name;
-
void
usage (int status)
{
gid_t primary_gid;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
{NULL, 0, NULL, 0}
};
-/* Global variable for error printing purposes */
-char const *program_name; /* Initialized before any possible use */
-
void
usage (int status)
{
char const *random_source = NULL;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("Paul Eggert")
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
size_t *permutation;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
proper_name ("Jim Meyering"), \
proper_name ("Paul Eggert")
-/* The name by which this program was run. */
-char const *program_name;
-
void
usage (int status)
{
bool ok = true;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
int val;
};
-/* The name this program was run with. */
-char const *program_name;
-
/* FIXME: None of these tables work with multibyte character sets.
Also, there are many other bugs when handling multibyte characters.
One way to fix this is to rewrite `sort' to use wide characters
char const *outfile = NULL;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define DEFAULT_SUFFIX_LENGTH 2
-/* The name this program was run with. */
-char const *program_name;
-
/* Base name of output files. */
static char const *outbase;
int digits_optind = 0;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
{NULL, 0, NULL, 0}
};
-char const *program_name;
-
/* Whether to follow symbolic links; True for --dereference (-L). */
static bool follow_links;
bool ok = true;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
{NULL, 0, NULL, 0}
};
-/* The name this program was run with. */
-char const *program_name;
-
static void wrapf (const char *message, ...)
__attribute__ ((__format__ (__printf__, 1, 2)));
const char *device_name;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static void run_shell (char const *, char const *, char **, size_t)
ATTRIBUTE_NORETURN;
-/* The name this program was run with. */
-char const *program_name;
-
/* If true, pass the `-f' option to the subshell. */
static bool fast_startup;
struct passwd pw_copy;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
proper_name ("Kayvan Aghaiepour"), \
proper_name ("David MacKenzie")
-/* The name this program was run with. */
-char const *program_name;
-
/* True if any of the files read were the standard input. */
static bool have_read_stdin;
bool (*sum_func) (const char *, int) = bsd_sum_file;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("Jim Meyering")
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
main (int argc, char **argv)
{
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
of the 100 binaries. */
#define proper_name(x) (x)
+#include "progname.h"
+
#define case_GETOPT_VERSION_CHAR(Program_name, Authors) \
case GETOPT_VERSION_CHAR: \
version_etc (stdout, Program_name, PACKAGE_NAME, VERSION, Authors, \
/* The number of bytes per atomic write. */
#define WRITESIZE 8192
-/* The name this program was run with. */
-char const *program_name;
-
/* The string that separates the records of the file. */
static char const *separator;
char const *const *file;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static uintmax_t max_n_unchanged_stats_between_opens =
DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS;
-/* The name this program was run with. */
-char const *program_name;
-
/* The process ID of the process (presumably on the current host)
that is writing to all followed files. */
static pid_t pid;
double sleep_interval = 1.0;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* If true, ignore interrupts. */
static bool ignore_interrupts;
-/* The name that this program was run with. */
-char const *program_name;
-
static struct option const long_options[] =
{
{"append", no_argument, NULL, 'a'},
int optc;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
# include <sys/param.h>
#endif
-char const *program_name;
-
/* Exit status for syntax errors, etc. */
enum { TEST_TRUE, TEST_FALSE, TEST_FAILURE };
return (test_error_return);
#else /* TEST_STANDALONE */
initialize_main (&margc, &margv);
- program_name = margv[0];
+ set_program_name (margv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
static int monitored_pid;
static int sigs_to_ignore[NSIG]; /* so monitor can ignore sigs it resends. */
-char const *program_name;
-
static struct option const long_options[] = {
{"signal", required_argument, NULL, 's'},
{NULL, 0, NULL, 0}
char *ep;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define CH_ATIME 1
#define CH_MTIME 2
-/* The name by which this program was run. */
-char const *program_name;
-
/* Which timestamps to change. */
static int change_times;
char const *flex_date = NULL;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
return es->s[i] == c && !es->escaped[i];
}
-/* The name by which this program was run. */
-char const *program_name;
-
/* When true, each sequence in the input of a repeated character
(call it c) is replaced (in the output) by a single occurrence of c
for every c in the squeeze set. */
struct Spec_list *s2 = &buf2;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("Jim Meyering")
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
main (int argc, char **argv)
{
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
struct successor *top;
};
-/* The name this program was run with. */
-char const *program_name;
-
/* The head of the sorted list. */
static struct item *head = NULL;
bool ok;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("David MacKenzie")
-/* The name under which this program was run. */
-char const *program_name;
-
/* If true, return an exit status but produce no output. */
static bool silent;
int optc;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Operating system. */
#define PRINT_OPERATING_SYSTEM 128
-/* The name this program was run with, for error messages. */
-char const *program_name;
-
static struct option const uname_long_options[] =
{
{"all", no_argument, NULL, 'a'},
unsigned int toprint = 0;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
allocated for the output line. */
#define OUTPUT_BLOCK 256
-/* The name this program was run with. */
-char const *program_name;
-
/* If true, convert blanks even after nonblank characters have been
read on the line. */
static bool convert_entire_line;
bool convert_first_only = false;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
} \
while (0)
-/* The name this program was run with. */
-char const *program_name;
-
/* True if the LC_COLLATE locale is hard. */
static bool hard_LC_COLLATE;
file[0] = file[1] = "-";
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("Michael Stone")
-/* Name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
main (int argc, char **argv)
{
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
int getloadavg ();
-/* The name this program was run with. */
-char const *program_name;
-
static void
print_uptime (size_t n, const STRUCT_UTMP *this)
{
main (int argc, char **argv)
{
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
proper_name ("Joseph Arceneaux"), \
proper_name ("David MacKenzie")
-/* The name this program was run with. */
-char const *program_name;
-
static int
userid_compare (const void *v_a, const void *v_b)
{
main (int argc, char **argv)
{
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Size of atomic reads. */
#define BUFFER_SIZE (16 * 1024)
-/* The name this program was run with. */
-char const *program_name;
-
/* Cumulative number of lines, words, chars and bytes in all files so far.
max_line_length is the maximum over all files processed so far. */
static uintmax_t total_lines;
struct Tokens tok;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
char *ttyname ();
-/* The name this program was run with. */
-char const *program_name;
-
/* If true, attempt to canonicalize hostnames via a DNS lookup. */
static bool do_lookup;
bool assumptions = true;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("Richard Mlynarik")
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
uid_t uid;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#define AUTHORS proper_name ("David MacKenzie")
-/* The name this program was run with. */
-char const *program_name;
-
void
usage (int status)
{
main (int argc, char **argv)
{
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);