diff options
author | Damien George <damien.p.george@gmail.com> | 2016-11-16 16:04:57 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-11-16 18:13:50 +1100 |
commit | 6b239c271c9c7041f9741c2a0f348f350808ad8a (patch) | |
tree | 32f8c5a9a114d2149409d020c889a8dc2b16a03b /py/persistentcode.h | |
parent | 6810f2c134f9329e9dc18f4e0d3a1936ca6d8011 (diff) |
py: Factor out persistent-code reader into separate files.
Implementations of persistent-code reader are provided for POSIX systems
and systems using FatFS. Macros to use these are MICROPY_READER_POSIX and
MICROPY_READER_FATFS respectively. If an alternative implementation is
needed then a port can define the function mp_reader_new_file.
Diffstat (limited to 'py/persistentcode.h')
-rw-r--r-- | py/persistentcode.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/py/persistentcode.h b/py/persistentcode.h index 8859bc577..d04e0b633 100644 --- a/py/persistentcode.h +++ b/py/persistentcode.h @@ -26,13 +26,9 @@ #ifndef MICROPY_INCLUDED_PY_PERSISTENTCODE_H #define MICROPY_INCLUDED_PY_PERSISTENTCODE_H -#include "py/obj.h" - -typedef struct _mp_reader_t { - void *data; - mp_uint_t (*read_byte)(void *data); - void (*close)(void *data); -} mp_reader_t; +#include "py/mpprint.h" +#include "py/reader.h" +#include "py/emitglue.h" mp_raw_code_t *mp_raw_code_load(mp_reader_t *reader); mp_raw_code_t *mp_raw_code_load_mem(const byte *buf, size_t len); |