argcargv.i cosmetic updates

This commit is contained in:
William S Fulton 2022-05-15 18:32:53 +01:00
commit e4cdf9d98f
6 changed files with 25 additions and 32 deletions

View file

@ -1,17 +1,16 @@
/* ------------------------------------------------------------
* --- Argc & Argv ---
* ------------------------------------------------------------
*
* Use it as follow:
*
* %apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) }
* extern int mainApp(size_t argc, const char **argv);
*
* then in the lua:
*
* args = { "arg0", "arg1" }
* mainApp(args);
*
* SWIG library containing argc and argv multi-argument typemaps
Use it as follows:
%apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) }
extern int mainApp(size_t argc, const char **argv);
then from lua:
args = { "arg0", "arg1" }
mainApp(args);
* ------------------------------------------------------------ */
%{

View file

@ -1,5 +1,5 @@
/* ------------------------------------------------------------
* --- Argc & Argv ---
* SWIG library containing argc and argv multi-argument typemaps
* ------------------------------------------------------------ */
%typemap(in) (int ARGC, char **ARGV) {

View file

@ -1,5 +1,5 @@
/* ------------------------------------------------------------
* --- Argc & Argv ---
* SWIG library containing argc and argv multi-argument typemaps
* ------------------------------------------------------------ */
%typemap(in) (int ARGC, char **ARGV) {

View file

@ -1,13 +1,10 @@
/* ------------------------------------------------------------
* --- Argc & Argv ---
* SWIG library containing argc and argv multi-argument typemaps
* ------------------------------------------------------------ */
%fragment("SWIG_AsArgcArgv","header",fragment="SWIG_AsCharPtrAndSize") {
SWIGINTERN int
SWIG_AsArgcArgv(PyObject *input,
swig_type_info *ppchar_info,
size_t *argc, char ***argv, int *owner)
{
SWIG_AsArgcArgv(PyObject *input, swig_type_info *ppchar_info, size_t *argc, char ***argv, int *owner) {
void *vptr;
int res = SWIG_ConvertPtr(input, &vptr, ppchar_info, 0);
if (!SWIG_IsOK(res)) {

View file

@ -1,10 +1,7 @@
/* ------------------------------------------------------------
* --- Argc & Argv ---
* ------------------------------------------------------------ */
* SWIG library containing argc and argv multi-argument typemaps
/* ------------------------------------------------------------
Use it as follow:
Use it as follows:
%apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) }
@ -15,7 +12,7 @@
return argc;
}
then in the ruby side:
then from ruby:
args = ["asdf", "asdf2"]
mainApp(args);

View file

@ -1,5 +1,5 @@
/* ------------------------------------------------------------
* --- Argc & Argv ---
* SWIG library containing argc and argv multi-argument typemaps
* ------------------------------------------------------------ */
%typemap(in) (int ARGC, char **ARGV) {