Move jerry-core API implementations and headers into dedicated subdirectories (#1793)
Moved all public API headers under the `jerry-core/include` directory. This makes installing all the public headers easier. Also, should we have new public headers in the future, their installation will be automatic, there will be no need to update the build files. Moreover, this aligns better with the structure of other libraries in the project (in those cases, public headers always reside in `<library>/include`). Moved all public API implementations under the `jerry-core/api` directory. This cleans up the root directory of `jerry-core`, moving all implementation code under "modules", i.e., subdirectories. This also makes the future splitting of the big and monolithic `jerry.c` along features easier, if needed. (Debugger and snapshot-related functions are already in separate sources.) Notes: * `jerryscript.h` is split up to separate header files along feature boundaries. These new headers are included by `jerryscript.h`, so this is not a breaking change but header modularization only. * `jerry-snapshot.h` is still under `jerry-core/api`, keeping it as a non-public header. * This commit also adapts all targets to the include path change. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "jerry-core/jerryscript.h"
|
||||
#include "jerry-core/include/jerryscript.h"
|
||||
#include "jerry_extapi.h"
|
||||
|
||||
#include "native_esp8266.h"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "jerry-core/jerryscript.h"
|
||||
#include "jerry-core/include/jerryscript.h"
|
||||
#include "jerry_extapi.h"
|
||||
#include "jerry_run.h"
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "jerry-core/jerryscript-port.h"
|
||||
#include "jerry-core/include/jerryscript-port.h"
|
||||
int ets_putc (int);
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "jerry-core/jerryscript.h"
|
||||
#include "jerry-core/include/jerryscript.h"
|
||||
#include "jerry_extapi.h"
|
||||
|
||||
#include "native_mbed.h"
|
||||
@@ -99,7 +99,7 @@ register_native_function (const char* name,
|
||||
jerry_value_t global_object_val = jerry_get_global_object ();
|
||||
jerry_value_t reg_function = jerry_create_external_function (handler);
|
||||
|
||||
bool is_ok = true;
|
||||
bool is_ok = true;
|
||||
|
||||
if (!(jerry_value_is_function (reg_function)
|
||||
&& jerry_value_is_constructor (reg_function)))
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "jerry-core/jerryscript.h"
|
||||
#include "jerry-core/include/jerryscript.h"
|
||||
#include "jerry_extapi.h"
|
||||
#include "jerry_run.h"
|
||||
|
||||
@@ -80,7 +80,7 @@ int js_loop (uint32_t ticknow)
|
||||
jerry_value_t global_obj = jerry_get_global_object ();
|
||||
jerry_value_t sys_name = jerry_create_string ((const jerry_char_t *) fn_sys_loop_name);
|
||||
jerry_value_t sysloop_func = jerry_get_property (global_obj, sys_name);
|
||||
|
||||
|
||||
jerry_release_value (sys_name);
|
||||
|
||||
if (jerry_value_has_error_flag (sysloop_func))
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "mbed-drivers/mbed.h"
|
||||
|
||||
#include "jerry-core/jerryscript.h"
|
||||
#include "jerry-core/include/jerryscript.h"
|
||||
#include "jerry_run.h"
|
||||
|
||||
#include "jerry-targetjs.h"
|
||||
@@ -64,7 +64,7 @@ void app_start (int, char**)
|
||||
|
||||
printf ("\r\nJerryScript in mbed\r\n");
|
||||
printf ("Version: \t%d.%d\n\n", JERRY_API_MAJOR_VERSION, JERRY_API_MINOR_VERSION);
|
||||
|
||||
|
||||
if (jerry_task_init () == 0)
|
||||
{
|
||||
minar::Scheduler::postCallback(jerry_loop).period(minar::milliseconds(100));
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "jerry-core/jerryscript-port.h"
|
||||
#include "jerry-core/include/jerryscript-port.h"
|
||||
|
||||
#include "mbed-hal/us_ticker_api.h"
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "jerry-core/jerryscript.h"
|
||||
#include "jerry-core/include/jerryscript.h"
|
||||
|
||||
#include "Callback.h"
|
||||
#include "mbed_assert.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifndef _JERRYSCRIPT_MBED_LAUNCHER_SETUP_H
|
||||
#define _JERRYSCRIPT_MBED_LAUNCHER_SETUP_H
|
||||
|
||||
#include "jerry-core/jerryscript.h"
|
||||
#include "jerry-core/include/jerryscript.h"
|
||||
|
||||
void jsmbed_js_load_magic_strings(void);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "mbed.h"
|
||||
#include "rtos.h"
|
||||
|
||||
#include "jerry-core/jerryscript.h"
|
||||
#include "jerry-core/include/jerryscript.h"
|
||||
|
||||
#include "jerryscript-mbed-event-loop/EventLoop.h"
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "jerry-core/jerryscript.h"
|
||||
|
||||
#include "jerry-core/include/jerryscript.h"
|
||||
|
||||
#include "jerryscript-mbed-util/logging.h"
|
||||
#include "jerryscript-mbed-util/wrappers.h"
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "jerry-core/jerryscript-port.h"
|
||||
#include "jerry-core/include/jerryscript-port.h"
|
||||
|
||||
#include "us_ticker_api.h"
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ EXT_CFLAGS += -Wno-error=format=
|
||||
.PHONY: jerrycore jerry-main flash clean
|
||||
|
||||
PARTICLE_BUILD_CONFIG = \
|
||||
INCLUDE_DIRS=$(JERRYDIR)/jerry-core \
|
||||
INCLUDE_DIRS=$(JERRYDIR)/jerry-core/include \
|
||||
LIBS=jerry-core \
|
||||
PLATFORM=photon \
|
||||
LIB_DIRS=$(BUILD_DIR)/lib \
|
||||
|
||||
@@ -37,7 +37,7 @@ CFLAGS += -DDEVELHELP
|
||||
# Change this to 0 show compiler invocation lines by default:
|
||||
QUIET ?= 1
|
||||
|
||||
INCLUDES += -I$(JERRYDIR)/jerry-core/
|
||||
INCLUDES += -I$(JERRYDIR)/jerry-core/include
|
||||
|
||||
# Add the shell and some shell commands
|
||||
USEMODULE += shell
|
||||
|
||||
@@ -34,7 +34,7 @@ ZEPHYRLIB = $(ZEPHYR_BASE)/lib
|
||||
TARGET_ZEPHYR ?= ./targets/zephyr
|
||||
SOURCE_DIR = $(TARGET_ZEPHYR)/src
|
||||
|
||||
export JERRY_INCLUDE = $(CURDIR)/jerry-core/
|
||||
export JERRY_INCLUDE = $(CURDIR)/jerry-core/include
|
||||
|
||||
MDEF_FILE = $(realpath $(SOURCE_DIR)/../prj.mdef)
|
||||
CONF_FILE = $(realpath $(SOURCE_DIR)/../prj.conf)
|
||||
@@ -57,7 +57,6 @@ export ALL_LIBS
|
||||
LDFLAGS_zephyr += $(USER_LIB_INCLUDE_DIR)
|
||||
export LDFLAGS_zephyr
|
||||
|
||||
include ${ZEPHYR_BASE}/Makefile.inc
|
||||
include ${ZEPHYR_BASE}/Makefile.inc
|
||||
|
||||
.PHONY = showconfig
|
||||
|
||||
|
||||
Reference in New Issue
Block a user