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:
Akos Kiss
2017-05-04 15:28:24 +02:00
committed by GitHub
parent 90efdf9c8b
commit 91e976f8c7
27 changed files with 103 additions and 40 deletions
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -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);
/**
+2 -2
View File
@@ -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)))
+2 -2
View File
@@ -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))
+2 -2
View File
@@ -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));
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -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 \
+1 -1
View File
@@ -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
+2 -3
View File
@@ -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