diff options
author | Roland Takacs <rtakacs.u-szeged@partner.samsung.com> | 2016-02-01 18:38:14 +0100 |
---|---|---|
committer | László Langó <llango.u-szeged@partner.samsung.com> | 2016-02-09 13:07:29 +0100 |
commit | 6608cc4b7dcb9573df16300f2717fc0d7a2f9cdb (patch) | |
tree | 8f334befac5dafca45fd7f9a55b93a963eb3d5f7 /jerry-core | |
parent | 0e88e819eb0f2c6e3c63e9b73246133b21a84059 (diff) |
Move jerry_port functions into jerry-core.
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
Diffstat (limited to 'jerry-core')
-rw-r--r-- | jerry-core/jerry-port.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/jerry-core/jerry-port.cpp b/jerry-core/jerry-port.cpp new file mode 100644 index 00000000..48124109 --- /dev/null +++ b/jerry-core/jerry-port.cpp @@ -0,0 +1,54 @@ +/* Copyright 2014-2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "jerry-port.h" +#include <stdarg.h> + +/** + * Provide log message to filestream implementation for the engine. + */ +int jerry_port_logmsg (FILE *stream, /**< stream pointer */ + const char *format, /**< format string */ + ...) /**< parameters */ +{ + va_list args; + int count; + va_start (args, format); + count = vfprintf (stream, format, args); + va_end (args); + return count; +} /* jerry_port_logmsg */ + +/** + * Provide error message to console implementation for the engine. + */ +int jerry_port_errormsg (const char *format, /**< format string */ + ...) /**< parameters */ +{ + va_list args; + int count; + va_start (args, format); + count = vfprintf (stderr, format, args); + va_end (args); + return count; +} /* jerry_port_errormsg */ + +/** + * Provide output character to console implementation for the engine. + */ +int jerry_port_putchar (int c) /**< character to put */ +{ + return putchar (c); +} /* jerry_port_putchar */ |