| 1 |
/* X11::GUITest ($Id: Common.h 249 2026-08-15 18:43:40Z ctrondlp $) |
| 2 |
* |
| 3 |
* Copyright (c) 2003-2026 Dennis K. Paulsen, All Rights Reserved. |
| 4 |
* Email: [email protected] |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or |
| 7 |
* modify it under the terms of the GNU General Public License as |
| 8 |
* published by the Free Software Foundation; either version 2 of |
| 9 |
* the License, or (at your option) any later version. |
| 10 |
* |
| 11 |
* This program is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU General Public License |
| 17 |
* along with this program; if not, see <http://www.gnu.org/licenses>. |
| 18 |
* |
| 19 |
*/ |
| 20 |
#ifndef COMMON_H |
| 21 |
#define COMMON_H |
| 22 |
|
| 23 |
/* Pulls in autoconf's generated defines (HAVE_GETTEXT below, etc.) for the |
| 24 |
* recorder's autotools build; automake supplies -DHAVE_CONFIG_H |
| 25 |
* automatically once configure.ac uses AC_CONFIG_HEADERS. This header is |
| 26 |
* also shared with the plain Perl module build (Makefile.PL, no |
| 27 |
* autoconf), where HAVE_CONFIG_H is never defined, so this is a no-op |
| 28 |
* there. */ |
| 29 |
#ifdef HAVE_CONFIG_H |
| 30 |
#include "config.h" |
| 31 |
#endif |
| 32 |
|
| 33 |
#define APP_VERSION "0.29" |
| 34 |
|
| 35 |
/* LOCALEDIR is supplied at compile time (see recorder/src/Makefile.am), |
| 36 |
* derived from --prefix/--datadir, so installs outside of /usr (common on |
| 37 |
* BSD, HP-UX, AIX, Solaris) still find their catalogs. Fall back to the |
| 38 |
* historical default for any build that doesn't define it. */ |
| 39 |
#ifndef APP_TEXTDOMAIN |
| 40 |
#ifdef LOCALEDIR |
| 41 |
#define APP_TEXTDOMAIN LOCALEDIR |
| 42 |
#else |
| 43 |
#define APP_TEXTDOMAIN "/usr/share/locale" |
| 44 |
#endif |
| 45 |
#endif |
| 46 |
|
| 47 |
/* GNU gettext isn't native on AIX/HP-UX (they use catgets-based i18n |
| 48 |
* instead of libintl.h), and no .po/.mo catalogs are shipped in this |
| 49 |
* project anyway, so translation support is optional: fall back to |
| 50 |
* returning the string unchanged when a usable gettext wasn't found by |
| 51 |
* configure (see recorder/configure.ac). */ |
| 52 |
#ifdef HAVE_GETTEXT |
| 53 |
#include <libintl.h> |
| 54 |
#ifndef _ |
| 55 |
#define _(str) gettext(str) |
| 56 |
#endif |
| 57 |
#else |
| 58 |
#ifndef _ |
| 59 |
#define _(str) (str) |
| 60 |
#endif |
| 61 |
#endif |
| 62 |
|
| 63 |
#ifndef TRUE |
| 64 |
#define TRUE (1) |
| 65 |
#endif |
| 66 |
#ifndef FALSE |
| 67 |
#define FALSE (0) |
| 68 |
#endif |
| 69 |
|
| 70 |
#ifndef BOOL |
| 71 |
#define BOOL int |
| 72 |
#endif |
| 73 |
#ifndef UINT |
| 74 |
#define UINT unsigned int |
| 75 |
#endif |
| 76 |
#ifndef ULONG |
| 77 |
#define ULONG unsigned long |
| 78 |
#endif |
| 79 |
#ifndef NUL |
| 80 |
#define NUL '\0' |
| 81 |
#endif |
| 82 |
#ifndef MAX_PATH |
| 83 |
#define MAX_PATH 255 |
| 84 |
#endif |
| 85 |
|
| 86 |
#endif /* #ifndef COMMON_H */ |