mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
OpenBSD patches for ttsnoop.
Mostly adding std:: for strstream interfaces.
This commit is contained in:
parent
76984653b4
commit
43bae997c8
9 changed files with 43 additions and 43 deletions
|
@ -34,7 +34,7 @@
|
|||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#include <strstream>
|
||||
#else
|
||||
#include <strstream.h>
|
||||
|
@ -468,7 +468,7 @@ DtTtSetLabel(
|
|||
)
|
||||
{
|
||||
Tt_status status = tt_ptr_error( val );
|
||||
ostrstream errStream;
|
||||
std::ostrstream errStream;
|
||||
errStream << func << " = " << val << " (" << status << ")" << ends;
|
||||
char *label = errStream.str();
|
||||
DtTtSetLabel( labelWidget, label );
|
||||
|
@ -483,7 +483,7 @@ DtTtSetLabel(
|
|||
Tt_status status
|
||||
)
|
||||
{
|
||||
ostrstream errStream;
|
||||
std::ostrstream errStream;
|
||||
errStream << func << " = " << status << ends;
|
||||
char *label = errStream.str();
|
||||
DtTtSetLabel( labelWidget, label );
|
||||
|
@ -498,7 +498,7 @@ DtTtSetLabel(
|
|||
int returnVal
|
||||
)
|
||||
{
|
||||
ostrstream errStream;
|
||||
std::ostrstream errStream;
|
||||
errStream << func << " = " << returnVal << ends;
|
||||
char *label = errStream.str();
|
||||
DtTtSetLabel( labelWidget, label );
|
||||
|
@ -519,7 +519,7 @@ _DtTtChoices(
|
|||
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 );
|
||||
|
@ -566,7 +566,7 @@ _DtTtChoices(
|
|||
}
|
||||
*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 ))) {
|
||||
|
@ -592,7 +592,7 @@ _DtTtChoices(
|
|||
}
|
||||
*itemCount = dtTtPatternsCount;
|
||||
for (i = 0; i < dtTtPatternsCount; i++) {
|
||||
ostrstream itemStream;
|
||||
std::ostrstream itemStream;
|
||||
itemStream << (void *)dtTtPatterns[ i ] << ends;
|
||||
items[ i ] = XmStringCreateLocalized(
|
||||
itemStream.str() );
|
||||
|
@ -636,11 +636,11 @@ _DtOpen(
|
|||
)
|
||||
{
|
||||
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();
|
||||
|
@ -662,12 +662,12 @@ _DtOpen(
|
|||
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;
|
||||
|
@ -699,12 +699,12 @@ _DtMan(
|
|||
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() );
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
*** Add include files, types, macros, externs, and user functions here.
|
||||
***/
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#include <fstream>
|
||||
#include <strstream>
|
||||
#else
|
||||
|
@ -50,7 +50,7 @@
|
|||
|
||||
#include "DtTt.h"
|
||||
|
||||
extern ofstream snoopStream;
|
||||
extern std::ofstream snoopStream;
|
||||
|
||||
typedef enum {
|
||||
DoJustPrint,
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include <sys/wait.h>
|
||||
#include <Xm/TextF.h>
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#include <fstream>
|
||||
#include <strstream>
|
||||
#else
|
||||
|
@ -61,7 +61,7 @@ extern XtPointer _XmStringUngenerate (XmString string,
|
|||
XmTextType output_type);
|
||||
}
|
||||
|
||||
extern ofstream snoopStream;
|
||||
extern std::ofstream snoopStream;
|
||||
extern int globalTimeout;
|
||||
|
||||
typedef struct _FileChooserInfo {
|
||||
|
@ -217,7 +217,7 @@ fileOkayed(
|
|||
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;
|
||||
|
@ -305,7 +305,7 @@ fileOkayed(
|
|||
break;
|
||||
}
|
||||
if (WEXITSTATUS( ival ) != 0) {
|
||||
ostrstream diagnosis;
|
||||
std::ostrstream diagnosis;
|
||||
diagnosis << "tt_type_comp -p: syntax error in "
|
||||
<< path << ends;
|
||||
DtTtSetLabel( label, diagnosis.str() );
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
*** 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>
|
||||
|
@ -620,7 +620,7 @@ DtTtMessageWidgetCreate(
|
|||
}
|
||||
}
|
||||
|
||||
ostrstream labelStream;
|
||||
std::ostrstream labelStream;
|
||||
labelStream << "Tt_message " << (void *)msg;
|
||||
XtVaSetValues( instance->messageProps,
|
||||
XmNtitle, labelStream.str(),
|
||||
|
@ -1408,7 +1408,7 @@ msgGenAction(
|
|||
/*** 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 );
|
||||
|
@ -1475,7 +1475,7 @@ msgGenC(
|
|||
/*** 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 );
|
||||
|
@ -1878,7 +1878,7 @@ genObserver(
|
|||
/*** 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 );
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
*** 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>
|
||||
|
@ -371,7 +371,7 @@ DtTtPatternWidgetCreate(
|
|||
}
|
||||
}
|
||||
|
||||
ostrstream labelStream;
|
||||
std::ostrstream labelStream;
|
||||
labelStream << "Tt_pattern " << (void *)pat << ends;
|
||||
XtVaSetValues( instance->patternProps,
|
||||
XmNtitle, labelStream.str(),
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#include <Xm/TextF.h>
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#include <fstream>
|
||||
#include <strstream>
|
||||
#else
|
||||
|
@ -52,7 +52,7 @@
|
|||
|
||||
#include "DtTt.h"
|
||||
|
||||
extern ofstream snoopStream;
|
||||
extern std::ofstream snoopStream;
|
||||
|
||||
void
|
||||
_DtSessionChooserSet(
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#include <strstream>
|
||||
#else
|
||||
#include <strstream.h>
|
||||
|
@ -213,7 +213,7 @@ _DtTtChooserSet(
|
|||
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;
|
||||
|
@ -314,7 +314,7 @@ choiceSelected(
|
|||
break;
|
||||
}
|
||||
void *entity = DtTtNth( type, info->item_position - 1 );
|
||||
ostrstream entityName;
|
||||
std::ostrstream entityName;
|
||||
if (isString) {
|
||||
entityName << (char *)entity << ends;
|
||||
} else {
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#include <iostream>
|
||||
#include <strstream>
|
||||
#include <fstream>
|
||||
|
@ -112,8 +112,8 @@ unsigned int snoopedArgsCount = 0;
|
|||
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[] =
|
||||
|
@ -196,7 +196,7 @@ signalHandler(
|
|||
}
|
||||
}
|
||||
|
||||
#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
|
||||
|
@ -208,7 +208,7 @@ _tt_sigset(
|
|||
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);
|
||||
|
@ -670,7 +670,7 @@ main(int argc, char **argv)
|
|||
}
|
||||
Tt_status status;
|
||||
snoopStream.open( snoopFile, ios::app );
|
||||
ostrstream envStr;
|
||||
std::ostrstream envStr;
|
||||
envStr << "TT_TRACE_SCRIPT=> ";
|
||||
envStr << traceFile << ends;
|
||||
traceScript = envStr.str();
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include <unistd.h>
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#include <fstream>
|
||||
#include <strstream>
|
||||
#else
|
||||
|
@ -50,7 +50,7 @@
|
|||
|
||||
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;
|
||||
|
@ -93,7 +93,7 @@ fork_tttrace(
|
|||
|
||||
/*** 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 &";
|
||||
|
@ -659,7 +659,7 @@ libcPause(
|
|||
|
||||
/*** 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();
|
||||
|
@ -667,7 +667,7 @@ libcPause(
|
|||
//
|
||||
// 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() << "\" ";
|
||||
|
@ -1343,7 +1343,7 @@ toggleSnooping(
|
|||
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue