This commit is contained in:
Vitor Santos Costa
2017-12-05 15:14:57 +00:00
parent b645f60405
commit 645b2c7d93
67 changed files with 1339 additions and 273977 deletions

View File

@@ -27,7 +27,7 @@ PyObject *py_ModDict;
VFS_t pystream;
static void *py_open(const char *name, const char *io_mode) {
static void *py_open(VFS_t *me, int sno, const char *name, const char *io_mode) {
#if HAVE_STRCASESTR
if (strcasestr(name, "//python/") == name)
name += strlen("//python/");
@@ -35,12 +35,16 @@ static void *py_open(const char *name, const char *io_mode) {
if (strstr(name, "//python/") == name)
name += strlen("//python/");
#endif
StreamDesc *st = YAP_RepStreamFromId(sno);
// we assume object is already open, so there is no need to open it.
PyObject *stream = string_to_python(name, true, NULL);
if (stream == Py_None)
return NULL;
Py_INCREF(stream);
return stream;
st->vfs_handle = stream;
st->vfs = me;
st->status = Append_Stream_f | Output_Stream_f;
return stream;
}
static bool py_close(int sno) {