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