summaryrefslogtreecommitdiffstats
path: root/bindings/python/gpod.i
diff options
context:
space:
mode:
authorNicholas Piper <nicholas@users.sourceforge.net>2006-04-08 18:10:15 +0000
committerNicholas Piper <nicholas@users.sourceforge.net>2006-04-08 18:10:15 +0000
commit8697e6e2b75c521980fc760ca6852de324c45c72 (patch)
treeb2a3c5e713ef580cbb8f55a175dfc8236cd6d1ea /bindings/python/gpod.i
parentf73ea5a7e838a3d0e6047997344d26f50eb1999a (diff)
downloadlibgpod-8697e6e2b75c521980fc760ca6852de324c45c72.tar.gz
libgpod-8697e6e2b75c521980fc760ca6852de324c45c72.tar.xz
libgpod-8697e6e2b75c521980fc760ca6852de324c45c72.zip
Provide typemap for guint8, and use to provide podcast support in add_songs.py example.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1234 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'bindings/python/gpod.i')
-rw-r--r--bindings/python/gpod.i12
1 files changed, 12 insertions, 0 deletions
diff --git a/bindings/python/gpod.i b/bindings/python/gpod.i
index 11670b8..482e5eb 100644
--- a/bindings/python/gpod.i
+++ b/bindings/python/gpod.i
@@ -77,8 +77,20 @@ PyObject* sw_get_playlists(Itdb_iTunesDB *itdb) {
# them utf8 encoded Strings.
typedef char gchar;
+%typemap(in) guint8 {
+ long ival;
+ ival = PyInt_AsLong($input);
+ if (( ival > 255 ) || ( ival < 0 )) {
+ PyErr_SetString(PyExc_ValueError, "Value must be between 0 and 255");
+ SWIG_fail;
+ } else {
+ $1 = (guint8) ival;
+ }
+}
+
typedef int gboolean;
typedef int gint32;
+
typedef unsigned int guint32;
#define G_BEGIN_DECLS