| 1 |
// python-gphoto2 - Python interface to libgphoto2 |
| 2 |
// http://github.com/jim-easterbrook/python-gphoto2 |
| 3 |
// Copyright (C) 2014-23 Jim Easterbrook [email protected] |
| 4 |
// |
| 5 |
// This file is part of python-gphoto2. |
| 6 |
// |
| 7 |
// python-gphoto2 is free software: you can redistribute it and/or modify |
| 8 |
// it under the terms of the GNU Lesser General Public License as published |
| 9 |
// by the Free Software Foundation, either version 3 of the License, or |
| 10 |
// (at your option) any later version. |
| 11 |
// |
| 12 |
// python-gphoto2 is distributed in the hope that it will be useful, |
| 13 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
// GNU Lesser General Public License for more details. |
| 16 |
// |
| 17 |
// You should have received a copy of the GNU Lesser General Public License |
| 18 |
// along with python-gphoto2. If not, see <https://www.gnu.org/licenses/>. |
| 19 |
|
| 20 |
%module(package="gphoto2") version |
| 21 |
|
| 22 |
%{ |
| 23 |
#include "gphoto2/gphoto2-version.h" |
| 24 |
%} |
| 25 |
|
| 26 |
%include "common/preamble.i" |
| 27 |
|
| 28 |
// Make docstring parameter types more Pythonic |
| 29 |
%typemap(doc) enum GPVersionVerbosity "$1_name: $1_type (gphoto2.GP_VERSION_SHORT etc.)" |
| 30 |
|
| 31 |
%include "typemaps.i" |
| 32 |
|
| 33 |
%typemap(out) char ** { |
| 34 |
int i; |
| 35 |
char **line = $1; |
| 36 |
$result = PyList_New(0); |
| 37 |
while (*line) { |
| 38 |
PyObject* temp = PyString_FromString(*line); |
| 39 |
PyList_Append($result, temp); |
| 40 |
SWIG_Py_DECREF(temp); |
| 41 |
line++; |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
%include "gphoto2/gphoto2-port-version.h" |
| 46 |
%include "gphoto2/gphoto2-version.h" |