#include <vector>
#include <iostream>
#include <termios.h>
+#include <JSUtil.h>
#undef LOG_TAG
#define LOG_TAG "TIZEN_DEVICEAPI"
JSValueRef StandaloneConsole::RunLineEx(const char* line, JSValueRef *exception){
JSStringRef jsScript = JSStringCreateWithUTF8CString(line);
+ int size = strlen(line);
+ if( size != static_cast <int>(JSStringGetLength(jsScript))){
+ cout <<"error - fail to converting JSStringRef"<<endl;
+ }
JSValueRef ret = JSEvaluateScript(mGlobalContext, jsScript, NULL, NULL, 0, exception);
JSStringRelease(jsScript);
return ret;
if( length > 0 )
{
- char buff[length];
- memset(buff, 0, length);
+ char buff[length+1];
+ memset(buff, 0, length+1);
int r = fread(buff, 1, length, f);
fclose(f);
vector<string> mHistory;
string mLine;
int mHistoryIndex;
- int mCurrentPos;
- int mCurrentPosTmp;
+ unsigned int mCurrentPos;
+ unsigned int mCurrentPosTmp;
int mLineLength;
public:
LineBuffer():mHistoryIndex(0), mCurrentPos(0){
case 49:
//home
mCurrentPos = 0;
- getch();
+ a = getch();
break;
default:
- getch();
+ a = getch();
}
return true;