diff options
author | Daniel Vince <vincedani@users.noreply.github.com> | 2019-04-25 14:57:17 +0200 |
---|---|---|
committer | Robert Fancsik <frobert@inf.u-szeged.hu> | 2019-04-25 14:57:17 +0200 |
commit | 37b7645e6a4740e8726ce097626cfc5f45064a45 (patch) | |
tree | 6b968f65500021e906d5130fe80853732122690d /targets | |
parent | 938e9c75301e909ff402f5750329fe02fc282d15 (diff) |
Rework ES2015 module system and add missing features. (#2792)
Co-authored-by: Dániel Bátyai <dbatyai@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Daniel Vince vinced@inf.u-szeged.hu
Diffstat (limited to 'targets')
-rw-r--r-- | targets/nuttx-stm32f4/jerry_main.c | 21 | ||||
-rw-r--r-- | targets/tizenrt-artik053/apps/jerryscript/jerry_main.c | 21 |
2 files changed, 42 insertions, 0 deletions
diff --git a/targets/nuttx-stm32f4/jerry_main.c b/targets/nuttx-stm32f4/jerry_main.c index 1b264ae9..a2c1e1cd 100644 --- a/targets/nuttx-stm32f4/jerry_main.c +++ b/targets/nuttx-stm32f4/jerry_main.c @@ -559,6 +559,27 @@ jerry_port_release_source (uint8_t *buffer_p) /**< buffer to free */ } /* jerry_port_release_source */ /** + * Normalize a file path + * + * @return length of the path written to the output buffer + */ +size_t +jerry_port_normalize_path (const char *in_path_p, /**< input file path */ + char *out_buf_p, /**< output buffer */ + size_t out_buf_size) /**< size of output buffer */ +{ + size_t len = strlen (in_path_p); + if (len + 1 > out_buf_size) + { + return 0; + } + + /* Return the original string. */ + strcpy (out_buf_p, in_path_p); + return len; +} /* jerry_port_normalize_path */ + +/** * Dummy function to get the time zone adjustment. * * @return 0 diff --git a/targets/tizenrt-artik053/apps/jerryscript/jerry_main.c b/targets/tizenrt-artik053/apps/jerryscript/jerry_main.c index e4d6ade6..3967dba8 100644 --- a/targets/tizenrt-artik053/apps/jerryscript/jerry_main.c +++ b/targets/tizenrt-artik053/apps/jerryscript/jerry_main.c @@ -574,6 +574,27 @@ jerry_port_release_source (uint8_t *buffer_p) /**< buffer to free */ } /* jerry_port_release_source */ /** + * Normalize a file path + * + * @return length of the path written to the output buffer + */ +size_t +jerry_port_normalize_path (const char *in_path_p, /**< input file path */ + char *out_buf_p, /**< output buffer */ + size_t out_buf_size) /**< size of output buffer */ +{ + size_t len = strlen (in_path_p); + if (len + 1 > out_buf_size) + { + return 0; + } + + /* Return the original string. */ + strcpy (out_buf_p, in_path_p); + return len; +} /* jerry_port_normalize_path */ + +/** * Main program. * * @return 0 if success, error code otherwise |