summaryrefslogtreecommitdiff
path: root/src/twm.h
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2020-06-19 20:23:42 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2020-06-19 20:23:42 -0400
commit248be9688c23f249f1ecf1860f6f4cb09e56fab2 (patch)
tree4e26a4b75c9659120aa4e509292b341bb2f305e1 /src/twm.h
parenta9d6701d977700b18e31a70cc7982431bc702095 (diff)
add/use functions to make warning messages more consistently use the program name as a prefix
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/twm.h')
-rw-r--r--src/twm.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/twm.h b/src/twm.h
index 1fe106d..d39abdb 100644
--- a/src/twm.h
+++ b/src/twm.h
@@ -60,6 +60,7 @@ from The Open Group.
#ifndef _TWM_
#define _TWM_
+/* *INDENT-OFF* */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -73,6 +74,18 @@ from The Open Group.
#include <X11/StringDefs.h>
#include <X11/Intrinsic.h>
+#ifndef GCC_PRINTFLIKE
+#if defined(GCC_PRINTF) && !defined(printf)
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#endif
+
+#ifndef GCC_NORETURN
+#define GCC_NORETURN _X_NORETURN
+#endif
+
#ifndef WithdrawnState
#define WithdrawnState 0
#endif
@@ -335,8 +348,7 @@ extern void CreateFonts(void);
extern void RestoreWithdrawnLocation(TwmWindow *tmp);
extern void Reborder(Time time);
extern void
-Done(XtPointer, XtSignalId *)
- _X_NORETURN;
+Done(XtPointer, XtSignalId *) _X_NORETURN;
extern void
ComputeCommonTitleOffsets(void);
extern void
@@ -392,6 +404,11 @@ NewBitmapCursor(Cursor *cp, char *source, char *mask);
extern Pixmap
CreateMenuIcon(int height, unsigned int *widthp, unsigned int *heightp);
+extern void twmError(const char *, ...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void twmWarning(const char *, ...) GCC_PRINTFLIKE(1,2);
+extern void twmVerbose(const char *, ...) GCC_PRINTFLIKE(1,2);
+extern void twmMessage(const char *, ...) GCC_PRINTFLIKE(1,2);
+
extern Bool ErrorOccurred;
extern XErrorEvent LastErrorEvent;
@@ -433,4 +450,5 @@ extern int XrandrErrorBase;
#define _XA_WM_CLIENT_LEADER TwmAtoms[9]
#define _XA_WM_WINDOW_ROLE TwmAtoms[10]
+/* *INDENT-ON* */
#endif /* _TWM_ */