trick/trick_source/sim_services/VariableServer/VariableServerThread_write_stdio.cpp

14 lines
459 B
C++
Raw Normal View History

2015-02-26 15:02:31 +00:00
#include "trick/VariableServer.hh"
#include "trick/variable_server_message_types.h"
#include "trick/tc_proto.h"
2015-02-26 15:02:31 +00:00
int Trick::VariableServerThread::write_stdio(int stream, std::string text) {
char header[16] ;
snprintf(header, sizeof(header), "%-2d %1d %8d\n" , VS_STDIO, stream , (int)text.length()) ;
2015-02-26 15:02:31 +00:00
tc_write(&connection , (char *) header , strlen(header)) ;
tc_write(&connection , (char *) text.c_str() , text.length()) ;
return 0 ;
}