src/platform/python/vfs-py.h (view raw)
1/* Copyright (c) 2013-2016 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7#include "util/vfs.h"
8
9struct VFilePy {
10 struct VFile d;
11 void* fileobj;
12};
13
14struct VFile* VFileFromPython(void* fileobj);
15
16extern "Python+C" {
17
18bool _vfpClose(struct VFile* vf);
19off_t _vfpSeek(struct VFile* vf, off_t offset, int whence);
20ssize_t _vfpRead(struct VFile* vf, void* buffer, size_t size);
21ssize_t _vfpWrite(struct VFile* vf, const void* buffer, size_t size);
22void* _vfpMap(struct VFile* vf, size_t size, int flags);
23void _vfpUnmap(struct VFile* vf, void* memory, size_t size);
24void _vfpTruncate(struct VFile* vf, size_t size);
25ssize_t _vfpSize(struct VFile* vf);
26bool _vfpSync(struct VFile* vf, const void* buffer, size_t size);
27
28}