]> git.siccegge.de Git - frida/frida.git/blob - src/bindings/Guile.hxx
Fix segfault when loading a sceme file
[frida/frida.git] / src / bindings / Guile.hxx
1 #ifndef INCLUDE__Guile_hxx_
2 #define INCLUDE__Guile_hxx_
3
4 #include <libguile.h>
5
6 #include "Interpreter.hxx"
7
8 class GuileInterpreter : public QObject, public Interpreter {
9 Q_OBJECT
10 Q_PLUGIN_METADATA(IID "xyz.frida.Interpreter")
11 Q_INTERFACES(Interpreter)
12 public:
13 GuileInterpreter();
14
15 int evaluate(const std::string& command,
16 std::ostream& stdout,
17 std::ostream& stderr,
18 std::string& result);
19
20 int loadFile(const std::string& filename,
21 std::ostream& stdout,
22 std::ostream& stderr,
23 std::string& result);
24
25 std::string fileExtension() const {return "scm";}
26 private:
27 SCM guile_output_port;
28 SCM guile_error_port;
29 };
30
31 #endif /* INCLUDE__Guile_hxx_ */