ReadRaw and WriteRaw are straight C functions, so's I can use ctypes to pass pointers in without a lot of list copying overhead

develop
doomchild 2010-04-05 11:08:42 -05:00
parent f0ed3f2098
commit 514b0a5e45
1 changed files with 19 additions and 0 deletions

@ -30,6 +30,25 @@ distribution.
#define PyMODINIT_FUNC void
#endif
extern "C"
{
void ReadRaw(DF_API* self, const uint32_t offset, const uint32_t size, uint8_t* target)
{
if(self != NULL && self->api_Ptr != NULL)
{
self->api_Ptr->ReadRaw(offset, size, target);
}
}
void WriteRaw(DF_API* self, const uint32_t offset, const uint32_t size, uint8_t* source)
{
if(self != NULL && self->api_Ptr != NULL)
{
self->api_Ptr->WriteRaw(offset, size, source);
}
}
}
static PyMethodDef module_methods[] =
{
{NULL} //Sentinel