24 |
#include "m4private.h" |
#include "m4private.h" |
25 |
#include "error.h" |
#include "error.h" |
26 |
|
|
27 |
void print_program_name (void); |
/* The name this program was run with. */ |
28 |
|
#ifdef _LIBC |
29 |
|
/* In the GNU C library, there is a predefined variable for this. */ |
30 |
|
# define program_name program_invocation_name |
31 |
|
#endif |
32 |
|
|
33 |
|
/* This will be provided either by GNU libc, or error.c. */ |
34 |
|
extern const char *program_name; |
35 |
|
|
36 |
|
static void print_program_name_CB (void); |
37 |
|
|
38 |
|
|
39 |
/* Name of frozen file to digest after initialization. */ |
/* Name of frozen file to digest after initialization. */ |
63 |
|
|
64 |
/* Print program name, source file and line reference on standard |
/* Print program name, source file and line reference on standard |
65 |
error, as a prefix for error messages. Flush standard output first. */ |
error, as a prefix for error messages. Flush standard output first. */ |
66 |
void |
static void |
67 |
print_program_name (void) |
print_program_name_CB (void) |
68 |
{ |
{ |
69 |
fflush (stdout); |
fflush (stdout); |
70 |
fprintf (stderr, "%s: ", program_name); |
fprintf (stderr, "%s: ", program_name); |
227 |
int exit_status; |
int exit_status; |
228 |
|
|
229 |
program_name = argv[0]; |
program_name = argv[0]; |
230 |
error_print_progname = print_program_name; |
error_print_progname = print_program_name_CB; |
231 |
|
|
232 |
setlocale (LC_ALL, ""); |
setlocale (LC_ALL, ""); |
233 |
#ifdef ENABLE_NLS |
#ifdef ENABLE_NLS |