fixes
This commit is contained in:
@@ -20,6 +20,7 @@ FILE( MAKE_DIRECTORY ${YAP_APP_DIR}/src/generated/jni)
|
||||
add_custom_target (pllib
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${pllib}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${pl_library} ${pllib}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/android.yap ${pllib}
|
||||
DEPENDS ${pl_library}
|
||||
)
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Created by vsc on 7/6/17.
|
||||
// Created by vsc on 7/6/17->
|
||||
//
|
||||
/* File : example.cxx */
|
||||
/* File : example->cxx */
|
||||
|
||||
#include "streamer.h"
|
||||
|
||||
@@ -25,13 +25,12 @@ extern "C" {
|
||||
#include <yapio.h>
|
||||
#include <iopreds.h>
|
||||
|
||||
extern void Java_pt_up_yap_streamerJNI_swig_1module_1init__(void);
|
||||
extern void Java_pt_up_yap_streamerJNI_swig_1module_1init(void);
|
||||
|
||||
static VFS_t andstream;
|
||||
|
||||
void Java_pt_up_yap_streamerJNI_swig_1module_1init__(void) {
|
||||
// streamerInstance = 0;
|
||||
} ;
|
||||
|
||||
static VFS_t *andstream;
|
||||
|
||||
|
||||
static std::string buff0;
|
||||
|
||||
@@ -83,21 +82,28 @@ streamerInstance->display(buff0);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
AndroidStreamer::bind() {
|
||||
buff0 = *new std::string[256];
|
||||
andstream.name = "/android/user_error";
|
||||
andstream.vflags = VFS_CAN_WRITE | VFS_HAS_PREFIX;
|
||||
andstream.prefix = "/android";
|
||||
andstream.suffix = NULL;
|
||||
andstream.open = and_open;
|
||||
andstream.close = and_close;
|
||||
andstream.get_char = and_get;
|
||||
andstream.put_char = and_put;
|
||||
andstream.flush = and_flush;
|
||||
andstream.seek = and_seek;
|
||||
andstream.next = GLOBAL_VFS;
|
||||
GLOBAL_VFS = &andstream;
|
||||
Yap_InitStdStream(StdOutStream, Output_Stream_f | Append_Stream_f, NULL, &andstream);
|
||||
Yap_InitStdStream(StdErrStream, Output_Stream_f | Append_Stream_f, NULL, &andstream);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
void Java_pt_up_yap_streamerJNI_swig_1module_1init(void) {
|
||||
andstream = new VFS_t();
|
||||
|
||||
andstream->name = "/android/user_error";
|
||||
andstream->vflags = VFS_CAN_WRITE | VFS_HAS_PREFIX;
|
||||
andstream->prefix = "/android";
|
||||
andstream->suffix = NULL;
|
||||
andstream->open = and_open;
|
||||
andstream->close = and_close;
|
||||
andstream->get_char = and_get;
|
||||
andstream->put_char = and_put;
|
||||
andstream->flush = and_flush;
|
||||
andstream->seek = and_seek;
|
||||
andstream->next = GLOBAL_VFS;
|
||||
GLOBAL_VFS = andstream;
|
||||
Yap_InitStdStream(StdOutStream, Output_Stream_f | Append_Stream_f, NULL, andstream);
|
||||
Yap_InitStdStream(StdErrStream, Output_Stream_f | Append_Stream_f, NULL, andstream); //streamerInstance = 0;
|
||||
} ;
|
||||
|
||||
|
||||
}
|
@@ -9,10 +9,14 @@
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
struct AndroidStreamer {
|
||||
std::string *buff0;
|
||||
|
||||
virtual void display(std::string text) const = 0;
|
||||
virtual ~AndroidStreamer() {}
|
||||
void bind();
|
||||
AndroidStreamer() { buff0 = new std::string[256];
|
||||
};
|
||||
};
|
||||
void setStreamer(AndroidStreamer* streamer);
|
||||
AndroidStreamer& getStreamer();
|
||||
|
Reference in New Issue
Block a user