Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Frida
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coenen, Joachim
Frida
Commits
e3a42e8e
Commit
e3a42e8e
authored
9 years ago
by
Wuttke, Joachim
Committed by
Wuttke, Joachim
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Test whether Gnuplot supports X11.
parent
32e77712
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pub/lib/dualplot.cpp
+7
-0
7 additions, 0 deletions
pub/lib/dualplot.cpp
pub/trivia/file_ops.cpp
+17
-0
17 additions, 0 deletions
pub/trivia/file_ops.cpp
pub/trivia/file_ops.hpp
+3
-5
3 additions, 5 deletions
pub/trivia/file_ops.hpp
with
27 additions
and
5 deletions
pub/lib/dualplot.cpp
+
7
−
0
View file @
e3a42e8e
...
...
@@ -40,6 +40,13 @@ CPlot::CPlot( int _iPlot, bool _logx, bool _logy ) :
if
(
mkfifo
(
fn_fifo
.
c_str
(),
0666
))
throw
"SYSTEM ERROR cannot make fifo "
+
fn_fifo
+
": will not be able to print"
;
// Check that Gnuplot supports X11.
string
out
=
triv
::
system_read
(
"gnuplot -e 'help X11' 2>&1 < /dev/null"
);
if
(
out
.
substr
(
0
,
5
)
==
"Sorry"
||
out
.
length
()
<
80
)
{
cerr
<<
"Gnuplot seems not to support X11
\n
"
;
exit
(
1
);
}
// Start a Gnuplot that will read from our pipe.
triv
::
system
(
"gnuplot -title "
+
S
(
iPlot
)
+
" -noraise < "
+
fn_fifo
+
"&"
);
...
...
This diff is collapsed.
Click to expand it.
pub/trivia/file_ops.cpp
+
17
−
0
View file @
e3a42e8e
...
...
@@ -40,6 +40,23 @@ void triv::system( string cmd, bool debug )
cout
<<
"DEBUG system call -> return value "
<<
ret
<<
"
\n
"
;
}
//! Execute operation system call, and return its stdout.
string
triv
::
system_read
(
string
cmd
,
bool
debug
)
{
if
(
debug
)
cout
<<
"DEBUG system call '"
+
cmd
+
"'
\n
"
;
FILE
*
f
=
::
popen
(
cmd
.
c_str
(),
"r"
);
string
ret
;
char
buf
[
1024
];
while
(
fgets
(
buf
,
1024
,
f
)
)
ret
+=
buf
;
pclose
(
f
);
return
ret
;
}
//**************************************************************************//
//* file names, globbing *//
...
...
This diff is collapsed.
Click to expand it.
pub/trivia/file_ops.hpp
+
3
−
5
View file @
e3a42e8e
...
...
@@ -11,14 +11,12 @@ namespace triv {
// Improved libc calls:
void
system
(
string
cmd
,
bool
debug
=
false
);
string
system_read
(
string
cmd
,
bool
debug
=
false
);
// File names, globbing:
bool
file_exists
(
const
string
&
fname
);
void
fname_divide
(
const
string
&
fname
,
string
*
fdir
,
string
*
fshort
,
string
*
fext
);
void
glob_file_list
(
const
string
&
pattern
,
const
string
&
extension
,
vector
<
string
>
*
fnames
);
void
fname_divide
(
const
string
&
fname
,
string
*
fdir
,
string
*
fshort
,
string
*
fext
);
void
glob_file_list
(
const
string
&
pattern
,
const
string
&
extension
,
vector
<
string
>
*
fnames
);
string
wordexp_unique
(
const
string
&
s
);
string
next_tmp_file
(
const
string
&
path_format
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment