Use PROGNAME_FONTSEL and PROGNAME_COMPARE

This commit is contained in:
Pierre Pronchery 2019-12-18 05:40:04 +01:00
parent f9828bfe30
commit 3ac7b1c166
2 changed files with 14 additions and 14 deletions

View File

@ -38,17 +38,17 @@
#define _(string) gettext(string) #define _(string) gettext(string)
/* constants */ /* constants */
#ifndef PROGNAME #ifndef PROGNAME_COMPARE
# define PROGNAME "compare" # define PROGNAME_COMPARE "compare"
#endif #endif
#ifndef PREFIX #ifndef PREFIX
# define PREFIX "/usr/local" # define PREFIX "/usr/local"
#endif #endif
#ifndef DATADIR #ifndef DATADIR
# define DATADIR PREFIX "/share" # define DATADIR PREFIX "/share"
#endif #endif
#ifndef LOCALEDIR #ifndef LOCALEDIR
# define LOCALEDIR DATADIR "/locale" # define LOCALEDIR DATADIR "/locale"
#endif #endif
@ -154,7 +154,7 @@ static int _compare(char const * string1, char const * string2)
/* error */ /* error */
static int _error(char const * message, int ret) static int _error(char const * message, int ret)
{ {
fputs(PROGNAME ": ", stderr); fputs(PROGNAME_COMPARE ": ", stderr);
perror(message); perror(message);
return ret; return ret;
} }
@ -163,7 +163,7 @@ static int _error(char const * message, int ret)
/* usage */ /* usage */
static int _usage(void) static int _usage(void)
{ {
fprintf(stderr, _("Usage: %s [string1 [string2]]\n"), PROGNAME); fprintf(stderr, _("Usage: %s [string1 [string2]]\n"), PROGNAME_COMPARE);
return 1; return 1;
} }

View File

@ -37,17 +37,17 @@
#define _(string) gettext(string) #define _(string) gettext(string)
/* constants */ /* constants */
#ifndef PROGNAME #ifndef PROGNAME_FONTSEL
# define PROGNAME "fontsel" # define PROGNAME_FONTSEL "fontsel"
#endif #endif
#ifndef PREFIX #ifndef PREFIX
# define PREFIX "/usr/local" # define PREFIX "/usr/local"
#endif #endif
#ifndef DATADIR #ifndef DATADIR
# define DATADIR PREFIX "/share" # define DATADIR PREFIX "/share"
#endif #endif
#ifndef LOCALEDIR #ifndef LOCALEDIR
# define LOCALEDIR DATADIR "/locale" # define LOCALEDIR DATADIR "/locale"
#endif #endif
@ -132,7 +132,7 @@ static gboolean _fontsel_on_closex(gpointer data)
/* error */ /* error */
static int _error(char const * message, int ret) static int _error(char const * message, int ret)
{ {
fputs(PROGNAME ": ", stderr); fputs(PROGNAME_FONTSEL ": ", stderr);
perror(message); perror(message);
return ret; return ret;
} }
@ -141,7 +141,7 @@ static int _error(char const * message, int ret)
/* usage */ /* usage */
static int _usage(void) static int _usage(void)
{ {
fprintf(stderr, _("Usage: %s\n"), PROGNAME); fprintf(stderr, _("Usage: %s\n"), PROGNAME_FONTSEL);
return 1; return 1;
} }