-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
swap the cython buffer implementation for a pure C one (fixes compila…
…tion problems on win32) git-svn-id: https://xpra.org/svn/Xpra/trunk@6252 3bb7dfac-3a0b-4e04-842a-767bc560f471
- Loading branch information
Showing
23 changed files
with
187 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* This file is part of Xpra. | ||
* Copyright (C) 2014 Antoine Martin <[email protected]> | ||
* Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
* later version. See the file COPYING for details. | ||
*/ | ||
|
||
#include "Python.h" | ||
|
||
int get_version(void); | ||
PyObject *memory_as_pybuffer(void* ptr, Py_ssize_t buf_len, int readonly); | ||
int object_as_buffer(PyObject *obj, const void ** buffer, Py_ssize_t * buffer_len); | ||
int object_as_write_buffer(PyObject *obj, void ** buffer, Py_ssize_t * buffer_len); |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* This file is part of Xpra. | ||
* Copyright (C) 2014 Antoine Martin <[email protected]> | ||
* Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
* later version. See the file COPYING for details. | ||
*/ | ||
|
||
#include "Python.h" | ||
|
||
int get_version(void) { | ||
return 1; | ||
} | ||
|
||
PyObject *memory_as_pybuffer(void *ptr, Py_ssize_t buf_len, int readonly) { | ||
Py_buffer pybuf; | ||
Py_ssize_t shape[] = {buf_len}; | ||
int ret; | ||
if (readonly) | ||
ret = PyBuffer_FillInfo(&pybuf, NULL, ptr, buf_len, 0, PyBUF_SIMPLE); | ||
else | ||
ret = PyBuffer_FillInfo(&pybuf, NULL, ptr, buf_len, 0, PyBUF_WRITABLE); | ||
if (ret!=0) | ||
return NULL; | ||
pybuf.format = "B"; | ||
pybuf.shape = shape; | ||
return PyMemoryView_FromBuffer(&pybuf); | ||
} | ||
|
||
int object_as_buffer(PyObject *obj, const void ** buffer, Py_ssize_t * buffer_len) { | ||
Py_buffer *rpybuf; | ||
if (PyMemoryView_Check(obj)) { | ||
rpybuf = PyMemoryView_GET_BUFFER(obj); | ||
if (rpybuf->buf==NULL) | ||
return 1; | ||
buffer[0] = rpybuf->buf; | ||
return 0; | ||
} | ||
return PyObject_AsReadBuffer(obj, buffer, buffer_len); | ||
} | ||
|
||
int object_as_write_buffer(PyObject *obj, void ** buffer, Py_ssize_t * buffer_len) { | ||
Py_buffer *wpybuf; | ||
if (PyMemoryView_Check(obj)) { | ||
wpybuf = PyMemoryView_GET_BUFFER(obj); | ||
if (wpybuf->buf==NULL) | ||
return 1; | ||
buffer[0] = wpybuf->buf; | ||
return 0; | ||
} | ||
return PyObject_AsWriteBuffer(obj, buffer, buffer_len); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.