diff options
author | axel <axel@liljencrantz.se> | 2005-10-14 00:08:33 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2005-10-14 00:08:33 +1000 |
commit | 0385fbe2be6d1fb03c6fdbc7ca2efb6fe2ff7ce6 (patch) | |
tree | e20858422bfd27f0b1eaed2cdbe3a6aa62b095f1 /output.c | |
parent | 7e3f9c222c3c1a45abf7a89d619aa2b487a65c1e (diff) |
Optimize interactive input reader by allowing multiple input characters between redraws
darcs-hash:20051013140833-ac50b-f652fada56ca7359246b03a4bdf2116fb8c52435.gz
Diffstat (limited to 'output.c')
-rw-r--r-- | output.c | 34 |
1 files changed, 32 insertions, 2 deletions
@@ -82,6 +82,19 @@ static int col_idx[]= } ; +static size_t writestr_buff_sz=0; +static char *writestr_buff = 0; + +void output_init() +{ +} + +void output_destroy() +{ + free( writestr_buff ); +} + + void set_color( int c, int c2 ) { static int last_color = FISH_COLOR_NORMAL, last_color2=FISH_COLOR_NORMAL; @@ -245,8 +258,25 @@ int writech( wint_t ch ) */ void writestr( const wchar_t *str ) { - while( *str != 0 ) - writech( *(str++) ); + while( *str ) + writech( *str++ ); +/* + size_t len = MAX_UTF8_BYTES*wcslen(str)+1; + + if( writestr_buff_sz < len ) + { + writestr_buff = realloc( writestr_buff, writestr_buff_sz ); + if( !writestr_buff ) + die_mem(); + writestr_buff_sz = len; + } + + wcstombs( writestr_buff, + str, + writestr_buff_sz ); + + write( 1, writestr_buff, strlen( writestr_buff ) ); +*/ } |