argcargv.i cosmetic updates
This commit is contained in:
parent
0307d0732c
commit
e4cdf9d98f
6 changed files with 25 additions and 32 deletions
|
|
@ -1,21 +1,18 @@
|
|||
/* ------------------------------------------------------------
|
||||
* --- 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) }
|
||||
|
||||
%inline %{
|
||||
|
||||
int mainApp(size_t argc, const char **argv)
|
||||
int mainApp(size_t argc, const char **argv)
|
||||
{
|
||||
return argc;
|
||||
}
|
||||
|
||||
then in the ruby side:
|
||||
then from ruby:
|
||||
|
||||
args = ["asdf", "asdf2"]
|
||||
mainApp(args);
|
||||
|
|
@ -31,7 +28,7 @@
|
|||
VALUE *ptr = RARRAY_PTR($input);
|
||||
for (i=0; i < size; i++, ptr++) {
|
||||
$2[i]= StringValuePtr(*ptr);
|
||||
}
|
||||
}
|
||||
$2[i]=NULL;
|
||||
} else {
|
||||
$1 = 0; $2 = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue