Blame view

epsilon-master/python/port/port.h 729 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  #ifndef PYTHON_PORT_H
  #define PYTHON_PORT_H
  
  extern "C" {
  #include <stddef.h>
  }
  
  namespace MicroPython {
  
  class ScriptProvider {
  public:
    virtual const char * contentOfScript(const char * name) = 0;
  };
  
  class ExecutionEnvironment {
  public:
    ExecutionEnvironment();
    static ExecutionEnvironment * currentExecutionEnvironment();
    void runCode(const char * );
    virtual const char * inputText(const char * prompt) {
      return nullptr;
    }
    virtual void displaySandbox() {
    }
    virtual void printText(const char * text, size_t length) {
    }
    void interrupt();
  protected:
    bool m_sandboxIsDisplayed;
  };
  
  void init(void * heapStart, void * heapEnd);
  void deinit();
  void registerScriptProvider(ScriptProvider * s);
  
  };
  
  #endif