Implement IO port API

Related issue: #964

Implemented the IO API of Jerry ports. Removed log file from API level.
The port implementation should define the destination of log messages.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2016-07-13 15:42:16 +02:00
parent 35c0869ef5
commit fa94c67ee7
10 changed files with 164 additions and 158 deletions
+17 -15
View File
@@ -17,34 +17,36 @@
#include <stdio.h>
#include <stdarg.h>
/**
* Provide log message to filestream implementation for the engine.
* Provide console message implementation for the engine.
*/
int jerry_port_logmsg (FILE* stream, const char* format, ...)
void
jerry_port_console (const char *format, /**< format string */
...) /**< parameters */
{
va_list args;
int count = 0;
va_start (args, format);
// TODO, uncomment when vfprint link is ok
//count = vfprintf (stream, format, args);
/* TODO, uncomment when vprint link is ok */
/* vfprintf (stdout, format, args); */
va_end (args);
return count;
}
} /* jerry_port_console */
/**
* Provide error message to console implementation for the engine.
* Provide log message implementation for the engine.
*/
int jerry_port_errormsg (const char* format, ...)
void
jerry_port_log (jerry_log_level_t level, /**< log level */
const char *format, /**< format string */
...) /**< parameters */
{
(void) level; /* ignore log level */
va_list args;
int count = 0;
va_start (args, format);
// TODO, uncomment when vprint link is ok
//count = vprintf (format, args);
/* TODO, uncomment when vprint link is ok */
/* vprintf (stderr, format, args); */
va_end (args);
return count;
}
} /* jerry_port_log */
/** exit - cause normal process termination */