From: Marcelo M. <mar...@us...> - 2006-02-27 04:12:11
|
Update of /cvsroot/swig/SWIG In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7834 Modified Files: CHANGES.current Log Message: add argc,argv typemap for ruby Index: CHANGES.current =================================================================== RCS file: /cvsroot/swig/SWIG/CHANGES.current,v retrieving revision 1.561 retrieving revision 1.562 diff -C2 -d -r1.561 -r1.562 *** CHANGES.current 27 Feb 2006 03:34:27 -0000 1.561 --- CHANGES.current 27 Feb 2006 04:12:08 -0000 1.562 *************** *** 4,8 **** --- 4,29 ---- [Ruby] add argcargv.i library file. + + Use it as follow: + %include argcargv.i + + %apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) } + + %inline { + int mainApp(size_t argc, const char **argv) + { + return argc; + } + } + + then in the ruby side: + + args = ["asdf", "asdf2"] + n = mainApp(args); + + + This is the similar to the python version Lib/python/argcargv.i + 02/24/2006: mgossage |