X-Git-Url: https://git.siccegge.de//index.cgi?a=blobdiff_plain;f=src%2Fbindings%2FGuile.hxx;h=63d5fcbafdad62bacbec6f8fbaa9c61fde1ba168;hb=057e0e59829f19ee4d9a550f2d3dc9fe9df5c92c;hp=5de69080be4e464229e627e4b314f78ef19f9c6c;hpb=7cc1f7b923b7859a7469e6a651d4a87bc48c4772;p=frida%2Ffrida.git diff --git a/src/bindings/Guile.hxx b/src/bindings/Guile.hxx index 5de6908..63d5fcb 100644 --- a/src/bindings/Guile.hxx +++ b/src/bindings/Guile.hxx @@ -2,20 +2,52 @@ #define INCLUDE__Guile_hxx_ #include +#include +#include "qt.hxx" #include "Interpreter.hxx" -class GuileInterpreter : public Interpreter { +namespace guile { + class Geiser : public QThread { + Q_OBJECT + public: + Geiser(QObject* parent) : QThread(parent) {} + Geiser() {} + private: + void run() Q_DECL_OVERRIDE; + }; +} + +class GuileInterpreter : public QObject, public Interpreter { + Q_OBJECT + Q_PLUGIN_METADATA(IID "xyz.frida.Interpreter") + Q_INTERFACES(Interpreter) public: GuileInterpreter(); + virtual ~GuileInterpreter(); int evaluate(const std::string& command, std::ostream& stdout, std::ostream& stderr, std::string& result); + + int loadFile(const std::string& filename, + std::ostream& stdout, + std::ostream& stderr, + std::string& result); + + std::string fileExtension() const {return "scm";} private: + int evaluateWithErrorHandling(SCM (*fun)(void *), + void* data, + std::ostream& stdout, + std::ostream& stderr, + std::string& result); + SCM guile_output_port; SCM guile_error_port; + log4cxx::LoggerPtr logger; + guile::Geiser* geiser; }; #endif /* INCLUDE__Guile_hxx_ */