Expose wrap_diff_file to python so we can call it in callbacks.py. */
| 187 | |
| 188 | /* Expose wrap_diff_file to python so we can call it in callbacks.py. */ |
| 189 | PyObject * |
| 190 | DiffFile_from_c(DiffFile *dummy, PyObject *py_diff_file_ptr) |
| 191 | { |
| 192 | const git_diff_file *diff_file; |
| 193 | char *buffer; |
| 194 | Py_ssize_t length; |
| 195 | |
| 196 | /* Here we need to do the opposite conversion from the _pointer getters */ |
| 197 | if (PyBytes_AsStringAndSize(py_diff_file_ptr, &buffer, &length)) |
| 198 | return NULL; |
| 199 | |
| 200 | if (length != sizeof(git_diff_file *)) { |
| 201 | PyErr_SetString(PyExc_TypeError, "passed value is not a pointer"); |
| 202 | return NULL; |
| 203 | } |
| 204 | |
| 205 | /* the "buffer" contains the pointer */ |
| 206 | diff_file = *((const git_diff_file **) buffer); |
| 207 | |
| 208 | return wrap_diff_file(diff_file); |
| 209 | } |
| 210 | |
| 211 | PyDoc_STRVAR(DiffFile_flags__doc__, |
| 212 | "A combination of enums.DiffFlag constants." |
nothing calls this directly
no test coverage detected
searching dependent graphs…