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 <mgba-util/vfs.h>
8
9struct VFilePy {
10 struct VFile d;
11 void* fileobj;
12};
13
14struct VFile* VFileFromPython(void* fileobj);
15
16PYEXPORT bool _vfpClose(struct VFile* vf);
17PYEXPORT off_t _vfpSeek(struct VFile* vf, off_t offset, int whence);
18PYEXPORT ssize_t _vfpRead(struct VFile* vf, void* buffer, size_t size);
19PYEXPORT ssize_t _vfpWrite(struct VFile* vf, const void* buffer, size_t size);
20PYEXPORT void* _vfpMap(struct VFile* vf, size_t size, int flags);
21PYEXPORT void _vfpUnmap(struct VFile* vf, void* memory, size_t size);
22PYEXPORT void _vfpTruncate(struct VFile* vf, size_t size);
23PYEXPORT ssize_t _vfpSize(struct VFile* vf);
24PYEXPORT bool _vfpSync(struct VFile* vf, const void* buffer, size_t size);