terminated = 1;
printf( "Command> " );
- if ( chomp( get_string( command, 10240, "" ) ) != NULL )
+ if ( chomp( io_get_string( command, 10240, "" ) ) != NULL )
{
if ( strcmp( command, "" ) )
{
return input;
}
-char *get_string( char *output, int maxlength, char *use )
+char *io_get_string( char *output, int maxlength, char *use )
{
char *value = NULL;
strcpy( output, use );
extern char *chomp( char * );
extern char *trim( char * );
extern char *strip_quotes( char * );
-extern char *get_string( char *, int, char * );
+extern char *io_get_string( char *, int, char * );
extern int *get_int( int *, int );
extern void term_init( );
extern int term_read( );
printf( "Server [localhost]: " );
- if ( get_string( server, sizeof( server ), "localhost" ) != NULL )
+ if ( io_get_string( server, sizeof( server ), "localhost" ) != NULL )
{
printf( "Port [5250]: " );
return input;
}
-char *get_string( char *output, int maxlength, char *use )
-{
- char *value = NULL;
- strcpy( output, use );
- if ( trim( chomp( fgets( output, maxlength, stdin ) ) ) != NULL )
- {
- if ( !strcmp( output, "" ) )
- strcpy( output, use );
- value = output;
- }
- return value;
-}
-
int *get_int( int *output, int use )
{
int *value = NULL;