| 2698 | } |
| 2699 | |
| 2700 | static int read_command( void ) |
| 2701 | { |
| 2702 | int result; |
| 2703 | int ch; |
| 2704 | string line[ 1 ]; |
| 2705 | string_new( line ); |
| 2706 | /* HACK: force line to be on the heap. */ |
| 2707 | string_reserve( line, 64 ); |
| 2708 | while( ( ch = fgetc( command_input ) ) != EOF ) |
| 2709 | { |
| 2710 | if ( ch == '\n' ) |
| 2711 | { |
| 2712 | break; |
| 2713 | } |
| 2714 | else |
| 2715 | { |
| 2716 | string_push_back( line, (char)ch ); |
| 2717 | } |
| 2718 | } |
| 2719 | result = process_command( line->value ); |
| 2720 | string_free( line ); |
| 2721 | return result; |
| 2722 | } |
| 2723 | |
| 2724 | static void debug_listen( void ) |
| 2725 | { |
no test coverage detected