X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=generator%2Fgenerator_python.ml;h=bc570a88a495ae0ddb6770f1dbab80f4cf9b3499;hp=f85f5d6c10567b0cd91da2316f521aa79b5f0220;hb=4ada0a7815075c9cbe9d8b00da791c105ae739a9;hpb=14490c3e1aac61c6ac90f28828896683f64f0dc9 diff --git a/generator/generator_python.ml b/generator/generator_python.ml index f85f5d6..bc570a8 100644 --- a/generator/generator_python.ml +++ b/generator/generator_python.ml @@ -324,6 +324,9 @@ py_guestfs_close (PyObject *self, PyObject *args) | Bool n -> pr " int %s;\n" n | Int n -> pr " int %s;\n" n | Int64 n -> pr " long long %s;\n" n + | Pointer (t, n) -> + pr " long long %s_int64;\n" n; + pr " %s %s;\n" t n ) args; if optargs <> [] then ( @@ -360,9 +363,11 @@ py_guestfs_close (PyObject *self, PyObject *args) | StringList _ | DeviceList _ -> pr "O" | Bool _ -> pr "i" (* XXX Python has booleans? *) | Int _ -> pr "i" - | Int64 _ -> pr "L" (* XXX Whoever thought it was a good idea to - * emulate C's int/long/long long in Python? - *) + | Int64 _ | Pointer _ -> + (* XXX Whoever thought it was a good idea to + * emulate C's int/long/long long in Python? + *) + pr "L" | BufferIn _ -> pr "s#" ) args; @@ -388,6 +393,7 @@ py_guestfs_close (PyObject *self, PyObject *args) | Bool n -> pr ", &%s" n | Int n -> pr ", &%s" n | Int64 n -> pr ", &%s" n + | Pointer (_, n) -> pr ", &%s_int64" n | BufferIn n -> pr ", &%s, &%s_size" n n ) args; @@ -409,6 +415,8 @@ py_guestfs_close (PyObject *self, PyObject *args) | StringList n | DeviceList n -> pr " %s = get_string_list (py_%s);\n" n n; pr " if (!%s) return NULL;\n" n + | Pointer (t, n) -> + pr " %s = (%s) (intptr_t) %s_int64;\n" n t n ) args; pr "\n"; @@ -444,7 +452,7 @@ py_guestfs_close (PyObject *self, PyObject *args) function | Pathname _ | Device _ | Dev_or_Path _ | String _ | Key _ | FileIn _ | FileOut _ | OptString _ | Bool _ | Int _ | Int64 _ - | BufferIn _ -> () + | BufferIn _ | Pointer _ -> () | StringList n | DeviceList n -> pr " free (%s);\n" n ) args;