Split string-sending debugger API into output- and log-sending functions (#2461)

This helps to avoid the use of non-public headers and
protocol-internal constants in external code (e.g., in jerry-port
and jerry-ext).

The patch also cleans up the necessary includes in jerry-core public
headers, and the include order in jerry-port/default public headers.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2018-08-14 09:29:06 +02:00
committed by yichoi
parent b9aa0da402
commit a3112ab901
8 changed files with 75 additions and 18 deletions
+2 -5
View File
@@ -17,7 +17,7 @@
#include "jerryscript-port.h"
#include "jerryscript-port-default.h"
#include "debugger.h"
#include "jerryscript-debugger.h"
#ifndef DISABLE_EXTRA_API
@@ -91,10 +91,7 @@ jerry_port_log (jerry_log_level_t level, /**< message log level */
vsnprintf (buffer, (size_t) length + 1, format, args);
fprintf (stderr, "%s", buffer);
if (jerry_debugger_transport_is_connected ())
{
jerry_debugger_send_output ((jerry_char_t *) buffer, (jerry_size_t) length, (uint8_t) (level + 2));
}
jerry_debugger_send_log (level, (jerry_char_t *) buffer, (jerry_size_t) length);
#else /* If jerry-debugger isn't defined, libc is turned on */
vfprintf (stderr, format, args);
#endif /* JERRY_DEBUGGER */
@@ -16,11 +16,11 @@
#ifndef JERRYSCRIPT_PORT_DEFAULT_H
#define JERRYSCRIPT_PORT_DEFAULT_H
#include <stdbool.h>
#include "jerryscript.h"
#include "jerryscript-port.h"
#include <stdbool.h>
#ifdef __cplusplus
extern "C"
{