mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 12:42:11 +00:00
Add some utility output formatting functions.
[SVN r41415]
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "jam.h"
|
||||
#include "output.h"
|
||||
#include "newstr.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define bjam_out (stdout)
|
||||
@@ -95,3 +96,26 @@ void out_action(
|
||||
fflush(bjam_err);
|
||||
fflush(globs.cmdout);
|
||||
}
|
||||
|
||||
|
||||
char * outf_int( int value )
|
||||
{
|
||||
char buffer[50];
|
||||
sprintf(buffer, "%i", value);
|
||||
return newstr(buffer);
|
||||
}
|
||||
|
||||
char * outf_double( double value )
|
||||
{
|
||||
char buffer[50];
|
||||
sprintf(buffer, "%f", value);
|
||||
return newstr(buffer);
|
||||
}
|
||||
|
||||
char * outf_time( time_t value )
|
||||
{
|
||||
char buffer[50];
|
||||
strftime(buffer,49,"%Y-%m-%d %H:%M:%SZ",gmtime(&value));
|
||||
return newstr(buffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#ifndef BJAM_OUTPUT_H
|
||||
#define BJAM_OUTPUT_H
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#define EXIT_OK 0
|
||||
#define EXIT_FAIL 1
|
||||
#define EXIT_TIMEOUT 2
|
||||
@@ -20,4 +22,8 @@ void out_action(
|
||||
int exit_reason
|
||||
);
|
||||
|
||||
char * outf_int( int value );
|
||||
char * outf_double( double value );
|
||||
char * outf_time( time_t value );
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user