aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken/helper.h
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-01-28 17:19:33 -0200
committerHugo Lima <hugo.lima@openbossa.org>2010-01-28 17:36:50 -0200
commit22eb430cecf6ddc10eed04dd67c81485aba84ab6 (patch)
tree4ebaa0d9d6c99cfe0419cf53859fde63713b852b /libshiboken/helper.h
parent02cdcb7e0e49b22cd10a5146d5a85cec9bfca7bd (diff)
Changed API for PySequence_to_argc_argv.
It was renamed to PySequenceToArgcArgv and a new argument was added, besides some documentation. If the sequence is empty and defaultAppName (the new argument) was provided, argc will be 1 and argv will have a copy of defaultAppName because some libraries, like Qt, need at least one element in argv (the application name), otherwise it'll crash somewhere inside Qt. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'libshiboken/helper.h')
-rw-r--r--libshiboken/helper.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libshiboken/helper.h b/libshiboken/helper.h
index 8c3e3a64d..2e625b3e9 100644
--- a/libshiboken/helper.h
+++ b/libshiboken/helper.h
@@ -61,7 +61,15 @@ inline PyObject* makeTuple(const A& a, const B& b, const C& c)
return tuple;
}
-LIBSHIBOKEN_API bool PySequence_to_argc_argv(PyObject* argList, int* argc, char*** argv);
+/**
+* It transforms a python sequence into two C variables, argc and argv.
+* If the sequence is empty and defaultAppName was provided, argc will be 1 and
+* argv will have a copy of defaultAppName.
+*
+* \note argc and argv *should* be deleted by the user.
+* \returns True on sucess, false otherwise.
+*/
+LIBSHIBOKEN_API bool PySequenceToArgcArgv(PyObject* argList, int* argc, char*** argv, const char* defaultAppName = 0);
} // namespace Shiboken