Numworks Epsilon  1.4.1
Graphing Calculator Operating System
port.h
Go to the documentation of this file.
1 #ifndef PYTHON_PORT_H
2 #define PYTHON_PORT_H
3 
4 extern "C" {
5 #include <stddef.h>
6 }
7 
8 namespace MicroPython {
9 
11 public:
12  virtual const char * contentOfScript(const char * name) = 0;
13 };
14 
16 public:
19  void runCode(const char * );
20  virtual const char * inputText(const char * prompt) {
21  return nullptr;
22  }
23  virtual void displaySandbox() {
24  }
25  virtual void printText(const char * text, size_t length) {
26  }
27 protected:
29 };
30 
31 void init(void * heapStart, void * heapEnd);
32 void deinit();
34 
35 };
36 
37 // Will implement :
38 // mp_lexer_new_from_file -> Ask the context about a file
39 // mp_import_stat
40 // mp_hal_stdout_tx_strn_cooked -> Tell the context Python printed text
41 // mp_hal_input
42 
43 #endif
static ExecutionEnvironment * currentExecutionEnvironment()
Definition: port.cpp:30
void runCode(const char *)
Definition: port.cpp:34
void init(void *heapStart, void *heapEnd)
Definition: port.cpp:92
virtual const char * contentOfScript(const char *name)=0
virtual const char * inputText(const char *prompt)
Definition: port.h:20
void registerScriptProvider(ScriptProvider *s)
Definition: port.cpp:109
virtual void printText(const char *text, size_t length)
Definition: port.h:25
void deinit()
Definition: port.cpp:105
virtual void displaySandbox()
Definition: port.h:23