Introduce JERRY_ZSTR_ARG macro to avoid jerryx_print_string, jerryx_print_byte, jerry_port_print_byte, strlen (#4982)

Replace usage of jerryx_print_byte, jerryx_print_string with jerryx_print_buffer.

As we now have JERRY_ZSTR_ARG, so we can take advantage of it

With this, the jerry_port_print_byte port api won't need any more
this reduced the port api surface

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
This commit is contained in:
Yonggang Luo
2024-11-26 00:28:55 +08:00
committed by GitHub
parent e4017f0b3a
commit dfa9afbf6e
15 changed files with 64 additions and 125 deletions
@@ -22,9 +22,7 @@
JERRY_C_API_BEGIN
jerry_value_t jerryx_print_value (const jerry_value_t value);
void jerryx_print_byte (jerry_char_t ch);
void jerryx_print_buffer (const jerry_char_t *buffer_p, jerry_size_t buffer_size);
void jerryx_print_string (const char *str_p);
void jerryx_print_backtrace (unsigned depth);
void jerryx_print_unhandled_exception (jerry_value_t exception);
void jerryx_print_unhandled_rejection (jerry_value_t exception);
+1 -1
View File
@@ -20,7 +20,7 @@
JERRY_C_API_BEGIN
void jerryx_repl (const char* prompt_p);
void jerryx_repl (const jerry_char_t *prompt_p, jerry_size_t prompt_size);
JERRY_C_API_END