aboutsummaryrefslogtreecommitdiffhomepage
path: root/output.h
diff options
context:
space:
mode:
authorGravatar liljencrantz <liljencrantz@gmail.com>2007-09-10 00:04:36 +1000
committerGravatar liljencrantz <liljencrantz@gmail.com>2007-09-10 00:04:36 +1000
commit76bb8e79b23556360881f3a8037542265b41a135 (patch)
tree60c4bcd815727c3baf35eb1f70f858b006483de2 /output.h
parent370aeec44d2230ba8ee86abaeb81f14e543e0375 (diff)
Add better debbuging information when writembs is called with null value.
darcs-hash:20070909140436-75c98-b6c925c441ebaa349f998b95314295296fb36252.gz
Diffstat (limited to 'output.h')
-rw-r--r--output.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/output.h b/output.h
index a9472711..4445b6d5 100644
--- a/output.h
+++ b/output.h
@@ -73,13 +73,34 @@ enum
void set_color( int c, int c2 );
+
+#define writembs( mbs ) \
+ { \
+ char *tmp = mbs; \
+ if( tmp ) \
+ { \
+ writembs_internal( tmp ); \
+ } \
+ else \
+ { \
+ debug( 0, \
+ _(L"Tried to use terminfo string %s on line %d of %s, which is undefined in terminal of type \"%ls\". Please report this error to %s"), \
+ #mbs, \
+ __LINE__, \
+ __FILE__, \
+ output_get_term(), \
+ PACKAGE_BUGREPORT); \
+ } \
+ }
+
+
/**
Write a char * narrow string to FD 1, needed for the terminfo
strings. This is usually just a wrapper aound tputs, using writeb
as the sending function. But a weird bug on PPC Linux means that on
this platform, write is instead used directly.
*/
-int writembs( char *str );
+int writembs_internal( char *str );
/**
Write a wide character using the output method specified using output_set_writer().
@@ -126,4 +147,7 @@ void output_set_writer( int (*writer)(char) );
int (*output_get_writer())(char) ;
+void output_set_term( wchar_t *term );
+wchar_t *output_get_term();
+
#endif