]> git.siccegge.de Git - frida/frida.git/blob - src/bindings/Guile.hxx
Make signals from geiser work
[frida/frida.git] / src / bindings / Guile.hxx
1 #ifndef INCLUDE__Guile_hxx_
2 #define INCLUDE__Guile_hxx_
3
4 #include <libguile.h>
5 #include <log4cxx/logger.h>
6
7 #include "qt.hxx"
8 #include "Interpreter.hxx"
9
10 class GuileInterpreter : public QObject, public Interpreter {
11 Q_OBJECT
12 Q_PLUGIN_METADATA(IID "xyz.frida.Interpreter")
13 Q_INTERFACES(Interpreter)
14 public:
15 GuileInterpreter();
16
17 int evaluate(const std::string& command,
18 std::ostream& stdout,
19 std::ostream& stderr,
20 std::string& result);
21
22 int loadFile(const std::string& filename,
23 std::ostream& stdout,
24 std::ostream& stderr,
25 std::string& result);
26
27 std::string fileExtension() const {return "scm";}
28 private:
29 int evaluateWithErrorHandling(SCM (*fun)(void *),
30 void* data,
31 std::ostream& stdout,
32 std::ostream& stderr,
33 std::string& result);
34
35 SCM guile_output_port;
36 SCM guile_error_port;
37 log4cxx::LoggerPtr logger;
38 };
39
40 namespace guile {
41 class Geiser : public QThread {
42 Q_OBJECT
43 public:
44 Geiser(QObject* parent) : QThread(parent) {}
45 private:
46 void run() Q_DECL_OVERRIDE;
47 };
48 }
49
50
51 #endif /* INCLUDE__Guile_hxx_ */