Mostly adding std:: for strstream interfaces.
#include <fcntl.h>
#include <unistd.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <strstream>
#else
#include <strstream.h>
)
{
Tt_status status = tt_ptr_error( val );
- ostrstream errStream;
+ std::ostrstream errStream;
errStream << func << " = " << val << " (" << status << ")" << ends;
char *label = errStream.str();
DtTtSetLabel( labelWidget, label );
Tt_status status
)
{
- ostrstream errStream;
+ std::ostrstream errStream;
errStream << func << " = " << status << ends;
char *label = errStream.str();
DtTtSetLabel( labelWidget, label );
int returnVal
)
{
- ostrstream errStream;
+ std::ostrstream errStream;
errStream << func << " = " << returnVal << ends;
char *label = errStream.str();
DtTtSetLabel( labelWidget, label );
return 0;
}
for (int i = 0; i < count; i++) {
- ostrstream itemStream;
+ std::ostrstream itemStream;
itemStream << (void *)pPats[ i ];
char *name = (char *)
tt_pattern_user( *pPats[ i ], _DtTtPatsNameKey );
}
*itemCount = dtTtMessagesCount;
for (i = 0; i < dtTtMessagesCount; i++) {
- ostrstream itemStream;
+ std::ostrstream itemStream;
itemStream << (void *)dtTtMessages[ i ];
char *op = tt_message_op( dtTtMessages[ i ] );
if (! tt_is_err( tt_ptr_error( op ))) {
}
*itemCount = dtTtPatternsCount;
for (i = 0; i < dtTtPatternsCount; i++) {
- ostrstream itemStream;
+ std::ostrstream itemStream;
itemStream << (void *)dtTtPatterns[ i ] << ends;
items[ i ] = XmStringCreateLocalized(
itemStream.str() );
)
{
char *file = tempnam( 0, AIX_CONST_STRING tempnamTemplate );
- ostrstream cmdStream;
+ std::ostrstream cmdStream;
cmdStream << cmd << " > " << file << ends;
int sysStat = system( cmdStream.str() );
if (! WIFEXITED( sysStat )) {
- ostrstream func;
+ std::ostrstream func;
func << "system( \"" << cmdStream.str() << "\" )" << ends;
DtTtSetLabel( label, func.str(), sysStat );
delete cmdStream.str();
const char * file
)
{
- ostrstream labelStream;
+ std::ostrstream labelStream;
labelStream << "dtaction Open " << file << ends;
DtTtSetLabel( label, labelStream.str() );
delete labelStream.str();
- ostrstream cmd;
+ std::ostrstream cmd;
cmd << "( unset TT_TRACE_SCRIPT; if dtaction Open " << file
<< "; then :; else textedit " << file << "; fi; sleep 600; rm -f "
<< file << " ) &" << ends;
const char * topic
)
{
- ostrstream labelStream;
+ std::ostrstream labelStream;
labelStream << "dtaction Dtmanpageview " << topic << ends;
DtTtSetLabel( label, labelStream.str() );
delete labelStream.str();
- ostrstream cmd;
+ std::ostrstream cmd;
cmd << "unset TT_TRACE_SCRIPT; if dtaction Dtmanpageview " << topic
<< "; then :; else cmdtool -c man " << topic << "; fi &" << ends;
system( cmd.str() );
*** Add include files, types, macros, externs, and user functions here.
***/
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <fstream>
#include <strstream>
#else
#include "DtTt.h"
-extern ofstream snoopStream;
+extern std::ofstream snoopStream;
typedef enum {
DoJustPrint,
#include <sys/wait.h>
#include <Xm/TextF.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <fstream>
#include <strstream>
#else
XmTextType output_type);
}
-extern ofstream snoopStream;
+extern std::ofstream snoopStream;
extern int globalTimeout;
typedef struct _FileChooserInfo {
XtVaGetValues( instance->fchooser, XmNuserData, &xtPtr, 0 );
FileChooserInfo *info = (FileChooserInfo *)xtPtr;
Widget label = dtb_ttsnoop_ttsnoop_win.ttsnoopWin_label;
- ostrstream script;
+ std::ostrstream script;
switch (info->choice) {
Tt_pattern *pats;
Tt_message msg;
break;
}
if (WEXITSTATUS( ival ) != 0) {
- ostrstream diagnosis;
+ std::ostrstream diagnosis;
diagnosis << "tt_type_comp -p: syntax error in "
<< path << ends;
DtTtSetLabel( label, diagnosis.str() );
*** Add include files, types, macros, externs, and user functions here.
***/
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <strstream>
#else
#include <strstream.h>
}
}
- ostrstream labelStream;
+ std::ostrstream labelStream;
labelStream << "Tt_message " << (void *)msg;
XtVaSetValues( instance->messageProps,
XmNtitle, labelStream.str(),
/*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
/*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- ostrstream action; // XXX when to delete .str()?
+ std::ostrstream action; // XXX when to delete .str()?
DtbMessagePropsMessagePropsInfo instance =
(DtbMessagePropsMessagePropsInfo)clientData;
Tt_message msg = messageProps2Msg( instance );
/*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
/*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- ostrstream code; // XXX when to delete .str()?
+ std::ostrstream code; // XXX when to delete .str()?
DtbMessagePropsMessagePropsInfo instance =
(DtbMessagePropsMessagePropsInfo)clientData;
Tt_message msg = messageProps2Msg( instance );
/*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
/*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- ostrstream ptype; // XXX when to delete .str()?
+ std::ostrstream ptype; // XXX when to delete .str()?
DtbMessagePropsMessagePropsInfo instance =
(DtbMessagePropsMessagePropsInfo)clientData;
Tt_message msg = messageProps2Msg( instance );
*** Add include files, types, macros, externs, and user functions here.
***/
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <strstream>
#else
#include <strstream.h>
}
}
- ostrstream labelStream;
+ std::ostrstream labelStream;
labelStream << "Tt_pattern " << (void *)pat << ends;
XtVaSetValues( instance->patternProps,
XmNtitle, labelStream.str(),
#include <Xm/TextF.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <fstream>
#include <strstream>
#else
#include "DtTt.h"
-extern ofstream snoopStream;
+extern std::ofstream snoopStream;
void
_DtSessionChooserSet(
#include <stdio.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <strstream>
#else
#include <strstream.h>
XmTextFieldSetString( instance->chooserText, 0 );
XtVaSetValues( instance->chooser, XmNtitle, title, 0 );
- ostrstream valuesStream;
+ std::ostrstream valuesStream;
valuesStream << itemCount << " " << valuesLabel;
if (itemCount != 1) valuesStream << "s";
valuesStream << ends;
break;
}
void *entity = DtTtNth( type, info->item_position - 1 );
- ostrstream entityName;
+ std::ostrstream entityName;
if (isString) {
entityName << (char *)entity << ends;
} else {
#include <sys/stat.h>
#include <time.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <iostream>
#include <strstream>
#include <fstream>
char * optTraceScript = 0;
String apiTracerArgv[ 10 ];
String snooperArgv[ 10 ];
-ostrstream tttraceCmd;
-ofstream snoopStream;
+std::ostrstream tttraceCmd;
+std::ofstream snoopStream;
// Xt squats on -tf ?! XXX
const char Usage[] =
}
}
-#if defined(SVR4) || defined(aix) || defined(hpux) || defined(__osf__) || defined(linux)
+#if defined(SVR4) || defined(aix) || defined(hpux) || defined(__osf__) || defined(linux) || defined(CSRG_BASED)
#if !defined(SIG_PF)
typedef void (*sig_pf_t)(int);
#define SIG_PF sig_pf_t
int sig,
SIG_PF handler )
{
-#if defined(hpux) || defined(linux)
+#if defined(hpux) || defined(linux) || defined(CSRG_BASED)
struct sigaction act;
act.sa_handler = handler;
sigemptyset(&act.sa_mask);
}
Tt_status status;
snoopStream.open( snoopFile, ios::app );
- ostrstream envStr;
+ std::ostrstream envStr;
envStr << "TT_TRACE_SCRIPT=> ";
envStr << traceFile << ends;
traceScript = envStr.str();
#include <unistd.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <fstream>
#include <strstream>
#else
extern "C" { const char *_tt_lib_version; };
-extern ofstream snoopStream;
+extern std::ofstream snoopStream;
extern unsigned int globalSaveLines;
extern char * traceScript;
extern const char * globalVersionString;
/*** DTB_USER_CODE_START vvv Add C code below vvv ***/
DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- ostrstream tttraceCmd;
+ std::ostrstream tttraceCmd;
tttraceCmd << "unset TT_TRACE_SCRIPT; dtterm -sb -sl ";
tttraceCmd << globalSaveLines;
tttraceCmd << " -title tttrace -geometry 120x24 -e tttrace &";
/*** DTB_USER_CODE_START vvv Add C code below vvv ***/
DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- ostrstream advice;
+ std::ostrstream advice;
advice << "pause(); /* kill -CONT " << getpid() << " */";
DtTtSetLabel( instance->ttsnoopWin_label, advice.str() );
delete advice.str();
//
// run "(if dterror.ds blah blah; then kill -CONT pid; fi)&"
//
- ostrstream script;
+ std::ostrstream script;
script << "(if dterror.ds ";
// arg 1: text
script << "\"kill -CONT " << getpid() << "\" ";
if (! tt_is_err( status )) {
snoopPatIsRegistered = ! snoopPatIsRegistered;
}
- ostrstream stream;
+ std::ostrstream stream;
stream << func << (void *)snoopPat << ")" << ends;
DtTtSetLabel( instance->ttsnoopWin_label, stream.str(), status );
delete stream.str();