Skip to content

Commit e5d4560

Browse files
committed
Splitting out feature-specific jerry-core APIs into separate headers
This affects snapshot and debugger-related declarations. The separated headers are included by jerryscript.h, so this is not a breaking change but header modularization only. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]
1 parent 1e1012c commit e5d4560

File tree

3 files changed

+100
-16
lines changed

3 files changed

+100
-16
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* Copyright JS Foundation and other contributors, http://js.foundation
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
#ifndef JERRYSCRIPT_DEBUGGER_H
17+
#define JERRYSCRIPT_DEBUGGER_H
18+
19+
#include <stdbool.h>
20+
#include <stddef.h>
21+
#include <stdint.h>
22+
23+
#ifdef __cplusplus
24+
extern "C"
25+
{
26+
#endif /* __cplusplus */
27+
28+
/** \addtogroup jerry-debugger Jerry engine interface - Debugger feature
29+
* @{
30+
*/
31+
32+
/**
33+
* Engine debugger functions.
34+
*/
35+
bool jerry_debugger_is_connected (void);
36+
void jerry_debugger_stop (void);
37+
void jerry_debugger_continue (void);
38+
void jerry_debugger_stop_at_breakpoint (bool enable_stop_at_breakpoint);
39+
40+
/**
41+
* @}
42+
*/
43+
44+
#ifdef __cplusplus
45+
}
46+
#endif /* __cplusplus */
47+
#endif /* !JERRYSCRIPT_DEBUGGER_H */
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/* Copyright JS Foundation and other contributors, http://js.foundation
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
#ifndef JERRYSCRIPT_SNAPSHOT_H
17+
#define JERRYSCRIPT_SNAPSHOT_H
18+
19+
#include "jerryscript.h"
20+
21+
#ifdef __cplusplus
22+
extern "C"
23+
{
24+
#endif /* __cplusplus */
25+
26+
/** \addtogroup jerry-snapshot Jerry engine interface - Snapshot feature
27+
* @{
28+
*/
29+
30+
/**
31+
* Snapshot functions.
32+
*/
33+
size_t jerry_parse_and_save_snapshot (const jerry_char_t *source_p, size_t source_size, bool is_for_global,
34+
bool is_strict, uint32_t *buffer_p, size_t buffer_size);
35+
jerry_value_t jerry_exec_snapshot (const uint32_t *snapshot_p, size_t snapshot_size, bool copy_bytecode);
36+
size_t jerry_parse_and_save_literals (const jerry_char_t *source_p, size_t source_size, bool is_strict,
37+
uint32_t *buffer_p, size_t buffer_size, bool is_c_format);
38+
39+
/**
40+
* @}
41+
*/
42+
43+
#ifdef __cplusplus
44+
}
45+
#endif /* __cplusplus */
46+
#endif /* !JERRYSCRIPT_SNAPSHOT_H */

jerry-core/include/jerryscript.h

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -393,27 +393,18 @@ bool jerry_foreach_object_property (const jerry_value_t obj_val, jerry_object_pr
393393
bool jerry_is_valid_utf8_string (const jerry_char_t *utf8_buf_p, jerry_size_t buf_size);
394394
bool jerry_is_valid_cesu8_string (const jerry_char_t *cesu8_buf_p, jerry_size_t buf_size);
395395

396-
/**
397-
* Snapshot functions.
398-
*/
399-
size_t jerry_parse_and_save_snapshot (const jerry_char_t *source_p, size_t source_size, bool is_for_global,
400-
bool is_strict, uint32_t *buffer_p, size_t buffer_size);
401-
jerry_value_t jerry_exec_snapshot (const uint32_t *snapshot_p, size_t snapshot_size, bool copy_bytecode);
402-
size_t jerry_parse_and_save_literals (const jerry_char_t *source_p, size_t source_size, bool is_strict,
403-
uint32_t *buffer_p, size_t buffer_size, bool is_c_format);
404-
/**
405-
* Engine debugger functions.
406-
*/
407-
bool jerry_debugger_is_connected (void);
408-
void jerry_debugger_stop (void);
409-
void jerry_debugger_continue (void);
410-
void jerry_debugger_stop_at_breakpoint (bool enable_stop_at_breakpoint);
411-
412396
/**
413397
* Miscellaneous functions.
414398
*/
415399
void jerry_set_vm_exec_stop_callback (jerry_vm_exec_stop_callback_t stop_cb, void *user_p, uint32_t frequency);
416400

401+
/*
402+
* Feature-specific APIs.
403+
*/
404+
405+
#include "jerryscript-snapshot.h"
406+
#include "jerryscript-debugger.h"
407+
417408
/**
418409
* @}
419410
*/

0 commit comments

Comments
 (0)