aboutsummaryrefslogtreecommitdiffhomepage
path: root/fallback.c
diff options
context:
space:
mode:
authorGravatar Claes Nästén <me@pekdon.net>2007-08-22 17:57:41 +1000
committerGravatar Claes Nästén <me@pekdon.net>2007-08-22 17:57:41 +1000
commit74a270ea327129b489410900851a88d1e5a4084d (patch)
tree9311f02e2bca1395536c0d3347ce095e0fe2b2a2 /fallback.c
parent2994378e1a56ccba59bb60c9cd448707eb0be077 (diff)
Add tparm fallback to use under systems having tparm with fixed number of paramters, required with Solaris curses. Updated configure script to check for c99 for compilation with Sun Studio under solaris and updated LDFlAGS for fish_pager etc to include library dependencies from common.c etc.
darcs-hash:20070822075741-cac88-5532b074490bce1d7f37289b1774a4a5e44416d8.gz
Diffstat (limited to 'fallback.c')
-rw-r--r--fallback.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/fallback.c b/fallback.c
index 4e690a77..d686f58d 100644
--- a/fallback.c
+++ b/fallback.c
@@ -65,6 +65,64 @@ int tputs(const char *str, int affcnt, int (*fish_putc)(tputs_arg_t))
#endif
+#ifdef TPARM_SOLARIS_KLUDGE
+
+#undef tparm
+
+/**
+ Checks for known string values and maps to correct number of parameters.
+*/
+char *tparm_solaris_kludge( char *str, ... )
+{
+ long int param[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ va_list ap;
+ va_start( ap, str );
+
+ if( ( set_a_foreground && ! strcmp( str, set_a_foreground ) )
+ || ( set_a_background && ! strcmp( str, set_a_background ) )
+ || ( set_foreground && ! strcmp( str, set_foreground ) )
+ || ( set_background && ! strcmp( str, set_background ) )
+ || ( enter_underline_mode && ! strcmp( str, enter_underline_mode ) )
+ || ( exit_underline_mode && ! strcmp( str, exit_underline_mode ) )
+ || ( enter_standout_mode && ! strcmp( str, enter_standout_mode ) )
+ || ( exit_standout_mode && ! strcmp( str, exit_standout_mode ) )
+ || ( flash_screen && ! strcmp( str, flash_screen ) )
+ || ( enter_subscript_mode && ! strcmp( str, enter_subscript_mode ) )
+ || ( exit_subscript_mode && ! strcmp( str, exit_subscript_mode ) )
+ || ( enter_superscript_mode && ! strcmp( str, enter_superscript_mode ) )
+ || ( exit_superscript_mode && ! strcmp( str, exit_superscript_mode ) )
+ || ( enter_blink_mode && ! strcmp( str, enter_blink_mode ) )
+ || ( enter_italics_mode && ! strcmp( str, enter_italics_mode ) )
+ || ( exit_italics_mode && ! strcmp( str, exit_italics_mode ) )
+ || ( enter_reverse_mode && ! strcmp( str, enter_reverse_mode ) )
+ || ( enter_shadow_mode && ! strcmp( str, enter_shadow_mode ) )
+ || ( exit_shadow_mode && ! strcmp( str, exit_shadow_mode ) )
+ || ( enter_standout_mode && ! strcmp( str, enter_standout_mode ) )
+ || ( exit_standout_mode && ! strcmp( str, exit_standout_mode ) )
+ || ( enter_secure_mode && ! strcmp( str, enter_secure_mode ) )
+ || ( enter_bold_mode && ! strcmp ( str, enter_bold_mode ) ) )
+ {
+ param[0] = va_arg( ap, long int );
+ }
+ else if( cursor_address && ! strcmp( str, cursor_address ) )
+ {
+ param[0] = va_arg( ap, long int );
+ param[1] = va_arg( ap, long int );
+ }
+
+ va_end( ap );
+
+
+ return tparm( str, param[0], param[1], param[2], param[3],
+ param[4], param[5], param[6], param[7], param[8] );
+}
+
+// Re-defining just to make sure nothing breaks further down in this file.
+#define tparm tparm_solaris_kludge
+
+#endif
+
#ifndef HAVE_FWPRINTF
#define INTERNAL_FWPRINTF 1