2 Copyright 2007 Rene Rivera
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
12 #define bjam_out (stdout)
13 #define bjam_err (stderr)
23 size_t len = strcspn(data,"\r");
24 data += fwrite(data,1,len,io);
25 if ( *data == '\r' ) ++data;
35 char const * out_data,
36 char const * err_data,
40 /* Print out the action+target line, if the action is quite the action
45 fprintf( bjam_out, "%s %s\n", action, target );
48 /* Print out the command executed if given -d+2. */
51 fputs( command, bjam_out );
52 fputc( '\n', bjam_out );
55 /* Print out the command executed to the command stream. */
58 fputs( command, globs.cmdout );
61 switch ( exit_reason )
69 /* Process expired, make user aware with explicit message. */
72 /* But only output for non-quietly actions. */
73 fprintf( bjam_out, "%ld second time limit exceeded\n", globs.timeout );
81 /* Print out the command output, if requested, or if the program failed. */
82 if ( action || exit_reason != EXIT_OK)
84 /* But only output for non-quietly actions. */
85 if ( ( 0 != out_data ) &&
86 ( ( globs.pipe_action & 1 /* STDOUT_FILENO */ ) ||
87 ( globs.pipe_action == 0 ) ) )
89 out_( out_data, bjam_out );
91 if ( ( 0 != err_data ) &&
92 ( globs.pipe_action & 2 /* STDERR_FILENO */ ) )
94 out_( err_data, bjam_err );
100 fflush( globs.cmdout );
104 char * outf_int( int value )
107 sprintf( buffer, "%i", value );
108 return newstr( buffer );
112 char * outf_double( double value )
115 sprintf( buffer, "%f", value );
116 return newstr( buffer );
120 char * outf_time( time_t value )
123 strftime( buffer, 49, "%Y-%m-%d %H:%M:%SZ", gmtime( &value ) );
124 return newstr( buffer );