home *** CD-ROM | disk | FTP | other *** search
- /* n4messag.c (c)Copyright Sequiter Software Inc., 1987-1990. All rights reserved. */
-
- #include "w4.h"
- #include "p4misc.h"
-
- #include <string.h>
-
- static void message_do( char *, int, int, int * ) ;
- extern CB_WINDOW *v4window_ptr ;
-
-
- static int v4menu_last_len = 0 ;
- int v4menu_row=24, v4menu_col=0 ;
-
- void n4message_do( char *message_ptr )
- {
- message_do( message_ptr, v4menu_row, v4menu_col, &v4menu_last_len ) ;
- }
-
-
- static int v4get_last_len = 0 ;
- int v4get_row=24, v4get_col=0 ;
-
- void g4message_do( char *message_ptr )
- {
- message_do( message_ptr, v4get_row, v4get_col, &v4get_last_len ) ;
- }
-
-
- static void message_do( char *message_ptr, int row, int col, int *last_len_ptr)
- {
- char buf[81] ;
- int len ;
-
- if ( message_ptr == (char *) 0 )
- len = 0 ;
- else
- len = (int) strlen( message_ptr ) ;
-
- if ( len == 0 && *last_len_ptr == 0 ) return ;
-
- memset( buf, (int) ' ', sizeof(buf) ) ;
- if ( len >= sizeof(buf) ) len = sizeof(buf)-1 ;
-
- if ( message_ptr != (char *) 0 )
- memcpy( buf, message_ptr, (size_t) len ) ;
-
- buf[80] = '\000' ;
- if ( *last_len_ptr < len ) *last_len_ptr = len ;
-
- #ifdef UNIX
- attrset( v4window_ptr->menu_attribute ) ;
- buf[*last_len_ptr] = '\000' ;
- mvaddstr( row,col, buf ) ;
- refresh() ;
- #else
- w4write_att( row,col, buf, *last_len_ptr, v4window_ptr->menu_attribute ) ;
- #endif
-
- *last_len_ptr = len ;
- }
-
-