diff options
Diffstat (limited to '05.PORT-API.md')
-rw-r--r-- | 05.PORT-API.md | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/05.PORT-API.md b/05.PORT-API.md index e57922de..4468da9e 100644 --- a/05.PORT-API.md +++ b/05.PORT-API.md @@ -82,6 +82,44 @@ typedef enum void jerry_port_log (jerry_log_level_t level, const char *fmt, ...); ``` +The `jerry_port_print_char` is currenlty not used by the jerry-core directly. +However, it provides a port specifc way for `jerry-ext` components to print +information. + +```c +/** + * Print a character to stdout. + */ +void jerry_port_print_char (char c); +``` + +### ES2015 Module system helper functions + +The import statement requires two specific functions for opening and closing files (the modules) port specific. + +```c +/** + * Opens file with the given path and reads its source. + * @return the source of the file + */ +uint8_t * +jerry_port_read_source (const char *file_name_p, /**< file name */ + size_t *out_size_p) /**< [out] read bytes */ +{ + // open file from given path + // return its source +} /* jerry_port_read_source */ + +/** + * Release the previously opened file's content. + */ +void +jerry_port_release_source (uint8_t *buffer_p) /**< buffer to free */ +{ + free (buffer_p); +} /* jerry_port_release_source */ +``` + ## Date ```c @@ -211,6 +249,17 @@ jerry_port_log (jerry_log_level_t level, /**< log level */ } /* jerry_port_log */ ``` +```c +/** + * Print a character to stdout with putchar. + */ +void +jerry_port_print_char (char c) +{ + putchar (c); +} /* jerr_port_print_char */ +``` + ## Date ```c |