diff --git a/etc/makepkg.conf b/etc/makepkg.conf index 1068f18983c..4b8f99c21ea 100644 --- a/etc/makepkg.conf +++ b/etc/makepkg.conf @@ -43,7 +43,7 @@ CXX=g++ CPPFLAGS= CFLAGS="-march=nocona -msahf -mtune=generic -O2 -pipe" CXXFLAGS="-march=nocona -msahf -mtune=generic -O2 -pipe" -LDFLAGS="-pipe" +LDFLAGS="" #-- Make Flags: change this for DistCC/SMP systems MAKEFLAGS="-j$(($(nproc)+1))" #-- Debugging flags diff --git a/etc/makepkg_mingw.conf b/etc/makepkg_mingw.conf index afc2b45914a..78ea563ac86 100644 --- a/etc/makepkg_mingw.conf +++ b/etc/makepkg_mingw.conf @@ -44,7 +44,7 @@ if [[ "$MSYSTEM" == "MINGW64" ]]; then CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1" CFLAGS="-march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong" CXXFLAGS="$CFLAGS" - LDFLAGS="-pipe" + LDFLAGS="" elif [[ "$MSYSTEM" == "MINGW32" ]]; then CARCH="i686" CHOST="i686-w64-mingw32" @@ -56,7 +56,7 @@ elif [[ "$MSYSTEM" == "MINGW32" ]]; then CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1" CFLAGS="-march=pentium4 -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong" CXXFLAGS="$CFLAGS" - LDFLAGS="-pipe -Wl,--no-seh -Wl,--large-address-aware" + LDFLAGS="-Wl,--no-seh -Wl,--large-address-aware" elif [[ "$MSYSTEM" == "CLANG64" ]]; then CARCH="x86_64" CHOST="x86_64-w64-mingw32" @@ -68,7 +68,7 @@ elif [[ "$MSYSTEM" == "CLANG64" ]]; then CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1" CFLAGS="-march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong" CXXFLAGS="$CFLAGS" - LDFLAGS="-pipe" + LDFLAGS="" elif [[ "$MSYSTEM" == "CLANG32" ]]; then CARCH="i686" CHOST="i686-w64-mingw32" @@ -80,7 +80,7 @@ elif [[ "$MSYSTEM" == "CLANG32" ]]; then CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1" CFLAGS="-march=pentium4 -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong" CXXFLAGS="$CFLAGS" - LDFLAGS="-pipe -Wl,--no-seh -Wl,--large-address-aware" + LDFLAGS="-Wl,--no-seh -Wl,--large-address-aware" elif [[ "$MSYSTEM" == "CLANGARM64" ]]; then CARCH="aarch64" CHOST="aarch64-w64-mingw32" @@ -92,7 +92,7 @@ elif [[ "$MSYSTEM" == "CLANGARM64" ]]; then CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1" CFLAGS="-O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong" CXXFLAGS="$CFLAGS" - LDFLAGS="-pipe" + LDFLAGS="" elif [[ "$MSYSTEM" == "UCRT64" ]]; then CARCH="x86_64" CHOST="x86_64-w64-mingw32" @@ -104,7 +104,7 @@ elif [[ "$MSYSTEM" == "UCRT64" ]]; then CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1" CFLAGS="-march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong" CXXFLAGS="$CFLAGS" - LDFLAGS="-pipe" + LDFLAGS="" else echo "Unsupported MSYSTEM: $MSYSTEM" exit 1 diff --git a/etc/pacman.d/gnupg/trustdb.gpg b/etc/pacman.d/gnupg/trustdb.gpg index 0b7e1a20a1f..79a9dac282c 100644 Binary files a/etc/pacman.d/gnupg/trustdb.gpg and b/etc/pacman.d/gnupg/trustdb.gpg differ diff --git a/usr/bin/ccache-swig.exe b/usr/bin/ccache-swig.exe index 211fecfc203..dec42130c30 100644 Binary files a/usr/bin/ccache-swig.exe and b/usr/bin/ccache-swig.exe differ diff --git a/usr/bin/lndir.exe b/usr/bin/lndir.exe index c2302f22557..448c2dcb0e2 100755 Binary files a/usr/bin/lndir.exe and b/usr/bin/lndir.exe differ diff --git a/usr/bin/msys-sasl2-3.dll b/usr/bin/msys-sasl2-3.dll index 124251ff00a..00d11ded34b 100755 Binary files a/usr/bin/msys-sasl2-3.dll and b/usr/bin/msys-sasl2-3.dll differ diff --git a/usr/bin/msys-sqlite3-0.dll b/usr/bin/msys-sqlite3-0.dll index f246c074514..39daabb7149 100755 Binary files a/usr/bin/msys-sqlite3-0.dll and b/usr/bin/msys-sqlite3-0.dll differ diff --git a/usr/bin/pacman-conf.exe b/usr/bin/pacman-conf.exe index 22312f786ab..2a2a202d621 100644 Binary files a/usr/bin/pacman-conf.exe and b/usr/bin/pacman-conf.exe differ diff --git a/usr/bin/pacman.exe b/usr/bin/pacman.exe index 4369a8be898..2f91a51cebf 100755 Binary files a/usr/bin/pacman.exe and b/usr/bin/pacman.exe differ diff --git a/usr/bin/pluginviewer.exe b/usr/bin/pluginviewer.exe index 47088994dcb..388bbaa9933 100755 Binary files a/usr/bin/pluginviewer.exe and b/usr/bin/pluginviewer.exe differ diff --git a/usr/bin/sasldblistusers2.exe b/usr/bin/sasldblistusers2.exe index b207e5b8d26..d4feecfdb40 100755 Binary files a/usr/bin/sasldblistusers2.exe and b/usr/bin/sasldblistusers2.exe differ diff --git a/usr/bin/saslpasswd2.exe b/usr/bin/saslpasswd2.exe index 39dc1d6ea0c..8e2534831cd 100755 Binary files a/usr/bin/saslpasswd2.exe and b/usr/bin/saslpasswd2.exe differ diff --git a/usr/bin/swig.exe b/usr/bin/swig.exe index 25119552798..f59383b5084 100644 Binary files a/usr/bin/swig.exe and b/usr/bin/swig.exe differ diff --git a/usr/bin/testpkg.exe b/usr/bin/testpkg.exe index b90376d3791..36d03c0b0c7 100755 Binary files a/usr/bin/testpkg.exe and b/usr/bin/testpkg.exe differ diff --git a/usr/bin/vercmp.exe b/usr/bin/vercmp.exe index 9824e9beeeb..9225e08f39c 100755 Binary files a/usr/bin/vercmp.exe and b/usr/bin/vercmp.exe differ diff --git a/usr/lib/libalpm.a b/usr/lib/libalpm.a index bdf3b4d58bf..9b1dae04d3a 100644 Binary files a/usr/lib/libalpm.a and b/usr/lib/libalpm.a differ diff --git a/usr/lib/sasl2/msys-anonymous-3.dll b/usr/lib/sasl2/msys-anonymous-3.dll index b8dbe29fe4b..f7dcfd08a52 100755 Binary files a/usr/lib/sasl2/msys-anonymous-3.dll and b/usr/lib/sasl2/msys-anonymous-3.dll differ diff --git a/usr/lib/sasl2/msys-crammd5-3.dll b/usr/lib/sasl2/msys-crammd5-3.dll index 1399153f214..21f760cf47b 100755 Binary files a/usr/lib/sasl2/msys-crammd5-3.dll and b/usr/lib/sasl2/msys-crammd5-3.dll differ diff --git a/usr/lib/sasl2/msys-digestmd5-3.dll b/usr/lib/sasl2/msys-digestmd5-3.dll index 9ab87d1791d..d3694c019e9 100755 Binary files a/usr/lib/sasl2/msys-digestmd5-3.dll and b/usr/lib/sasl2/msys-digestmd5-3.dll differ diff --git a/usr/lib/sasl2/msys-gs2-3.dll b/usr/lib/sasl2/msys-gs2-3.dll index c9419f9fb08..a5cd97ac82b 100755 Binary files a/usr/lib/sasl2/msys-gs2-3.dll and b/usr/lib/sasl2/msys-gs2-3.dll differ diff --git a/usr/lib/sasl2/msys-gssapiv2-3.dll b/usr/lib/sasl2/msys-gssapiv2-3.dll index f5e3c87ecc6..17d9262284f 100755 Binary files a/usr/lib/sasl2/msys-gssapiv2-3.dll and b/usr/lib/sasl2/msys-gssapiv2-3.dll differ diff --git a/usr/lib/sasl2/msys-otp-3.dll b/usr/lib/sasl2/msys-otp-3.dll index f5b9b1d65b6..8b5420d392a 100755 Binary files a/usr/lib/sasl2/msys-otp-3.dll and b/usr/lib/sasl2/msys-otp-3.dll differ diff --git a/usr/lib/sasl2/msys-plain-3.dll b/usr/lib/sasl2/msys-plain-3.dll index f44cd27183a..bec579268d7 100755 Binary files a/usr/lib/sasl2/msys-plain-3.dll and b/usr/lib/sasl2/msys-plain-3.dll differ diff --git a/usr/lib/sasl2/msys-sasldb-3.dll b/usr/lib/sasl2/msys-sasldb-3.dll index 02d8fcf2f4c..f6d6da00b86 100755 Binary files a/usr/lib/sasl2/msys-sasldb-3.dll and b/usr/lib/sasl2/msys-sasldb-3.dll differ diff --git a/usr/lib/sasl2/msys-scram-3.dll b/usr/lib/sasl2/msys-scram-3.dll index 22530a8b88e..3dff36143de 100755 Binary files a/usr/lib/sasl2/msys-scram-3.dll and b/usr/lib/sasl2/msys-scram-3.dll differ diff --git a/usr/share/man/man1/lndir.1.gz b/usr/share/man/man1/lndir.1.gz index 4d2e0e416ab..99d31f8cd9e 100644 Binary files a/usr/share/man/man1/lndir.1.gz and b/usr/share/man/man1/lndir.1.gz differ diff --git a/usr/share/man/man1/makepkg-template.1.gz b/usr/share/man/man1/makepkg-template.1.gz index 60b0d39bc4c..420df176da7 100644 Binary files a/usr/share/man/man1/makepkg-template.1.gz and b/usr/share/man/man1/makepkg-template.1.gz differ diff --git a/usr/share/man/man3/libalpm.3.gz b/usr/share/man/man3/libalpm.3.gz index ee5a717d3ee..6b01d49af48 100644 Binary files a/usr/share/man/man3/libalpm.3.gz and b/usr/share/man/man3/libalpm.3.gz differ diff --git a/usr/share/man/man3/libalpm_cb.3.gz b/usr/share/man/man3/libalpm_cb.3.gz index c3217b068a4..872361eeb04 100644 Binary files a/usr/share/man/man3/libalpm_cb.3.gz and b/usr/share/man/man3/libalpm_cb.3.gz differ diff --git a/usr/share/man/man3/libalpm_databases.3.gz b/usr/share/man/man3/libalpm_databases.3.gz index 2603a456023..de39837bcf7 100644 Binary files a/usr/share/man/man3/libalpm_databases.3.gz and b/usr/share/man/man3/libalpm_databases.3.gz differ diff --git a/usr/share/man/man3/libalpm_depends.3.gz b/usr/share/man/man3/libalpm_depends.3.gz index f7e04b83157..a380463f6ca 100644 Binary files a/usr/share/man/man3/libalpm_depends.3.gz and b/usr/share/man/man3/libalpm_depends.3.gz differ diff --git a/usr/share/man/man3/libalpm_errors.3.gz b/usr/share/man/man3/libalpm_errors.3.gz index a8e3221509d..b88bbc7e5fc 100644 Binary files a/usr/share/man/man3/libalpm_errors.3.gz and b/usr/share/man/man3/libalpm_errors.3.gz differ diff --git a/usr/share/man/man3/libalpm_files.3.gz b/usr/share/man/man3/libalpm_files.3.gz index 0fe5b2c99ec..b2894653668 100644 Binary files a/usr/share/man/man3/libalpm_files.3.gz and b/usr/share/man/man3/libalpm_files.3.gz differ diff --git a/usr/share/man/man3/libalpm_groups.3.gz b/usr/share/man/man3/libalpm_groups.3.gz index 3a7cb990739..95cf39d1588 100644 Binary files a/usr/share/man/man3/libalpm_groups.3.gz and b/usr/share/man/man3/libalpm_groups.3.gz differ diff --git a/usr/share/man/man3/libalpm_handle.3.gz b/usr/share/man/man3/libalpm_handle.3.gz index ebfd4ef03ce..31e95d18b66 100644 Binary files a/usr/share/man/man3/libalpm_handle.3.gz and b/usr/share/man/man3/libalpm_handle.3.gz differ diff --git a/usr/share/man/man3/libalpm_list.3.gz b/usr/share/man/man3/libalpm_list.3.gz index 3c6ac9075cc..c5b71d8b5c0 100644 Binary files a/usr/share/man/man3/libalpm_list.3.gz and b/usr/share/man/man3/libalpm_list.3.gz differ diff --git a/usr/share/man/man3/libalpm_log.3.gz b/usr/share/man/man3/libalpm_log.3.gz index cc164561793..fd1c2be6eb8 100644 Binary files a/usr/share/man/man3/libalpm_log.3.gz and b/usr/share/man/man3/libalpm_log.3.gz differ diff --git a/usr/share/man/man3/libalpm_misc.3.gz b/usr/share/man/man3/libalpm_misc.3.gz index 9afb1135c2c..1dfa6c13cc8 100644 Binary files a/usr/share/man/man3/libalpm_misc.3.gz and b/usr/share/man/man3/libalpm_misc.3.gz differ diff --git a/usr/share/man/man3/libalpm_options.3.gz b/usr/share/man/man3/libalpm_options.3.gz index 10b1398d97c..1c713f7e6b6 100644 Binary files a/usr/share/man/man3/libalpm_options.3.gz and b/usr/share/man/man3/libalpm_options.3.gz differ diff --git a/usr/share/man/man3/libalpm_packages.3.gz b/usr/share/man/man3/libalpm_packages.3.gz index 9bff9e46350..af0021cede4 100644 Binary files a/usr/share/man/man3/libalpm_packages.3.gz and b/usr/share/man/man3/libalpm_packages.3.gz differ diff --git a/usr/share/man/man3/libalpm_sig.3.gz b/usr/share/man/man3/libalpm_sig.3.gz index 81561ac29b3..ef75b54b3c0 100644 Binary files a/usr/share/man/man3/libalpm_sig.3.gz and b/usr/share/man/man3/libalpm_sig.3.gz differ diff --git a/usr/share/man/man3/libalpm_trans.3.gz b/usr/share/man/man3/libalpm_trans.3.gz index 8b21eeb4592..fca98bd8306 100644 Binary files a/usr/share/man/man3/libalpm_trans.3.gz and b/usr/share/man/man3/libalpm_trans.3.gz differ diff --git a/usr/share/man/man5/BUILDINFO.5.gz b/usr/share/man/man5/BUILDINFO.5.gz index 071060c30ec..d86e27d537c 100644 Binary files a/usr/share/man/man5/BUILDINFO.5.gz and b/usr/share/man/man5/BUILDINFO.5.gz differ diff --git a/usr/share/man/man5/PKGBUILD.5.gz b/usr/share/man/man5/PKGBUILD.5.gz index 0ab21ded06e..344f66bd929 100644 Binary files a/usr/share/man/man5/PKGBUILD.5.gz and b/usr/share/man/man5/PKGBUILD.5.gz differ diff --git a/usr/share/man/man5/alpm-hooks.5.gz b/usr/share/man/man5/alpm-hooks.5.gz index f6f0e32235d..c8596bc76e9 100644 Binary files a/usr/share/man/man5/alpm-hooks.5.gz and b/usr/share/man/man5/alpm-hooks.5.gz differ diff --git a/usr/share/man/man5/makepkg.conf.5.gz b/usr/share/man/man5/makepkg.conf.5.gz index fb669ae8ed6..8fa49aa1fe2 100644 Binary files a/usr/share/man/man5/makepkg.conf.5.gz and b/usr/share/man/man5/makepkg.conf.5.gz differ diff --git a/usr/share/man/man5/pacman-hooks.5.gz b/usr/share/man/man5/pacman-hooks.5.gz index f6f0e32235d..c8596bc76e9 100644 Binary files a/usr/share/man/man5/pacman-hooks.5.gz and b/usr/share/man/man5/pacman-hooks.5.gz differ diff --git a/usr/share/man/man5/pacman.conf.5.gz b/usr/share/man/man5/pacman.conf.5.gz index 8935a604a0f..5f02517407b 100644 Binary files a/usr/share/man/man5/pacman.conf.5.gz and b/usr/share/man/man5/pacman.conf.5.gz differ diff --git a/usr/share/man/man8/makepkg.8.gz b/usr/share/man/man8/makepkg.8.gz index 4eb61dbd7b0..cf5b30213fd 100644 Binary files a/usr/share/man/man8/makepkg.8.gz and b/usr/share/man/man8/makepkg.8.gz differ diff --git a/usr/share/man/man8/pacman-conf.8.gz b/usr/share/man/man8/pacman-conf.8.gz index a95c11a0407..8096d6691c4 100644 Binary files a/usr/share/man/man8/pacman-conf.8.gz and b/usr/share/man/man8/pacman-conf.8.gz differ diff --git a/usr/share/man/man8/pacman-key.8.gz b/usr/share/man/man8/pacman-key.8.gz index a0611e638ff..543b62684e6 100644 Binary files a/usr/share/man/man8/pacman-key.8.gz and b/usr/share/man/man8/pacman-key.8.gz differ diff --git a/usr/share/man/man8/pacman.8.gz b/usr/share/man/man8/pacman.8.gz index 6ccee224b69..03669d0f7a3 100644 Binary files a/usr/share/man/man8/pacman.8.gz and b/usr/share/man/man8/pacman.8.gz differ diff --git a/usr/share/man/man8/repo-add.8.gz b/usr/share/man/man8/repo-add.8.gz index 57a5c087ee4..92df336917e 100644 Binary files a/usr/share/man/man8/repo-add.8.gz and b/usr/share/man/man8/repo-add.8.gz differ diff --git a/usr/share/man/man8/repo-remove.8.gz b/usr/share/man/man8/repo-remove.8.gz index 57a5c087ee4..92df336917e 100644 Binary files a/usr/share/man/man8/repo-remove.8.gz and b/usr/share/man/man8/repo-remove.8.gz differ diff --git a/usr/share/man/man8/vercmp.8.gz b/usr/share/man/man8/vercmp.8.gz index fe268f7594e..112dee70b66 100644 Binary files a/usr/share/man/man8/vercmp.8.gz and b/usr/share/man/man8/vercmp.8.gz differ diff --git a/usr/share/swig/4.1.1/guile/std_map.i b/usr/share/swig/4.1.1/guile/std_map.i deleted file mode 100644 index f84e78bc34e..00000000000 --- a/usr/share/swig/4.1.1/guile/std_map.i +++ /dev/null @@ -1,1370 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// -// The aim of all that follows would be to integrate std::map with -// Guile as much as possible, namely, to allow the user to pass and -// be returned Scheme association lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::map), f(const std::map&), f(const std::map*): -// the parameter being read-only, either a Scheme alist or a -// previously wrapped std::map can be passed. -// -- f(std::map&), f(std::map*): -// the parameter must be modified; therefore, only a wrapped std::map -// can be passed. -// -- std::map f(): -// the map is returned by copy; therefore, a Scheme alist -// is returned which is most easily used in other Scheme functions -// -- std::map& f(), std::map* f(), const std::map& f(), -// const std::map* f(): -// the map is returned by reference; therefore, a wrapped std::map -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[*k] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[*k] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - K* key = new K(i->first); - T* val = new T(i->second); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - /* native sequence? */ - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - K* k; - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - /* native sequence? */ - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - /* check the first element only */ - K* k; - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, const T& x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scm_cons(k,result); - } - return result; - } - } - }; - - - // specializations for built-ins - - %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) - - template class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[CONVERT_FROM(key)] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - T* x; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != 0) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[CONVERT_FROM(key)] = *x; - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - T* val = new T(i->second); - SCM k = CONVERT_TO(i->first); - SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - T* x; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == 0) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, const T& x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - SCM k = CONVERT_TO(i->first); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) - template class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[*k] = CONVERT_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - K* k; - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[*k] = CONVERT_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - SCM x = CONVERT_TO(i->second); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - K* k; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - K* k; - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM val = SCM_CDR(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) != 0) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, T x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - K* key = new K(i->first); - SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, - T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) - template<> class map< K, T, C > { - %typemap(in) map< K, T, C > { - if (scm_is_null($input)) { - $1 = std::map< K, T, C >(); - } else if (scm_is_pair($input)) { - $1 = std::map< K, T, C >(); - SCM alist = $input; - while (!scm_is_null(alist)) { - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[CONVERT_K_FROM(key)] = - CONVERT_T_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), - const map< K, T, C >* (std::map< K, T, C > temp) { - if (scm_is_null($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (scm_is_pair($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - SCM alist = $input; - while (!scm_is_null(alist)) { - SCM entry, key, val; - entry = SCM_CAR(alist); - if (!scm_is_pair(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = SCM_CAR(entry); - val = SCM_CDR(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!scm_is_pair(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = SCM_CAR(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[CONVERT_K_FROM(key)] = CONVERT_T_FROM(val); - alist = SCM_CDR(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - SCM alist = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { - SCM k = CONVERT_K_TO(i->first); - SCM x = CONVERT_T_TO(i->second); - SCM entry = scm_cons(k,x); - alist = scm_cons(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (scm_is_null($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (scm_is_pair($input)) { - // check the first element only - SCM head = SCM_CAR($input); - if (scm_is_pair(head)) { - SCM key = SCM_CAR(head); - SCM val = SCM_CDR(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (scm_is_pair(val)) { - val = SCM_CAR(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) == 0) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, T x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - SCM keys() { - SCM result = SCM_EOL; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { - SCM k = CONVERT_K_TO(i->first); - result = scm_cons(k,result); - } - return result; - } - } - }; - %enddef - - - specialize_std_map_on_key(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_key(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_key(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_key(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_key(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_key(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_map_on_value(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_value(int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_value(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_value(double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_value(float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_value(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(bool,scm_is_bool, - scm_is_true,SWIG_bool2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(int,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(short,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(long,scm_is_number, - scm_to_long,scm_from_long, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(double,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(float,scm_is_number, - scm_to_double,scm_from_double, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - bool,scm_is_bool, - scm_is_true,SWIG_bool2scm); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - int,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - short,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - long,scm_is_number, - scm_to_long,scm_from_long); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned int,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned short,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - unsigned long,scm_is_number, - scm_to_ulong,scm_from_ulong); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - double,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - float,scm_is_number, - scm_to_double,scm_from_double); - specialize_std_map_on_both(std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm, - std::string,scm_is_string, - SWIG_scm2string,SWIG_string2scm); -} diff --git a/usr/share/swig/4.1.1/javascript/jsc/std_map.i b/usr/share/swig/4.1.1/javascript/jsc/std_map.i deleted file mode 100644 index 9fa10880f88..00000000000 --- a/usr/share/swig/4.1.1/javascript/jsc/std_map.i +++ /dev/null @@ -1,81 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - // add typemaps here - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - const T& get(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void set(const K& key, const T& x) { - (*self)[key] = x; - } - void del(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - } - }; - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - -} diff --git a/usr/share/swig/4.1.1/javascript/v8/javascriptkw.swg b/usr/share/swig/4.1.1/javascript/v8/javascriptkw.swg deleted file mode 100644 index c3c1183916c..00000000000 --- a/usr/share/swig/4.1.1/javascript/v8/javascriptkw.swg +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef JAVASCRIPT_JAVASCRIPTKW_SWG_ -#define JAVASCRIPT_JAVASCRIPTKW_SWG_ - -/* Warnings for Java keywords */ -#define JAVASCRIPTKW(x) %keywordwarn("'" `x` "' is a javascript keyword, renaming to '_"`x`"'",rename="_%s") `x` - -/* Taken from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Reserved_Words */ - -JAVASCRIPTKW(break); -JAVASCRIPTKW(case); -JAVASCRIPTKW(catch); -JAVASCRIPTKW(continue); -JAVASCRIPTKW(default); -JAVASCRIPTKW(delete); -JAVASCRIPTKW(do); -JAVASCRIPTKW(else); -JAVASCRIPTKW(finally); -JAVASCRIPTKW(for); -JAVASCRIPTKW(function); -JAVASCRIPTKW(if); -JAVASCRIPTKW(in); -JAVASCRIPTKW(instanceof); -JAVASCRIPTKW(new); -JAVASCRIPTKW(return); -JAVASCRIPTKW(switch); -JAVASCRIPTKW(this); -JAVASCRIPTKW(throw); -JAVASCRIPTKW(try); -JAVASCRIPTKW(typeof); -JAVASCRIPTKW(var); -JAVASCRIPTKW(void); -JAVASCRIPTKW(while); -JAVASCRIPTKW(with); - -/* others bad names if any*/ -// for example %namewarn("321:clone() is a javascript bad method name") *::clone(); - -#undef JAVASCRIPTKW - -#endif //JAVASCRIPT_JAVASCRIPTKW_SWG_ diff --git a/usr/share/swig/4.1.1/mzscheme/std_map.i b/usr/share/swig/4.1.1/mzscheme/std_map.i deleted file mode 100644 index 1d3eec241b3..00000000000 --- a/usr/share/swig/4.1.1/mzscheme/std_map.i +++ /dev/null @@ -1,1388 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_map.i - * - * SWIG typemaps for std::map - * ----------------------------------------------------------------------------- */ - -%include - -// ------------------------------------------------------------------------ -// std::map -// -// The aim of all that follows would be to integrate std::map with -// MzScheme as much as possible, namely, to allow the user to pass and -// be returned Scheme association lists. -// const declarations are used to guess the intent of the function being -// exported; therefore, the following rationale is applied: -// -// -- f(std::map), f(const std::map&), f(const std::map*): -// the parameter being read-only, either a Scheme alist or a -// previously wrapped std::map can be passed. -// -- f(std::map&), f(std::map*): -// the parameter must be modified; therefore, only a wrapped std::map -// can be passed. -// -- std::map f(): -// the map is returned by copy; therefore, a Scheme alist -// is returned which is most easily used in other Scheme functions -// -- std::map& f(), std::map* f(), const std::map& f(), -// const std::map* f(): -// the map is returned by reference; therefore, a wrapped std::map -// is returned -// ------------------------------------------------------------------------ - -%{ -#include -#include -#include -%} - -// exported class - -namespace std { - - template > class map { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[*k] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[*k] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - K* key = new K(i->first); - T* val = new T(i->second); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - Scheme_Object* x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - /* native sequence? */ - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - K* k; - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - /* native sequence? */ - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - /* check the first element only */ - K* k; - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(key,(void**) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - /* wrapped map? */ - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, const T& x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - - - // specializations for built-ins - - %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) - - template class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - (($1_type &)$1)[CONVERT_FROM(key)] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - T* x; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) == -1) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); - } - temp[CONVERT_FROM(key)] = *x; - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - T* val = new T(i->second); - Scheme_Object* k = CONVERT_TO(i->first); - Scheme_Object* x = SWIG_NewPointerObj(val,$descriptor(T *), 1); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - T* x; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK(key)) { - $1 = 0; - } else { - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (SWIG_ConvertPtr(val,(void**) &x, - $descriptor(T *), 0) != -1) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T& __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, const T& x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - Scheme_Object* k = CONVERT_TO(i->first); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) - template class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[*k] = CONVERT_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - K* k; - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); - if (!CHECK(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[*k] = CONVERT_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - Scheme_Object* x = CONVERT_TO(i->second); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - K* k; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - K* k; - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (SWIG_ConvertPtr(val,(void **) &k, - $descriptor(K *), 0) == -1) { - $1 = 0; - } else { - if (CHECK(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(const K& key, T x) { - (*self)[key] = x; - } - void __delitem__(const K& key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - K* key = new K(i->first); - Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, - T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) - template<> class map< K, T, C > { - %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - $1 = std::map< K, T, C >(); - } else if (SCHEME_PAIRP($input)) { - $1 = std::map< K, T, C >(); - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - (($1_type &)$1)[CONVERT_K_FROM(key)] = - CONVERT_T_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = *(($&1_type) - SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); - } - } - %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, - std::map< K, T, C >* m), - const map< K, T, C >* (std::map< K, T, C > temp, - std::map< K, T, C >* m) { - if (SCHEME_NULLP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - } else if (SCHEME_PAIRP($input)) { - temp = std::map< K, T, C >(); - $1 = &temp; - Scheme_Object* alist = $input; - while (!SCHEME_NULLP(alist)) { - Scheme_Object *entry, *key, *val; - entry = scheme_car(alist); - if (!SCHEME_PAIRP(entry)) - SWIG_exception(SWIG_TypeError,"alist expected"); - key = scheme_car(entry); - val = scheme_cdr(entry); - if (!CHECK_K(key)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - if (!CHECK_T(val)) { - if (!SCHEME_PAIRP(val)) - SWIG_exception(SWIG_TypeError,"alist expected"); - val = scheme_car(val); - if (!CHECK_T(val)) - SWIG_exception(SWIG_TypeError, - "map<" #K "," #T "," #C "> expected"); - } - temp[CONVERT_K_FROM(key)] = CONVERT_T_FROM(val); - alist = scheme_cdr(alist); - } - } else { - $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); - } - } - %typemap(out) map< K, T, C > { - Scheme_Object* alist = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); - i!=$1.rend(); ++i) { - Scheme_Object* k = CONVERT_K_TO(i->first); - Scheme_Object* x = CONVERT_T_TO(i->second); - Scheme_Object* entry = scheme_make_pair(k,x); - alist = scheme_make_pair(entry,alist); - } - $result = alist; - } - %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $&1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, - const map< K, T, C >* { - // native sequence? - if (SCHEME_NULLP($input)) { - /* an empty sequence can be of any type */ - $1 = 1; - } else if (SCHEME_PAIRP($input)) { - // check the first element only - Scheme_Object* head = scheme_car($input); - if (SCHEME_PAIRP(head)) { - Scheme_Object* key = scheme_car(head); - Scheme_Object* val = scheme_cdr(head); - if (!CHECK_K(key)) { - $1 = 0; - } else { - if (CHECK_T(val)) { - $1 = 1; - } else if (SCHEME_PAIRP(val)) { - val = scheme_car(val); - if (CHECK_T(val)) - $1 = 1; - else - $1 = 0; - } else { - $1 = 0; - } - } - } else { - $1 = 0; - } - } else { - // wrapped map? - std::map< K, T, C >* m; - if (SWIG_ConvertPtr($input,(void **) &m, - $1_descriptor, 0) != -1) - $1 = 1; - else - $1 = 0; - } - } - %rename("length") size; - %rename("null?") empty; - %rename("clear!") clear; - %rename("ref") __getitem__; - %rename("set!") __setitem__; - %rename("delete!") __delitem__; - %rename("has-key?") has_key; - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - typedef std::pair< const K, T > value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - - map(); - map(const map& other); - - unsigned int size() const; - bool empty() const; - void clear(); - %extend { - T __getitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - return i->second; - else - throw std::out_of_range("key not found"); - } - void __setitem__(K key, T x) { - (*self)[key] = x; - } - void __delitem__(K key) throw (std::out_of_range) { - std::map< K, T, C >::iterator i = self->find(key); - if (i != self->end()) - self->erase(i); - else - throw std::out_of_range("key not found"); - } - bool has_key(K key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); - } - Scheme_Object* keys() { - Scheme_Object* result = scheme_null; - for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); - i!=self->rend(); ++i) { - Scheme_Object* k = CONVERT_K_TO(i->first); - result = scheme_make_pair(k,result); - } - return result; - } - } - }; - %enddef - - - specialize_std_map_on_key(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_key(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_key(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_key(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_key(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_map_on_value(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_value(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_value(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_value(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_value(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - bool,SCHEME_BOOLP, - SCHEME_TRUEP,swig_make_boolean); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned int,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned short,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - unsigned long,SCHEME_INTP, - SCHEME_INT_VAL,scheme_make_integer_value); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - double,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - float,SCHEME_REALP, - scheme_real_to_double,scheme_make_double); - specialize_std_map_on_both(std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string, - std::string,SCHEME_STRINGP, - swig_scm_to_string,swig_make_string); -} diff --git a/usr/share/swig/4.1.1/ocaml/ocamlrundec.swg b/usr/share/swig/4.1.1/ocaml/ocamlrundec.swg deleted file mode 100644 index dde0b8e5cfd..00000000000 --- a/usr/share/swig/4.1.1/ocaml/ocamlrundec.swg +++ /dev/null @@ -1,212 +0,0 @@ -/* ----------------------------------------------------------------------------- - * ocamlrundec.swg - * - * Ocaml runtime code -- declarations - * ----------------------------------------------------------------------------- */ - -#include -#include -#include - -#ifdef __cplusplus -#define SWIGEXT extern "C" -SWIGEXT { -#else -#define SWIGEXT -#endif -#define value caml_value_t -#define CAML_VALUE caml_value_t -#define CAML_NAME_SPACE -#include -#include -#include -#include -#include -#include -#include - -#if defined(CAMLassert) -/* Both this macro and version.h were introduced in version 4.02.0 */ -#include -#else -#define OCAML_VERSION 0 /* Unknown, but < 40200 */ -#endif - -#define caml_array_set swig_caml_array_set - -/* Adapted from memory.h and mlvalues.h */ - -#define SWIG_CAMLlocal1(x) \ - caml_value_t x = 0; \ - CAMLxparam1 (x) - -#define SWIG_CAMLlocal2(x, y) \ - caml_value_t x = 0, y = 0; \ - CAMLxparam2 (x, y) - -#define SWIG_CAMLlocal3(x, y, z) \ - caml_value_t x = 0, y = 0, z = 0; \ - CAMLxparam3 (x, y, z) - -#define SWIG_CAMLlocal4(x, y, z, t) \ - caml_value_t x = 0, y = 0, z = 0, t = 0; \ - CAMLxparam4 (x, y, z, t) - -#define SWIG_CAMLlocal5(x, y, z, t, u) \ - caml_value_t x = 0, y = 0, z = 0, t = 0, u = 0; \ - CAMLxparam5 (x, y, z, t, u) - -#define SWIG_CAMLlocalN(x, size) \ - caml_value_t x [(size)] = { 0, /* 0, 0, ... */ }; \ - CAMLxparamN (x, (size)) - -#define SWIG_Field(x, i) (((caml_value_t *)(x)) [i]) /* Also an l-value. */ -#define SWIG_Store_field(block, offset, val) do{ \ - mlsize_t caml__temp_offset = (offset); \ - caml_value_t caml__temp_val = (val); \ - caml_modify (&SWIG_Field ((block), caml__temp_offset), caml__temp_val); \ -}while(0) - -#define SWIG_Data_custom_val(v) ((void *) &SWIG_Field((v), 1)) -#ifdef ARCH_BIG_ENDIAN -#define SWIG_Tag_val(val) (((unsigned char *) (val)) [-1]) - /* Also an l-value. */ -#define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [sizeof(caml_value_t)-1]) - /* Also an l-value. */ -#else -#define SWIG_Tag_val(val) (((unsigned char *) (val)) [-sizeof(caml_value_t)]) - /* Also an l-value. */ -#define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [0]) - /* Also an l-value. */ -#endif - -#ifdef CAMLreturn0 -#undef CAMLreturn0 -#endif -#define CAMLreturn0 do{ \ - caml_local_roots = caml__frame; \ - return; \ -}while (0) - -#ifdef CAMLreturn -#undef CAMLreturn -#endif -#define CAMLreturn(result) do{ \ - caml_value_t caml__temp_result = (result); \ - caml_local_roots = caml__frame; \ - return (caml__temp_result); \ -}while(0) - -#define CAMLreturn_type(result) do{ \ - caml_local_roots = caml__frame; \ - return result; \ -}while(0) - -#ifdef CAMLnoreturn -#undef CAMLnoreturn -#endif -#define CAMLnoreturn ((void) caml__frame) - - -#ifndef ARCH_ALIGN_INT64 -#if OCAML_VERSION >= 40300 -#define SWIG_Int64_val(v) (*((int64_t *) SWIG_Data_custom_val(v))) -#else -#define SWIG_Int64_val(v) (*((int64 *) SWIG_Data_custom_val(v))) -#endif -#else -#if OCAML_VERSION >= 40300 -CAMLextern int64_t Int64_val(caml_value_t v); -#else -CAMLextern int64 Int64_val(caml_value_t v); -#endif -#define SWIG_Int64_val(v) Int64_val(v) -#endif - -#define SWIG_NewPointerObj(p,type,flags) caml_val_ptr(p,type) -#define SWIG_GetModule(clientdata) SWIG_Ocaml_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Ocaml_SetModule(pointer) - -typedef enum { - SWIG_OCamlArithmeticException, - SWIG_OCamlDirectorPureVirtual, - SWIG_OCamlOutOfMemoryError, - SWIG_OCamlOverflowException, - SWIG_OCamlIllegalArgumentException, - SWIG_OCamlIndexOutOfBoundsException, - SWIG_OCamlRuntimeException, - SWIG_OCamlSystemException, - SWIG_OCamlUnknownError -} SWIG_OCamlExceptionCodes; - -SWIGINTERN void SWIG_OCamlThrowException(SWIG_OCamlExceptionCodes code, const char *msg) { - CAMLparam0(); - SWIG_CAMLlocal1(str); - - switch (code) { - case SWIG_OCamlIllegalArgumentException: - caml_invalid_argument(msg); - break; - case SWIG_OCamlSystemException: - str = caml_copy_string(msg); - caml_raise_sys_error(str); - break; - case SWIG_OCamlArithmeticException: - case SWIG_OCamlIndexOutOfBoundsException: - case SWIG_OCamlOutOfMemoryError: - case SWIG_OCamlOverflowException: - case SWIG_OCamlRuntimeException: - case SWIG_OCamlUnknownError: - default: - caml_failwith(msg); - break; - } - CAMLreturn0; -} - -#define SWIG_contract_assert(expr, msg) do { if(!(expr)) {SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, msg);} } while (0) - - SWIGINTERN int - SWIG_GetPtr(void *source, void **result, swig_type_info *type, swig_type_info *result_type); - - SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ); - SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ); - SWIGINTERN int caml_list_length( CAML_VALUE lst ); - SWIGINTERN CAML_VALUE caml_array_new( int n ); - SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ); - SWIGINTERN CAML_VALUE caml_array_nth( CAML_VALUE arr, int n ); - SWIGINTERN int caml_array_len( CAML_VALUE arr ); - - SWIGINTERN CAML_VALUE caml_val_char( char c ); - SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char c ); - - SWIGINTERN CAML_VALUE caml_val_short( short s ); - SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short s ); - - SWIGINTERN CAML_VALUE caml_val_int( int x ); - SWIGINTERN CAML_VALUE caml_val_uint( unsigned int x ); - - SWIGINTERN CAML_VALUE caml_val_long( long x ); - SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long x ); - - SWIGINTERN CAML_VALUE caml_val_float( float f ); - SWIGINTERN CAML_VALUE caml_val_double( double d ); - - SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *descriptor ); - - SWIGINTERN CAML_VALUE caml_val_string( const char *str ); - SWIGINTERN CAML_VALUE caml_val_string_len( const char *str, int len ); - - SWIGINTERN long caml_long_val( CAML_VALUE v ); - SWIGINTERN double caml_double_val( CAML_VALUE v ); - - SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out, - swig_type_info *descriptor ); - SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ); - - SWIGINTERN char *caml_string_val( CAML_VALUE v ); - SWIGINTERN int caml_string_len( CAML_VALUE v ); - -#ifdef __cplusplus -} -#endif diff --git a/usr/share/swig/4.1.1/octave/std_carray.i b/usr/share/swig/4.1.1/octave/std_carray.i deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/usr/share/swig/4.1.1/python/std_carray.i b/usr/share/swig/4.1.1/python/std_carray.i deleted file mode 100644 index 680d6711578..00000000000 --- a/usr/share/swig/4.1.1/python/std_carray.i +++ /dev/null @@ -1,54 +0,0 @@ -%include - - -%fragment("StdCarrayTraits","header",fragment="StdSequenceTraits") -{ -namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::carray **array) { - return traits_asptr_stdseq >::asptr(obj, array); - } - }; -} -} - -%warnfilter(SWIGWARN_IGNORE_OPERATOR_INDEX) std::carray::operator[]; - -%extend std::carray { - %fragment(SWIG_Traits_frag(std::carray<_Type, _Size >), "header", - fragment="SwigPyIterator_T", - fragment=SWIG_Traits_frag(_Type), - fragment="StdCarrayTraits") { - namespace swig { - template <> struct traits > { - typedef pointer_category category; - static const char* type_name() { - return "std::carray<" #_Type "," #_Size " >"; - } - }; - } - } - - %typemaps_asptr(SWIG_TYPECHECK_VECTOR, swig::asptr, - SWIG_Traits_frag(std::carray<_Type, _Size >), - std::carray<_Type, _Size >); - - %typemap(out,noblock=1) iterator, const_iterator { - $result = SWIG_NewPointerObj(swig::make_output_iterator((const $type &)$1), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); - } - - inline size_t __len__() const { return self->size(); } - - inline const _Type& __getitem__(size_t i) const { return (*self)[i]; } - - inline void __setitem__(size_t i, const _Type& v) { (*self)[i] = v; } - - - swig::SwigPyIterator* __iter__(PyObject **PYTHON_SELF) { - return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } -} - -%include diff --git a/usr/share/swig/4.1.1/std/std_carray.swg b/usr/share/swig/4.1.1/std/std_carray.swg deleted file mode 100644 index de2a076278a..00000000000 --- a/usr/share/swig/4.1.1/std/std_carray.swg +++ /dev/null @@ -1,64 +0,0 @@ -%{ -#include -%} - -// -// std::carray - is really an extension to the 'std' namespace. -// -// A simple fix C array wrapper, more or less as presented in -// -// "The C++ Standarf Library", by Nicolai M. Josuttis -// -// which is also derived from the example in -// -// "The C++ Programming Language", by Bjarne Stroustup. -// - -%inline %{ -namespace std { - template - class carray - { - public: - typedef _Type value_type; - typedef size_t size_type; - - typedef _Type * iterator; - typedef const _Type * const_iterator; - - carray() { } - - carray(const carray& other) { - std::copy(other.v, other.v + size(), v); - } - - template - carray(_Iterator first, _Iterator last) { - assign(first, last); - } - - iterator begin() { return v; } - iterator end() { return v + _Size; } - - const_iterator begin() const { return v; } - const_iterator end() const { return v + _Size; } - - _Type& operator[](size_t i) { return v[i]; } - const _Type& operator[](size_t i) const { return v[i]; } - - static size_t size() { return _Size; } - - template - void assign(_Iterator first, _Iterator last) { - if (std::distance(first,last) == size()) { - std::copy(first, last, v); - } else { - throw std::length_error("bad range length"); - } - } - - private: - _Type v[_Size]; - }; -} -%} diff --git a/usr/share/swig/4.1.1/swigarch.i b/usr/share/swig/4.1.1/swigarch.i deleted file mode 100644 index bf4ee8ef862..00000000000 --- a/usr/share/swig/4.1.1/swigarch.i +++ /dev/null @@ -1,62 +0,0 @@ -/* ----------------------------------------------------------------------------- - * swigarch.i - * - * SWIG library file for 32bit/64bit code specialization and checking. - * - * Use only in extreme cases, when no arch. independent code can be - * generated - * - * To activate architecture specific code, use - * - * swig -DSWIGWORDSIZE32 - * - * or - * - * swig -DSWIGWORDSIZE64 - * - * Note that extra checking code will be added to the wrapped code, - * which will prevent the compilation in a different architecture. - * - * If you don't specify the SWIGWORDSIZE (the default case), swig will - * generate architecture independent and/or 32bits code, with no extra - * checking code added. - * ----------------------------------------------------------------------------- */ - -#if !defined(SWIGWORDSIZE32) && !defined(SWIGWORDSIZE64) -# if (__WORDSIZE == 32) -# define SWIGWORDSIZE32 -# endif -#endif - -#if !defined(SWIGWORDSIZE64) && !defined(SWIGWORDSIZE32) -# if defined(__x86_64) || defined(__x86_64__) || (__WORDSIZE == 64) -# define SWIGWORDSIZE64 -# endif -#endif - - -#ifdef SWIGWORDSIZE32 -%{ -#define SWIGWORDSIZE32 -#ifndef LONG_MAX -#include -#endif -#if (__WORDSIZE == 64) || (LONG_MAX != INT_MAX) -# error "SWIG wrapped code invalid in 64 bit architecture, regenerate code using -DSWIGWORDSIZE64" -#endif -%} -#endif - -#ifdef SWIGWORDSIZE64 -%{ -#define SWIGWORDSIZE64 -#ifndef LONG_MAX -#include -#endif -#if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX) -# error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32" -#endif -%} -#endif - - diff --git a/usr/share/swig/4.1.1/allkw.swg b/usr/share/swig/4.2.1/allkw.swg similarity index 100% rename from usr/share/swig/4.1.1/allkw.swg rename to usr/share/swig/4.2.1/allkw.swg diff --git a/usr/share/swig/4.1.1/attribute.i b/usr/share/swig/4.2.1/attribute.i similarity index 100% rename from usr/share/swig/4.1.1/attribute.i rename to usr/share/swig/4.2.1/attribute.i diff --git a/usr/share/swig/4.1.1/carrays.i b/usr/share/swig/4.2.1/carrays.i similarity index 73% rename from usr/share/swig/4.1.1/carrays.i rename to usr/share/swig/4.2.1/carrays.i index 0aa3eee89c1..71712c83cc2 100644 --- a/usr/share/swig/4.1.1/carrays.i +++ b/usr/share/swig/4.2.1/carrays.i @@ -17,16 +17,16 @@ * Generates functions for creating and accessing elements of a C array * (as pointers). Creates the following functions: * - * TYPE *new_NAME(int nelements) + * TYPE *new_NAME(size_t nelements) * void delete_NAME(TYPE *); - * TYPE NAME_getitem(TYPE *, int index); - * void NAME_setitem(TYPE *, int index, TYPE value); - * + * TYPE NAME_getitem(TYPE *, size_t index); + * void NAME_setitem(TYPE *, size_t index, TYPE value); + * * ----------------------------------------------------------------------------- */ %define %array_functions(TYPE,NAME) %{ -static TYPE *new_##NAME(int nelements) { %} +static TYPE *new_##NAME(size_t nelements) { %} #ifdef __cplusplus %{ return new TYPE[nelements](); %} #else @@ -42,18 +42,18 @@ static void delete_##NAME(TYPE *ary) { %} #endif %{} -static TYPE NAME##_getitem(TYPE *ary, int index) { +static TYPE NAME##_getitem(TYPE *ary, size_t index) { return ary[index]; } -static void NAME##_setitem(TYPE *ary, int index, TYPE value) { +static void NAME##_setitem(TYPE *ary, size_t index, TYPE value) { ary[index] = value; } %} -TYPE *new_##NAME(int nelements); +TYPE *new_##NAME(size_t nelements); void delete_##NAME(TYPE *ary); -TYPE NAME##_getitem(TYPE *ary, int index); -void NAME##_setitem(TYPE *ary, int index, TYPE value); +TYPE NAME##_getitem(TYPE *ary, size_t index); +void NAME##_setitem(TYPE *ary, size_t index, TYPE value); %enddef @@ -65,13 +65,13 @@ void NAME##_setitem(TYPE *ary, int index, TYPE value); * interface: * * struct NAME { - * NAME(int nelements); + * NAME(size_t nelements); * ~NAME(); - * TYPE getitem(int index); - * void setitem(int index, TYPE value); + * TYPE getitem(size_t index); + * void setitem(size_t index, TYPE value); * TYPE * cast(); * static NAME *frompointer(TYPE *t); - * } + * } * * ----------------------------------------------------------------------------- */ @@ -86,14 +86,14 @@ typedef struct { %extend NAME { #ifdef __cplusplus -NAME(int nelements) { +NAME(size_t nelements) { return new TYPE[nelements](); } ~NAME() { delete [] self; } #else -NAME(int nelements) { +NAME(size_t nelements) { return (TYPE *) calloc(nelements,sizeof(TYPE)); } ~NAME() { @@ -101,10 +101,10 @@ NAME(int nelements) { } #endif -TYPE getitem(int index) { +TYPE getitem(size_t index) { return self[index]; } -void setitem(int index, TYPE value) { +void setitem(size_t index, TYPE value) { self[index] = value; } TYPE * cast() { diff --git a/usr/share/swig/4.1.1/cdata.i b/usr/share/swig/4.2.1/cdata.i similarity index 100% rename from usr/share/swig/4.1.1/cdata.i rename to usr/share/swig/4.2.1/cdata.i diff --git a/usr/share/swig/4.1.1/cmalloc.i b/usr/share/swig/4.2.1/cmalloc.i similarity index 100% rename from usr/share/swig/4.1.1/cmalloc.i rename to usr/share/swig/4.2.1/cmalloc.i diff --git a/usr/share/swig/4.1.1/constraints.i b/usr/share/swig/4.2.1/constraints.i similarity index 67% rename from usr/share/swig/4.1.1/constraints.i rename to usr/share/swig/4.2.1/constraints.i index 8bc7f9159ca..77e9778d126 100644 --- a/usr/share/swig/4.1.1/constraints.i +++ b/usr/share/swig/4.2.1/constraints.i @@ -8,67 +8,60 @@ * errors in a language-independent manner. * ----------------------------------------------------------------------------- */ -#ifdef AUTODOC -%text %{ -%include - -This library provides support for applying constraints to function -arguments. Using a constraint, you can restrict arguments to be -positive numbers, non-NULL pointers, and so on. The following -constraints are available : - - Number POSITIVE - Positive number (not zero) - Number NEGATIVE - Negative number (not zero) - Number NONZERO - Nonzero number - Number NONNEGATIVE - Positive number (including zero) - Number NONPOSITIVE - Negative number (including zero) - Pointer NONNULL - Non-NULL pointer - Pointer ALIGN8 - 8-byte aligned pointer - Pointer ALIGN4 - 4-byte aligned pointer - Pointer ALIGN2 - 2-byte aligned pointer - -To use the constraints, you need to "apply" them to specific -function arguments in your code. This is done using the %apply -directive. For example : - - %apply Number NONNEGATIVE { double nonneg }; - double sqrt(double nonneg); // Name of argument must match - - %apply Pointer NONNULL { void *ptr }; - void *malloc(int POSITIVE); // May return a NULL pointer - void free(void *ptr); // May not accept a NULL pointer - -Any function argument of the type you specify with the %apply directive -will be checked with the appropriate constraint. Multiple types may -be specified as follows : - - %apply Pointer NONNULL { void *, Vector *, List *, double *}; - -In this case, all of the types listed would be checked for non-NULL -pointers. - -The common datatypes of int, short, long, unsigned int, unsigned long, -unsigned short, unsigned char, signed char, float, and double can be -checked without using the %apply directive by simply using the -constraint name as the parameter name. For example : - - double sqrt(double NONNEGATIVE); - double log(double POSITIVE); - -If you have used typedef to change type-names, you can also do this : - - %apply double { Real }; // Make everything defined for doubles - // work for Reals. - Real sqrt(Real NONNEGATIVE); - Real log(Real POSITIVE); - -%} -#endif +// This library provides support for applying constraints to function +// arguments. Using a constraint, you can restrict arguments to be +// positive numbers, non-NULL pointers, and so on. The following +// constraints are available : +// +// Number POSITIVE - Positive number (not zero) +// Number NEGATIVE - Negative number (not zero) +// Number NONZERO - Nonzero number +// Number NONNEGATIVE - Positive number (including zero) +// Number NONPOSITIVE - Negative number (including zero) +// Pointer NONNULL - Non-NULL pointer +// Pointer ALIGN8 - 8-byte aligned pointer +// Pointer ALIGN4 - 4-byte aligned pointer +// Pointer ALIGN2 - 2-byte aligned pointer +// +// To use the constraints, you need to "apply" them to specific +// function arguments in your code. This is done using the %apply +// directive. For example : +// +// %apply Number NONNEGATIVE { double nonneg }; +// double sqrt(double nonneg); // Name of argument must match +// +// %apply Pointer NONNULL { FILE *stream }; +// FILE *fdopen(int NONNEGATIVE); // May return a NULL pointer +// int fclose(void *stream); // Does not accept a NULL pointer +// +// Any function argument of the type you specify with the %apply directive +// will be checked with the appropriate constraint. Multiple types may +// be specified as follows : +// +// %apply Pointer NONNULL { void *, Vector *, List *, double *}; +// +// In this case, all of the types listed would be checked for non-NULL +// pointers. +// +// The common datatypes of int, short, long, unsigned int, unsigned long, +// unsigned short, unsigned char, signed char, float, and double can be +// checked without using the %apply directive by simply using the +// constraint name as the parameter name. For example : +// +// double sqrt(double NONNEGATIVE); +// double log(double POSITIVE); +// +// If you have used typedef to change type-names, you can also do this : +// +// %apply double { Real }; // Make everything defined for doubles +// // work for Reals. +// Real sqrt(Real NONNEGATIVE); +// Real log(Real POSITIVE); %include -#ifdef SWIGCSHARP -// Required attribute for C# exception handling +#if defined(SWIGCSHARP) || defined(SWIGD) +// Required attribute for C# and D exception handling #define SWIGCSHARPCANTHROW , canthrow=1 #else #define SWIGCSHARPCANTHROW diff --git a/usr/share/swig/4.1.1/cpointer.i b/usr/share/swig/4.2.1/cpointer.i similarity index 100% rename from usr/share/swig/4.1.1/cpointer.i rename to usr/share/swig/4.2.1/cpointer.i diff --git a/usr/share/swig/4.2.1/csharp/argcargv.i b/usr/share/swig/4.2.1/csharp/argcargv.i new file mode 100644 index 00000000000..2dae1f6dc7b --- /dev/null +++ b/usr/share/swig/4.2.1/csharp/argcargv.i @@ -0,0 +1,76 @@ +/* ------------------------------------------------------------- + * SWIG library containing argc and argv multi-argument typemaps + * ------------------------------------------------------------- */ + +%typemap(cstype) (int ARGC, char **ARGV) "string[]" +%typemap(imtype) (int ARGC, char **ARGV) "global::System.IntPtr" +%typemap(ctype) (int ARGC, char **ARGV) "void*" +%typemap(csin) (int ARGC, char **ARGV) "$modulePINVOKE.SWIG_csharp_string_array_to_c($csinput.Length, $csinput)" +%pragma(csharp) imclasscode=%{ + [global::System.Runtime.InteropServices.DllImport("$module", EntryPoint="SWIG_csharp_string_array_to_c")] + public static extern global::System.IntPtr SWIG_csharp_string_array_to_c(int len, [global::System.Runtime.InteropServices.In,global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray, ArraySubType=global::System.Runtime.InteropServices.UnmanagedType.LPStr, SizeParamIndex=0)] string[] array); +%} +%fragment("SWIG_csharp_string_array", "header") %{ +#ifdef __cplusplus +extern "C" { +#endif +typedef struct { int len; char* array[1]; } SWIG_csharp_string_array; + +static void* SWIG_csharp_string_array_free(SWIG_csharp_string_array *arr) { + if (arr != SWIG_NULLPTR) { + int i; + for(i = 0; i < arr->len; i++) { + free(arr->array[i]); + } + free(arr); + } + return SWIG_NULLPTR; +} + +SWIGEXPORT void* SWIGSTDCALL SWIG_csharp_string_array_to_c(int len, void *array) { + int i; + size_t alen, slen; + char *p, **ptr; + SWIG_csharp_string_array *ret; + /* We don't need to add one to len for the terminating NULL here because + * SWIG_csharp_string_array includes one element already. + */ + alen = sizeof(SWIG_csharp_string_array) + sizeof(char *) * len; + ret = (SWIG_csharp_string_array *)malloc(alen); + if (ret == SWIG_NULLPTR) { + SWIG_CSharpSetPendingException(SWIG_CSharpOutOfMemoryException, "fail to duplicate array."); + return SWIG_NULLPTR; + } + memset(ret, 0, alen); + ret->len = len; + ptr = (char **)array; + for(i = 0; i < len; i++) { + slen = strlen(ptr[i]) + 1; + p = (char*)malloc(slen); + if (p == SWIG_NULLPTR) { + SWIG_CSharpSetPendingException(SWIG_CSharpOutOfMemoryException, "fail to alloc a string."); + return SWIG_csharp_string_array_free(ret); + } + memcpy(p, ptr[i], slen); + ret->array[i] = p; + } + ret->array[i] = SWIG_NULLPTR; + return ret; +} + +#ifdef __cplusplus +} +#endif +%} + +%typemap(in, canthrow=1, fragment="SWIG_csharp_string_array") (int ARGC, char **ARGV) %{ + SWIG_csharp_string_array *arr = (SWIG_csharp_string_array*)$input; + if (arr != SWIG_NULLPTR) { + $1 = ($1_ltype)arr->len; + $2 = ($2_ltype)arr->array; + } +%} + +%typemap(freearg, fragment="SWIG_csharp_string_array") (int ARGC, char **ARGV) %{ + SWIG_csharp_string_array_free((SWIG_csharp_string_array*)$input); +%} diff --git a/usr/share/swig/4.1.1/csharp/arrays_csharp.i b/usr/share/swig/4.2.1/csharp/arrays_csharp.i similarity index 84% rename from usr/share/swig/4.1.1/csharp/arrays_csharp.i rename to usr/share/swig/4.2.1/csharp/arrays_csharp.i index 861da8386aa..00ded7187d3 100644 --- a/usr/share/swig/4.1.1/csharp/arrays_csharp.i +++ b/usr/share/swig/4.2.1/csharp/arrays_csharp.i @@ -49,8 +49,17 @@ * %csmethodmodifiers myArrayCopy "public unsafe"; * void myArrayCopy( int *sourceArray, int* targetArray, int nitems ); * + * long type + * --------- + * Unlike other primitive types, the sizeof(long) varies considerably from one + * platform to another. The sizeof(long) in the unmanaged layer must match the + * number of bytes used in the managed layer. A check is implemented via the + * "long_check_wordsize" fragment which results in a compile time error upon an + * inconsistent match. Use the SWIGWORDSIZE64 macro to target 64-bit long. + * For easiest portability, avoid using long! * ----------------------------------------------------------------------------- */ + %define CSHARP_ARRAYS( CTYPE, CSTYPE ) // input only arrays @@ -94,16 +103,23 @@ CSHARP_ARRAYS(short, short) CSHARP_ARRAYS(unsigned short, ushort) CSHARP_ARRAYS(int, int) CSHARP_ARRAYS(unsigned int, uint) -// FIXME - on Unix 64 bit, long is 8 bytes but is 4 bytes on Windows 64 bit. -// How can this be handled sensibly? -// See e.g. http://www.xml.com/ldd/chapter/book/ch10.html -CSHARP_ARRAYS(long, int) -CSHARP_ARRAYS(unsigned long, uint) CSHARP_ARRAYS(long long, long) CSHARP_ARRAYS(unsigned long long, ulong) CSHARP_ARRAYS(float, float) CSHARP_ARRAYS(double, double) +// 32-bit/64-bit architecture specific typemaps - special handling to ensure sizeof(long) on C side matches size used on C# side +#if !defined(SWIGWORDSIZE64) +CSHARP_ARRAYS(long, int) +CSHARP_ARRAYS(unsigned long, uint) +#else +CSHARP_ARRAYS(long, long) +CSHARP_ARRAYS(unsigned long, ulong) +#endif +%typemap(in, fragment="long_check_wordsize") long INPUT[], unsigned long INPUT[] "$1 = $input;" +%typemap(in, fragment="long_check_wordsize") long OUTPUT[], unsigned long OUTPUT[] "$1 = $input;" +%typemap(in, fragment="long_check_wordsize") long INOUT[], unsigned long INOUT[] "$1 = $input;" + // By default C# will marshal bools as 4 bytes // UnmanagedType.I1 will change this to 1 byte // FIXME - When running on mono ArraySubType appears to be ignored and bools will be marshalled as 4-byte @@ -169,11 +185,18 @@ CSHARP_ARRAYS_FIXED(short, short) CSHARP_ARRAYS_FIXED(unsigned short, ushort) CSHARP_ARRAYS_FIXED(int, int) CSHARP_ARRAYS_FIXED(unsigned int, uint) -CSHARP_ARRAYS_FIXED(long, int) -CSHARP_ARRAYS_FIXED(unsigned long, uint) CSHARP_ARRAYS_FIXED(long long, long) CSHARP_ARRAYS_FIXED(unsigned long long, ulong) CSHARP_ARRAYS_FIXED(float, float) CSHARP_ARRAYS_FIXED(double, double) CSHARP_ARRAYS_FIXED(bool, bool) +// 32-bit/64-bit architecture specific typemaps - special handling to ensure sizeof(long) on C side matches size used on C# side +#ifdef !SWIGWORDSIZE64 +CSHARP_ARRAYS_FIXED(long, int) +CSHARP_ARRAYS_FIXED(unsigned long, uint) +#else +CSHARP_ARRAYS_FIXED(long, long) +CSHARP_ARRAYS_FIXED(unsigned long, ulong) +#endif +%typemap(in, fragment="long_check_wordsize") long FIXED[], unsigned long FIXED[] "$1 = $input;" diff --git a/usr/share/swig/4.1.1/csharp/boost_intrusive_ptr.i b/usr/share/swig/4.2.1/csharp/boost_intrusive_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/boost_intrusive_ptr.i rename to usr/share/swig/4.2.1/csharp/boost_intrusive_ptr.i diff --git a/usr/share/swig/4.1.1/csharp/boost_shared_ptr.i b/usr/share/swig/4.2.1/csharp/boost_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/boost_shared_ptr.i rename to usr/share/swig/4.2.1/csharp/boost_shared_ptr.i diff --git a/usr/share/swig/4.1.1/csharp/complex.i b/usr/share/swig/4.2.1/csharp/complex.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/complex.i rename to usr/share/swig/4.2.1/csharp/complex.i diff --git a/usr/share/swig/4.1.1/csharp/csharp.swg b/usr/share/swig/4.2.1/csharp/csharp.swg similarity index 97% rename from usr/share/swig/4.1.1/csharp/csharp.swg rename to usr/share/swig/4.2.1/csharp/csharp.swg index 1f80d12a181..fffde505cc4 100644 --- a/usr/share/swig/4.1.1/csharp/csharp.swg +++ b/usr/share/swig/4.2.1/csharp/csharp.swg @@ -82,8 +82,8 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { %typemap(ctype) unsigned short, const unsigned short & "unsigned short" %typemap(ctype) int, const int & "int" %typemap(ctype) unsigned int, const unsigned int & "unsigned int" -%typemap(ctype) long, const long & "long" -%typemap(ctype) unsigned long, const unsigned long & "unsigned long" +%typemap(ctype) long, const long & "int" +%typemap(ctype) unsigned long, const unsigned long & "unsigned int" %typemap(ctype) long long, const long long & "long long" %typemap(ctype) unsigned long long, const unsigned long long & "unsigned long long" %typemap(ctype) float, const float & "float" @@ -201,9 +201,9 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { %typemap(directorin) short "$input = $1;" %typemap(directorin) unsigned short "$input = $1;" %typemap(directorin) int "$input = $1;" -%typemap(directorin) unsigned int "$input = $1;" +%typemap(directorin) unsigned int "$input = (unsigned int)$1;" %typemap(directorin) long "$input = $1;" -%typemap(directorin) unsigned long "$input = (unsigned long)$1;" +%typemap(directorin) unsigned long "$input = $1;" %typemap(directorin) long long "$input = $1;" %typemap(directorin) unsigned long long "$input = $1;" %typemap(directorin) float "$input = $1;" @@ -246,9 +246,9 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { %typemap(out) short %{ $result = $1; %} %typemap(out) unsigned short %{ $result = $1; %} %typemap(out) int %{ $result = $1; %} -%typemap(out) unsigned int %{ $result = $1; %} +%typemap(out) unsigned int %{ $result = (unsigned int)$1; %} %typemap(out) long %{ $result = $1; %} -%typemap(out) unsigned long %{ $result = (unsigned long)$1; %} +%typemap(out) unsigned long %{ $result = $1; %} %typemap(out) long long %{ $result = $1; %} %typemap(out) unsigned long long %{ $result = $1; %} %typemap(out) float %{ $result = $1; %} @@ -327,7 +327,7 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { %typemap(directorin) const short & "$input = $1;" %typemap(directorin) const unsigned short & "$input = $1;" %typemap(directorin) const int & "$input = $1;" -%typemap(directorin) const unsigned int & "$input = $1;" +%typemap(directorin) const unsigned int & "$input = (unsigned int)$1;" %typemap(directorin) const long & "$input = $1;" %typemap(directorin) const unsigned long & "$input = $1;" %typemap(directorin) const long long & "$input = $1;" @@ -373,9 +373,9 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { %typemap(out) const short & %{ $result = *$1; %} %typemap(out) const unsigned short & %{ $result = *$1; %} %typemap(out) const int & %{ $result = *$1; %} -%typemap(out) const unsigned int & %{ $result = *$1; %} +%typemap(out) const unsigned int & %{ $result = (unsigned int)*$1; %} %typemap(out) const long & %{ $result = *$1; %} -%typemap(out) const unsigned long & %{ $result = (unsigned long)*$1; %} +%typemap(out) const unsigned long & %{ $result = *$1; %} %typemap(out) const long long & %{ $result = *$1; %} %typemap(out) const unsigned long long & %{ $result = *$1; %} %typemap(out) const float & %{ $result = *$1; %} @@ -579,7 +579,7 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { unsigned long, unsigned short %{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); + SWIG_snprintf(error_msg, sizeof(error_msg), "C++ $1_type exception thrown, value: %d", $1); SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, error_msg); return $null; %} @@ -1062,10 +1062,17 @@ SWIG_CSBODY_TYPEWRAPPER(internal, protected, internal, SWIGTYPE) %pragma(csharp) imclassclassmodifiers="class" %pragma(csharp) moduleclassmodifiers="public class" -/* Some ANSI C typemaps */ +/* 64-bit architecture specific typemaps */ +#if defined(SWIGWORDSIZE64) +%apply long long { long }; +%apply unsigned long long { unsigned long }; +%apply const long long & { const long & }; +%apply const unsigned long long & { const unsigned long & }; +#endif -%apply unsigned long { size_t }; -%apply const unsigned long & { const size_t & }; +/* size_t maps to C# 32-bit uint type */ +%apply unsigned int { size_t }; +%apply const unsigned int & { const size_t & }; /* Array reference typemaps */ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } diff --git a/usr/share/swig/4.1.1/csharp/csharphead.swg b/usr/share/swig/4.2.1/csharp/csharphead.swg similarity index 100% rename from usr/share/swig/4.1.1/csharp/csharphead.swg rename to usr/share/swig/4.2.1/csharp/csharphead.swg diff --git a/usr/share/swig/4.1.1/csharp/csharpkw.swg b/usr/share/swig/4.2.1/csharp/csharpkw.swg similarity index 100% rename from usr/share/swig/4.1.1/csharp/csharpkw.swg rename to usr/share/swig/4.2.1/csharp/csharpkw.swg diff --git a/usr/share/swig/4.1.1/csharp/director.swg b/usr/share/swig/4.2.1/csharp/director.swg similarity index 100% rename from usr/share/swig/4.1.1/csharp/director.swg rename to usr/share/swig/4.2.1/csharp/director.swg diff --git a/usr/share/swig/4.1.1/csharp/enums.swg b/usr/share/swig/4.2.1/csharp/enums.swg similarity index 100% rename from usr/share/swig/4.1.1/csharp/enums.swg rename to usr/share/swig/4.2.1/csharp/enums.swg diff --git a/usr/share/swig/4.1.1/csharp/enumsimple.swg b/usr/share/swig/4.2.1/csharp/enumsimple.swg similarity index 100% rename from usr/share/swig/4.1.1/csharp/enumsimple.swg rename to usr/share/swig/4.2.1/csharp/enumsimple.swg diff --git a/usr/share/swig/4.1.1/csharp/enumtypesafe.swg b/usr/share/swig/4.2.1/csharp/enumtypesafe.swg similarity index 100% rename from usr/share/swig/4.1.1/csharp/enumtypesafe.swg rename to usr/share/swig/4.2.1/csharp/enumtypesafe.swg diff --git a/usr/share/swig/4.1.1/csharp/std_array.i b/usr/share/swig/4.2.1/csharp/std_array.i similarity index 82% rename from usr/share/swig/4.1.1/csharp/std_array.i rename to usr/share/swig/4.2.1/csharp/std_array.i index 6e7fe9eb43f..87b1b895633 100644 --- a/usr/share/swig/4.1.1/csharp/std_array.i +++ b/usr/share/swig/4.2.1/csharp/std_array.i @@ -6,37 +6,37 @@ * The C# wrapper is made to look and feel like a C# System.Collections.Generic.IReadOnlyList<> collection. * ----------------------------------------------------------------------------- */ -%{ -#include -#include -#include -%} - %include -%define SWIG_STD_ARRAY_INTERNAL(T, N) -%typemap(csinterfaces) std::array< T, N > "global::System.IDisposable, global::System.Collections.IEnumerable\n , global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>\n" +%define SWIG_STD_ARRAY_INTERNAL(CTYPE, N) +%typemap(csinterfaces) std::array< CTYPE, N > "global::System.IDisposable, global::System.Collections.IEnumerable\n , global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>\n" %proxycode %{ public $csclassname(global::System.Collections.ICollection c) : this() { if (c == null) throw new global::System.ArgumentNullException("c"); - int end = global::System.Math.Min(this.Count, c.Count); + int count = this.Count; int i = 0; - foreach ($typemap(cstype, T) elem in c) { - if (i >= end) + foreach ($typemap(cstype, CTYPE) element in c) { + if (i >= count) break; - this[i++] = elem; + this[i++] = element; } } - public int Count { + public bool IsFixedSize { get { - return (int)size(); + return true; } } - public $typemap(cstype, T) this[int index] { + public bool IsReadOnly { + get { + return false; + } + } + + public $typemap(cstype, CTYPE) this[int index] { get { return getitem(index); } @@ -51,17 +51,29 @@ } } - public void CopyTo($typemap(cstype, T)[] array) + public int Count { + get { + return (int)size(); + } + } + + public bool IsSynchronized { + get { + return false; + } + } + + public void CopyTo($typemap(cstype, CTYPE)[] array) { CopyTo(0, array, 0, this.Count); } - public void CopyTo($typemap(cstype, T)[] array, int arrayIndex) + public void CopyTo($typemap(cstype, CTYPE)[] array, int arrayIndex) { CopyTo(0, array, arrayIndex, this.Count); } - public void CopyTo(int index, $typemap(cstype, T)[] array, int arrayIndex, int count) + public void CopyTo(int index, $typemap(cstype, CTYPE)[] array, int arrayIndex, int count) { if (array == null) throw new global::System.ArgumentNullException("array"); @@ -79,7 +91,13 @@ array.SetValue(getitemcopy(index+i), arrayIndex+i); } - global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>.GetEnumerator() { + public $typemap(cstype, CTYPE)[] ToArray() { + $typemap(cstype, CTYPE)[] array = new $typemap(cstype, CTYPE)[this.Count]; + this.CopyTo(array); + return array; + } + + global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() { return new $csclassnameEnumerator(this); } @@ -97,7 +115,7 @@ /// collection but not when one of the elements of the collection is modified as it is a bit /// tricky to detect unmanaged code that modifies the collection under our feet. public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator - , global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> + , global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> { private $csclassname collectionRef; private int currentIndex; @@ -112,7 +130,7 @@ } // Type-safe iterator Current - public $typemap(cstype, T) Current { + public $typemap(cstype, CTYPE) Current { get { if (currentIndex == -1) throw new global::System.InvalidOperationException("Enumeration not started."); @@ -120,7 +138,7 @@ throw new global::System.InvalidOperationException("Enumeration finished."); if (currentObject == null) throw new global::System.InvalidOperationException("Collection modified."); - return ($typemap(cstype, T))currentObject; + return ($typemap(cstype, CTYPE))currentObject; } } @@ -161,7 +179,7 @@ public: typedef size_t size_type; typedef ptrdiff_t difference_type; - typedef T value_type; + typedef CTYPE value_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; @@ -180,7 +198,7 @@ void swap(array& other); %extend { - T getitemcopy(int index) throw (std::out_of_range) { + CTYPE getitemcopy(int index) throw (std::out_of_range) { if (index>=0 && index<(int)$self->size()) return (*$self)[index]; else @@ -213,6 +231,11 @@ } %enddef +%{ +#include +#include +#include +%} %csmethodmodifiers std::array::empty "private" %csmethodmodifiers std::array::getitemcopy "private" diff --git a/usr/share/swig/4.1.1/csharp/std_auto_ptr.i b/usr/share/swig/4.2.1/csharp/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/std_auto_ptr.i rename to usr/share/swig/4.2.1/csharp/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/csharp/std_common.i b/usr/share/swig/4.2.1/csharp/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/std_common.i rename to usr/share/swig/4.2.1/csharp/std_common.i diff --git a/usr/share/swig/4.1.1/csharp/std_complex.i b/usr/share/swig/4.2.1/csharp/std_complex.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/std_complex.i rename to usr/share/swig/4.2.1/csharp/std_complex.i diff --git a/usr/share/swig/4.1.1/csharp/std_deque.i b/usr/share/swig/4.2.1/csharp/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/std_deque.i rename to usr/share/swig/4.2.1/csharp/std_deque.i diff --git a/usr/share/swig/4.1.1/csharp/std_except.i b/usr/share/swig/4.2.1/csharp/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/std_except.i rename to usr/share/swig/4.2.1/csharp/std_except.i diff --git a/usr/share/swig/4.1.1/csharp/std_list.i b/usr/share/swig/4.2.1/csharp/std_list.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/std_list.i rename to usr/share/swig/4.2.1/csharp/std_list.i diff --git a/usr/share/swig/4.1.1/csharp/std_map.i b/usr/share/swig/4.2.1/csharp/std_map.i similarity index 94% rename from usr/share/swig/4.1.1/csharp/std_map.i rename to usr/share/swig/4.2.1/csharp/std_map.i index 7a118569a58..4f447422a18 100644 --- a/usr/share/swig/4.1.1/csharp/std_map.i +++ b/usr/share/swig/4.2.1/csharp/std_map.i @@ -48,6 +48,12 @@ return false; } + public bool IsEmpty { + get { + return empty(); + } + } + public int Count { get { return (int)size(); @@ -236,7 +242,11 @@ } void setitem(const key_type& key, const mapped_type& x) { +%#ifdef __cpp_lib_map_try_emplace + (*$self).insert_or_assign(key, x); +%#else (*$self)[key] = x; +%#endif } bool ContainsKey(const key_type& key) { @@ -269,12 +279,14 @@ } const key_type& get_next_key(std::map< K, T, C >::iterator *swigiterator) { + (void)$self; std::map< K, T, C >::iterator iter = *swigiterator; (*swigiterator)++; return (*iter).first; } void destroy_iterator(std::map< K, T, C >::iterator *swigiterator) { + (void)$self; delete swigiterator; } } @@ -282,6 +294,7 @@ %enddef +%csmethodmodifiers std::map::empty "private" %csmethodmodifiers std::map::size "private" %csmethodmodifiers std::map::getitem "private" %csmethodmodifiers std::map::setitem "private" @@ -295,18 +308,3 @@ namespace std { SWIG_STD_MAP_INTERNAL(K, T, C) }; } - - -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - diff --git a/usr/share/swig/4.1.1/csharp/std_pair.i b/usr/share/swig/4.2.1/csharp/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/std_pair.i rename to usr/share/swig/4.2.1/csharp/std_pair.i diff --git a/usr/share/swig/4.1.1/csharp/std_set.i b/usr/share/swig/4.2.1/csharp/std_set.i similarity index 98% rename from usr/share/swig/4.1.1/csharp/std_set.i rename to usr/share/swig/4.2.1/csharp/std_set.i index 012152260f5..480a24cc7c0 100644 --- a/usr/share/swig/4.1.1/csharp/std_set.i +++ b/usr/share/swig/4.2.1/csharp/std_set.i @@ -16,6 +16,7 @@ #include %} +%csmethodmodifiers std::set::empty "private" %csmethodmodifiers std::set::size "private" %csmethodmodifiers std::set::getitem "private" %csmethodmodifiers std::set::create_iterator_begin "private" @@ -44,6 +45,12 @@ class set { } } + public bool IsEmpty { + get { + return empty(); + } + } + public int Count { get { return (int)size(); @@ -297,12 +304,14 @@ class set { } const key_type& get_next(std::set::iterator *swigiterator) { + (void)$self; std::set::iterator iter = *swigiterator; (*swigiterator)++; return *iter; } void destroy_iterator(std::set::iterator *swigiterator) { + (void)$self; delete swigiterator; } } diff --git a/usr/share/swig/4.1.1/csharp/std_shared_ptr.i b/usr/share/swig/4.2.1/csharp/std_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/std_shared_ptr.i rename to usr/share/swig/4.2.1/csharp/std_shared_ptr.i diff --git a/usr/share/swig/4.1.1/csharp/std_string.i b/usr/share/swig/4.2.1/csharp/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/std_string.i rename to usr/share/swig/4.2.1/csharp/std_string.i diff --git a/usr/share/swig/4.2.1/csharp/std_string_view.i b/usr/share/swig/4.2.1/csharp/std_string_view.i new file mode 100644 index 00000000000..3b6cd40efa7 --- /dev/null +++ b/usr/share/swig/4.2.1/csharp/std_string_view.i @@ -0,0 +1,116 @@ +/* ----------------------------------------------------------------------------- + * std_string_view.i + * + * Typemaps for std::string_view and const std::string_view& + * These are mapped to a C# String and are passed around by value. + * + * To use non-const std::string_view references use the following %apply. Note + * that they are passed by value. + * %apply const std::string_view & {std::string_view &}; + * ----------------------------------------------------------------------------- */ + +%{ +#include +#include +%} + +namespace std { + +%naturalvar string_view; + +class string_view; + +// string_view +%typemap(ctype) string_view "const char *" +%typemap(imtype) string_view "string" +%typemap(cstype) string_view "string" + +%typemap(csdirectorin) string_view "$iminput" +%typemap(csdirectorout) string_view "$cscall" + +%typemap(in, canthrow=1) string_view +%{ if (!$input) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); + return $null; + } + $1 = std::string_view($input); %} +%typemap(out) string_view %{ $result = SWIG_csharp_string_callback(std::string($1).c_str()); %} + +%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) string_view +%{ if (!$input) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); + return $null; + } + /* possible thread/reentrant code problem */ + static std::string $1_str; + $1_str = $input; + $result = std::string_view($1_str); %} + +%typemap(directorin) string_view %{ $input = std::string($1).c_str(); %} + +%typemap(csin) string_view "$csinput" +%typemap(csout, excode=SWIGEXCODE) string_view { + string ret = $imcall;$excode + return ret; + } + +%typemap(typecheck) string_view = char *; + +%typemap(throws, canthrow=1) string_view +%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, std::string($1).c_str()); + return $null; %} + +// const string_view & +%typemap(ctype) const string_view & "const char *" +%typemap(imtype) const string_view & "string" +%typemap(cstype) const string_view & "string" + +%typemap(csdirectorin) const string_view & "$iminput" +%typemap(csdirectorout) const string_view & "$cscall" + +%typemap(in, canthrow=1) const string_view & +%{ if (!$input) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); + return $null; + } + $*1_ltype $1_str($input); + $1 = &$1_str; %} +%typemap(out) const string_view & %{ $result = SWIG_csharp_string_callback(std::string(*$1).c_str()); %} + +%typemap(csin) const string_view & "$csinput" +%typemap(csout, excode=SWIGEXCODE) const string_view & { + string ret = $imcall;$excode + return ret; + } + +%typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string_view & +%{ if (!$input) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); + return $null; + } + /* possible thread/reentrant code problem */ + static std::string $1_str; + $1_str = $input; + static $*1_ltype $1_strview; + $1_strview = $1_str; + $result = &$1_strview; %} + +%typemap(directorin) const string_view & %{ $input = std::string($1).c_str(); %} + +%typemap(csvarin, excode=SWIGEXCODE2) const string_view & %{ + set { + $imcall;$excode + } %} +%typemap(csvarout, excode=SWIGEXCODE2) const string_view & %{ + get { + string ret = $imcall;$excode + return ret; + } %} + +%typemap(typecheck) const string_view & = char *; + +%typemap(throws, canthrow=1) const string_view & +%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, std::string($1).c_str()); + return $null; %} + +} diff --git a/usr/share/swig/4.1.1/csharp/std_unique_ptr.i b/usr/share/swig/4.2.1/csharp/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/std_unique_ptr.i rename to usr/share/swig/4.2.1/csharp/std_unique_ptr.i diff --git a/usr/share/swig/4.2.1/csharp/std_unordered_map.i b/usr/share/swig/4.2.1/csharp/std_unordered_map.i new file mode 100644 index 00000000000..f8145e372d6 --- /dev/null +++ b/usr/share/swig/4.2.1/csharp/std_unordered_map.i @@ -0,0 +1,306 @@ +/* ----------------------------------------------------------------------------- + * std_unordered_map.i + * + * SWIG typemaps for std::unordered_map< K, T, H > + * + * The C# wrapper is made to look and feel like a C# System.Collections.Generic.IDictionary<>. + * + * Using this wrapper is fairly simple. For example, to create an unordered_map from integers to doubles use: + * + * %include + * %template(MapIntDouble) std::unordered_map + * + * Notes: + * 1) IEnumerable<> is implemented in the proxy class which is useful for using LINQ with + * C++ std::unordered_map wrappers. + * + * Warning: heavy macro usage in this file. Use swig -E to get a sane view on the real file contents! + * ----------------------------------------------------------------------------- */ + +%{ +#include +#include +#include +%} + +/* K is the C++ key type, T is the C++ value type */ +%define SWIG_STD_UNORDERED_MAP_INTERNAL(K, T, H) + +%typemap(csinterfaces) std::unordered_map< K, T, H > "global::System.IDisposable \n , global::System.Collections.Generic.IDictionary<$typemap(cstype, K), $typemap(cstype, T)>\n" +%proxycode %{ + + public $typemap(cstype, T) this[$typemap(cstype, K) key] { + get { + return getitem(key); + } + + set { + setitem(key, value); + } + } + + public bool TryGetValue($typemap(cstype, K) key, out $typemap(cstype, T) value) { + if (this.ContainsKey(key)) { + value = this[key]; + return true; + } + value = default($typemap(cstype, T)); + return false; + } + + public bool IsEmpty { + get { + return empty(); + } + } + + public int Count { + get { + return (int)size(); + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public global::System.Collections.Generic.ICollection<$typemap(cstype, K)> Keys { + get { + global::System.Collections.Generic.ICollection<$typemap(cstype, K)> keys = new global::System.Collections.Generic.List<$typemap(cstype, K)>(); + int size = this.Count; + if (size > 0) { + global::System.IntPtr iter = create_iterator_begin(); + for (int i = 0; i < size; i++) { + keys.Add(get_next_key(iter)); + } + destroy_iterator(iter); + } + return keys; + } + } + + public global::System.Collections.Generic.ICollection<$typemap(cstype, T)> Values { + get { + global::System.Collections.Generic.ICollection<$typemap(cstype, T)> vals = new global::System.Collections.Generic.List<$typemap(cstype, T)>(); + foreach (global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> pair in this) { + vals.Add(pair.Value); + } + return vals; + } + } + + public void Add(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { + Add(item.Key, item.Value); + } + + public bool Remove(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { + if (Contains(item)) { + return Remove(item.Key); + } else { + return false; + } + } + + public bool Contains(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { + if (this[item.Key] == item.Value) { + return true; + } else { + return false; + } + } + + public void CopyTo(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array) { + CopyTo(array, 0); + } + + public void CopyTo(global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array, int arrayIndex) { + if (array == null) + throw new global::System.ArgumentNullException("array"); + if (arrayIndex < 0) + throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); + if (array.Rank > 1) + throw new global::System.ArgumentException("Multi dimensional array.", "array"); + if (arrayIndex+this.Count > array.Length) + throw new global::System.ArgumentException("Number of elements to copy is too large."); + + global::System.Collections.Generic.IList<$typemap(cstype, K)> keyList = new global::System.Collections.Generic.List<$typemap(cstype, K)>(this.Keys); + for (int i = 0; i < keyList.Count; i++) { + $typemap(cstype, K) currentKey = keyList[i]; + array.SetValue(new global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, this[currentKey]), arrayIndex+i); + } + } + + global::System.Collections.Generic.IEnumerator> global::System.Collections.Generic.IEnumerable>.GetEnumerator() { + return new $csclassnameEnumerator(this); + } + + global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { + return new $csclassnameEnumerator(this); + } + + public $csclassnameEnumerator GetEnumerator() { + return new $csclassnameEnumerator(this); + } + + // Type-safe enumerator + /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown + /// whenever the collection is modified. This has been done for changes in the size of the + /// collection but not when one of the elements of the collection is modified as it is a bit + /// tricky to detect unmanaged code that modifies the collection under our feet. + public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, + global::System.Collections.Generic.IEnumerator> + { + private $csclassname collectionRef; + private global::System.Collections.Generic.IList<$typemap(cstype, K)> keyCollection; + private int currentIndex; + private object currentObject; + private int currentSize; + + public $csclassnameEnumerator($csclassname collection) { + collectionRef = collection; + keyCollection = new global::System.Collections.Generic.List<$typemap(cstype, K)>(collection.Keys); + currentIndex = -1; + currentObject = null; + currentSize = collectionRef.Count; + } + + // Type-safe iterator Current + public global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> Current { + get { + if (currentIndex == -1) + throw new global::System.InvalidOperationException("Enumeration not started."); + if (currentIndex > currentSize - 1) + throw new global::System.InvalidOperationException("Enumeration finished."); + if (currentObject == null) + throw new global::System.InvalidOperationException("Collection modified."); + return (global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>)currentObject; + } + } + + // Type-unsafe IEnumerator.Current + object global::System.Collections.IEnumerator.Current { + get { + return Current; + } + } + + public bool MoveNext() { + int size = collectionRef.Count; + bool moveOkay = (currentIndex+1 < size) && (size == currentSize); + if (moveOkay) { + currentIndex++; + $typemap(cstype, K) currentKey = keyCollection[currentIndex]; + currentObject = new global::System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, collectionRef[currentKey]); + } else { + currentObject = null; + } + return moveOkay; + } + + public void Reset() { + currentIndex = -1; + currentObject = null; + if (collectionRef.Count != currentSize) { + throw new global::System.InvalidOperationException("Collection modified."); + } + } + + public void Dispose() { + currentIndex = -1; + currentObject = null; + } + } + +%} + + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef K key_type; + typedef T mapped_type; + typedef std::pair< const K, T > value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + + unordered_map(); + unordered_map(const unordered_map& other); + size_type size() const; + bool empty() const; + %rename(Clear) clear; + void clear(); + %extend { + const mapped_type& getitem(const key_type& key) throw (std::out_of_range) { + std::unordered_map< K, T, H >::iterator iter = $self->find(key); + if (iter != $self->end()) + return iter->second; + else + throw std::out_of_range("key not found"); + } + + void setitem(const key_type& key, const mapped_type& x) { + (*$self)[key] = x; + } + + bool ContainsKey(const key_type& key) { + std::unordered_map< K, T, H >::iterator iter = $self->find(key); + return iter != $self->end(); + } + + void Add(const key_type& key, const mapped_type& value) throw (std::out_of_range) { + std::unordered_map< K, T, H >::iterator iter = $self->find(key); + if (iter != $self->end()) + throw std::out_of_range("key already exists"); + $self->insert(std::pair< K, T >(key, value)); + } + + bool Remove(const key_type& key) { + std::unordered_map< K, T, H >::iterator iter = $self->find(key); + if (iter != $self->end()) { + $self->erase(iter); + return true; + } + return false; + } + + // create_iterator_begin(), get_next_key() and destroy_iterator work together to provide a collection of keys to C# + %apply void *VOID_INT_PTR { std::unordered_map< K, T, H >::iterator *create_iterator_begin } + %apply void *VOID_INT_PTR { std::unordered_map< K, T, H >::iterator *swigiterator } + + std::unordered_map< K, T, H >::iterator *create_iterator_begin() { + return new std::unordered_map< K, T, H >::iterator($self->begin()); + } + + const key_type& get_next_key(std::unordered_map< K, T, H >::iterator *swigiterator) { + (void)self; + std::unordered_map< K, T, H >::iterator iter = *swigiterator; + (*swigiterator)++; + return (*iter).first; + } + + void destroy_iterator(std::unordered_map< K, T, H >::iterator *swigiterator) { + (void)self; + delete swigiterator; + } + } + + +%enddef + +%csmethodmodifiers std::unordered_map::empty "private" +%csmethodmodifiers std::unordered_map::size "private" +%csmethodmodifiers std::unordered_map::getitem "private" +%csmethodmodifiers std::unordered_map::setitem "private" +%csmethodmodifiers std::unordered_map::create_iterator_begin "private" +%csmethodmodifiers std::unordered_map::get_next_key "private" +%csmethodmodifiers std::unordered_map::destroy_iterator "private" + +// Default implementation +namespace std { + template > class unordered_map { + SWIG_STD_UNORDERED_MAP_INTERNAL(K, T, H) + }; +} diff --git a/usr/share/swig/4.2.1/csharp/std_unordered_set.i b/usr/share/swig/4.2.1/csharp/std_unordered_set.i new file mode 100644 index 00000000000..d6f6a18f394 --- /dev/null +++ b/usr/share/swig/4.2.1/csharp/std_unordered_set.i @@ -0,0 +1,320 @@ +/* ----------------------------------------------------------------------------- + * std_unordered_set.i + * + * SWIG typemaps for std::unordered_set. + * + * Note that ISet<> used here requires .NET 4 or later. + * + * The C# wrapper implements ISet<> interface and is similar in + * characteristics to the C# System.Collections.Generic.HashSet<> class, but + * doesn't provide quite all of its methods. + * ----------------------------------------------------------------------------- */ + +%{ +#include +#include +#include +%} + +%csmethodmodifiers std::unordered_set::empty "private" +%csmethodmodifiers std::unordered_set::size "private" +%csmethodmodifiers std::unordered_set::getitem "private" +%csmethodmodifiers std::unordered_set::create_iterator_begin "private" +%csmethodmodifiers std::unordered_set::get_next "private" +%csmethodmodifiers std::unordered_set::destroy_iterator "private" + +namespace std { + +// TODO: Add support for comparator and allocator template parameters. +template +class unordered_set { + +%typemap(csinterfaces) std::unordered_set "global::System.IDisposable, global::System.Collections.Generic.ISet<$typemap(cstype, T)>\n" +%proxycode %{ + void global::System.Collections.Generic.ICollection<$typemap(cstype, T)>.Add($typemap(cstype, T) item) { + ((global::System.Collections.Generic.ISet<$typemap(cstype, T)>)this).Add(item); + } + + public bool TryGetValue($typemap(cstype, T) equalValue, out $typemap(cstype, T) actualValue) { + try { + actualValue = getitem(equalValue); + return true; + } catch { + actualValue = default($typemap(cstype, T)); + return false; + } + } + + public bool IsEmpty { + get { + return empty(); + } + } + + public int Count { + get { + return (int)size(); + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public void CopyTo($typemap(cstype, T)[] array) { + CopyTo(array, 0); + } + + public void CopyTo($typemap(cstype, T)[] array, int arrayIndex) { + if (array == null) + throw new global::System.ArgumentNullException("array"); + if (arrayIndex < 0) + throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); + if (array.Rank > 1) + throw new global::System.ArgumentException("Multi dimensional array.", "array"); + if (arrayIndex+this.Count > array.Length) + throw new global::System.ArgumentException("Number of elements to copy is too large."); + + foreach ($typemap(cstype, T) item in this) { + array.SetValue(item, arrayIndex++); + } + } + + public void ExceptWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { + foreach ($typemap(cstype, T) item in other) { + Remove(item); + } + } + + public void IntersectWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { + $csclassname old = new $csclassname(this); + + Clear(); + foreach ($typemap(cstype, T) item in other) { + if (old.Contains(item)) + Add(item); + } + } + + private static int count_enum(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { + int count = 0; + foreach ($typemap(cstype, T) item in other) { + count++; + } + + return count; + } + + public bool IsProperSubsetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { + return IsSubsetOf(other) && Count < count_enum(other); + } + + public bool IsProperSupersetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { + return IsSupersetOf(other) && Count > count_enum(other); + } + + public bool IsSubsetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { + int countContained = 0; + + foreach ($typemap(cstype, T) item in other) { + if (Contains(item)) + countContained++; + } + + return countContained == Count; + } + + public bool IsSupersetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { + foreach ($typemap(cstype, T) item in other) { + if (!Contains(item)) + return false; + } + + return true; + } + + public bool Overlaps(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { + foreach ($typemap(cstype, T) item in other) { + if (Contains(item)) + return true; + } + + return false; + } + + public bool SetEquals(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { + return IsSupersetOf(other) && Count == count_enum(other); + } + + public void SymmetricExceptWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { + foreach ($typemap(cstype, T) item in other) { + if (!Remove(item)) + Add(item); + } + } + + public void UnionWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) { + foreach ($typemap(cstype, T) item in other) { + Add(item); + } + } + + private global::System.Collections.Generic.ICollection<$typemap(cstype, T)> Items { + get { + global::System.Collections.Generic.ICollection<$typemap(cstype, T)> items = new global::System.Collections.Generic.List<$typemap(cstype, T)>(); + int size = this.Count; + if (size > 0) { + global::System.IntPtr iter = create_iterator_begin(); + for (int i = 0; i < size; i++) { + items.Add(get_next(iter)); + } + destroy_iterator(iter); + } + return items; + } + } + + global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>.GetEnumerator() { + return new $csclassnameEnumerator(this); + } + + global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { + return new $csclassnameEnumerator(this); + } + + public $csclassnameEnumerator GetEnumerator() { + return new $csclassnameEnumerator(this); + } + + // Type-safe enumerator + /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown + /// whenever the collection is modified. This has been done for changes in the size of the + /// collection but not when one of the elements of the collection is modified as it is a bit + /// tricky to detect unmanaged code that modifies the collection under our feet. + public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, + global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> + { + private $csclassname collectionRef; + private global::System.Collections.Generic.IList<$typemap(cstype, T)> ItemsCollection; + private int currentIndex; + private object currentObject; + private int currentSize; + + public $csclassnameEnumerator($csclassname collection) { + collectionRef = collection; + ItemsCollection = new global::System.Collections.Generic.List<$typemap(cstype, T)>(collection.Items); + currentIndex = -1; + currentObject = null; + currentSize = collectionRef.Count; + } + + // Type-safe iterator Current + public $typemap(cstype, T) Current { + get { + if (currentIndex == -1) + throw new global::System.InvalidOperationException("Enumeration not started."); + if (currentIndex > currentSize - 1) + throw new global::System.InvalidOperationException("Enumeration finished."); + if (currentObject == null) + throw new global::System.InvalidOperationException("Collection modified."); + return ($typemap(cstype, T))currentObject; + } + } + + // Type-unsafe IEnumerator.Current + object global::System.Collections.IEnumerator.Current { + get { + return Current; + } + } + + public bool MoveNext() { + int size = collectionRef.Count; + bool moveOkay = (currentIndex+1 < size) && (size == currentSize); + if (moveOkay) { + currentIndex++; + currentObject = ItemsCollection[currentIndex]; + } else { + currentObject = null; + } + return moveOkay; + } + + public void Reset() { + currentIndex = -1; + currentObject = null; + if (collectionRef.Count != currentSize) { + throw new global::System.InvalidOperationException("Collection modified."); + } + } + + public void Dispose() { + currentIndex = -1; + currentObject = null; + } + } + +%} + + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef T key_type; + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + + unordered_set(); + unordered_set(const unordered_set& other); + size_type size() const; + bool empty() const; + %rename(Clear) clear; + void clear(); + %extend { + bool Add(const value_type& item) { + return $self->insert(item).second; + } + + bool Contains(const value_type& item) { + return $self->count(item) != 0; + } + + bool Remove(const value_type& item) { + return $self->erase(item) != 0; + } + + const value_type& getitem(const value_type& item) throw (std::out_of_range) { + std::unordered_set::iterator iter = $self->find(item); + if (iter == $self->end()) + throw std::out_of_range("item not found"); + + return *iter; + } + + // create_iterator_begin(), get_next() and destroy_iterator work together to provide a collection of items to C# + %apply void *VOID_INT_PTR { std::unordered_set::iterator *create_iterator_begin } + %apply void *VOID_INT_PTR { std::unordered_set::iterator *swigiterator } + + std::unordered_set::iterator *create_iterator_begin() { + return new std::unordered_set::iterator($self->begin()); + } + + const key_type& get_next(std::unordered_set::iterator *swigiterator) { + (void)$self; + std::unordered_set::iterator iter = *swigiterator; + (*swigiterator)++; + return *iter; + } + + void destroy_iterator(std::unordered_set::iterator *swigiterator) { + (void)$self; + delete swigiterator; + } + } +}; + +} diff --git a/usr/share/swig/4.1.1/csharp/std_vector.i b/usr/share/swig/4.2.1/csharp/std_vector.i similarity index 97% rename from usr/share/swig/4.1.1/csharp/std_vector.i rename to usr/share/swig/4.2.1/csharp/std_vector.i index a2add584da3..982306e0d61 100644 --- a/usr/share/swig/4.1.1/csharp/std_vector.i +++ b/usr/share/swig/4.2.1/csharp/std_vector.i @@ -69,6 +69,12 @@ } } + public bool IsEmpty { + get { + return empty(); + } + } + public int Count { get { return (int)size(); @@ -203,19 +209,20 @@ typedef value_type& reference; typedef CONST_REFERENCE const_reference; + vector(); + vector(const vector &other); + %rename(Clear) clear; void clear(); %rename(Add) push_back; void push_back(CTYPE const& x); size_type size() const; + bool empty() const; size_type capacity() const; void reserve(size_type n); %newobject GetRange(int index, int count); %newobject Repeat(CTYPE const& value, int count); - vector(); - vector(const vector &other); - %extend { vector(int capacity) throw (std::out_of_range) { std::vector< CTYPE >* pv = 0; @@ -357,22 +364,13 @@ namespace std { } %enddef -// Legacy macros -%define SWIG_STD_VECTOR_SPECIALIZE(CSTYPE, CTYPE...) -#warning SWIG_STD_VECTOR_SPECIALIZE macro deprecated, please see csharp/std_vector.i and switch to SWIG_STD_VECTOR_ENHANCED -SWIG_STD_VECTOR_ENHANCED(CTYPE) -%enddef - -%define SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(CSTYPE, CTYPE...) -#warning SWIG_STD_VECTOR_SPECIALIZE_MINIMUM macro deprecated, it is no longer required -%enddef - %{ #include #include #include %} +%csmethodmodifiers std::vector::empty "private" %csmethodmodifiers std::vector::getitemcopy "private" %csmethodmodifiers std::vector::getitem "private" %csmethodmodifiers std::vector::setitem "private" @@ -415,4 +413,3 @@ SWIG_STD_VECTOR_ENHANCED(float) SWIG_STD_VECTOR_ENHANCED(double) SWIG_STD_VECTOR_ENHANCED(std::string) // also requires a %include SWIG_STD_VECTOR_ENHANCED(std::wstring) // also requires a %include - diff --git a/usr/share/swig/4.1.1/csharp/std_wstring.i b/usr/share/swig/4.2.1/csharp/std_wstring.i similarity index 93% rename from usr/share/swig/4.1.1/csharp/std_wstring.i rename to usr/share/swig/4.2.1/csharp/std_wstring.i index 1d10ca808dd..c7fef41a50f 100644 --- a/usr/share/swig/4.1.1/csharp/std_wstring.i +++ b/usr/share/swig/4.2.1/csharp/std_wstring.i @@ -63,7 +63,7 @@ class wstring; return $null; } $1 = Swig_csharp_UTF16ToWString($input); %} -%typemap(out) wstring %{ $result = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} +%typemap(out) wstring %{ $result = SWIG_csharp_wstring_with_length_callback($1.data(), (int)$1.size()); %} %typemap(directorout, canthrow=1) wstring %{ if (!$input) { @@ -72,7 +72,7 @@ class wstring; } $result = Swig_csharp_UTF16ToWString($input); %} -%typemap(directorin) wstring %{ $input = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} +%typemap(directorin) wstring %{ $input = SWIG_csharp_wstring_with_length_callback($1.data(), (int)$1.size()); %} %typemap(csin) wstring "$csinput" %typemap(csout, excode=SWIGEXCODE) wstring { @@ -83,7 +83,7 @@ class wstring; %typemap(typecheck) wstring = wchar_t *; %typemap(throws, canthrow=1) wstring -%{ SWIG_csharp_ApplicationException_callback($1.c_str(), (int)$1.size()); +%{ SWIG_csharp_ApplicationException_callback($1.data(), (int)$1.size()); return $null; %} // const wstring & @@ -106,7 +106,7 @@ class wstring; } std::wstring $1_str(Swig_csharp_UTF16ToWString($input)); $1 = &$1_str; %} -%typemap(out) const wstring & %{ $result = SWIG_csharp_wstring_with_length_callback($1->c_str(), (int)$1->size()); %} +%typemap(out) const wstring & %{ $result = SWIG_csharp_wstring_with_length_callback($1->data(), (int)$1->size()); %} %typemap(csin) const wstring & "$csinput" %typemap(csout, excode=SWIGEXCODE) const wstring & { @@ -124,7 +124,7 @@ class wstring; $1_str = Swig_csharp_UTF16ToWString($input); $result = &$1_str; %} -%typemap(directorin) const wstring & %{ $input = SWIG_csharp_wstring_with_length_callback($1.c_str(), (int)$1.size()); %} +%typemap(directorin) const wstring & %{ $input = SWIG_csharp_wstring_with_length_callback($1.data(), (int)$1.size()); %} %typemap(csvarin, excode=SWIGEXCODE2) const wstring & %{ set { @@ -139,7 +139,7 @@ class wstring; %typemap(typecheck) const wstring & = wchar_t *; %typemap(throws, canthrow=1) const wstring & -%{ SWIG_csharp_ApplicationException_callback($1.c_str(), (int)$1.size()); +%{ SWIG_csharp_ApplicationException_callback($1.data(), (int)$1.size()); return $null; %} } diff --git a/usr/share/swig/4.1.1/csharp/stl.i b/usr/share/swig/4.2.1/csharp/stl.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/stl.i rename to usr/share/swig/4.2.1/csharp/stl.i diff --git a/usr/share/swig/4.1.1/csharp/swiginterface.i b/usr/share/swig/4.2.1/csharp/swiginterface.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/swiginterface.i rename to usr/share/swig/4.2.1/csharp/swiginterface.i diff --git a/usr/share/swig/4.1.1/csharp/swigmove.i b/usr/share/swig/4.2.1/csharp/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/swigmove.i rename to usr/share/swig/4.2.1/csharp/swigmove.i diff --git a/usr/share/swig/4.1.1/csharp/swigtype_inout.i b/usr/share/swig/4.2.1/csharp/swigtype_inout.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/swigtype_inout.i rename to usr/share/swig/4.2.1/csharp/swigtype_inout.i diff --git a/usr/share/swig/4.1.1/csharp/typemaps.i b/usr/share/swig/4.2.1/csharp/typemaps.i similarity index 87% rename from usr/share/swig/4.1.1/csharp/typemaps.i rename to usr/share/swig/4.2.1/csharp/typemaps.i index b6f9bddbdbf..80a5cb545c2 100644 --- a/usr/share/swig/4.1.1/csharp/typemaps.i +++ b/usr/share/swig/4.2.1/csharp/typemaps.i @@ -74,15 +74,11 @@ INPUT_TYPEMAP(short, short, short) INPUT_TYPEMAP(unsigned short, unsigned short, ushort) INPUT_TYPEMAP(int, int, int) INPUT_TYPEMAP(unsigned int, unsigned int, uint) -INPUT_TYPEMAP(long, long, int) -INPUT_TYPEMAP(unsigned long, unsigned long, uint) INPUT_TYPEMAP(long long, long long, long) INPUT_TYPEMAP(unsigned long long, unsigned long long, ulong) INPUT_TYPEMAP(float, float, float) INPUT_TYPEMAP(double, double, double) -#undef INPUT_TYPEMAP - /* OUTPUT typemaps --------------- @@ -153,15 +149,11 @@ OUTPUT_TYPEMAP(short, short, short, INT16_PTR) OUTPUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) OUTPUT_TYPEMAP(int, int, int, INT32_PTR) OUTPUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -OUTPUT_TYPEMAP(long, long, int, INT32_PTR) -OUTPUT_TYPEMAP(unsigned long, unsigned long, uint, UINT32_PTR) OUTPUT_TYPEMAP(long long, long long, long, INT64_PTR) OUTPUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) OUTPUT_TYPEMAP(float, float, float, FLOAT_PTR) OUTPUT_TYPEMAP(double, double, double, DOUBLE_PTR) -#undef OUTPUT_TYPEMAP - %typemap(in) bool *OUTPUT, bool &OUTPUT %{ *$input = 0; $1 = ($1_ltype)$input; %} @@ -242,12 +234,47 @@ INOUT_TYPEMAP(short, short, short, INT16_PTR) INOUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) INOUT_TYPEMAP(int, int, int, INT32_PTR) INOUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) -INOUT_TYPEMAP(long, long, int, INT32_PTR) -INOUT_TYPEMAP(unsigned long, unsigned long, uint, UINT32_PTR) INOUT_TYPEMAP(long long, long long, long, INT64_PTR) INOUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) INOUT_TYPEMAP(float, float, float, FLOAT_PTR) INOUT_TYPEMAP(double, double, double, DOUBLE_PTR) -#undef INOUT_TYPEMAP +// 32-bit/64-bit architecture specific typemaps - marshal as 32-bit by default +#if !defined(SWIGWORDSIZE64) +INPUT_TYPEMAP(long, int, int) +INPUT_TYPEMAP(unsigned long, unsigned int, uint) + +OUTPUT_TYPEMAP(long, int, int, INT32_PTR) +OUTPUT_TYPEMAP(unsigned long, unsigned int, uint, UINT32_PTR) + +INOUT_TYPEMAP(long, int, int, INT32_PTR) +INOUT_TYPEMAP(unsigned long, unsigned int, uint, UINT32_PTR) +#else +INPUT_TYPEMAP(long, long long, int) +INPUT_TYPEMAP(unsigned long, unsigned long long, uint) + +OUTPUT_TYPEMAP(long, long long, int, INT64_PTR) +OUTPUT_TYPEMAP(unsigned long, unsigned long long, uint, UINT64_PTR) + +INOUT_TYPEMAP(long, long long, int, INT64_PTR) +INOUT_TYPEMAP(unsigned long, unsigned long long, uint, UINT64_PTR) +#endif +%typemap(in) long INPUT[] ($*1_ltype tempinput), unsigned long INPUT[] ($*1_ltype tempinput) +%{tempinput = ($*1_ltype)*$input; + $1 = &tempinput;%} + +%typemap(in) long OUTPUT[] ($*1_ltype tempoutput), unsigned long OUTPUT[] ($*1_ltype tempoutput) +%{$1 = &tempoutput;%} + +%typemap(in) long INOUT[] ($*1_ltype tempinout), unsigned long INOUT[] ($*1_ltype tempinout) +%{tempinout = ($*1_ltype)*$input; + $1 = &tempinout;%} + +%typemap(argout) long OUTPUT[], unsigned long OUTPUT[] "*$input = *$1;" +%typemap(argout) long INOUT[], unsigned long INOUT[] "*$input = *$1;" + + +#undef INPUT_TYPEMAP +#undef OUTPUT_TYPEMAP +#undef INOUT_TYPEMAP diff --git a/usr/share/swig/4.1.1/csharp/wchar.i b/usr/share/swig/4.2.1/csharp/wchar.i similarity index 100% rename from usr/share/swig/4.1.1/csharp/wchar.i rename to usr/share/swig/4.2.1/csharp/wchar.i diff --git a/usr/share/swig/4.1.1/cstring.i b/usr/share/swig/4.2.1/cstring.i similarity index 100% rename from usr/share/swig/4.1.1/cstring.i rename to usr/share/swig/4.2.1/cstring.i diff --git a/usr/share/swig/4.1.1/cwstring.i b/usr/share/swig/4.2.1/cwstring.i similarity index 100% rename from usr/share/swig/4.1.1/cwstring.i rename to usr/share/swig/4.2.1/cwstring.i diff --git a/usr/share/swig/4.2.1/d/argcargv.i b/usr/share/swig/4.2.1/d/argcargv.i new file mode 100644 index 00000000000..92544f9b627 --- /dev/null +++ b/usr/share/swig/4.2.1/d/argcargv.i @@ -0,0 +1,26 @@ +/* ------------------------------------------------------------- + * SWIG library containing argc and argv multi-argument typemaps + * ------------------------------------------------------------- */ + +%typemap(ctype) (int ARGC, char **ARGV) "SWIG_c_dstring_array" +%typemap(imtype) (int ARGC, char **ARGV) "string[]" +%typemap(dtype) (int ARGC, char **ARGV) "string[]" + +%typemap(in, canthrow=1) (int ARGC, char **ARGV) { + $1_ltype i, len; + len = $input.len; + $2 = ($2_ltype) malloc((len+1)*sizeof($*2_ltype)); + if ($2 == SWIG_NULLPTR) { + SWIG_DSetPendingException(SWIG_DException, "memory allocation failed"); + return $null; + } + $1 = len; + for (i = 0; i < len; i++) { + $2[i] = $input.array[i].str; + } + $2[i] = SWIG_NULLPTR; +} + +%typemap(freearg) (int ARGC, char **ARGV) { + free((void *)$2); +} diff --git a/usr/share/swig/4.1.1/d/boost_shared_ptr.i b/usr/share/swig/4.2.1/d/boost_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/d/boost_shared_ptr.i rename to usr/share/swig/4.2.1/d/boost_shared_ptr.i diff --git a/usr/share/swig/4.1.1/d/carrays.i b/usr/share/swig/4.2.1/d/carrays.i similarity index 60% rename from usr/share/swig/4.1.1/d/carrays.i rename to usr/share/swig/4.2.1/d/carrays.i index f2803ea4671..0bd99a7c97c 100644 --- a/usr/share/swig/4.1.1/d/carrays.i +++ b/usr/share/swig/4.2.1/d/carrays.i @@ -10,16 +10,16 @@ * Generates functions for creating and accessing elements of a C array * (as pointers). Creates the following functions: * - * TYPE *new_NAME(int nelements) + * TYPE *new_NAME(size_t nelements) * void delete_NAME(TYPE *); - * TYPE NAME_getitem(TYPE *, int index); - * void NAME_setitem(TYPE *, int index, TYPE value); + * TYPE NAME_getitem(TYPE *, size_t index); + * void NAME_setitem(TYPE *, size_t index, TYPE value); * * ----------------------------------------------------------------------------- */ %define %array_functions(TYPE,NAME) %{ -static TYPE *new_##NAME(int nelements) { %} +static TYPE *new_##NAME(size_t nelements) { %} #ifdef __cplusplus %{ return new TYPE[nelements](); %} #else @@ -35,18 +35,18 @@ static void delete_##NAME(TYPE *ary) { %} #endif %{} -static TYPE NAME##_getitem(TYPE *ary, int index) { +static TYPE NAME##_getitem(TYPE *ary, size_t index) { return ary[index]; } -static void NAME##_setitem(TYPE *ary, int index, TYPE value) { +static void NAME##_setitem(TYPE *ary, size_t index, TYPE value) { ary[index] = value; } %} -TYPE *new_##NAME(int nelements); +TYPE *new_##NAME(size_t nelements); void delete_##NAME(TYPE *ary); -TYPE NAME##_getitem(TYPE *ary, int index); -void NAME##_setitem(TYPE *ary, int index, TYPE value); +TYPE NAME##_getitem(TYPE *ary, size_t index); +void NAME##_setitem(TYPE *ary, size_t index, TYPE value); %enddef @@ -58,13 +58,13 @@ void NAME##_setitem(TYPE *ary, int index, TYPE value); * interface: * * struct NAME { - * NAME(int nelements); + * NAME(size_t nelements); * ~NAME(); - * TYPE getitem(int index); - * void setitem(int index, TYPE value); + * TYPE getitem(size_t index); + * void setitem(size_t index, TYPE value); * TYPE * ptr(); * static NAME *frompointer(TYPE *t); - * } + * } * * ----------------------------------------------------------------------------- */ @@ -76,34 +76,36 @@ typedef TYPE NAME; typedef struct {} NAME; %extend NAME { + #ifdef __cplusplus - NAME(int nelements) { - return new TYPE[nelements](); - } - ~NAME() { - delete [] self; - } +NAME(size_t nelements) { + return new TYPE[nelements](); +} +~NAME() { + delete [] self; +} #else - NAME(int nelements) { - return (TYPE *) calloc(nelements,sizeof(TYPE)); - } - ~NAME() { - free(self); - } +NAME(size_t nelements) { + return (TYPE *) calloc(nelements,sizeof(TYPE)); +} +~NAME() { + free(self); +} #endif - TYPE getitem(int index) { - return self[index]; - } - void setitem(int index, TYPE value) { - self[index] = value; - } - TYPE * ptr() { - return self; - } - static NAME *frompointer(TYPE *t) { - return (NAME *) t; - } +TYPE getitem(size_t index) { + return self[index]; +} +void setitem(size_t index, TYPE value) { + self[index] = value; +} +TYPE * ptr() { + return self; +} +static NAME *frompointer(TYPE *t) { + return (NAME *) t; +} + }; %types(NAME = TYPE); diff --git a/usr/share/swig/4.1.1/d/cpointer.i b/usr/share/swig/4.2.1/d/cpointer.i similarity index 100% rename from usr/share/swig/4.1.1/d/cpointer.i rename to usr/share/swig/4.2.1/d/cpointer.i diff --git a/usr/share/swig/4.1.1/d/d.swg b/usr/share/swig/4.2.1/d/d.swg similarity index 100% rename from usr/share/swig/4.1.1/d/d.swg rename to usr/share/swig/4.2.1/d/d.swg diff --git a/usr/share/swig/4.1.1/d/dclassgen.swg b/usr/share/swig/4.2.1/d/dclassgen.swg similarity index 100% rename from usr/share/swig/4.1.1/d/dclassgen.swg rename to usr/share/swig/4.2.1/d/dclassgen.swg diff --git a/usr/share/swig/4.1.1/d/ddirectives.swg b/usr/share/swig/4.2.1/d/ddirectives.swg similarity index 100% rename from usr/share/swig/4.1.1/d/ddirectives.swg rename to usr/share/swig/4.2.1/d/ddirectives.swg diff --git a/usr/share/swig/4.1.1/d/denums.swg b/usr/share/swig/4.2.1/d/denums.swg similarity index 100% rename from usr/share/swig/4.1.1/d/denums.swg rename to usr/share/swig/4.2.1/d/denums.swg diff --git a/usr/share/swig/4.1.1/d/dexception.swg b/usr/share/swig/4.2.1/d/dexception.swg similarity index 92% rename from usr/share/swig/4.1.1/d/dexception.swg rename to usr/share/swig/4.2.1/d/dexception.swg index 1aadbaada49..74e0422b148 100644 --- a/usr/share/swig/4.1.1/d/dexception.swg +++ b/usr/share/swig/4.2.1/d/dexception.swg @@ -15,7 +15,7 @@ unsigned long, unsigned short %{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); + SWIG_snprintf(error_msg, sizeof(error_msg), "C++ $1_type exception thrown, value: %d", $1); SWIG_DSetPendingException(SWIG_DException, error_msg); return $null; %} diff --git a/usr/share/swig/4.1.1/d/dhead.swg b/usr/share/swig/4.2.1/d/dhead.swg similarity index 56% rename from usr/share/swig/4.1.1/d/dhead.swg rename to usr/share/swig/4.2.1/d/dhead.swg index 1ef1e416410..40393c9887f 100644 --- a/usr/share/swig/4.1.1/d/dhead.swg +++ b/usr/share/swig/4.2.1/d/dhead.swg @@ -1,9 +1,6 @@ /* ----------------------------------------------------------------------------- * dhead.swg * - * Support code for exceptions if the SWIG_D_NO_EXCEPTION_HELPER is not defined - * Support code for strings if the SWIG_D_NO_STRING_HELPER is not defined - * * Support code for function pointers. ----------------------------------------------------------------------------- */ %insert(runtime) %{ @@ -20,7 +17,6 @@ * Exception support code. */ -#if !defined(SWIG_D_NO_EXCEPTION_HELPER) %insert(runtime) %{ // Support for throwing D exceptions from C/C++. typedef enum { @@ -71,87 +67,6 @@ SWIGEXPORT void SWIGRegisterExceptionCallbacks_$module( } %} -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports=%{ -// Exception throwing support currently requires Tango, but there is no reason -// why it could not support Phobos. -static import tango.core.Exception; -static import tango.core.Thread; -static import tango.stdc.stringz; -%} - -%pragma(d) imdmodulecode=%{ -private class SwigExceptionHelper { - static this() { - swigRegisterExceptionCallbacks$module( - &setException, - &setIllegalArgumentException, - &setIllegalElementException, - &setIOException, - &setNoSuchElementException); - } - - static void setException(char* message) { - auto exception = new object.Exception(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIllegalArgumentException(char* message) { - auto exception = new tango.core.Exception.IllegalArgumentException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIllegalElementException(char* message) { - auto exception = new tango.core.Exception.IllegalElementException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setIOException(char* message) { - auto exception = new tango.core.Exception.IOException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } - - static void setNoSuchElementException(char* message) { - auto exception = new tango.core.Exception.NoSuchElementException(tango.stdc.stringz.fromStringz(message).dup); - SwigPendingException.set(exception); - } -} - -package class SwigPendingException { -public: - static this() { - m_sPendingException = new ThreadLocalData(null); - } - - static bool isPending() { - return m_sPendingException.val !is null; - } - - static void set(object.Exception e) { - auto pending = m_sPendingException.val; - if (pending !is null) { - e.next = pending; - throw new object.Exception("FATAL: An earlier pending exception from C/C++ " ~ - "code was missed and thus not thrown (" ~ pending.classinfo.name ~ ": " ~ - pending.msg ~ ")!", e); - } - m_sPendingException.val = e; - } - - static object.Exception retrieve() { - auto e = m_sPendingException.val; - m_sPendingException.val = null; - return e; - } - -private: - // The reference to the pending exception (if any) is stored thread-local. - alias tango.core.Thread.ThreadLocal!(object.Exception) ThreadLocalData; - static ThreadLocalData m_sPendingException; -} -alias void function(char* message) SwigExceptionCallback; -%} -#else %pragma(d) imdmoduleimports=%{ static import std.conv; %} @@ -175,7 +90,7 @@ private class SwigExceptionHelper { } } -package struct SwigPendingException { +public class SwigPendingException { public: static this() { m_sPendingException = null; @@ -208,16 +123,13 @@ private: } alias void function(const char* message) SwigExceptionCallback; %} -#endif // Callback registering function in wrapperloader.swg. -#endif // SWIG_D_NO_EXCEPTION_HELPER /* * String support code. */ -#if !defined(SWIG_D_NO_STRING_HELPER) %insert(runtime) %{ // Callback for returning strings to D without leaking memory. typedef char * (* SWIG_DStringHelperCallback)(const char *); @@ -231,23 +143,6 @@ SWIGEXPORT void SWIGRegisterStringCallback_$module(SWIG_DStringHelperCallback ca } %} -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports = "static import tango.stdc.stringz;"; - -%pragma(d) imdmodulecode = %{ -private class SwigStringHelper { - static this() { - swigRegisterStringCallback$module(&createString); - } - - static char* createString(char* cString) { - // We are effectively dup'ing the string here. - return tango.stdc.stringz.toStringz(tango.stdc.stringz.fromStringz(cString)); - } -} -alias char* function(char* cString) SwigStringCallback; -%} -#else %pragma(d) imdmoduleimports = %{ static import std.conv; static import std.string; @@ -261,31 +156,18 @@ private class SwigStringHelper { static const(char)* createString(const(char*) cString) { // We are effectively dup'ing the string here. - // TODO: Is this also correct for D2/Phobos? + // TODO: Is this correct for D2/Phobos? return std.string.toStringz(std.conv.to!string(cString)); } } alias const(char)* function(const(char*) cString) SwigStringCallback; %} -#endif // Callback registering function in wrapperloader.swg. -#endif // SWIG_D_NO_STRING_HELPER /* * Function pointer support code. */ -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmodulecode = %{ -template SwigExternC(T) { - static if (is(typeof(*(T.init)) R == return)) { - static if (is(typeof(*(T.init)) P == function)) { - alias extern(C) R function(P) SwigExternC; - } - } -} -%} -#else %pragma(d) imdmodulecode = %{ template SwigExternC(T) if (is(typeof(*(T.init)) P == function)) { static if (is(typeof(*(T.init)) R == return)) { @@ -295,4 +177,3 @@ template SwigExternC(T) if (is(typeof(*(T.init)) P == function)) { } } %} -#endif diff --git a/usr/share/swig/4.1.1/d/director.swg b/usr/share/swig/4.2.1/d/director.swg similarity index 100% rename from usr/share/swig/4.1.1/d/director.swg rename to usr/share/swig/4.2.1/d/director.swg diff --git a/usr/share/swig/4.1.1/d/dkw.swg b/usr/share/swig/4.2.1/d/dkw.swg similarity index 97% rename from usr/share/swig/4.1.1/d/dkw.swg rename to usr/share/swig/4.2.1/d/dkw.swg index 2a189ed6452..b96d1fa6bd2 100644 --- a/usr/share/swig/4.1.1/d/dkw.swg +++ b/usr/share/swig/4.2.1/d/dkw.swg @@ -120,7 +120,7 @@ DKEYWORD(with); DKEYWORD(wstring); // Not really a keyword, but dispose() methods are generated in proxy classes -// and it's a special method name for D1/Tango. +// and it was a special method name for D1/Tango. DKEYWORD(dispose); #undef DKEYWORD diff --git a/usr/share/swig/4.1.1/d/dmemberfunctionpointers.swg b/usr/share/swig/4.2.1/d/dmemberfunctionpointers.swg similarity index 100% rename from usr/share/swig/4.1.1/d/dmemberfunctionpointers.swg rename to usr/share/swig/4.2.1/d/dmemberfunctionpointers.swg diff --git a/usr/share/swig/4.1.1/d/doperators.swg b/usr/share/swig/4.2.1/d/doperators.swg similarity index 56% rename from usr/share/swig/4.1.1/d/doperators.swg rename to usr/share/swig/4.2.1/d/doperators.swg index 0a82a6cb478..f651c392856 100644 --- a/usr/share/swig/4.1.1/d/doperators.swg +++ b/usr/share/swig/4.2.1/d/doperators.swg @@ -4,129 +4,6 @@ * Mapping of C++ operator overloading methods to D. * ----------------------------------------------------------------------------- */ -#if (SWIG_D_VERSION == 1) - -%pragma(d) imdmodulecode=%{ -template SwigOperatorDefinitions() { - public override int opEquals(Object o) { - if (auto rhs = cast(typeof(this))o) { - if (swigCPtr == rhs.swigCPtr) return 1; - static if (is(typeof(swigOpEquals(rhs)))) { - return swigOpEquals(rhs) ? 1 : 0; - } else { - return 0; - } - } - return super.opEquals(o); - } -%} -// opEquals is emitted in pure C mode as well to define two proxy classes -// pointing to the same struct as equal. - -#ifdef __cplusplus -%rename(opPos) *::operator+(); -%rename(opPos) *::operator+() const; -%rename(opNeg) *::operator-(); -%rename(opNeg) *::operator-() const; -%rename(opCom) *::operator~(); -%rename(opCom) *::operator~() const; - -%rename(opAdd) *::operator+; -%rename(opAddAssign) *::operator+=; -%rename(opSub) *::operator-; -%rename(opSubAssign) *::operator-=; -%rename(opMul) *::operator*; -%rename(opMulAssign) *::operator*=; -%rename(opDiv) *::operator/; -%rename(opDivAssign) *::operator/=; -%rename(opMod) *::operator%; -%rename(opModAssign) *::operator%=; -%rename(opAnd) *::operator&; -%rename(opAndAssign) *::operator&=; -%rename(opOr) *::operator|; -%rename(opOrAssign) *::operator|=; -%rename(opXor) *::operator^; -%rename(opXorAssign) *::operator^=; -%rename(opShl) *::operator<<; -%rename(opShlAssign) *::operator<<=; -%rename(opShr) *::operator>>; -%rename(opShrAssign) *::operator>>=; - -%rename(opIndex) *::operator[](unsigned) const; -// opIndexAssign is not currently generated, it needs more extensive support -// mechanisms. - -%rename(opCall) *::operator(); - -// !a is not overridable in D1. -%ignoreoperator(LNOT) operator!; - -// opCmp is used in D. -%rename(swigOpEquals) *::operator==; -%rename(swigOpLt) *::operator<; -%rename(swigOpLtEquals) *::operator<=; -%rename(swigOpGt) *::operator>; -%rename(swigOpGtEquals) *::operator>=; - -// a != b is rewritten as !a.opEquals(b) in D. -%ignoreoperator(NOTEQUAL) operator!=; - -// The logic operators are not overridable in D. -%ignoreoperator(LAND) operator&&; -%ignoreoperator(LOR) operator||; - -// ++/--a is rewritten as a +/-= 1 in D1,so ignore the prefix operators. -%ignoreoperator(PLUSPLUS) *::operator++(); -%ignoreoperator(MINUSMINUS) *::operator--(); -%rename(swigOpInc) *::operator++(int); -%rename(swigOpDec) *::operator--(int); - -// The C++ assignment operator does not translate well to D where the proxy -// classes have reference semantics. -%ignoreoperator(EQ) operator=; - -%pragma(d) imdmodulecode=%{ - public override int opCmp(Object o) { - static if (is(typeof(swigOpLt(typeof(this).init) && - swigOpEquals(typeof(this).init)))) { - if (auto rhs = cast(typeof(this))o) { - if (swigOpLt(rhs)) { - return -1; - } else if (swigOpEquals(rhs)) { - return 0; - } else { - return 1; - } - } - } - return super.opCmp(o); - } - - public typeof(this) opPostInc(T = int)(T unused = 0) { - static assert( - is(typeof(swigOpInc(int.init))), - "opPostInc called on " ~ typeof(this).stringof ~ ", but no postfix " ~ - "increment operator exists in the corresponding C++ class." - ); - return swigOpInc(int.init); - } - - public typeof(this) opPostDec(T = int)(T unused = 0) { - static assert( - is(typeof(swigOpDec(int.init))), - "opPostInc called on " ~ typeof(this).stringof ~ ", but no postfix " ~ - "decrement operator exists in the corresponding C++ class." - ); - return swigOpDec(int.init); - } -%} -#endif - -%pragma(d) imdmodulecode=%{ -} -%} - -#else %pragma(d) imdmodulecode=%{ mixin template SwigOperatorDefinitions() { public override bool opEquals(Object o) { @@ -255,5 +132,3 @@ mixin template SwigOperatorDefinitions() { %pragma(d) imdmodulecode=%{ } %} - -#endif diff --git a/usr/share/swig/4.1.1/d/dprimitives.swg b/usr/share/swig/4.2.1/d/dprimitives.swg similarity index 94% rename from usr/share/swig/4.1.1/d/dprimitives.swg rename to usr/share/swig/4.2.1/d/dprimitives.swg index eaee816d3b3..843350fedcc 100644 --- a/usr/share/swig/4.1.1/d/dprimitives.swg +++ b/usr/share/swig/4.2.1/d/dprimitives.swg @@ -5,17 +5,10 @@ * ----------------------------------------------------------------------------- */ // C long/ulong width depends on the target arch, use stdlib aliases for them. -#if (SWIG_D_VERSION == 1) -%pragma(d) imdmoduleimports = "static import tango.stdc.config;" -%pragma(d) globalproxyimports = "static import tango.stdc.config;" -#define SWIG_LONG_DTYPE tango.stdc.config.c_long -#define SWIG_ULONG_DTYPE tango.stdc.config.c_ulong -#else %pragma(d) imdmoduleimports = "static import core.stdc.config;" %pragma(d) globalproxyimports = "static import core.stdc.config;" #define SWIG_LONG_DTYPE core.stdc.config.c_long #define SWIG_ULONG_DTYPE core.stdc.config.c_ulong -#endif /* * The SWIG_D_PRIMITIVE macro is used to define the typemaps for the primitive @@ -150,6 +143,12 @@ SWIG_D_PRIMITIVE(double, double) const unsigned long & "" +// Default assumes size_t is 32-bit for overloading +%typecheck(SWIG_TYPECHECK_UINT32) + size_t, + const size_t & + "" + %typecheck(SWIG_TYPECHECK_INT64) long long, const long long & diff --git a/usr/share/swig/4.1.1/d/dstrings.swg b/usr/share/swig/4.2.1/d/dstrings.swg similarity index 89% rename from usr/share/swig/4.1.1/d/dstrings.swg rename to usr/share/swig/4.2.1/d/dstrings.swg index 02895c15323..0b875b58b9d 100644 --- a/usr/share/swig/4.1.1/d/dstrings.swg +++ b/usr/share/swig/4.2.1/d/dstrings.swg @@ -64,17 +64,10 @@ // We need to have the \0-terminated string conversion functions available in // the D proxy modules. -#if (SWIG_D_VERSION == 1) -// Could be easily extended to support Phobos as well. -SWIGD_STRING_TYPEMAPS(char*, char[], tango.stdc.stringz.fromStringz, tango.stdc.stringz.toStringz) - -%pragma(d) globalproxyimports = "static import tango.stdc.stringz;"; -#else SWIGD_STRING_TYPEMAPS(const(char)*, string, std.conv.to!string, std.string.toStringz) %pragma(d) globalproxyimports = %{ static import std.conv; static import std.string; %} -#endif #undef SWIGD_STRING_TYPEMAPS diff --git a/usr/share/swig/4.1.1/d/dswigtype.swg b/usr/share/swig/4.2.1/d/dswigtype.swg similarity index 82% rename from usr/share/swig/4.1.1/d/dswigtype.swg rename to usr/share/swig/4.2.1/d/dswigtype.swg index c227519e887..81a7d833d14 100644 --- a/usr/share/swig/4.1.1/d/dswigtype.swg +++ b/usr/share/swig/4.2.1/d/dswigtype.swg @@ -239,3 +239,46 @@ nativepointer="cast(void*)$dcall" ) SWIGTYPE *const& "$*dclassname.swigGetCPtr($dcall)" +/* + * D String & D array represent in C + */ + +%insert(runtime) %{ +#include +typedef struct { size_t len; char *str;} SWIG_c_dstring; +typedef struct { size_t len; SWIG_c_dstring *array; } SWIG_c_dstring_array; +%} + +/* + * String & length + */ +%typemap(imtype) (const char *STRING, size_t LENGTH) "string" +%typemap(dtype) (const char *STRING, size_t LENGTH) "string" +%typemap(ctype,default="={0,0}") (const char *STRING, size_t LENGTH) "SWIG_c_dstring" +%typemap(din, nativepointer="std.conv.to!string($dinput)") (const char *STRING, size_t LENGTH) "$dinput" +%typemap(freearg) (const char *STRING, size_t LENGTH) "" +%typemap(in, canthrow=1) (const char *STRING, size_t LENGTH) %{ + $1 = ($1_ltype)$input.str; + $2 = ($2_ltype)$input.len; +%} +%typemap(argout) (const char *STRING, size_t LENGTH) { + $input.str = (char *)$1; + $input.len = (size_t)$2; +} +%typemap(directorin) (const char *STRING, size_t LENGTH) { + $input.str = (char *)$1; + $input.len = (size_t)$2; +} +%typemap(ddirectorin) (const char *STRING, size_t LENGTH) "std.conv.to!string($winput)" +%apply (const char *STRING, size_t LENGTH) { (char *STRING, size_t LENGTH) } +/* Enable write-back for non-const version */ +%typemap(argout) (char *STRING, size_t LENGTH) { + $input.str = (char *)$1; + $input.len = (size_t)$2; +} +%typemap(directorargout) (char *STRING, size_t LENGTH) +{ + $1 = ($1_ltype)$input.str; + $2 = ($2_ltype)$input.len; +} +%apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) } diff --git a/usr/share/swig/4.1.1/d/dvoid.swg b/usr/share/swig/4.2.1/d/dvoid.swg similarity index 100% rename from usr/share/swig/4.1.1/d/dvoid.swg rename to usr/share/swig/4.2.1/d/dvoid.swg diff --git a/usr/share/swig/4.1.1/d/std_auto_ptr.i b/usr/share/swig/4.2.1/d/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/d/std_auto_ptr.i rename to usr/share/swig/4.2.1/d/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/d/std_common.i b/usr/share/swig/4.2.1/d/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/d/std_common.i rename to usr/share/swig/4.2.1/d/std_common.i diff --git a/usr/share/swig/4.1.1/d/std_deque.i b/usr/share/swig/4.2.1/d/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/d/std_deque.i rename to usr/share/swig/4.2.1/d/std_deque.i diff --git a/usr/share/swig/4.1.1/d/std_except.i b/usr/share/swig/4.2.1/d/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/d/std_except.i rename to usr/share/swig/4.2.1/d/std_except.i diff --git a/usr/share/swig/4.1.1/d/std_map.i b/usr/share/swig/4.2.1/d/std_map.i similarity index 95% rename from usr/share/swig/4.1.1/d/std_map.i rename to usr/share/swig/4.2.1/d/std_map.i index c5e03d06dab..a374f55aa53 100644 --- a/usr/share/swig/4.1.1/d/std_map.i +++ b/usr/share/swig/4.2.1/d/std_map.i @@ -44,7 +44,11 @@ namespace std { throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } void del(const K& key) throw (std::out_of_range) { std::map< K, T, C >::iterator i = self->find(key); diff --git a/usr/share/swig/4.1.1/d/std_pair.i b/usr/share/swig/4.2.1/d/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/d/std_pair.i rename to usr/share/swig/4.2.1/d/std_pair.i diff --git a/usr/share/swig/4.1.1/d/std_shared_ptr.i b/usr/share/swig/4.2.1/d/std_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/d/std_shared_ptr.i rename to usr/share/swig/4.2.1/d/std_shared_ptr.i diff --git a/usr/share/swig/4.1.1/d/std_string.i b/usr/share/swig/4.2.1/d/std_string.i similarity index 91% rename from usr/share/swig/4.1.1/d/std_string.i rename to usr/share/swig/4.2.1/d/std_string.i index 8d75d23e42f..fbee0578c7a 100644 --- a/usr/share/swig/4.1.1/d/std_string.i +++ b/usr/share/swig/4.2.1/d/std_string.i @@ -79,19 +79,12 @@ class string; // We need to have the \0-terminated string conversion functions available in // the D proxy modules. -#if (SWIG_D_VERSION == 1) -// Could be easily extended to support Phobos as well. -SWIGD_STD_STRING_TYPEMAPS(char*, char[], tango.stdc.stringz.fromStringz, tango.stdc.stringz.toStringz) - -%pragma(d) globalproxyimports = "static import tango.stdc.stringz;"; -#else SWIGD_STD_STRING_TYPEMAPS(const(char)*, string, std.conv.to!string, std.string.toStringz) %pragma(d) globalproxyimports = %{ static import std.conv; static import std.string; %} -#endif #undef SWIGD_STD_STRING_TYPEMAPS diff --git a/usr/share/swig/4.1.1/d/std_unique_ptr.i b/usr/share/swig/4.2.1/d/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/d/std_unique_ptr.i rename to usr/share/swig/4.2.1/d/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/d/std_vector.i b/usr/share/swig/4.2.1/d/std_vector.i similarity index 72% rename from usr/share/swig/4.1.1/d/std_vector.i rename to usr/share/swig/4.2.1/d/std_vector.i index fb8f7d2e006..8c67402e525 100644 --- a/usr/share/swig/4.1.1/d/std_vector.i +++ b/usr/share/swig/4.2.1/d/std_vector.i @@ -22,169 +22,6 @@ // MACRO for use within the std::vector class body %define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CONST_REFERENCE, CTYPE...) -#if (SWIG_D_VERSION == 1) -%typemap(dimports) std::vector< CTYPE > "static import tango.core.Exception;" -%proxycode %{ -public this($typemap(dtype, CTYPE)[] values) { - this(); - append(values); -} - -alias push_back add; -alias push_back push; -alias push_back opCatAssign; -alias size length; -alias opSlice slice; - -public $typemap(dtype, CTYPE) opIndexAssign($typemap(dtype, CTYPE) value, size_t index) { - if (index >= size()) { - throw new tango.core.Exception.NoSuchElementException("Tried to assign to element out of vector bounds."); - } - setElement(index, value); - return value; -} - -public $typemap(dtype, CTYPE) opIndex(size_t index) { - if (index >= size()) { - throw new tango.core.Exception.NoSuchElementException("Tried to read from element out of vector bounds."); - } - return getElement(index); -} - -public void append($typemap(dtype, CTYPE)[] value...) { - foreach (v; value) { - add(v); - } -} - -public $typemap(dtype, CTYPE)[] opSlice() { - $typemap(dtype, CTYPE)[] array = new $typemap(dtype, CTYPE)[size()]; - foreach (i, ref value; array) { - value = getElement(i); - } - return array; -} - -public int opApply(int delegate(ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - result = dg(value); - setElement(i, value); - } - return result; -} - -public int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) { - int result; - - size_t currentSize = size(); - for (size_t i = 0; i < currentSize; ++i) { - auto value = getElement(i); - - // Workaround for http://d.puremagic.com/issues/show_bug.cgi?id=2443. - auto index = i; - - result = dg(index, value); - setElement(i, value); - } - return result; -} - -public void capacity(size_t value) { - if (value < size()) { - throw new tango.core.Exception.IllegalArgumentException("Tried to make the capacity of a vector smaller than its size."); - } - - reserve(value); -} -%} - - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef CTYPE value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef CONST_REFERENCE const_reference; - - void clear(); - void push_back(CTYPE const& x); - size_type size() const; - size_type capacity() const; - void reserve(size_type n) throw (std::length_error); - - vector(); - vector(const vector &other); - - %extend { - vector(size_type capacity) throw (std::length_error) { - std::vector< CTYPE >* pv = 0; - pv = new std::vector< CTYPE >(); - - // Might throw std::length_error. - pv->reserve(capacity); - - return pv; - } - - size_type unused() const { - return $self->capacity() - $self->size(); - } - - const_reference remove() throw (std::out_of_range) { - if ($self->empty()) { - throw std::out_of_range("Tried to remove last element from empty vector."); - } - - std::vector< CTYPE >::const_reference value = $self->back(); - $self->pop_back(); - return value; - } - - const_reference remove(size_type index) throw (std::out_of_range) { - if (index >= $self->size()) { - throw std::out_of_range("Tried to remove element with invalid index."); - } - - std::vector< CTYPE >::iterator it = $self->begin() + index; - std::vector< CTYPE >::const_reference value = *it; - $self->erase(it); - return value; - } - } - - // Wrappers for setting/getting items with the possibly thrown exception - // specified (important for SWIG wrapper generation). - %extend { - const_reference getElement(size_type index) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to get value of element with invalid index."); - } - return (*$self)[index]; - } - } - - // Use CTYPE const& instead of const_reference to work around SWIG code - // generation issue when using const pointers as vector elements (like - // std::vector< const int* >). - %extend { - void setElement(size_type index, CTYPE const& val) throw (std::out_of_range) { - if ((index < 0) || ($self->size() <= index)) { - throw std::out_of_range("Tried to set value of element with invalid index."); - } - (*$self)[index] = val; - } - } - -%dmethodmodifiers std::vector::getElement "private" -%dmethodmodifiers std::vector::setElement "private" -%dmethodmodifiers std::vector::reserve "private" - -#else %typemap(dimports) std::vector< CTYPE > %{ static import std.algorithm; @@ -541,7 +378,6 @@ int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) %dmethodmodifiers std::vector::getElement "private" %dmethodmodifiers std::vector::setElement "private" -#endif %enddef // Extra methods added to the collection class if operator== is defined for the class being wrapped diff --git a/usr/share/swig/4.1.1/d/stl.i b/usr/share/swig/4.2.1/d/stl.i similarity index 100% rename from usr/share/swig/4.1.1/d/stl.i rename to usr/share/swig/4.2.1/d/stl.i diff --git a/usr/share/swig/4.1.1/d/swigmove.i b/usr/share/swig/4.2.1/d/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/d/swigmove.i rename to usr/share/swig/4.2.1/d/swigmove.i diff --git a/usr/share/swig/4.1.1/d/typemaps.i b/usr/share/swig/4.2.1/d/typemaps.i similarity index 100% rename from usr/share/swig/4.1.1/d/typemaps.i rename to usr/share/swig/4.2.1/d/typemaps.i diff --git a/usr/share/swig/4.1.1/d/wrapperloader.swg b/usr/share/swig/4.2.1/d/wrapperloader.swg similarity index 95% rename from usr/share/swig/4.1.1/d/wrapperloader.swg rename to usr/share/swig/4.2.1/d/wrapperloader.swg index 67e03bfc823..f0f1d1b4696 100644 --- a/usr/share/swig/4.1.1/d/wrapperloader.swg +++ b/usr/share/swig/4.2.1/d/wrapperloader.swg @@ -282,27 +282,19 @@ static this() { "))library.loadSymbol(`" ~ symbol ~ "`);"; } - //#if !defined(SWIG_D_NO_EXCEPTION_HELPER) mixin(bindCode("swigRegisterExceptionCallbacks$module", "SWIGRegisterExceptionCallbacks_$module")); - //#endif // SWIG_D_NO_EXCEPTION_HELPER - //#if !defined(SWIG_D_NO_STRING_HELPER) mixin(bindCode("swigRegisterStringCallback$module", "SWIGRegisterStringCallback_$module")); - //#endif // SWIG_D_NO_STRING_HELPER $wrapperloaderbindcode } -//#if !defined(SWIG_D_NO_EXCEPTION_HELPER) extern(C) void function( SwigExceptionCallback exceptionCallback, SwigExceptionCallback illegalArgumentCallback, SwigExceptionCallback illegalElementCallback, SwigExceptionCallback ioCallback, SwigExceptionCallback noSuchElementCallback) swigRegisterExceptionCallbacks$module; -//#endif // SWIG_D_NO_EXCEPTION_HELPER -//#if !defined(SWIG_D_NO_STRING_HELPER) extern(C) void function(SwigStringCallback callback) swigRegisterStringCallback$module; -//#endif // SWIG_D_NO_STRING_HELPER %} %pragma(d) wrapperloaderbindcommand = %{ diff --git a/usr/share/swig/4.1.1/director_common.swg b/usr/share/swig/4.2.1/director_common.swg similarity index 100% rename from usr/share/swig/4.1.1/director_common.swg rename to usr/share/swig/4.2.1/director_common.swg diff --git a/usr/share/swig/4.1.1/exception.i b/usr/share/swig/4.2.1/exception.i similarity index 96% rename from usr/share/swig/4.1.1/exception.i rename to usr/share/swig/4.2.1/exception.i index 5cdea58e8b2..1c00fb3a1c0 100644 --- a/usr/share/swig/4.1.1/exception.i +++ b/usr/share/swig/4.2.1/exception.i @@ -14,14 +14,9 @@ #ifdef SWIGPHP %{ -#if PHP_MAJOR_VERSION >= 8 -# define SWIG_HANDLE_VALUE_ERROR_FOR_PHP8(code) code == SWIG_ValueError ? zend_ce_value_error : -#else -# define SWIG_HANDLE_VALUE_ERROR_FOR_PHP8(code) -#endif #define SWIG_exception(code, msg) do { zend_throw_exception( \ code == SWIG_TypeError ? zend_ce_type_error : \ - SWIG_HANDLE_VALUE_ERROR_FOR_PHP8(code) \ + code == SWIG_ValueError ? zend_ce_value_error : \ code == SWIG_DivisionByZero ? zend_ce_division_by_zero_error : \ code == SWIG_SyntaxError ? zend_ce_parse_error : \ code == SWIG_OverflowError ? zend_ce_arithmetic_error : \ @@ -34,9 +29,8 @@ SWIGINTERN void SWIG_exception_ (int code, const char *msg, const char *subr) { #define ERROR(scmerr) \ - scm_error(scm_from_locale_string((char *) (scmerr)), \ - (char *) subr, (char *) msg, \ - SCM_EOL, SCM_BOOL_F) + scm_error(scm_from_locale_string(scmerr), \ + subr, msg, SCM_EOL, SCM_BOOL_F) #define MAP(swigerr, scmerr) \ case swigerr: \ ERROR(scmerr); \ diff --git a/usr/share/swig/4.2.1/go/argcargv.i b/usr/share/swig/4.2.1/go/argcargv.i new file mode 100644 index 00000000000..f2dee2be955 --- /dev/null +++ b/usr/share/swig/4.2.1/go/argcargv.i @@ -0,0 +1,62 @@ +/* ------------------------------------------------------------- + * SWIG library containing argc and argv multi-argument typemaps + * ------------------------------------------------------------- */ + +%typemap(gotype) (int ARGC, char **ARGV) "[]string" + +%insert(go_wrapper) %{ +//export cgo_swig_get_string_slice_idx +func cgo_swig_get_string_slice_idx(s []string, i C.swig_intgo) string { + return s[i] +} +%} + +%{ +extern +#ifdef __cplusplus + "C" +#endif +_gostring_ cgo_swig_get_string_slice_idx(_goslice_ s, intgo i); +%} + +%typemap(in) (int ARGC, char **ARGV) { + $1_ltype len = ($1_ltype)$input.len; + size_t aralloc = (size_t)((len + 1) * sizeof(char *)); + if (len < 0) { + _swig_gopanic("negative array length"); + } + $2 = ($2_ltype) Swig_malloc((int)aralloc); + if ($2 == NULL) { + _swig_gopanic("fail allocating memory for array"); + } + memset($2, 0, aralloc); + $1 = len; + { + $1_ltype i; + for (i = 0; i < len; i++) { + char *p; + _gostring_ st = cgo_swig_get_string_slice_idx($input, (intgo)i); + if (st.n < 0) { + _swig_gopanic("string length negative"); + } + p = (char *) Swig_malloc((int)(st.n + 1)); + if (p == NULL) { + _swig_gopanic("fail allocating memory for a string"); + } + memcpy(p, st.p, st.n); + p[st.n] = 0; + $2[i] = p; + } + $2[i] = NULL; + } +} + +%typemap(freearg) (int ARGC, char **ARGV) { + if ($2 != NULL) { + $1_ltype i; + for (i = 0; i < $1; i++) { + Swig_free((void *)$2[i]); + } + Swig_free((void *)$2); + } +} diff --git a/usr/share/swig/4.1.1/go/cdata.i b/usr/share/swig/4.2.1/go/cdata.i similarity index 100% rename from usr/share/swig/4.1.1/go/cdata.i rename to usr/share/swig/4.2.1/go/cdata.i diff --git a/usr/share/swig/4.1.1/go/director.swg b/usr/share/swig/4.2.1/go/director.swg similarity index 100% rename from usr/share/swig/4.1.1/go/director.swg rename to usr/share/swig/4.2.1/go/director.swg diff --git a/usr/share/swig/4.1.1/go/exception.i b/usr/share/swig/4.2.1/go/exception.i similarity index 100% rename from usr/share/swig/4.1.1/go/exception.i rename to usr/share/swig/4.2.1/go/exception.i diff --git a/usr/share/swig/4.1.1/go/go.swg b/usr/share/swig/4.2.1/go/go.swg similarity index 100% rename from usr/share/swig/4.1.1/go/go.swg rename to usr/share/swig/4.2.1/go/go.swg diff --git a/usr/share/swig/4.1.1/go/gokw.swg b/usr/share/swig/4.2.1/go/gokw.swg similarity index 100% rename from usr/share/swig/4.1.1/go/gokw.swg rename to usr/share/swig/4.2.1/go/gokw.swg diff --git a/usr/share/swig/4.1.1/go/goruntime.swg b/usr/share/swig/4.2.1/go/goruntime.swg similarity index 100% rename from usr/share/swig/4.1.1/go/goruntime.swg rename to usr/share/swig/4.2.1/go/goruntime.swg diff --git a/usr/share/swig/4.1.1/go/gostring.swg b/usr/share/swig/4.2.1/go/gostring.swg similarity index 100% rename from usr/share/swig/4.1.1/go/gostring.swg rename to usr/share/swig/4.2.1/go/gostring.swg diff --git a/usr/share/swig/4.1.1/go/std_array.i b/usr/share/swig/4.2.1/go/std_array.i similarity index 100% rename from usr/share/swig/4.1.1/go/std_array.i rename to usr/share/swig/4.2.1/go/std_array.i diff --git a/usr/share/swig/4.1.1/go/std_common.i b/usr/share/swig/4.2.1/go/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/go/std_common.i rename to usr/share/swig/4.2.1/go/std_common.i diff --git a/usr/share/swig/4.1.1/go/std_deque.i b/usr/share/swig/4.2.1/go/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/go/std_deque.i rename to usr/share/swig/4.2.1/go/std_deque.i diff --git a/usr/share/swig/4.1.1/go/std_except.i b/usr/share/swig/4.2.1/go/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/go/std_except.i rename to usr/share/swig/4.2.1/go/std_except.i diff --git a/usr/share/swig/4.1.1/go/std_list.i b/usr/share/swig/4.2.1/go/std_list.i similarity index 100% rename from usr/share/swig/4.1.1/go/std_list.i rename to usr/share/swig/4.2.1/go/std_list.i diff --git a/usr/share/swig/4.1.1/lua/std_map.i b/usr/share/swig/4.2.1/go/std_map.i similarity index 95% rename from usr/share/swig/4.1.1/lua/std_map.i rename to usr/share/swig/4.2.1/go/std_map.i index 773b6d0c31d..19281ad7d50 100644 --- a/usr/share/swig/4.1.1/lua/std_map.i +++ b/usr/share/swig/4.2.1/go/std_map.i @@ -48,7 +48,11 @@ namespace std { throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } void del(const K& key) throw (std::out_of_range) { std::map< K, T, C >::iterator i = self->find(key); diff --git a/usr/share/swig/4.1.1/go/std_pair.i b/usr/share/swig/4.2.1/go/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/go/std_pair.i rename to usr/share/swig/4.2.1/go/std_pair.i diff --git a/usr/share/swig/4.1.1/go/std_string.i b/usr/share/swig/4.2.1/go/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/go/std_string.i rename to usr/share/swig/4.2.1/go/std_string.i diff --git a/usr/share/swig/4.1.1/go/std_vector.i b/usr/share/swig/4.2.1/go/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/go/std_vector.i rename to usr/share/swig/4.2.1/go/std_vector.i diff --git a/usr/share/swig/4.1.1/go/stl.i b/usr/share/swig/4.2.1/go/stl.i similarity index 100% rename from usr/share/swig/4.1.1/go/stl.i rename to usr/share/swig/4.2.1/go/stl.i diff --git a/usr/share/swig/4.1.1/go/swigmove.i b/usr/share/swig/4.2.1/go/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/go/swigmove.i rename to usr/share/swig/4.2.1/go/swigmove.i diff --git a/usr/share/swig/4.1.1/go/typemaps.i b/usr/share/swig/4.2.1/go/typemaps.i similarity index 100% rename from usr/share/swig/4.1.1/go/typemaps.i rename to usr/share/swig/4.2.1/go/typemaps.i diff --git a/usr/share/swig/4.2.1/guile/argcargv.i b/usr/share/swig/4.2.1/guile/argcargv.i new file mode 100644 index 00000000000..003be96a7ea --- /dev/null +++ b/usr/share/swig/4.2.1/guile/argcargv.i @@ -0,0 +1,44 @@ +/* ------------------------------------------------------------- + * SWIG library containing argc and argv multi-argument typemaps + * ------------------------------------------------------------- */ + +%typemap(in) (int ARGC, char **ARGV) { + $1_ltype i, len; + SWIG_contract_assert($input != (SCM)0 && + !scm_is_null($input) && + scm_is_array($input), + "you must pass array of strings"); + len = scm_c_array_length($input); + $1 = len; + $2 = ($2_ltype) malloc((len+1)*sizeof($*2_ltype)); + if ($2 == NULL) { + scm_misc_error(FUNC_NAME, "fail allocating memory for array", SCM_EOL); + } + for (i = 0; i < len; i++) { + SCM args = scm_list_1(scm_from_long(i)); + SCM str = scm_array_ref($input, args); + SWIG_contract_assert(scm_is_string(str), "elements in array must be strings"); + $2[i] = ($*2_ltype)SWIG_scm2str(str); + } + $2[i] = NULL; +} + +%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { + if ($input != (SCM)0 && !scm_is_null($input) && scm_is_array($input)) { + size_t len = scm_c_array_length($input); + size_t i; + for(i = 0; i < len; i++) { + SCM args = scm_list_1(scm_from_long(i)); + SCM str = scm_array_ref($input, args); + if (!scm_is_string(str)) { + break; + } + } + /* All elements are strings! */ + $1 = (i == len); + } +} + +%typemap(freearg) (int ARGC, char **ARGV) { + free((void *)$2); +} diff --git a/usr/share/swig/4.1.1/guile/common.scm b/usr/share/swig/4.2.1/guile/common.scm similarity index 100% rename from usr/share/swig/4.1.1/guile/common.scm rename to usr/share/swig/4.2.1/guile/common.scm diff --git a/usr/share/swig/4.1.1/guile/cplusplus.i b/usr/share/swig/4.2.1/guile/cplusplus.i similarity index 100% rename from usr/share/swig/4.1.1/guile/cplusplus.i rename to usr/share/swig/4.2.1/guile/cplusplus.i diff --git a/usr/share/swig/4.1.1/guile/guile.i b/usr/share/swig/4.2.1/guile/guile.i similarity index 100% rename from usr/share/swig/4.1.1/guile/guile.i rename to usr/share/swig/4.2.1/guile/guile.i diff --git a/usr/share/swig/4.1.1/guile/guile_scm.swg b/usr/share/swig/4.2.1/guile/guile_scm.swg similarity index 100% rename from usr/share/swig/4.1.1/guile/guile_scm.swg rename to usr/share/swig/4.2.1/guile/guile_scm.swg diff --git a/usr/share/swig/4.1.1/guile/guile_scm_run.swg b/usr/share/swig/4.2.1/guile/guile_scm_run.swg similarity index 94% rename from usr/share/swig/4.1.1/guile/guile_scm_run.swg rename to usr/share/swig/4.2.1/guile/guile_scm_run.swg index 689a1060f6b..89eda398384 100644 --- a/usr/share/swig/4.1.1/guile/guile_scm_run.swg +++ b/usr/share/swig/4.2.1/guile/guile_scm_run.swg @@ -74,8 +74,7 @@ typedef struct swig_guile_clientdata { do { \ if (!(expr)) \ scm_error(scm_from_locale_symbol("swig-contract-assertion-failed"), \ - (char *) FUNC_NAME, (char *) msg, \ - SCM_EOL, SCM_BOOL_F); \ + FUNC_NAME, msg, SCM_EOL, SCM_BOOL_F); \ } while (0) /* for C++ member pointers, ie, member methods */ @@ -246,7 +245,7 @@ SWIG_Guile_MustGetPtr (SCM s, swig_type_info *type, int res = SWIG_Guile_ConvertPtr(s, &result, type, flags); if (!SWIG_IsOK(res)) { /* type mismatch */ - scm_wrong_type_arg((char *) func_name, argnum, s); + scm_wrong_type_arg(func_name, argnum, s); } return result; } @@ -340,13 +339,13 @@ print_swig_aux (SCM swig_smob, SCM port, scm_print_state *pstate, type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob); if (type) { - scm_puts((char *) "#<", port); - scm_puts((char *) attribute, port); - scm_puts((char *) "swig-pointer ", port); - scm_puts((char *) SWIG_TypePrettyName(type), port); - scm_puts((char *) " ", port); + scm_puts("#<", port); + scm_puts(attribute, port); + scm_puts("swig-pointer ", port); + scm_puts(SWIG_TypePrettyName(type), port); + scm_puts(" ", port); scm_intprint((long) SCM_CELL_WORD_1(swig_smob), 16, port); - scm_puts((char *) ">", port); + scm_puts(">", port); /* non-zero means success */ return 1; } else { @@ -379,10 +378,10 @@ print_member_function_swig (SCM swig_smob, SCM port, scm_print_state *pstate) swig_type_info *type; type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob); if (type) { - scm_puts((char *) "#<", port); - scm_puts((char *) "swig-member-function-pointer ", port); - scm_puts((char *) SWIG_TypePrettyName(type), port); - scm_puts((char *) " >", port); + scm_puts("#<", port); + scm_puts("swig-member-function-pointer ", port); + scm_puts(SWIG_TypePrettyName(type), port); + scm_puts(" >", port); /* non-zero means success */ return 1; } else { @@ -426,7 +425,7 @@ ensure_smob_tag(SCM swig_module, SCM variable = scm_module_variable(swig_module, scm_from_locale_symbol(scheme_variable_name)); if (scm_is_false(variable)) { - *tag_variable = scm_make_smob_type((char*)scheme_variable_name, 0); + *tag_variable = scm_make_smob_type(scheme_variable_name, 0); scm_c_module_define(swig_module, scheme_variable_name, scm_from_ulong(*tag_variable)); return 1; @@ -471,7 +470,7 @@ SWIG_Guile_Init () } swig_make_func = scm_permanent_object( scm_variable_ref(scm_c_module_lookup(scm_c_resolve_module("oop goops"), "make"))); - swig_keyword = scm_permanent_object(scm_from_locale_keyword((char*) "init-smob")); + swig_keyword = scm_permanent_object(scm_from_locale_keyword("init-smob")); swig_symbol = scm_permanent_object(scm_from_locale_symbol("swig-smob")); #ifdef SWIG_INIT_RUNTIME_MODULE SWIG_INIT_RUNTIME_MODULE @@ -510,7 +509,7 @@ SWIG_Guile_GetArgs (SCM *dest, SCM rest, int num_args_passed = 0; for (i = 0; i") PTRTYPE *OUTPUT_NONCOLLECTABLE "SWIG_APPEND_VALUE(SWIG_NewPointerObj(*$1, $*descriptor, 0));"; -%typemap(in) PTRTYPE *BOTH = PTRTYPE *INPUT; -%typemap(argout) PTRTYPE *BOTH = PTRTYPE *OUTPUT; %typemap(in) PTRTYPE *INOUT = PTRTYPE *INPUT; %typemap(argout) PTRTYPE *INOUT = PTRTYPE *OUTPUT; diff --git a/usr/share/swig/4.1.1/guile/ports.i b/usr/share/swig/4.2.1/guile/ports.i similarity index 100% rename from usr/share/swig/4.1.1/guile/ports.i rename to usr/share/swig/4.2.1/guile/ports.i diff --git a/usr/share/swig/4.1.1/guile/std_auto_ptr.i b/usr/share/swig/4.2.1/guile/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/guile/std_auto_ptr.i rename to usr/share/swig/4.2.1/guile/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/guile/std_common.i b/usr/share/swig/4.2.1/guile/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/guile/std_common.i rename to usr/share/swig/4.2.1/guile/std_common.i diff --git a/usr/share/swig/4.1.1/guile/std_deque.i b/usr/share/swig/4.2.1/guile/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/guile/std_deque.i rename to usr/share/swig/4.2.1/guile/std_deque.i diff --git a/usr/share/swig/4.1.1/guile/std_except.i b/usr/share/swig/4.2.1/guile/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/guile/std_except.i rename to usr/share/swig/4.2.1/guile/std_except.i diff --git a/usr/share/swig/4.2.1/guile/std_map.i b/usr/share/swig/4.2.1/guile/std_map.i new file mode 100644 index 00000000000..6fb9bcab755 --- /dev/null +++ b/usr/share/swig/4.2.1/guile/std_map.i @@ -0,0 +1,280 @@ +/* ----------------------------------------------------------------------------- + * std_map.i + * + * SWIG typemaps for std::map + * ----------------------------------------------------------------------------- */ + +%include +%include + +// ------------------------------------------------------------------------ +// std::map +// +// The aim of all that follows would be to integrate std::map with +// Guile as much as possible, namely, to allow the user to pass and +// be returned Scheme association lists. +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::map), f(const std::map&), f(const std::map*): +// the parameter being read-only, either a Scheme alist or a +// previously wrapped std::map can be passed. +// -- f(std::map&), f(std::map*): +// the parameter must be modified; therefore, only a wrapped std::map +// can be passed. +// -- std::map f(): +// the map is returned by copy; therefore, a Scheme alist +// is returned which is most easily used in other Scheme functions +// -- std::map& f(), std::map* f(), const std::map& f(), +// const std::map* f(): +// the map is returned by reference; therefore, a wrapped std::map +// is returned +// ------------------------------------------------------------------------ + +%{ +#include +#include +#include +%} + +// exported class + +namespace std { + + template > class map { + %typemap(in) map< K, T, C > { + if (scm_is_null($input)) { + $1 = std::map< K, T, C >(); + } else if (scm_is_pair($input)) { + $1 = std::map< K, T, C >(); + SCM alist = $input; + while (!scm_is_null(alist)) { + K* k; + T* x; + SCM entry, key, val; + entry = SCM_CAR(alist); + if (!scm_is_pair(entry)) + SWIG_exception(SWIG_TypeError,"alist expected"); + key = SCM_CAR(entry); + val = SCM_CDR(entry); + k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) != 0) { + if (!scm_is_pair(val)) + SWIG_exception(SWIG_TypeError,"alist expected"); + val = SCM_CAR(val); + x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); + } +%#ifdef __cpp_lib_map_try_emplace + (($1_type &)$1).insert_or_assign(*k, *x); +%#else + (($1_type &)$1)[*k] = *x; +%#endif + alist = SCM_CDR(alist); + } + } else { + $1 = *(($&1_type) + SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); + } + } + %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp), + const map< K, T, C >* (std::map< K, T, C > temp) { + if (scm_is_null($input)) { + temp = std::map< K, T, C >(); + $1 = &temp; + } else if (scm_is_pair($input)) { + temp = std::map< K, T, C >(); + $1 = &temp; + SCM alist = $input; + while (!scm_is_null(alist)) { + K* k; + T* x; + SCM entry, key, val; + entry = SCM_CAR(alist); + if (!scm_is_pair(entry)) + SWIG_exception(SWIG_TypeError,"alist expected"); + key = SCM_CAR(entry); + val = SCM_CDR(entry); + k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) != 0) { + if (!scm_is_pair(val)) + SWIG_exception(SWIG_TypeError,"alist expected"); + val = SCM_CAR(val); + x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); + } +%#ifdef __cpp_lib_map_try_emplace + temp.insert_or_assign(*k, *x); +%#else + temp[*k] = *x; +%#endif + alist = SCM_CDR(alist); + } + } else { + $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); + } + } + %typemap(out) map< K, T, C > { + SCM alist = SCM_EOL; + for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { + K* key = new K(i->first); + T* val = new T(i->second); + SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); + SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1); + SCM entry = scm_cons(k,x); + alist = scm_cons(entry,alist); + } + $result = alist; + } + %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { + /* native sequence? */ + if (scm_is_null($input)) { + /* an empty sequence can be of any type */ + $1 = 1; + } else if (scm_is_pair($input)) { + /* check the first element only */ + K* k; + T* x; + SCM head = SCM_CAR($input); + if (scm_is_pair(head)) { + SCM key = SCM_CAR(head); + SCM val = SCM_CDR(head); + if (SWIG_ConvertPtr(key,(void**) &k, + $descriptor(K *), 0) != 0) { + $1 = 0; + } else { + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) == 0) { + $1 = 1; + } else if (scm_is_pair(val)) { + val = SCM_CAR(val); + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) == 0) + $1 = 1; + else + $1 = 0; + } else { + $1 = 0; + } + } + } else { + $1 = 0; + } + } else { + /* wrapped map? */ + std::map< K, T, C >* m; + if (SWIG_ConvertPtr($input,(void **) &m, + $&1_descriptor, 0) == 0) + $1 = 1; + else + $1 = 0; + } + } + %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, + const map< K, T, C >* { + /* native sequence? */ + if (scm_is_null($input)) { + /* an empty sequence can be of any type */ + $1 = 1; + } else if (scm_is_pair($input)) { + /* check the first element only */ + K* k; + T* x; + SCM head = SCM_CAR($input); + if (scm_is_pair(head)) { + SCM key = SCM_CAR(head); + SCM val = SCM_CDR(head); + if (SWIG_ConvertPtr(key,(void**) &k, + $descriptor(K *), 0) != 0) { + $1 = 0; + } else { + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) == 0) { + $1 = 1; + } else if (scm_is_pair(val)) { + val = SCM_CAR(val); + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) == 0) + $1 = 1; + else + $1 = 0; + } else { + $1 = 0; + } + } + } else { + $1 = 0; + } + } else { + /* wrapped map? */ + std::map< K, T, C >* m; + if (SWIG_ConvertPtr($input,(void **) &m, + $1_descriptor, 0) == 0) + $1 = 1; + else + $1 = 0; + } + } + %rename("length") size; + %rename("null?") empty; + %rename("clear!") clear; + %rename("ref") __getitem__; + %rename("set!") __setitem__; + %rename("delete!") __delitem__; + %rename("has-key?") has_key; + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef K key_type; + typedef T mapped_type; + typedef std::pair< const K, T > value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + + map(); + map(const map& other); + + unsigned int size() const; + bool empty() const; + void clear(); + %extend { + const T& __getitem__(const K& key) throw (std::out_of_range) { + std::map< K, T, C >::iterator i = self->find(key); + if (i != self->end()) + return i->second; + else + throw std::out_of_range("key not found"); + } + void __setitem__(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else + (*self)[key] = x; +%#endif + } + void __delitem__(const K& key) throw (std::out_of_range) { + std::map< K, T, C >::iterator i = self->find(key); + if (i != self->end()) + self->erase(i); + else + throw std::out_of_range("key not found"); + } + bool has_key(const K& key) { + std::map< K, T, C >::iterator i = self->find(key); + return i != self->end(); + } + SCM keys() { + SCM result = SCM_EOL; + for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); i!=self->rend(); ++i) { + K* key = new K(i->first); + SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); + result = scm_cons(k,result); + } + return result; + } + } + }; + +} diff --git a/usr/share/swig/4.1.1/guile/std_pair.i b/usr/share/swig/4.2.1/guile/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/guile/std_pair.i rename to usr/share/swig/4.2.1/guile/std_pair.i diff --git a/usr/share/swig/4.1.1/guile/std_string.i b/usr/share/swig/4.2.1/guile/std_string.i similarity index 94% rename from usr/share/swig/4.1.1/guile/std_string.i rename to usr/share/swig/4.2.1/guile/std_string.i index c49bfcb070b..178c484ce3c 100644 --- a/usr/share/swig/4.1.1/guile/std_string.i +++ b/usr/share/swig/4.2.1/guile/std_string.i @@ -84,12 +84,12 @@ namespace std { } %typemap(throws) string { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_throw(scm_from_locale_symbol("swig-exception"), scm_list_n(SWIG_str02scm($1.c_str()), SCM_UNDEFINED)); } %typemap(throws) const string & { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_throw(scm_from_locale_symbol("swig-exception"), scm_list_n(SWIG_str02scm($1.c_str()), SCM_UNDEFINED)); } } diff --git a/usr/share/swig/4.1.1/guile/std_unique_ptr.i b/usr/share/swig/4.2.1/guile/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/guile/std_unique_ptr.i rename to usr/share/swig/4.2.1/guile/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/guile/std_vector.i b/usr/share/swig/4.2.1/guile/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/guile/std_vector.i rename to usr/share/swig/4.2.1/guile/std_vector.i diff --git a/usr/share/swig/4.1.1/guile/stl.i b/usr/share/swig/4.2.1/guile/stl.i similarity index 100% rename from usr/share/swig/4.1.1/guile/stl.i rename to usr/share/swig/4.2.1/guile/stl.i diff --git a/usr/share/swig/4.1.1/guile/swigmove.i b/usr/share/swig/4.2.1/guile/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/guile/swigmove.i rename to usr/share/swig/4.2.1/guile/swigmove.i diff --git a/usr/share/swig/4.1.1/guile/swigrun.i b/usr/share/swig/4.2.1/guile/swigrun.i similarity index 100% rename from usr/share/swig/4.1.1/guile/swigrun.i rename to usr/share/swig/4.2.1/guile/swigrun.i diff --git a/usr/share/swig/4.1.1/guile/typemaps.i b/usr/share/swig/4.2.1/guile/typemaps.i similarity index 92% rename from usr/share/swig/4.1.1/guile/typemaps.i rename to usr/share/swig/4.2.1/guile/typemaps.i index 45a2208f237..d9b78fb4fbf 100644 --- a/usr/share/swig/4.1.1/guile/typemaps.i +++ b/usr/share/swig/4.2.1/guile/typemaps.i @@ -7,7 +7,7 @@ /* These are defined with a view to eventually merging with those defined for other target languages in swigtypemaps.swg and exception.swg */ #define %set_output(obj) $result = obj #define %set_varoutput(obj) $result = obj -#define %argument_fail(_code, _type, _name, _argn) scm_wrong_type_arg((char *) FUNC_NAME, _argn, $input) +#define %argument_fail(_code, _type, _name, _argn) scm_wrong_type_arg(FUNC_NAME, _argn, $input) #define %as_voidptr(ptr) (void*)(ptr) #define %argument_nullref(_type, _name, _argn) scm_misc_error(FUNC_NAME, "invalid null reference for argument " #_argn " of type '" _type "'", SCM_EOL) #define %releasenotowned_fail(_code, _type, _name, _argn) scm_misc_error(FUNC_NAME, "cannot release ownership as memory is not owned for argument " #_argn " of type '" _type "'", SCM_EOL) @@ -55,7 +55,7 @@ } %typemap(varin) SWIGTYPE [] { - scm_wrong_type_arg((char *) FUNC_NAME, 1, $input); + scm_wrong_type_arg(FUNC_NAME, 1, $input); } %typemap(varin) SWIGTYPE [ANY] { @@ -94,31 +94,31 @@ %typemap(throws) SWIGTYPE { $<ype temp = new $ltype($1); - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_throw(scm_from_locale_symbol("swig-exception"), scm_list_n(SWIG_NewPointerObj(temp, $&descriptor, 1), SCM_UNDEFINED)); } %typemap(throws) SWIGTYPE & { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_throw(scm_from_locale_symbol("swig-exception"), scm_list_n(SWIG_NewPointerObj(&$1, $descriptor, 1), SCM_UNDEFINED)); } %typemap(throws) SWIGTYPE && { - scm_throw(gh_symbol2scm((char *) "swig-exception"), - gh_list(SWIG_NewPointerObj(&$1, $descriptor, 1), + scm_throw(scm_from_locale_symbol("swig-exception"), + scm_list_n(SWIG_NewPointerObj(&$1, $descriptor, 1), SCM_UNDEFINED)); } %typemap(throws) SWIGTYPE * { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_throw(scm_from_locale_symbol("swig-exception"), scm_list_n(SWIG_NewPointerObj($1, $descriptor, 1), SCM_UNDEFINED)); } %typemap(throws) SWIGTYPE [] { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_throw(scm_from_locale_symbol("swig-exception"), scm_list_n(SWIG_NewPointerObj($1, $descriptor, 1), SCM_UNDEFINED)); } @@ -192,8 +192,8 @@ %typemap(varin) enum SWIGTYPE { if (sizeof(int) != sizeof($1)) { scm_error(scm_from_locale_symbol("swig-error"), - (char *) FUNC_NAME, - (char *) "enum variable '$name' cannot be set", + FUNC_NAME, + "enum variable '$name' cannot be set", SCM_EOL, SCM_BOOL_F); } * (int *) &($1) = scm_to_int($input); @@ -201,7 +201,7 @@ %typemap(out) enum SWIGTYPE { $result = scm_from_long((int)$1); } %typemap(varout) enum SWIGTYPE { $result = scm_from_long((int)$1); } %typemap(throws) enum SWIGTYPE { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_throw(scm_from_locale_symbol("swig-exception"), scm_list_n(scm_from_long((int)$1), SCM_UNDEFINED)); } @@ -235,8 +235,6 @@ %typemap (argout,doc="$name (of type <" #SCM_NAME ">)") C_NAME *OUTPUT { C_NAME swig_c_value = *$1; SWIG_APPEND_VALUE(C_TO_SCM_EXPR); } - %typemap (in) C_NAME *BOTH = C_NAME *INPUT; - %typemap (argout) C_NAME *BOTH = C_NAME *OUTPUT; %typemap (in) C_NAME *INOUT = C_NAME *INPUT; %typemap (argout) C_NAME *INOUT = C_NAME *OUTPUT; /* Const primitive references. Passed by value */ @@ -250,7 +248,7 @@ /* Throw typemap */ %typemap(throws) C_NAME { C_NAME swig_c_value = $1; - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_throw(scm_from_locale_symbol("swig-exception"), scm_list_n(C_TO_SCM_EXPR, SCM_UNDEFINED)); } %enddef @@ -278,8 +276,6 @@ {$1 = &temp;} %typemap (argout,doc="$name (of type <" #SCM_NAME ">)") C_NAME *OUTPUT, C_NAME &OUTPUT {SWIG_APPEND_VALUE(C_TO_SCM(*$1));} - %typemap (in) C_NAME *BOTH = C_NAME *INPUT; - %typemap (argout) C_NAME *BOTH = C_NAME *OUTPUT; %typemap (in) C_NAME *INOUT = C_NAME *INPUT; %typemap (argout) C_NAME *INOUT = C_NAME *OUTPUT; %typemap (in) C_NAME &INOUT = C_NAME &INPUT; @@ -294,7 +290,7 @@ } /* Throw typemap */ %typemap(throws) C_NAME { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_throw(scm_from_locale_symbol("swig-exception"), scm_list_n(C_TO_SCM($1), SCM_UNDEFINED)); } %enddef @@ -340,8 +336,6 @@ SIMPLE_MAP(unsigned long long, scm_to_ulong_long, scm_from_ulong_long, integer); {$1 = &temp;} %typemap (argout,doc="$NAME (a string)") char **OUTPUT {SWIG_APPEND_VALUE(SWIG_str02scm(*$1));} - %typemap (in) char **BOTH = char **INPUT; - %typemap (argout) char **BOTH = char **OUTPUT; %typemap (in) char **INOUT = char **INPUT; %typemap (argout) char **INOUT = char **OUTPUT; @@ -349,13 +343,13 @@ SIMPLE_MAP(unsigned long long, scm_to_ulong_long, scm_from_ulong_long, integer); the function call. */ %typemap (freearg) char * "if (must_free$argnum) SWIG_free($1);" -%typemap (freearg) char **INPUT, char **BOTH "if (must_free$argnum) SWIG_free(*$1);" +%typemap (freearg) char **INPUT, char **INOUT "if (must_free$argnum) SWIG_free(*$1);" %typemap (freearg) char **OUTPUT "SWIG_free(*$1);" /* But this shall not apply if we try to pass a single char by reference. */ -%typemap (freearg) char *OUTPUT, char *BOTH "" +%typemap (freearg) char *OUTPUT, char *INOUT "" /* If we set a string variable, delete the old result first, unless const. */ @@ -369,7 +363,7 @@ SIMPLE_MAP(unsigned long long, scm_to_ulong_long, scm_from_ulong_long, integer); } %typemap(throws) char * { - scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_throw(scm_from_locale_symbol("swig-exception"), scm_list_n(SWIG_str02scm($1), SCM_UNDEFINED)); } @@ -413,7 +407,7 @@ typedef unsigned long SCM; %typemap(varin) SWIGTYPE (CLASS::*) { int res = SWIG_ConvertMember($input,%as_voidptr(&$1), sizeof($1), $descriptor); if (!SWIG_IsOK(res)) { - scm_wrong_type_arg((char *) FUNC_NAME, 1, $input); + scm_wrong_type_arg(FUNC_NAME, 1, $input); } } diff --git a/usr/share/swig/4.1.1/intrusive_ptr.i b/usr/share/swig/4.2.1/intrusive_ptr.i similarity index 66% rename from usr/share/swig/4.1.1/intrusive_ptr.i rename to usr/share/swig/4.2.1/intrusive_ptr.i index 621a701f96f..a4e8df0aad8 100644 --- a/usr/share/swig/4.1.1/intrusive_ptr.i +++ b/usr/share/swig/4.2.1/intrusive_ptr.i @@ -56,25 +56,3 @@ SWIG_INTRUSIVE_PTR_TYPEMAPS(const, TYPE) SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(, TYPE) SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(const, TYPE) %enddef - -// Legacy macros -%define SWIG_INTRUSIVE_PTR(PROXYCLASS, TYPE...) -#warning "SWIG_INTRUSIVE_PTR(PROXYCLASS, TYPE) is deprecated. Please use %intrusive_ptr(TYPE) instead." -%intrusive_ptr(TYPE) -%enddef - -%define SWIG_INTRUSIVE_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE...) -#warning "SWIG_INTRUSIVE_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE) is deprecated. Please use %intrusive_ptr(TYPE) instead." -%intrusive_ptr(TYPE) -%enddef - -%define SWIG_INTRUSIVE_PTR_NO_WRAP(PROXYCLASS, TYPE...) -#warning "SWIG_INTRUSIVE_PTR_NO_WRAP(PROXYCLASS, TYPE) is deprecated. Please use %intrusive_ptr_no_wrap(TYPE) instead." -%intrusive_ptr_no_wrap(TYPE) -%enddef - -%define SWIG_INTRUSIVE_PTR_DERIVED_NO_WRAP(PROXYCLASS, BASECLASSTYPE, TYPE...) -#warning "SWIG_INTRUSIVE_PTR_DERIVED_NO_WRAP(PROXYCLASS, BASECLASSTYPE, TYPE) is deprecated. Please use %intrusive_ptr_no_wrap(TYPE) instead." -%intrusive_ptr_no_wrap(TYPE) -%enddef - diff --git a/usr/share/swig/4.1.1/inttypes.i b/usr/share/swig/4.2.1/inttypes.i similarity index 66% rename from usr/share/swig/4.1.1/inttypes.i rename to usr/share/swig/4.2.1/inttypes.i index 85bd5adaf3d..f5a09f0bb80 100644 --- a/usr/share/swig/4.1.1/inttypes.i +++ b/usr/share/swig/4.2.1/inttypes.i @@ -49,37 +49,12 @@ extern "C" { extern uintmax_t wcstoumax (const wchar_t *nptr, wchar_t ** endptr, int base); #endif -#ifdef SWIGWORDSIZE64 - /* Like `strtol' but convert to `intmax_t'. */ extern intmax_t strtoimax (const char *nptr, char **endptr, int base); /* Like `strtoul' but convert to `uintmax_t'. */ extern uintmax_t strtoumax (const char *nptr, char **endptr,int base); -#ifdef SWIG_WCHAR - /* Like `wcstol' but convert to `intmax_t'. */ - extern intmax_t wcstoimax (const wchar_t *nptr, wchar_t **endptr, int base); - - /* Like `wcstoul' but convert to `uintmax_t'. */ - extern uintmax_t wcstoumax (const wchar_t *nptr, wchar_t **endptr, int base); -#endif - -#else /* SWIGWORDSIZE32 */ - - /* Like `strtol' but convert to `intmax_t'. */ - extern intmax_t strtoimax (const char *nptr, char **endptr, int base); - - /* Like `strtoul' but convert to `uintmax_t'. */ - extern uintmax_t strtoumax (const char *nptr, char **endptr, int base); - -#ifdef SWIG_WCHAR - /* Like `wcstol' but convert to `intmax_t'. */ - extern uintmax_t wcstoumax (const wchar_t *nptr, wchar_t **endptr, int base); -#endif - -#endif /* SWIGWORDSIZE64 */ - #ifdef __cplusplus } #endif diff --git a/usr/share/swig/4.2.1/java/argcargv.i b/usr/share/swig/4.2.1/java/argcargv.i new file mode 100644 index 00000000000..cf0f85ba8b8 --- /dev/null +++ b/usr/share/swig/4.2.1/java/argcargv.i @@ -0,0 +1,36 @@ +/* ------------------------------------------------------------- + * SWIG library containing argc and argv multi-argument typemaps + * ------------------------------------------------------------- */ + +%typemap(jni) (int ARGC, char **ARGV) "jobjectArray" +%typemap(jtype) (int ARGC, char **ARGV) "String[]" +%typemap(jstype) (int ARGC, char **ARGV) "String[]" + +%typemap(in) (int ARGC, char **ARGV) { + $1_ltype i, len; + if ($input == (jobjectArray)0) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return $null; + } + len = ($1_ltype)JCALL1(GetArrayLength, jenv, $input); + if (len < 0) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "array length negative"); + return $null; + } + $2 = ($2_ltype) malloc((len+1)*sizeof($*2_ltype)); + if ($2 == NULL) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "memory allocation failed"); + return $null; + } + $1 = len; + for (i = 0; i < len; i++) { + jstring j_string = (jstring)JCALL2(GetObjectArrayElement, jenv, $input, (jsize)i); + const char *c_string = JCALL2(GetStringUTFChars, jenv, j_string, 0); + $2[i] = ($*2_ltype)c_string; + } + $2[i] = NULL; +} + +%typemap(freearg) (int ARGC, char **ARGV) { + free((void *)$2); +} diff --git a/usr/share/swig/4.1.1/java/arrays_java.i b/usr/share/swig/4.2.1/java/arrays_java.i similarity index 95% rename from usr/share/swig/4.1.1/java/arrays_java.i rename to usr/share/swig/4.2.1/java/arrays_java.i index a57da64b451..a8f5180c402 100644 --- a/usr/share/swig/4.1.1/java/arrays_java.i +++ b/usr/share/swig/4.2.1/java/arrays_java.i @@ -147,19 +147,19 @@ JAVA_ARRAYS_IMPL(double, jdouble, Double, Double) /* double[] */ %typemap(jstype) CTYPE[ANY], CTYPE[] %{JTYPE[]%} %typemap(in) CTYPE[] (JNITYPE *jarr) -%{ if (!SWIG_JavaArrayIn##JFUNCNAME(jenv, &jarr, (CTYPE **)&$1, $input)) return $null; %} +%{ if (!SWIG_JavaArrayIn##JFUNCNAME(jenv, &jarr, ($&1_ltype)&$1, $input)) return $null; %} %typemap(in) CTYPE[ANY] (JNITYPE *jarr) %{ if ($input && JCALL1(GetArrayLength, jenv, $input) != $1_size) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "incorrect array size"); return $null; } - if (!SWIG_JavaArrayIn##JFUNCNAME(jenv, &jarr, (CTYPE **)&$1, $input)) return $null; %} + if (!SWIG_JavaArrayIn##JFUNCNAME(jenv, &jarr, ($&1_ltype)&$1, $input)) return $null; %} %typemap(argout) CTYPE[ANY], CTYPE[] -%{ SWIG_JavaArrayArgout##JFUNCNAME(jenv, jarr$argnum, (CTYPE *)$1, $input); %} +%{ SWIG_JavaArrayArgout##JFUNCNAME(jenv, jarr$argnum, ($1_ltype)$1, $input); %} %typemap(out) CTYPE[ANY] -%{$result = SWIG_JavaArrayOut##JFUNCNAME(jenv, (CTYPE *)$1, $1_dim0); %} +%{$result = SWIG_JavaArrayOut##JFUNCNAME(jenv, ($1_ltype)$1, $1_dim0); %} %typemap(out) CTYPE[] -%{$result = SWIG_JavaArrayOut##JFUNCNAME(jenv, (CTYPE *)$1, FillMeInAsSizeCannotBeDeterminedAutomatically); %} +%{$result = SWIG_JavaArrayOut##JFUNCNAME(jenv, ($1_ltype)$1, FillMeInAsSizeCannotBeDeterminedAutomatically); %} %typemap(freearg) CTYPE[ANY], CTYPE[] #ifdef __cplusplus %{ delete [] $1; %} @@ -227,6 +227,12 @@ JAVA_ARRAYS_TYPEMAPS(double, double, jdouble, Double, "[D") /* double[ANY] * double[ANY], double[] "" +#if defined(SWIGWORDSIZE64) +%apply long long[ANY] { long[ANY] }; +%apply unsigned long long[ANY] { unsigned long[ANY] }; +%apply long long[] { long[] }; +%apply unsigned long long[] { unsigned long[] }; +#endif /* Arrays of proxy classes. The typemaps in this macro make it possible to treat an array of * class/struct/unions as an array of Java classes. diff --git a/usr/share/swig/4.1.1/java/boost_intrusive_ptr.i b/usr/share/swig/4.2.1/java/boost_intrusive_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/java/boost_intrusive_ptr.i rename to usr/share/swig/4.2.1/java/boost_intrusive_ptr.i diff --git a/usr/share/swig/4.1.1/java/boost_shared_ptr.i b/usr/share/swig/4.2.1/java/boost_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/java/boost_shared_ptr.i rename to usr/share/swig/4.2.1/java/boost_shared_ptr.i diff --git a/usr/share/swig/4.1.1/java/director.swg b/usr/share/swig/4.2.1/java/director.swg similarity index 93% rename from usr/share/swig/4.1.1/java/director.swg rename to usr/share/swig/4.2.1/java/director.swg index 536513557cb..630a98f3b07 100644 --- a/usr/share/swig/4.1.1/java/director.swg +++ b/usr/share/swig/4.2.1/java/director.swg @@ -60,11 +60,11 @@ namespace Swig { /* Java object wrapper */ class JObjectWrapper { public: - JObjectWrapper() : jthis_(NULL), weak_global_(true) { + JObjectWrapper() : jthis_(SWIG_NULLPTR), weak_global_(true) { } ~JObjectWrapper() { - jthis_ = NULL; + jthis_ = SWIG_NULLPTR; weak_global_ = true; } @@ -103,13 +103,13 @@ namespace Swig { #endif if (jthis_) { if (weak_global_) { - if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE) + if (jenv->IsSameObject(jthis_, SWIG_NULLPTR) == JNI_FALSE) jenv->DeleteWeakGlobalRef((jweak)jthis_); } else jenv->DeleteGlobalRef(jthis_); } - jthis_ = NULL; + jthis_ = SWIG_NULLPTR; weak_global_ = true; } @@ -193,7 +193,7 @@ namespace Swig { JNIEnv *jenv_; int env_status; public: - JNIEnvWrapper(const Director *director) : director_(director), jenv_(0), env_status(0) { + JNIEnvWrapper(const Director *director) : director_(director), jenv_(SWIG_NULLPTR), env_status(0) { #if defined(__ANDROID__) JNIEnv **jenv = &jenv_; #else @@ -202,8 +202,8 @@ namespace Swig { env_status = director_->swig_jvm_->GetEnv((void **)&jenv_, JNI_VERSION_1_2); JavaVMAttachArgs args; args.version = JNI_VERSION_1_2; - args.group = NULL; - args.name = NULL; + args.group = SWIG_NULLPTR; + args.name = SWIG_NULLPTR; #if defined(SWIG_JAVA_USE_THREAD_NAME) char thread_name[64]; // MAX_TASK_COMM_LEN=16 is hard-coded in the Linux kernel and MacOS has MAXTHREADNAMESIZE=64. if (Swig::GetThreadName(thread_name, sizeof(thread_name)) == 0) { @@ -267,7 +267,7 @@ namespace Swig { #if defined(DEBUG_DIRECTOR_OWNED) std::cout << "Swig::Director::disconnect_director_self(" << jobj << ")" << std::endl; #endif - if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) { + if (jobj && jenv->IsSameObject(jobj, SWIG_NULLPTR) == JNI_FALSE) { jmethodID disconn_meth = jenv->GetMethodID(jenv->GetObjectClass(jobj), disconn_method, "()V"); if (disconn_meth) { #if defined(DEBUG_DIRECTOR_OWNED) @@ -280,11 +280,11 @@ namespace Swig { jclass swig_new_global_ref(JNIEnv *jenv, const char *classname) { jclass clz = jenv->FindClass(classname); - return clz ? (jclass)jenv->NewGlobalRef(clz) : 0; + return clz ? (jclass)jenv->NewGlobalRef(clz) : SWIG_NULLPTR; } public: - Director(JNIEnv *jenv) : swig_jvm_((JavaVM *) NULL), swig_self_() { + Director(JNIEnv *jenv) : swig_jvm_((JavaVM *) SWIG_NULLPTR), swig_self_() { /* Acquire the Java VM pointer */ jenv->GetJavaVM(&swig_jvm_); } @@ -329,9 +329,9 @@ namespace Swig { // Simple holder for a Java string during exception handling, providing access to a c-style string class JavaString { public: - JavaString(JNIEnv *jenv, jstring jstr) : jenv_(jenv), jstr_(jstr), cstr_(0) { + JavaString(JNIEnv *jenv, jstring jstr) : jenv_(jenv), jstr_(jstr), cstr_(SWIG_NULLPTR) { if (jenv_ && jstr_) - cstr_ = (const char *) jenv_->GetStringUTFChars(jstr_, NULL); + cstr_ = (const char *) jenv_->GetStringUTFChars(jstr_, SWIG_NULLPTR); } ~JavaString() { @@ -372,7 +372,7 @@ namespace Swig { // Get exception message by calling Java method Throwable.getMessage() static jstring exceptionMessageFromThrowable(JNIEnv *jenv, jthrowable throwable) { - jstring jmsg = NULL; + jstring jmsg = SWIG_NULLPTR; if (jenv && throwable) { jenv->ExceptionClear(); // Cannot invoke methods with any pending exceptions jclass throwclz = jenv->GetObjectClass(throwable); @@ -382,7 +382,7 @@ namespace Swig { if (getMessageMethodID) jmsg = (jstring)jenv->CallObjectMethod(throwable, getMessageMethodID); } - if (jmsg == NULL && jenv->ExceptionCheck()) + if (jmsg == SWIG_NULLPTR && jenv->ExceptionCheck()) jenv->ExceptionClear(); } return jmsg; @@ -396,7 +396,7 @@ namespace Swig { public: // Construct exception from a Java throwable - DirectorException(JNIEnv *jenv, jthrowable throwable) : jenv_(jenv), throwable_(throwable), classname_(0), msg_(0) { + DirectorException(JNIEnv *jenv, jthrowable throwable) : jenv_(jenv), throwable_(throwable), classname_(SWIG_NULLPTR), msg_(SWIG_NULLPTR) { // Call Java method Object.getClass().getName() to obtain the throwable's class name (delimited by '/') if (jenv && throwable) { @@ -411,7 +411,7 @@ namespace Swig { // Copy strings, since there is no guarantee that jenv will be active when handled if (jstr_classname) { JavaString jsclassname(jenv, jstr_classname); - const char *classname = jsclassname.c_str(0); + const char *classname = jsclassname.c_str(SWIG_NULLPTR); if (classname) classname_ = copypath(classname); } @@ -421,11 +421,11 @@ namespace Swig { } JavaExceptionMessage exceptionmsg(jenv, throwable); - msg_ = copystr(exceptionmsg.message(0)); + msg_ = copystr(exceptionmsg.message(SWIG_NULLPTR)); } // More general constructor for handling as a java.lang.RuntimeException - DirectorException(const char *msg) : jenv_(0), throwable_(0), classname_(0), msg_(msg ? copystr(msg) : 0) { + DirectorException(const char *msg) : jenv_(SWIG_NULLPTR), throwable_(SWIG_NULLPTR), classname_(SWIG_NULLPTR), msg_(msg ? copystr(msg) : SWIG_NULLPTR) { } ~DirectorException() throw() { @@ -446,7 +446,7 @@ namespace Swig { jthrowable throwable = jenv->ExceptionOccurred(); if (throwable && jenv->IsSameObject(throwable, throwable_) == JNI_FALSE) { jenv->ExceptionClear(); - throwable = 0; + throwable = SWIG_NULLPTR; } if (!throwable) jenv->Throw(throwable_); @@ -454,8 +454,8 @@ namespace Swig { // Try and reconstruct original exception, but original stacktrace is not reconstructed jenv->ExceptionClear(); - jmethodID ctorMethodID = 0; - jclass throwableclass = 0; + jmethodID ctorMethodID = SWIG_NULLPTR; + jclass throwableclass = SWIG_NULLPTR; if (classname_) { throwableclass = jenv->FindClass(classname_); if (throwableclass) @@ -492,7 +492,7 @@ namespace Swig { } static char *copystr(const char *srcmsg) { - char *target = 0; + char *target = SWIG_NULLPTR; if (srcmsg) { size_t msglen = strlen(srcmsg) + 1; target = new char[msglen]; diff --git a/usr/share/swig/4.1.1/java/enums.swg b/usr/share/swig/4.2.1/java/enums.swg similarity index 100% rename from usr/share/swig/4.1.1/java/enums.swg rename to usr/share/swig/4.2.1/java/enums.swg diff --git a/usr/share/swig/4.1.1/java/enumsimple.swg b/usr/share/swig/4.2.1/java/enumsimple.swg similarity index 100% rename from usr/share/swig/4.1.1/java/enumsimple.swg rename to usr/share/swig/4.2.1/java/enumsimple.swg diff --git a/usr/share/swig/4.1.1/java/enumtypesafe.swg b/usr/share/swig/4.2.1/java/enumtypesafe.swg similarity index 100% rename from usr/share/swig/4.1.1/java/enumtypesafe.swg rename to usr/share/swig/4.2.1/java/enumtypesafe.swg diff --git a/usr/share/swig/4.1.1/java/enumtypeunsafe.swg b/usr/share/swig/4.2.1/java/enumtypeunsafe.swg similarity index 100% rename from usr/share/swig/4.1.1/java/enumtypeunsafe.swg rename to usr/share/swig/4.2.1/java/enumtypeunsafe.swg diff --git a/usr/share/swig/4.1.1/java/java.swg b/usr/share/swig/4.2.1/java/java.swg similarity index 98% rename from usr/share/swig/4.1.1/java/java.swg rename to usr/share/swig/4.2.1/java/java.swg index 8719818bb8d..4d427cbee83 100644 --- a/usr/share/swig/4.1.1/java/java.swg +++ b/usr/share/swig/4.2.1/java/java.swg @@ -1039,7 +1039,7 @@ Swig::LocalRefGuard $1_refguard(jenv, $input); } unsigned long, unsigned short %{ char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); + SWIG_snprintf(error_msg, sizeof(error_msg), "C++ $1_type exception thrown, value: %d", $1); SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, error_msg); return $null; %} @@ -1304,7 +1304,7 @@ SWIG_JAVABODY_PROXY(protected, protected, SWIGTYPE) SWIG_JAVABODY_TYPEWRAPPER(protected, protected, protected, SWIGTYPE) %typemap(javafinalize) SWIGTYPE %{ - @SuppressWarnings("deprecation") + @SuppressWarnings({"deprecation", "removal"}) protected void finalize() { delete(); } @@ -1399,10 +1399,17 @@ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) %pragma(java) jniclassclassmodifiers="public class" %pragma(java) moduleclassmodifiers="public class" -/* Some ANSI C typemaps */ +/* 64-bit architecture specific typemaps */ +#if defined(SWIGWORDSIZE64) +%apply long long { long }; +%apply unsigned long long { unsigned long }; +%apply const long long & { const long & }; +%apply const unsigned long long & { const unsigned long & }; +#endif -%apply unsigned long { size_t }; -%apply const unsigned long & { const size_t & }; +/* size_t maps to Java 64-bit (signed) long type */ +%apply unsigned int { size_t }; +%apply const unsigned int & { const size_t & }; /* Array reference typemaps */ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } diff --git a/usr/share/swig/4.1.1/java/javahead.swg b/usr/share/swig/4.2.1/java/javahead.swg similarity index 100% rename from usr/share/swig/4.1.1/java/javahead.swg rename to usr/share/swig/4.2.1/java/javahead.swg diff --git a/usr/share/swig/4.1.1/java/javakw.swg b/usr/share/swig/4.2.1/java/javakw.swg similarity index 100% rename from usr/share/swig/4.1.1/java/javakw.swg rename to usr/share/swig/4.2.1/java/javakw.swg diff --git a/usr/share/swig/4.1.1/java/std_array.i b/usr/share/swig/4.2.1/java/std_array.i similarity index 70% rename from usr/share/swig/4.1.1/java/std_array.i rename to usr/share/swig/4.2.1/java/std_array.i index d3436cc66cd..b5012dee038 100644 --- a/usr/share/swig/4.1.1/java/std_array.i +++ b/usr/share/swig/4.2.1/java/std_array.i @@ -4,6 +4,19 @@ %include +%fragment("SWIG_ArraySize", "header", fragment="SWIG_JavaIntFromSize_t") { + SWIGINTERN jint SWIG_ArraySize(size_t size) { + jint sz = SWIG_JavaIntFromSize_t(size); + if (sz == -1) { + throw std::out_of_range("array size is too large to fit into a Java int"); + } + + return sz; + } +} + +%javamethodmodifiers std::array::sizeImpl "private"; + namespace std { template class array { @@ -19,11 +32,16 @@ namespace std { array(); array(const array& other); - size_type size() const; %rename(isEmpty) empty; bool empty() const; void fill(const T& u); %extend { + %fragment("SWIG_ArraySize"); + + jint size() const throw (std::out_of_range) { + return SWIG_ArraySize(self->size()); + } + const_reference get(int i) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && i::iterator ret = *$self; std::advance(ret, index); return ret; diff --git a/usr/share/swig/4.1.1/java/std_map.i b/usr/share/swig/4.2.1/java/std_map.i similarity index 90% rename from usr/share/swig/4.1.1/java/std_map.i rename to usr/share/swig/4.2.1/java/std_map.i index 6d5ca1aacb5..d9623b2936d 100644 --- a/usr/share/swig/4.1.1/java/std_map.i +++ b/usr/share/swig/4.2.1/java/std_map.i @@ -79,7 +79,7 @@ template > class map { } public $typemap(jboxtype, T) put($typemap(jboxtype, K) key, $typemap(jboxtype, T) value) { - Iterator itr = find(($typemap(jboxtype, K)) key); + Iterator itr = find(key); if (itr.isNot(end())) { $typemap(jboxtype, T) oldValue = itr.getValue(); itr.setValue(value); @@ -199,7 +199,11 @@ template > class map { } void putUnchecked(const K& key, const T& value) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, value); +%#else (*self)[key] = value; +%#endif } void removeUnchecked(const std::map< K, T, C >::iterator itr) { @@ -208,17 +212,4 @@ template > class map { } }; -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - } diff --git a/usr/share/swig/4.1.1/java/std_pair.i b/usr/share/swig/4.2.1/java/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/java/std_pair.i rename to usr/share/swig/4.2.1/java/std_pair.i diff --git a/usr/share/swig/4.1.1/java/std_set.i b/usr/share/swig/4.2.1/java/std_set.i similarity index 100% rename from usr/share/swig/4.1.1/java/std_set.i rename to usr/share/swig/4.2.1/java/std_set.i diff --git a/usr/share/swig/4.1.1/java/std_shared_ptr.i b/usr/share/swig/4.2.1/java/std_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/java/std_shared_ptr.i rename to usr/share/swig/4.2.1/java/std_shared_ptr.i diff --git a/usr/share/swig/4.1.1/java/std_string.i b/usr/share/swig/4.2.1/java/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/java/std_string.i rename to usr/share/swig/4.2.1/java/std_string.i diff --git a/usr/share/swig/4.2.1/java/std_string_view.i b/usr/share/swig/4.2.1/java/std_string_view.i new file mode 100644 index 00000000000..c89f79979d5 --- /dev/null +++ b/usr/share/swig/4.2.1/java/std_string_view.i @@ -0,0 +1,138 @@ +/* ----------------------------------------------------------------------------- + * std_string_view.i + * + * Typemaps for std::string_view and const std::string_view& + * These are mapped to a Java String and are passed around by value. + * + * To use non-const std::string_view references use the following %apply. Note + * that they are passed by value. + * %apply const std::string_view & {std::string_view &}; + * ----------------------------------------------------------------------------- */ + +%{ +#include +#include +%} + +namespace std { + +%naturalvar string_view; + +class string_view; + +// string_view +%typemap(jni) string_view "jstring" +%typemap(jtype) string_view "String" +%typemap(jstype) string_view "String" +%typemap(javadirectorin) string_view "$jniinput" +%typemap(javadirectorout) string_view "$javacall" + +%typemap(in) string_view +%{ if(!$input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); + return $null; + } + const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); + if (!$1_pstr) return $null; + $1 = std::string_view($1_pstr); %} + +/* std::string_view requires the string data to remain valid while the + * string_view is in use. */ +%typemap(freearg) string_view +%{ jenv->ReleaseStringUTFChars($input, $1_pstr); %} + +%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) string_view +%{ if(!$input) { + if (!jenv->ExceptionCheck()) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); + } + return $null; + } + const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); + if (!$1_pstr) return $null; + /* possible thread/reentrant code problem */ + static std::string $1_str; + $1_str = $1_pstr; + $result = std::string_view($1_str); + jenv->ReleaseStringUTFChars($input, $1_pstr); %} + +/* std::string_view::data() isn't zero-byte terminated, but NewStringUTF() + * requires a zero byte so it seems we have to make a copy (ick). The + * cleanest way to do that seems to be via a temporary std::string. + */ +%typemap(directorin,descriptor="Ljava/lang/String;") string_view +%{ $input = jenv->NewStringUTF(std::string($1).c_str()); + Swig::LocalRefGuard $1_refguard(jenv, $input); %} + +%typemap(out) string_view +%{ $result = jenv->NewStringUTF(std::string($1).c_str()); %} + +%typemap(javain) string_view "$javainput" + +%typemap(javaout) string_view { + return $jnicall; + } + +%typemap(typecheck) string_view = char *; + +%typemap(throws) string_view +%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string($1).c_str()); + return $null; %} + +// const string_view & +%typemap(jni) const string_view & "jstring" +%typemap(jtype) const string_view & "String" +%typemap(jstype) const string_view & "String" +%typemap(javadirectorin) const string_view & "$jniinput" +%typemap(javadirectorout) const string_view & "$javacall" + +%typemap(in) const string_view & +%{ if(!$input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); + return $null; + } + const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); + if (!$1_pstr) return $null; + $*1_ltype $1_str($1_pstr); + $1 = &$1_str; %} + +/* std::string_view requires the string data to remain valid while the + * string_view is in use. */ +%typemap(freearg) const string_view & +%{ jenv->ReleaseStringUTFChars($input, $1_pstr); %} + +%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string_view & +%{ if(!$input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); + return $null; + } + const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); + if (!$1_pstr) return $null; + /* possible thread/reentrant code problem */ + static std::string $1_str; + $1_str = $1_pstr; + static $*1_ltype $1_strview; + $1_strview = $1_str; + $result = &$1_strview; + jenv->ReleaseStringUTFChars($input, $1_pstr); %} + +%typemap(directorin,descriptor="Ljava/lang/String;") const string_view & +%{ $input = jenv->NewStringUTF(std::string($1).c_str()); + Swig::LocalRefGuard $1_refguard(jenv, $input); %} + +%typemap(out) const string_view & +%{ $result = jenv->NewStringUTF(std::string(*$1).c_str()); %} + +%typemap(javain) const string_view & "$javainput" + +%typemap(javaout) const string_view & { + return $jnicall; + } + +%typemap(typecheck) const string_view & = char *; + +%typemap(throws) const string_view & +%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string($1).c_str()); + return $null; %} + +} diff --git a/usr/share/swig/4.1.1/java/std_unique_ptr.i b/usr/share/swig/4.2.1/java/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/java/std_unique_ptr.i rename to usr/share/swig/4.2.1/java/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/java/std_unordered_map.i b/usr/share/swig/4.2.1/java/std_unordered_map.i similarity index 98% rename from usr/share/swig/4.1.1/java/std_unordered_map.i rename to usr/share/swig/4.2.1/java/std_unordered_map.i index 283a9b4647f..2d933952a57 100644 --- a/usr/share/swig/4.1.1/java/std_unordered_map.i +++ b/usr/share/swig/4.2.1/java/std_unordered_map.i @@ -199,7 +199,11 @@ template class unordered_map { } void putUnchecked(const K& key, const T& value) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, value); +%#else (*self)[key] = value; +%#endif } void removeUnchecked(const std::unordered_map< K, T >::iterator itr) { diff --git a/usr/share/swig/4.1.1/java/std_unordered_set.i b/usr/share/swig/4.2.1/java/std_unordered_set.i similarity index 100% rename from usr/share/swig/4.1.1/java/std_unordered_set.i rename to usr/share/swig/4.2.1/java/std_unordered_set.i diff --git a/usr/share/swig/4.1.1/java/std_vector.i b/usr/share/swig/4.2.1/java/std_vector.i similarity index 90% rename from usr/share/swig/4.1.1/java/std_vector.i rename to usr/share/swig/4.2.1/java/std_vector.i index 60ee23ebbe5..dee48fac554 100644 --- a/usr/share/swig/4.1.1/java/std_vector.i +++ b/usr/share/swig/4.2.1/java/std_vector.i @@ -75,6 +75,14 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { public int size() { return doSize(); } + + public int capacity() { + return doCapacity(); + } + + public void reserve(int n) { + doReserve(n); + } %} public: @@ -89,8 +97,6 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { vector(); vector(const vector &other); - size_type capacity() const; - void reserve(size_type n) throw (std::length_error); %rename(isEmpty) empty; bool empty() const; void clear(); @@ -103,6 +109,16 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { return new std::vector< CTYPE >(static_cast::size_type>(count), value); } + jint doCapacity() throw (std::out_of_range) { + return SWIG_VectorSize(self->capacity()); + } + + void doReserve(jint n) throw (std::length_error, std::out_of_range) { + if (n < 0) + throw std::out_of_range("vector reserve size must be positive"); + self->reserve(n); + } + jint doSize() const throw (std::out_of_range) { return SWIG_VectorSize(self->size()); } @@ -161,6 +177,8 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { } %enddef +%javamethodmodifiers std::vector::doCapacity "private"; +%javamethodmodifiers std::vector::doReserve "private"; %javamethodmodifiers std::vector::doSize "private"; %javamethodmodifiers std::vector::doAdd "private"; %javamethodmodifiers std::vector::doGet "private"; diff --git a/usr/share/swig/4.1.1/java/std_wstring.i b/usr/share/swig/4.2.1/java/std_wstring.i similarity index 100% rename from usr/share/swig/4.1.1/java/std_wstring.i rename to usr/share/swig/4.2.1/java/std_wstring.i diff --git a/usr/share/swig/4.1.1/java/stl.i b/usr/share/swig/4.2.1/java/stl.i similarity index 100% rename from usr/share/swig/4.1.1/java/stl.i rename to usr/share/swig/4.2.1/java/stl.i diff --git a/usr/share/swig/4.1.1/java/swiginterface.i b/usr/share/swig/4.2.1/java/swiginterface.i similarity index 100% rename from usr/share/swig/4.1.1/java/swiginterface.i rename to usr/share/swig/4.2.1/java/swiginterface.i diff --git a/usr/share/swig/4.1.1/java/swigmove.i b/usr/share/swig/4.2.1/java/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/java/swigmove.i rename to usr/share/swig/4.2.1/java/swigmove.i diff --git a/usr/share/swig/4.1.1/java/typemaps.i b/usr/share/swig/4.2.1/java/typemaps.i similarity index 96% rename from usr/share/swig/4.1.1/java/typemaps.i rename to usr/share/swig/4.2.1/java/typemaps.i index e130c1930bb..658a6b116c4 100644 --- a/usr/share/swig/4.1.1/java/typemaps.i +++ b/usr/share/swig/4.2.1/java/typemaps.i @@ -527,3 +527,23 @@ INOUT_TYPEMAP(double, jdouble, double, Double, "[D", jdoubleArray); %typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; %typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; + +#if defined(SWIGWORDSIZE64) +%apply long long *INPUT { long *INPUT }; +%apply unsigned long long *INPUT { unsigned long *INPUT }; + +%apply long long &INPUT { long &INPUT }; +%apply unsigned long long &INPUT { unsigned long &INPUT }; + +%apply long long *INOUT { long *INOUT }; +%apply unsigned long long *INOUT { unsigned long *INOUT }; + +%apply long long &INOUT { long &INOUT }; +%apply unsigned long long &INOUT { unsigned long &INOUT }; + +%apply long long *OUTPUT { long *OUTPUT }; +%apply unsigned long long *OUTPUT { unsigned long *OUTPUT }; + +%apply long long &OUTPUT { long &OUTPUT }; +%apply unsigned long long &OUTPUT { unsigned long &OUTPUT }; +#endif diff --git a/usr/share/swig/4.1.1/java/various.i b/usr/share/swig/4.2.1/java/various.i similarity index 100% rename from usr/share/swig/4.1.1/java/various.i rename to usr/share/swig/4.2.1/java/various.i diff --git a/usr/share/swig/4.2.1/javascript/jsc/argcargv.i b/usr/share/swig/4.2.1/javascript/jsc/argcargv.i new file mode 100644 index 00000000000..dacecb0855d --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/jsc/argcargv.i @@ -0,0 +1,67 @@ +/* ------------------------------------------------------------ + * SWIG library containing argc and argv multi-argument typemaps + * ------------------------------------------------------------ */ + +%{ +SWIGINTERN int SWIG_AsVal_string SWIG_JSC_AS_DECL_ARGS(JSValueRef obj, JSStringRef* str) +{ + if (!JSValueIsString SWIG_JSC_FROM_CALL_ARGS(obj)) { + return SWIG_TypeError; + } + if(str != SWIG_NULLPTR) { + *str = JSValueToStringCopy SWIG_JSC_AS_CALL_ARGS(obj, SWIG_NULLPTR); + } + return SWIG_OK; +} +%} + +%typemap(in) (int ARGC, char **ARGV) { + int i, len; + size_t arraysize; + JSObjectRef array; + if (!JSValueIsArray SWIG_JSC_FROM_CALL_ARGS($input)) { + SWIG_exception_fail(SWIG_ERROR, "not array"); + } + array = JSValueToObject SWIG_JSC_AS_CALL_ARGS($input, SWIG_NULLPTR); + len = SWIGJSC_ArrayLength SWIG_JSC_FROM_CALL_ARGS(array); + arraysize = (len+1)*sizeof($*2_ltype); + $1 = len; + $2 = ($2_ltype) malloc(arraysize); + if ($2 == SWIG_NULLPTR) { + SWIG_exception_fail(SWIG_ERROR, "memory allocation of array failed"); + } + memset($2, 0, arraysize); + for (i = 0; i < len; i++) { + int res, slen; + $*2_ltype pstr; + JSStringRef str; + JSValueRef jsvalue = JSObjectGetPropertyAtIndex(context, array, i, SWIG_NULLPTR); + res = SWIG_AsVal_string SWIG_JSC_AS_CALL_ARGS(jsvalue, &str); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ERROR, "failed to convert to string"); + } + slen = JSStringGetMaximumUTF8CStringSize(str); + pstr = ($*2_ltype) malloc(slen); + if (pstr == SWIG_NULLPTR) { + SWIG_exception_fail(SWIG_ERROR, "memory allocation of a string failed"); + } + if (slen) { + res = JSStringGetUTF8CString(str, pstr, slen); + if (res > slen) { + SWIG_exception_fail(SWIG_ERROR, "wrong string length"); + } + } + $2[i] = pstr; + } + $2[i] = SWIG_NULLPTR; +} + +%typemap(freearg) (int ARGC, char **ARGV) { + if ($2 != SWIG_NULLPTR) { + $1_ltype i; + for (i = 0; i < $1; i++) { + free((void *)$2[i]); + } + free((void *)$2); + } +} diff --git a/usr/share/swig/4.1.1/javascript/jsc/arrays_javascript.i b/usr/share/swig/4.2.1/javascript/jsc/arrays_javascript.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/arrays_javascript.i rename to usr/share/swig/4.2.1/javascript/jsc/arrays_javascript.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/ccomplex.i b/usr/share/swig/4.2.1/javascript/jsc/ccomplex.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/ccomplex.i rename to usr/share/swig/4.2.1/javascript/jsc/ccomplex.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/cdata.i b/usr/share/swig/4.2.1/javascript/jsc/cdata.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/cdata.i rename to usr/share/swig/4.2.1/javascript/jsc/cdata.i diff --git a/usr/share/swig/4.1.1/octave/cmalloc.i b/usr/share/swig/4.2.1/javascript/jsc/cmalloc.i similarity index 100% rename from usr/share/swig/4.1.1/octave/cmalloc.i rename to usr/share/swig/4.2.1/javascript/jsc/cmalloc.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/complex.i b/usr/share/swig/4.2.1/javascript/jsc/complex.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/complex.i rename to usr/share/swig/4.2.1/javascript/jsc/complex.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/exception.i b/usr/share/swig/4.2.1/javascript/jsc/exception.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/exception.i rename to usr/share/swig/4.2.1/javascript/jsc/exception.i diff --git a/usr/share/swig/4.1.1/octave/factory.i b/usr/share/swig/4.2.1/javascript/jsc/factory.i similarity index 100% rename from usr/share/swig/4.1.1/octave/factory.i rename to usr/share/swig/4.2.1/javascript/jsc/factory.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascript.swg b/usr/share/swig/4.2.1/javascript/jsc/javascript.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/javascript.swg rename to usr/share/swig/4.2.1/javascript/jsc/javascript.swg diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascriptcode.swg b/usr/share/swig/4.2.1/javascript/jsc/javascriptcode.swg similarity index 90% rename from usr/share/swig/4.1.1/javascript/jsc/javascriptcode.swg rename to usr/share/swig/4.2.1/javascript/jsc/javascriptcode.swg index 4050a6ee33c..e560200a301 100644 --- a/usr/share/swig/4.1.1/javascript/jsc/javascriptcode.swg +++ b/usr/share/swig/4.2.1/javascript/jsc/javascriptcode.swg @@ -4,6 +4,7 @@ * - $jslocals: locals part of wrapper * - $jscode: code part of wrapper * - $jsargcount: number of arguments + * - $jsargrequired: required number of arguments * - $jsmangledtype: mangled type of class * ----------------------------------------------------------------------------- */ %fragment ("js_ctor", "templates") @@ -11,7 +12,7 @@ static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) { $jslocals - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + if (argc < $jsargrequired || argc > $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); $jscode return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); @@ -67,6 +68,7 @@ static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, * - $jslocals: locals part of wrapper * - $jscode: code part of wrapper * - $jsargcount: number of arguments + * - $jsargrequired: required number of arguments * - $jsmangledtype: mangled type of class * ----------------------------------------------------------------------------- */ %fragment ("js_overloaded_ctor", "templates") @@ -86,13 +88,14 @@ static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size /* ----------------------------------------------------------------------------- * js_ctor_dispatch_case: template for a dispatch case for calling an overloaded ctor. * - $jsargcount: number of arguments of called ctor + * - $jsargrequired: required number of arguments * - $jswrapper: wrapper of called ctor * * Note: a try-catch-like mechanism is used to switch cases * ----------------------------------------------------------------------------- */ %fragment ("js_ctor_dispatch_case", "templates") %{ - if(argc == $jsargcount) { + if(argc >= $jsargrequired && argc <= $jsargcount) { thisObject = $jswrapper(context, NULL, argc, argv, exception); if(thisObject != NULL) { *exception=0; return thisObject; } /* reset exception and return */ } @@ -187,9 +190,11 @@ static bool $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef /* ----------------------------------------------------------------------------- * js_function: template for function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper + * - $jswrapper: wrapper function name + * - $jslocals: locals part of wrapper + * - $jsargcount: number of arguments + * - $jsargrequired: required number of arguments + * - $jscode: code part of wrapper * ----------------------------------------------------------------------------- */ %fragment ("js_function", "templates") %{ @@ -198,7 +203,7 @@ static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjec $jslocals JSValueRef jsresult; - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + if (argc < $jsargrequired || argc > $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); $jscode return jsresult; @@ -236,9 +241,11 @@ static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjec /* ----------------------------------------------------------------------------- * js_overloaded_function: template for a overloaded function - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper + * - $jswrapper: wrapper function name + * - $jslocals: locals part of wrapper + * - $jsargcount: required number of arguments + * - $jsargrequired: required number of arguments + * - $jscode: code part of wrapper * ----------------------------------------------------------------------------- */ %fragment ("js_overloaded_function", "templates") %{ @@ -247,7 +254,7 @@ static int $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef th $jslocals JSValueRef jsresult; - if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + if (argc < $jsargrequired || argc > $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); $jscode *p_result = jsresult; @@ -261,18 +268,26 @@ static int $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef th /* ----------------------------------------------------------------------------- * js_function_dispatch_case: template for a case used in the function dispatcher - * - $jswrapper: wrapper function name - * - $jsargcount: number of arguments of overloaded function - * - $jscode: code part of wrapper + * - $jswrapper: wrapper function name + * - $jsargcount: number of arguments of overloaded function + * - $jsargrequired: required number of arguments + * - $jscode: code part of wrapper * ----------------------------------------------------------------------------- */ %fragment ("js_function_dispatch_case", "templates") %{ - if(argc == $jsargcount) { + if(argc >= $jsargrequired && argc <= $jsargcount) { res = $jswrapper(context, function, thisObject, argc, argv, exception, &jsresult); if(res == SWIG_OK) { *exception = 0; return jsresult; } } %} +/* ----------------------------------------------------------------------------- + * js_check_arg: template for checking if an argument exists + * - $jsarg: number of argument + * ----------------------------------------------------------------------------- */ +%fragment ("js_check_arg", "templates") +%{if(argc > $jsarg)%} + /* ----------------------------------------------------------------------------- * jsc_variable_declaration: template for a variable table entry * - $jsname: name of the variable diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascriptcomplex.swg b/usr/share/swig/4.2.1/javascript/jsc/javascriptcomplex.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/javascriptcomplex.swg rename to usr/share/swig/4.2.1/javascript/jsc/javascriptcomplex.swg diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascriptfragments.swg b/usr/share/swig/4.2.1/javascript/jsc/javascriptfragments.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/javascriptfragments.swg rename to usr/share/swig/4.2.1/javascript/jsc/javascriptfragments.swg diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascripthelpers.swg b/usr/share/swig/4.2.1/javascript/jsc/javascripthelpers.swg similarity index 96% rename from usr/share/swig/4.1.1/javascript/jsc/javascripthelpers.swg rename to usr/share/swig/4.2.1/javascript/jsc/javascripthelpers.swg index 45765433efc..bdd5142a5b9 100644 --- a/usr/share/swig/4.1.1/javascript/jsc/javascripthelpers.swg +++ b/usr/share/swig/4.2.1/javascript/jsc/javascripthelpers.swg @@ -46,7 +46,7 @@ SWIGINTERN bool JS_veto_set_variable(JSContextRef context, JSObjectRef thisObjec int res; JSStringGetUTF8CString(propertyName, buffer, 256); - res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); + res = SWIG_snprintf(msg, sizeof(msg), "Tried to write read-only variable: %s.", buffer); if(res<0) { SWIG_exception(SWIG_ERROR, "Tried to write read-only variable."); diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascriptinit.swg b/usr/share/swig/4.2.1/javascript/jsc/javascriptinit.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/javascriptinit.swg rename to usr/share/swig/4.2.1/javascript/jsc/javascriptinit.swg diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascriptprimtypes.swg b/usr/share/swig/4.2.1/javascript/jsc/javascriptprimtypes.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/javascriptprimtypes.swg rename to usr/share/swig/4.2.1/javascript/jsc/javascriptprimtypes.swg diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascriptrun.swg b/usr/share/swig/4.2.1/javascript/jsc/javascriptrun.swg similarity index 99% rename from usr/share/swig/4.1.1/javascript/jsc/javascriptrun.swg rename to usr/share/swig/4.2.1/javascript/jsc/javascriptrun.swg index 4d5a9355b85..ee68c57718a 100644 --- a/usr/share/swig/4.1.1/javascript/jsc/javascriptrun.swg +++ b/usr/share/swig/4.2.1/javascript/jsc/javascriptrun.swg @@ -273,11 +273,12 @@ int SWIG_JSC_ConvertPacked(JSContextRef context, JSValueRef valRef, void *ptr, s SWIGRUNTIME JSValueRef SWIG_JSC_NewPackedObj(JSContextRef context, void *data, size_t size, swig_type_info *type) { - JSClassRef classRef = _SwigObject_classRef; + JSClassRef classRef = _SwigPackedData_classRef; JSObjectRef result = JSObjectMake(context, classRef, NULL); SwigPackedData* cdata = (SwigPackedData*) malloc(sizeof(SwigPackedData)); - cdata->data = data; + cdata->data = malloc(size); + memcpy(cdata->data, data, size); cdata->size = size; cdata->type = type; diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascriptruntime.swg b/usr/share/swig/4.2.1/javascript/jsc/javascriptruntime.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/javascriptruntime.swg rename to usr/share/swig/4.2.1/javascript/jsc/javascriptruntime.swg diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascriptstrings.swg b/usr/share/swig/4.2.1/javascript/jsc/javascriptstrings.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/javascriptstrings.swg rename to usr/share/swig/4.2.1/javascript/jsc/javascriptstrings.swg diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascripttypemaps.swg b/usr/share/swig/4.2.1/javascript/jsc/javascripttypemaps.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/javascripttypemaps.swg rename to usr/share/swig/4.2.1/javascript/jsc/javascripttypemaps.swg diff --git a/usr/share/swig/4.1.1/javascript/jsc/std_auto_ptr.i b/usr/share/swig/4.2.1/javascript/jsc/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/std_auto_ptr.i rename to usr/share/swig/4.2.1/javascript/jsc/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/std_common.i b/usr/share/swig/4.2.1/javascript/jsc/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/std_common.i rename to usr/share/swig/4.2.1/javascript/jsc/std_common.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/std_complex.i b/usr/share/swig/4.2.1/javascript/jsc/std_complex.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/std_complex.i rename to usr/share/swig/4.2.1/javascript/jsc/std_complex.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/std_deque.i b/usr/share/swig/4.2.1/javascript/jsc/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/std_deque.i rename to usr/share/swig/4.2.1/javascript/jsc/std_deque.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/std_except.i b/usr/share/swig/4.2.1/javascript/jsc/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/std_except.i rename to usr/share/swig/4.2.1/javascript/jsc/std_except.i diff --git a/usr/share/swig/4.1.1/ocaml/std_map.i b/usr/share/swig/4.2.1/javascript/jsc/std_map.i similarity index 77% rename from usr/share/swig/4.1.1/ocaml/std_map.i rename to usr/share/swig/4.2.1/javascript/jsc/std_map.i index 3f197baa60c..a679f44981d 100644 --- a/usr/share/swig/4.1.1/ocaml/std_map.i +++ b/usr/share/swig/4.2.1/javascript/jsc/std_map.i @@ -19,6 +19,7 @@ // exported class namespace std { + template > class map { // add typemaps here public: @@ -32,6 +33,7 @@ namespace std { typedef value_type& reference; typedef const value_type& const_reference; + map(); map(const map& other); @@ -47,7 +49,11 @@ namespace std { throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } void del(const K& key) throw (std::out_of_range) { std::map< K, T, C >::iterator i = self->find(key); @@ -63,17 +69,4 @@ namespace std { } }; -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - } diff --git a/usr/share/swig/4.1.1/javascript/jsc/std_pair.i b/usr/share/swig/4.2.1/javascript/jsc/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/std_pair.i rename to usr/share/swig/4.2.1/javascript/jsc/std_pair.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/std_string.i b/usr/share/swig/4.2.1/javascript/jsc/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/std_string.i rename to usr/share/swig/4.2.1/javascript/jsc/std_string.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/std_unique_ptr.i b/usr/share/swig/4.2.1/javascript/jsc/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/std_unique_ptr.i rename to usr/share/swig/4.2.1/javascript/jsc/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/std_vector.i b/usr/share/swig/4.2.1/javascript/jsc/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/std_vector.i rename to usr/share/swig/4.2.1/javascript/jsc/std_vector.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/stl.i b/usr/share/swig/4.2.1/javascript/jsc/stl.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/stl.i rename to usr/share/swig/4.2.1/javascript/jsc/stl.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/swigmove.i b/usr/share/swig/4.2.1/javascript/jsc/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/jsc/swigmove.i rename to usr/share/swig/4.2.1/javascript/jsc/swigmove.i diff --git a/usr/share/swig/4.1.1/javascript/v8/typemaps.i b/usr/share/swig/4.2.1/javascript/jsc/typemaps.i similarity index 96% rename from usr/share/swig/4.1.1/javascript/v8/typemaps.i rename to usr/share/swig/4.2.1/javascript/jsc/typemaps.i index e88f0019e23..08b58386373 100644 --- a/usr/share/swig/4.1.1/javascript/v8/typemaps.i +++ b/usr/share/swig/4.2.1/javascript/jsc/typemaps.i @@ -139,10 +139,6 @@ to a Python variable you might do this : x = neg(x) -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - */ %include diff --git a/usr/share/swig/4.2.1/javascript/napi/argcargv.i b/usr/share/swig/4.2.1/javascript/napi/argcargv.i new file mode 100644 index 00000000000..4a146047e8f --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/argcargv.i @@ -0,0 +1,66 @@ +/* ------------------------------------------------------------ + * SWIG library containing argc and argv multi-argument typemaps + * ------------------------------------------------------------ */ + +%{ +SWIGINTERN int SWIG_AsVal_string (Napi::Value valRef, Napi::String *str) +{ + if (!valRef.IsString()) { + return SWIG_TypeError; + } + if(str != SWIG_NULLPTR) { + *str = valRef.ToString(); + } + return SWIG_OK; +} +%} + +%typemap(in) (int ARGC, char **ARGV) { + $1_ltype i, len; + size_t arraysize; + Napi::Array array; + if (!$input.IsArray()) { + SWIG_exception_fail(SWIG_ERROR, "not array"); + } + array = $input.As(); + len = array.Length(); + arraysize = (len+1)*sizeof($*2_ltype); + $1 = len; + $2 = ($2_ltype) malloc(arraysize); + if ($2 == SWIG_NULLPTR) { + SWIG_exception_fail(SWIG_ERROR, "memory allocation of array failed"); + } + memset($2, 0, arraysize); + for (i = 0; i < len; i++) { + int res, slen; + $*2_ltype pstr; + Napi::String napi_str; + Napi::Value jsvalue = array.Get(i); + res = SWIG_AsVal_string(jsvalue, &napi_str); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ERROR, "failed to convert to string"); + } + std::string str = napi_str.Utf8Value(); + slen = str.size(); + pstr = ($*2_ltype) malloc(slen + 1); + if (pstr == SWIG_NULLPTR) { + SWIG_exception_fail(SWIG_ERROR, "memory allocation of a string failed"); + } + if (slen) { + memcpy(pstr, str.c_str(), slen); + } + pstr[slen] = 0; + $2[i] = pstr; + } + $2[i] = SWIG_NULLPTR; +} + +%typemap(freearg) (int ARGC, char **ARGV) { + if ($2 != SWIG_NULLPTR) { + $1_ltype i; + for (i = 0; i < $1; i++) { + free((void *)$2[i]); + } + free((void *)$2); + } +} diff --git a/usr/share/swig/4.2.1/javascript/napi/arrays_javascript.i b/usr/share/swig/4.2.1/javascript/napi/arrays_javascript.i new file mode 100644 index 00000000000..c020978182e --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/arrays_javascript.i @@ -0,0 +1,88 @@ +/* ----------------------------------------------------------------------------- + * arrays_javascript.i + * + * These typemaps give more natural support for arrays. The typemaps are not efficient + * as there is a lot of copying of the array values whenever the array is passed to C/C++ + * from JavaScript and vice versa. The JavaScript array is expected to be the same size as the C array. + * An exception is thrown if they are not. + * + * Example usage: + * Wrapping: + * + * %include + * %inline %{ + * extern int FiddleSticks[3]; + * %} + * + * Use from JavaScript like this: + * + * var fs = [10, 11, 12]; + * example.FiddleSticks = fs; + * fs = example.FiddleSticks; + * ----------------------------------------------------------------------------- */ + + +%fragment("SWIG_NAPI_GetIntProperty", "header", fragment=SWIG_AsVal_frag(int)) {} +%fragment("SWIG_NAPI_GetNumberProperty", "header", fragment=SWIG_AsVal_frag(double)) {} +%fragment("SWIG_NAPI_OutInt", "header", fragment=SWIG_From_frag(int)) {} +%fragment("SWIG_NAPI_OutNumber", "header", fragment=SWIG_From_frag(double)) {} + +%define JAVASCRIPT_ARRAYS_IN_DECL(NAME, CTYPE, ANY, ANYLENGTH) + +%typemap(in, fragment=NAME) CTYPE[ANY] { + if ($input.IsArray()) { + Napi::Env env = $input.Env(); + // Convert into Array + Napi::Array array = $input.As(); + + int length = ANYLENGTH; + + $1 = ($*1_ltype *)malloc(sizeof($*1_ltype) * length); + + // Get each element from array + for (int i = 0; i < length; i++) { + Napi::Value jsvalue = array.Get(i); + $*1_ltype temp; + + // Get primitive value from JSObject + int res = SWIG_AsVal(CTYPE)(jsvalue, &temp); + if (!SWIG_IsOK(res)) { + SWIG_Error(SWIG_ERROR, "Failed to convert $input to double"); + } + arg$argnum[i] = temp; + } + } else { + Napi::Env env = $input.Env(); + SWIG_Error(SWIG_ERROR, "$input is not an array"); + } +} + +%typemap(freearg) CTYPE[ANY] { + free($1); +} + +%enddef + +%define JAVASCRIPT_ARRAYS_OUT_DECL(NAME, CTYPE) + +%typemap(out, fragment=NAME) CTYPE[ANY] { + int length = $1_dim0; + Napi::Array array = Napi::Array::New(env, length); + + for (int i = 0; i < length; i++) { + array.Set(i, SWIG_From(CTYPE)($1[i])); + } + + $result = array; +} + +%enddef + +JAVASCRIPT_ARRAYS_IN_DECL("SWIG_NAPI_GetIntProperty", int, , array.Length()) +JAVASCRIPT_ARRAYS_IN_DECL("SWIG_NAPI_GetIntProperty", int, ANY, $1_dim0) +JAVASCRIPT_ARRAYS_IN_DECL("SWIG_NAPI_GetNumberProperty", double, , array.Length()) +JAVASCRIPT_ARRAYS_IN_DECL("SWIG_NAPI_GetNumberProperty", double, ANY, $1_dim0) + +JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_NAPI_OutInt", int) +JAVASCRIPT_ARRAYS_OUT_DECL("SWIG_NAPI_OutNumber", double) + diff --git a/usr/share/swig/4.1.1/javascript/v8/ccomplex.i b/usr/share/swig/4.2.1/javascript/napi/ccomplex.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/ccomplex.i rename to usr/share/swig/4.2.1/javascript/napi/ccomplex.i diff --git a/usr/share/swig/4.1.1/javascript/v8/cdata.i b/usr/share/swig/4.2.1/javascript/napi/cdata.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/cdata.i rename to usr/share/swig/4.2.1/javascript/napi/cdata.i diff --git a/usr/share/swig/4.1.1/perl5/cmalloc.i b/usr/share/swig/4.2.1/javascript/napi/cmalloc.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/cmalloc.i rename to usr/share/swig/4.2.1/javascript/napi/cmalloc.i diff --git a/usr/share/swig/4.1.1/javascript/v8/complex.i b/usr/share/swig/4.2.1/javascript/napi/complex.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/complex.i rename to usr/share/swig/4.2.1/javascript/napi/complex.i diff --git a/usr/share/swig/4.1.1/javascript/v8/exception.i b/usr/share/swig/4.2.1/javascript/napi/exception.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/exception.i rename to usr/share/swig/4.2.1/javascript/napi/exception.i diff --git a/usr/share/swig/4.1.1/perl5/factory.i b/usr/share/swig/4.2.1/javascript/napi/factory.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/factory.i rename to usr/share/swig/4.2.1/javascript/napi/factory.i diff --git a/usr/share/swig/4.2.1/javascript/napi/javascript.swg b/usr/share/swig/4.2.1/javascript/napi/javascript.swg new file mode 100644 index 00000000000..c37a3848c85 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/javascript.swg @@ -0,0 +1,17 @@ +/* ----------------------------------------------------------------------------- + * javascript.swg + * + * Javascript typemaps + * ----------------------------------------------------------------------------- */ + +%include + +%include + +%include + +%include + +%include + +%include diff --git a/usr/share/swig/4.2.1/javascript/napi/javascriptcode.swg b/usr/share/swig/4.2.1/javascript/napi/javascriptcode.swg new file mode 100644 index 00000000000..26e8aded5cb --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/javascriptcode.swg @@ -0,0 +1,880 @@ +/* ----------------------------------------------------------------------------- + * js_ctor: template for wrapping a ctor. + * - $jswrapper: wrapper of called ctor + * - $jsparent: mangled name of parent (or SWIG_NAPI_ObjectWrap if none) + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * - $jsargcount: number of arguments + * - $jsargrequired: minimum number of arguments + * - $jsmangledname: mangled name of class + * - $jsmangledtype: mangled type of class + * ----------------------------------------------------------------------------- */ + +%fragment("js_ctor", "templates") %{ +template +// js_ctor +// This is the main constructor +$jsmangledname_templ::$jsmangledname_templ(const Napi::CallbackInfo &info) + : $jsparent_templ(true, info) { + Napi::Env env = info.Env(); + + this->info = SWIGTYPE_$jsmangledtype; + if (info.Length() == 1 && info[0].IsExternal()) { + // This constructor has been called internally from C++/SWIG + // to wrap an already existing C++ object in JS + this->self = info[0].As>().Data(); + this->owned = false; + return; + } + this->owned = true; + + $jslocals + if(static_cast(info.Length()) < $jsargrequired || static_cast(info.Length()) > $jsargcount) { + SWIG_Error(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + } + $jscode + this->self = result; + return; + goto fail; +fail: + return; +} + +// This is the bypass constructor to be used from child classes +template +$jsmangledname_templ::$jsmangledname_templ(bool, const Napi::CallbackInfo &info) + : $jsparent_templ(true, info) {} +%} + + +/* ----------------------------------------------------------------------------- + * js_veto_ctor: a vetoing ctor for abstract classes + * - $jsmangledname: mangled name of class + * - $jsparent: mangled name of parent (or SWIG_NAPI_ObjectWrap if none) + * ----------------------------------------------------------------------------- */ +%fragment ("js_veto_ctor", "templates") +%{ +// js_veto_ctor +template +$jsmangledname_templ::$jsmangledname_templ(const Napi::CallbackInfo &info) + : $jsparent_templ(true, info) { + Napi::Env env = info.Env(); + if (info.Length() == 1 && info[0].IsExternal()) { + // This constructor has been called internally from C++/SWIG + // to wrap an already existing C++ object in JS as its + // base abstract class + this->self = info[0].As>().Data(); + this->owned = false; + return; + } + SWIG_Error(SWIG_ERROR, "Class $jsname can not be instantiated"); + return; + goto fail; +fail: + return; +} + +// This is the extendable constructor to be used from child classes +template +$jsmangledname_templ::$jsmangledname_templ(bool, const Napi::CallbackInfo &info) + : $jsparent_templ(true, info) { +} +%} + + +/* ----------------------------------------------------------------------------- + * js_ctor_dispatcher: dispatcher for overloaded constructors + * - $jsmangledname: mangled name of class + * - $jsparent: mangled name of parent (or SWIG_NAPI_ObjectWrap if none) + * - $jsdispatchcases: part containing code for dispatching + * - $jsmangledtype: mangled type of class + * ----------------------------------------------------------------------------- */ +%fragment ("js_ctor_dispatcher", "templates") +%{ +// js_ctor_dispatcher +template +$jsmangledname_templ::$jsmangledname_templ(const Napi::CallbackInfo &info) + : $jsparent_templ(true, info) { + Napi::Env env = info.Env(); + Napi::Object self; + NAPI_CHECK_RESULT(info.This().ToObject(), self); + this->info = SWIGTYPE_$jsmangledtype; + if (info.Length() == 1 && info[0].IsExternal()) { + // This constructor has been called internally from C++/SWIG + // to wrap an already existing C++ object in JS + this->self = info[0].As>().Data(); + this->owned = false; + return; + } + + // switch all cases by means of series of if-returns. + $jsdispatchcases + + // default: + SWIG_Error(SWIG_ERROR, "Illegal arguments for construction of $jsmangledname"); + + goto fail; +fail: + return; +} + +// This is the extendable constructor to be used from child classes +template +$jsmangledname_templ::$jsmangledname_templ(bool, const Napi::CallbackInfo &info) + : $jsparent_templ(true, info) { +} +%} + + +/* ----------------------------------------------------------------------------- + * js_overloaded_ctor: template for wrapping a ctor. + * - $jswrapper: wrapper of called ctor + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * - $jsargcount: number of arguments + * - $jsargrequired: minimum number of arguments + * - $jsmangledtype: mangled type of class + * ----------------------------------------------------------------------------- */ +%fragment("js_overloaded_ctor", "templates") %{ +// js_overloaded_ctor +template +Napi::Value $jsmangledname_templ::$jswrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Object self; + $jslocals + NAPI_CHECK_RESULT(info.This().ToObject(), self); + this->owned = true; + if(static_cast(info.Length()) < $jsargrequired || static_cast(info.Length()) > $jsargcount) { + SWIG_Error(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + } + $jscode + this->self = result; + + goto fail; +fail: + return Napi::Value(); +} +%} + + +/* ----------------------------------------------------------------------------- + * js_ctor_dispatch_case: template for a dispatch case for calling an overloaded ctor. + * - $jsargcount: number of arguments of called ctor + * - $jsargrequired: minimum number of arguments + * - $jswrapper: wrapper of called ctor + * + * Note: a try-catch-like mechanism is used to switch cases + * ----------------------------------------------------------------------------- */ +%fragment ("js_ctor_dispatch_case", "templates") +%{ + // js_ctor_dispatch_case + if(static_cast(info.Length()) >= $jsargrequired && static_cast(info.Length()) <= $jsargcount) { +#ifdef NAPI_CPP_EXCEPTIONS + bool tryNext = false; + try { + $jswrapper(info); + } catch (const Napi::TypeError &) { + tryNext = true; + } catch (const Napi::Error &e) { + throw e; + } + if (!tryNext) + return; +#else + $jswrapper(info); + if (env.IsExceptionPending()) { + Napi::Error e = env.GetAndClearPendingException(); + Napi::Value typeErrorValue; + bool isTypeError; + Napi::Function typeErrorCons; + // Yes, this is ugly + // TODO: Fix this in Node.js when the core team grows up + NAPI_CHECK_RESULT(env.Global().Get("TypeError"), typeErrorValue); + typeErrorCons = typeErrorValue.As(); + NAPI_CHECK_RESULT(e.Value().InstanceOf(typeErrorCons), isTypeError); + if (!isTypeError) { + // This is not the error you are looking for + e.ThrowAsJavaScriptException(); + SWIG_fail; + } + } else { + return; + } +#endif + } +%} + + +/* ----------------------------------------------------------------------------- + * js_check_arg: template for checking if an argument exists + * - $jsarg: number of argument + * ----------------------------------------------------------------------------- */ +%fragment ("js_check_arg", "templates") +%{if(info.Length() > $jsarg)%} + + +/* ----------------------------------------------------------------------------- + * js_dtor: template for a destructor wrapper + * - $jsmangledname: mangled class name + * - $jstype: class type + * ----------------------------------------------------------------------------- */ +%fragment ("js_dtor", "templates") +%{ +// js_dtor +template +$jsmangledname_templ::~$jsmangledname_templ() { +} +%} + + +/* ----------------------------------------------------------------------------- + * js_dtoroverride: template for a destructor wrapper + * - ${classname_mangled}: mangled class name + * - $jstype: class type + * - ${destructor_action}: The custom destructor action to invoke. + * ----------------------------------------------------------------------------- */ +%fragment ("js_dtoroverride", "templates") +%{ +// js_dtoroverride +template +${classname_mangled}_templ::~${classname_mangled}_templ() { + auto arg1 = reinterpret_cast<$jstype>(this->self); + if (this->owned && arg1) { + ${destructor_action} + this->self = nullptr; + } +} +%} + +/* ----------------------------------------------------------------------------- + * js_global_getter: template for global getter function wrappers + * - $jswrapper: wrapper function name + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * ----------------------------------------------------------------------------- */ +%fragment("js_global_getter", "templates") +%{ +// js_global_getter +Napi::Value $jswrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Value jsresult; + $jslocals + $jscode + return jsresult; + + goto fail; +fail: + return Napi::Value(); +} +%} + + +/* ----------------------------------------------------------------------------- + * js_global_setter: template for global setter function wrappers + * - $jswrapper: wrapper function name + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * ----------------------------------------------------------------------------- */ +%fragment("js_global_setter", "templates") +%{ +// js_global_setter +void $jswrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Value value = info.Length() > 0 ? info[0] : Napi::Value(); + Napi::Value jsresult; + $jslocals + $jscode + return; + + goto fail; +fail: + return; +} +%} + + +/* ----------------------------------------------------------------------------- + * jsnapi_register_global_variable: template for a statement that registers a global variable + * - $jsname: variable name + * - $jsparent: parent namespace + * - $jsgetter: wrapper of the getter function + * - $jssetter: wrapper of the setter function + * + * Note: this template is also used for global variables. + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_register_global_variable", "templates") +%{ + // jsnapi_register_global_variable + do { + Napi::PropertyDescriptor pd = Napi::PropertyDescriptor::Accessor<$jsgetter, $jssetter>("$jsname"); + NAPI_CHECK_MAYBE($jsparent.DefineProperties({pd})); + } while (0); +%} + + +/* ----------------------------------------------------------------------------- + * js_global_function: template for function wrappers + * - $jswrapper: wrapper function name + * - $jslocals: locals part of wrapper + * - $jsargcount: number of arguments + * - $jsargrequired: minimum number of arguments + * - $jscode: code part of wrapper + * ----------------------------------------------------------------------------- */ +%fragment("js_global_function", "templates") +%{ +// js_global_function +Napi::Value $jswrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Value jsresult; + $jslocals + if(static_cast(info.Length()) < $jsargrequired || static_cast(info.Length()) > $jsargcount) { + SWIG_Error(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + } + + $jscode + return jsresult; + + goto fail; +fail: + return Napi::Value(); +} +%} + + +/* ----------------------------------------------------------------------------- + * js_global_function_dispatcher: template for a global function dispatcher for + * global overloaded functions + * - $jswrapper: wrapper function name + * - $jsname: name of the wrapped function + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * ----------------------------------------------------------------------------- */ +%fragment("js_global_function_dispatcher", "templates") +%{ +// js_global_function_dispatcher +Napi::Value $jswrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Value jsresult; + $jscode + + SWIG_Error(SWIG_ERROR, "Illegal arguments for function $jsname."); + + goto fail; +fail: + return Napi::Value(); +} +%} + + +/* ----------------------------------------------------------------------------- + * jsnapi_register_global_function: template for a statement that registers a global function + * - $jsname: function name + * - $jsparent: parent namespace + * - $jswrapper: name of the JS wrapper + * + * Note: this template is also used for global variables. + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_register_global_function", "templates") +%{ + // jsnapi_register_global_function + do { + Napi::PropertyDescriptor pd = Napi::PropertyDescriptor::Function("$jsname", $jswrapper); + NAPI_CHECK_MAYBE($jsparent.DefineProperties({pd})); + } while (0); +%} + + +/* ----------------------------------------------------------------------------- + * js_getter: template for getter function wrappers + * - $jsmangledname: mangled class name + * - $jswrapper: wrapper function name + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * ----------------------------------------------------------------------------- */ +%fragment("js_getter", "templates") +%{ +// js_getter +template +Napi::Value $jsmangledname_templ::$jswrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Value jsresult; + $jslocals + $jscode + return jsresult; + + goto fail; +fail: + return Napi::Value(); +} +%} + + +/* ----------------------------------------------------------------------------- + * js_setter: template for setter function wrappers + * - $jsmangledname: mangled class name + * - $jswrapper: wrapper function name + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * ----------------------------------------------------------------------------- */ +%fragment("js_setter", "templates") +%{ +// js_setter +template +void $jsmangledname_templ::$jswrapper(const Napi::CallbackInfo &info, const Napi::Value &value) { + Napi::Env env = info.Env(); + Napi::Value jsresult; + $jslocals + $jscode + return; + + goto fail; +fail: + return; +} +%} + + +/* ----------------------------------------------------------------------------- + * js_function: template for function wrappers + * - $jsmangledname: mangled class name + * - $jswrapper: wrapper function name + * - $jsargcount: minimum number of arguments + * - $jsargrequired: minimum number of arguments + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * ----------------------------------------------------------------------------- */ +%fragment("js_function", "templates") +%{ +// js_function +template +Napi::Value $jsmangledname_templ::$jswrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Value jsresult; + $jslocals + if(static_cast(info.Length()) < $jsargrequired || static_cast(info.Length()) > $jsargcount) { + SWIG_Error(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + } + + $jscode + return jsresult; + + goto fail; +fail: + return Napi::Value(); +} +%} + + +/* ----------------------------------------------------------------------------- + * js_function_dispatcher: template for a function dispatcher for overloaded functions + * - $jsmangledname: mangled class name + * - $jswrapper: wrapper function name + * - $jsname: name of the wrapped function + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * ----------------------------------------------------------------------------- */ +%fragment("js_function_dispatcher", "templates") +%{ +// js_function_dispatcher +template +Napi::Value $jsmangledname_templ::$jswrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Value jsresult; + $jscode + + SWIG_Error(SWIG_ERROR, "Illegal arguments for function $jsname."); + + goto fail; +fail: + return Napi::Value(); +} +%} + + +/* ----------------------------------------------------------------------------- + * js_overloaded_function: template for a overloaded function + * - $jswrapper: wrapper function name + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * ----------------------------------------------------------------------------- */ +%fragment ("js_overloaded_function", "templates") +%{ +// js_overloaded_function +template +Napi::Value $jsmangledname_templ::$jswrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Value jsresult; + $jslocals + $jscode + return jsresult; + + goto fail; +fail: + return Napi::Value(); +} +%} + + +/* ----------------------------------------------------------------------------- + * js_global_overloaded_function: template for a global overloaded function + * - $jswrapper: wrapper function name + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * ----------------------------------------------------------------------------- */ +%fragment ("js_global_overloaded_function", "templates") +%{ +// js_global_overloaded_function +Napi::Value $jswrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Value jsresult; + $jslocals + $jscode + return jsresult; + + goto fail; +fail: + return Napi::Value(); +} +%} + + +/* ----------------------------------------------------------------------------- + * js_function_dispatch_case: template for a case used in the function dispatcher + * - $jswrapper: wrapper function name + * - $jsargcount: number of arguments of overloaded function + * - $jsargrequired: minimum number of arguments + * - $jscode: code part of wrapper + * ----------------------------------------------------------------------------- */ +%fragment ("js_function_dispatch_case", "templates") +%{ + // js_function_dispatch_case + if(static_cast(info.Length()) >= $jsargrequired && static_cast(info.Length()) <= $jsargcount) { +#ifdef NAPI_CPP_EXCEPTIONS + bool tryNext = false; + try { + jsresult = $jswrapper(info); + } catch (const Napi::TypeError &) { + tryNext = true; + } catch (const Napi::Error &e) { + throw e; + } + if (!tryNext) + return jsresult; +#else + $jswrapper(info); + if (env.IsExceptionPending()) { + Napi::Error e = env.GetAndClearPendingException(); + Napi::Value typeErrorValue; + bool isTypeError; + Napi::Function typeErrorCons; + // Yes, this is ugly + // TODO: Fix this in Node.js when the core team grows up + NAPI_CHECK_RESULT(env.Global().Get("TypeError"), typeErrorValue); + typeErrorCons = typeErrorValue.As(); + NAPI_CHECK_RESULT(e.Value().InstanceOf(typeErrorCons), isTypeError); + if (!isTypeError) { + // This is not the error you are looking for + e.ThrowAsJavaScriptException(); + SWIG_fail; + } + } else { + return jsresult; + } +#endif + } +%} + +/* ----------------------------------------------------------------------------- + * jsnapi_class_prologue_template: template for a class prologue + * - $jsmangledname: mangled class name + * - $jsparent: mangled name of parent (or SWIG_NAPI_ObjectWrap if none) + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_class_prologue_template", "templates") +%{ + // jsnapi_class_prologue_template + template + class $jsmangledname_templ : public $jsparent_templ { + public: + $jsmangledname_templ(const Napi::CallbackInfo &); + $jsmangledname_templ(bool, const Napi::CallbackInfo &); +%} + + +/* ----------------------------------------------------------------------------- + * jsnapi_class_dtor_declaration: template for a class destructor declaration + * - $jsmangledname: mangled class name + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_class_dtor_declaration", "templates") +%{ + virtual ~$jsmangledname_templ(); +%} + + +/* ----------------------------------------------------------------------------- + * jsnapi_class_method_declaration: template for a class method declaration + * - $jsmangledname: mangled class name + * - $jswrapper: method name + * - $jsstatic: static modifier + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_class_method_declaration", "templates") +%{ + // jsnapi_class_method_declaration + $jsstatic Napi::Value $jswrapper(const Napi::CallbackInfo &); +%} + + +/* ----------------------------------------------------------------------------- + * jsnapi_class_setter_declaration: template for a class method declaration + * - $jsmangledname: mangled class name + * - $jswrapper: method name + * - $jsstatic: static modifier + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_class_setter_declaration", "templates") +%{ + // jsnapi_class_setter_declaration + $jsstatic void $jswrapper(const Napi::CallbackInfo &, const Napi::Value &); +%} + + + +/* ----------------------------------------------------------------------------- + * jsnapi_class_epilogue_template: template for a class epilogue + * - $jsmangledname: mangled class name + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_class_epilogue_template", "templates") +%{ + // jsnapi_class_epilogue_template + static void JS_veto_set_static_variable(const Napi::CallbackInfo &, const Napi::Value &); + void JS_veto_set_variable(const Napi::CallbackInfo &, const Napi::Value &); +}; + +template +void $jsmangledname_templ::JS_veto_set_static_variable(const Napi::CallbackInfo &info, const Napi::Value &value) { + SWIG_NAPI_Raise(info.Env(), "Tried to write read-only variable."); +} + +template +void $jsmangledname_templ::JS_veto_set_variable(const Napi::CallbackInfo &info, const Napi::Value &value) { + SWIG_NAPI_Raise(info.Env(), "Tried to write read-only variable."); +} +%} + + +/* ----------------------------------------------------------------------------- + * jsnapi_class_instance: template for a class declaration instance + * - $jsmangledname: mangled class name + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_declare_class_instance", "templates") +%{ + // jsnapi_class_instance + class $jsmangledname_inst : public $jsmangledname_templ<$jsmangledname_inst> { + public: + using $jsmangledname_templ::$jsmangledname_templ; + virtual ~$jsmangledname_inst() {}; + static void GetMembers( + Napi::Env, + std::map &, + std::map & + ); + static Napi::Function GetClass(Napi::Env); + }; +%} + + +/* + * Inheritance is still not officially supported in NAPI + * Refer to this for my workaround: + * https://mmomtchev.medium.com/c-class-inheritance-with-node-api-and-node-addon-api-c180334d9902 + */ + +/* ----------------------------------------------------------------------------- + * jsnapi_inherited_class_prologue_template: template for a class prologue + * - $jsmangledname: mangled class name + * - $jsparent: mangled name of parent class + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_inherited_class_prologue_template", "templates") +%{ + // jsnapi_inherited_class_prologue_template + SWIG_NAPI_ClientData $jsmangledname_clientData; + template + class $jsmangledname_templ : public $jsparent_templ { + public: + $jsmangledname_templ(const Napi::CallbackInfo& info); +%} + + +/* ----------------------------------------------------------------------------- + * jsnapi_getclass: template for creating a class object + * - $jsname: class name + * - $jsmangledname: mangled class name + * - $jsfunctions: member functions + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_getclass", "templates") +%{ + /* Class: $jsname ($jsmangledname) */ + // jsnapi_getclass +Napi::Function $jsmangledname_inst::GetClass(Napi::Env env) { + std::map members, staticMembers; + GetMembers(env, members, staticMembers); + + std::vector<$jsmangledname_inst::PropertyDescriptor> symbolTable; + for (auto it = members.begin(); it != members.end(); it++) + symbolTable.push_back(it->second); + for (auto it = staticMembers.begin(); it != staticMembers.end(); it++) + symbolTable.push_back(it->second); + + return Napi::ObjectWrap<$jsmangledname_inst>::DefineClass(env, "$jsname", symbolTable); +} + +void $jsmangledname_inst::GetMembers( + Napi::Env env, + std::map &members, + std::map &staticMembers +) { + std::map::PropertyDescriptor> baseMembers, baseStaticMembers; + $jsparent_inst::GetMembers(env, baseMembers, baseStaticMembers); + members.insert(baseMembers.begin(), baseMembers.end()); + staticMembers.insert(staticMembers.begin(), staticMembers.end()); + + /* register wrapper functions */ + $jsnapiwrappers + /* add static class functions and variables */ + $jsnapistaticwrappers +} +%} + +/* ----------------------------------------------------------------------------- + * jsnapi_registerclass: template for regsitering a class object + * - $jsname: class name + * - $jsmangledname: mangled class name + * - $jsparent: parent namespace + * - $jsmangledtype: mangled class type + * - $jsclassidx: class index in the class table + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_registerclass", "templates") +%{ + + /* Class: $jsname ($jsmangledname) */ + // jsnapi_registerclass + Napi::Function $jsmangledname_ctor = $jsmangledname_inst::GetClass(env); + $jsparent.Set("$jsname", $jsmangledname_ctor); + if (SWIGTYPE_$jsmangledtype->clientdata == nullptr) { + SWIGTYPE_$jsmangledtype->clientdata = new size_t($jsclassidx); + } + Napi::FunctionReference *$jsmangledname_ctor_ref = new Napi::FunctionReference(); + *$jsmangledname_ctor_ref = Napi::Persistent($jsmangledname_ctor); + env.GetInstanceData()->ctor[$jsclassidx] = $jsmangledname_ctor_ref; +%} + +/* ----------------------------------------------------------------------------- + * jsnapi_setup_inheritance: setup inheritance between two classes + * - $jsname: class name + * - $jsmangledname: mangled class name + * - $jsparent: mangled name of parent class + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_setup_inheritance", "templates") +%{ + // Inheritance for $jsmangledname ($jsname) <- $jsparent + // jsnapi_setup_inheritance + do { + Napi::Value protoBase, protoSub; + NAPI_CHECK_RESULT($jsmangledname_ctor.Get("prototype"), protoSub); + NAPI_CHECK_RESULT($jsparent_ctor.Get("prototype"), protoBase); + NAPI_CHECK_MAYBE(setProto.Call({$jsmangledname_ctor, $jsparent_ctor})); + NAPI_CHECK_MAYBE(setProto.Call({protoSub, protoBase})); + } while (0); +%} + +/* ----------------------------------------------------------------------------- + * jsnapi_create_namespace: template for a statement that creates a namespace object. + * - $jsmangledname: mangled namespace name + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_create_namespace", "templates") +%{ + // jsnapi_create_namespace + Napi::Object $jsmangledname = Napi::Object::New(env); +%} + +/* ----------------------------------------------------------------------------- + * jsnapi_register_namespace: template for a statement that registers a namespace in a parent namespace. + * - $jsname: name of namespace + * - $jsmangledname: mangled name of namespace + * - $jsparent: mangled name of parent namespace + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_register_namespace", "templates") +%{ + // jsnapi_register_namespace + NAPI_CHECK_MAYBE($jsparent.Set("$jsname", $jsmangledname)); +%} + +/* ----------------------------------------------------------------------------- + * jsnapi_member_function_descriptor: template for a statement that registers a member function. + * - $jsmangledname: mangled class name + * - $jsname: name of the function + * - $jswrapper: wrapper of the member function + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_register_member_function", "templates") +%{ + // jsnapi_member_function_descriptor + members.erase("$jsname"); + members.insert({"$jsname", + $jsmangledname_templ::InstanceMethod("$jsname", + &$jsmangledname_templ::$jswrapper, + static_cast(napi_writable | napi_configurable)) + }); +%} + +/* ----------------------------------------------------------------------------- + * jsnapi_register_member_variable: template for a statement that registers a member variable. + * - $jsname: name of the function + * - $jsmangledname: mangled class name + * - $jsgetter: wrapper of the getter function + * - $jssetter: wrapper of the setter function + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_register_member_variable", "templates") +%{ + // jsnapi_register_member_variable + members.erase("$jsname"); + members.insert({"$jsname", + $jsmangledname_templ::InstanceAccessor("$jsname", + &$jsmangledname_templ::$jsgetter, + &$jsmangledname_templ::$jssetter, + static_cast(napi_writable | napi_enumerable | napi_configurable)) + }); +%} + +/* ----------------------------------------------------------------------------- + * jsnapi_register_static_function: template for a statement that registers a static class function. + * - $jsname: function name + * - $jsmangledname: mangled class name + * - $jswrapper: wrapper of the function + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_register_static_function", "templates") +%{ + // jsnapi_register_static_function + staticMembers.erase("$jsname"); + staticMembers.insert({"$jsname", + StaticMethod("$jsname", + &$jsmangledname_templ::$jswrapper, + static_cast(napi_writable | napi_configurable)) + }); +%} + +/* ----------------------------------------------------------------------------- + * jsnapi_register_static_variable: template for a statement that registers a static variable. + * - $jsname: variable name + * - $jsmangledname: mangled class name + * - $jsgetter: wrapper of the getter function + * - $jssetter: wrapper of the setter function + * ----------------------------------------------------------------------------- */ +%fragment("jsnapi_register_static_variable", "templates") +%{ + // jsnapi_register_static_variable + staticMembers.erase("$jsname"); + staticMembers.insert({"$jsname", + StaticAccessor("$jsname", + &$jsmangledname_templ::$jsgetter, + &$jsmangledname_templ::$jssetter, + static_cast(napi_writable | napi_enumerable | napi_configurable)) + }); +%} diff --git a/usr/share/swig/4.2.1/javascript/napi/javascriptcomplex.swg b/usr/share/swig/4.2.1/javascript/napi/javascriptcomplex.swg new file mode 100644 index 00000000000..3b086440894 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/javascriptcomplex.swg @@ -0,0 +1,116 @@ +/* + Defines the As/From converters for double/float complex, you need to + provide complex Type, the Name you want to use in the converters, + the complex Constructor method, and the Real and Imag complex + accessor methods. + + See the std_complex.i and ccomplex.i for concrete examples. +*/ + +/* the common from converter */ +%define %swig_fromcplx_conv(Type, Real, Imag) +%fragment(SWIG_From_frag(Type),"header", + fragment=SWIG_From_frag(double)) +{ +SWIGINTERNINLINE Napi::Value +SWIG_From_dec(Type)(%ifcplusplus(const Type&, Type) c) +{ + Napi::Array vals = Napi::Array::New(0); + + vals.Set(0, SWIG_From(double)(Real(c))); + vals.Set(1, SWIG_From(double)(Imag(c))); + return vals; +} +} +%enddef + +/* the double case */ +%define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) +%fragment(SWIG_AsVal_frag(Type),"header", + fragment=SWIG_AsVal_frag(double)) +{ +SWIGINTERN int +SWIG_AsVal_dec(Type) (Napi::Value o, Type* val) +{ + if (o.IsArray()) { + Napi::Array array = Napi::Array::Cast(o); + + if (array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); + double re, im; + Napi::Value r; + + r = array.Get(0); + if (!r.IsNumber()) { + return SWIG_TypeError; + } + re = r.ToNumber().DoubleValue(); + + r = array.Get(1); + if (!r.IsNumber()) { + return SWIG_TypeError; + } + im = r.ToNumber().DoubleValue(); + + if (val) *val = Constructor(re, im); + return SWIG_OK; + } else if (o.IsNumber()) { + double d = o.ToNumber().DoubleValue(); + if (val) *val = Constructor(d, 0.0); + return SWIG_OK; + } + return SWIG_TypeError; +} +} +%swig_fromcplx_conv(Type, Real, Imag); +%enddef + +/* the float case */ +%define %swig_cplxflt_conv(Type, Constructor, Real, Imag) +%fragment(SWIG_AsVal_frag(Type),"header", + fragment=SWIG_AsVal_frag(float)) { +SWIGINTERN int +SWIG_AsVal_dec(Type) (Napi::Value o, Type* val) +{ + if (o.IsArray()) { + Napi::Array array = o.As(); + + if (array.Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); + double re, im; + Napi::Value r; + + r = array.Get(0); + if (!r.IsNumber()) { + return SWIG_TypeError; + } + re = r.ToNumber().DoubleValue(); + + r = array.Get(1); + if (!r.IsNumber()) { + return SWIG_TypeError; + } + im = r.ToNumber().DoubleValue(); + + if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { + if (val) *val = Constructor(%numeric_cast(re, float), + %numeric_cast(im, float)); + return SWIG_OK; + } else { + return SWIG_OverflowError; + } + } else if (o.IsNumber()) { + float f = static_cast(o.ToNumber().DoubleValue()); + if (val) *val = Constructor(f, 0.0); + return SWIG_OK; + } + return SWIG_TypeError; +} +} +%swig_fromcplx_conv(Type, Real, Imag); +%enddef + +#define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ +%swig_cplxflt_conv(Type, Constructor, Real, Imag) + + +#define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ +%swig_cplxdbl_conv(Type, Constructor, Real, Imag) diff --git a/usr/share/swig/4.1.1/javascript/v8/javascriptfragments.swg b/usr/share/swig/4.2.1/javascript/napi/javascriptfragments.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/javascriptfragments.swg rename to usr/share/swig/4.2.1/javascript/napi/javascriptfragments.swg diff --git a/usr/share/swig/4.2.1/javascript/napi/javascriptinit.swg b/usr/share/swig/4.2.1/javascript/napi/javascriptinit.swg new file mode 100644 index 00000000000..e8b3d38c700 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/javascriptinit.swg @@ -0,0 +1,111 @@ +%insert(header) %{ +#include +%} + +%insert(init) %{ + +EnvInstanceData::EnvInstanceData(Napi::Env env, swig_module_info *swig_module) : +env(env), SWIG_NAPI_ObjectWrapCtor(nullptr), ctor(nullptr), swig_module(swig_module) { + ctor = new Napi::FunctionReference*[swig_module->size + 1]; + for (size_t i = 0; i <= swig_module->size; i++) { + ctor[i] = nullptr; + } +} + +EnvInstanceData::~EnvInstanceData() { + for (size_t i = 0; i <= swig_module->size; i++) { + if (ctor[i] != nullptr) + delete ctor[i]; + ctor[i] = nullptr; + } + delete [] ctor; + delete SWIG_NAPI_ObjectWrapCtor; +} + +SWIGRUNTIME void +SWIG_NAPI_SetModule(Napi::Env env, swig_module_info *swig_module) { + auto data = new EnvInstanceData(env, swig_module); + env.SetInstanceData(data); +} + +SWIGRUNTIME swig_module_info * +SWIG_NAPI_GetModule(Napi::Env env) { + auto data = env.GetInstanceData(); + if (data == nullptr) return nullptr; + return data->swig_module; +} + +#define SWIG_GetModule(clientdata) SWIG_NAPI_GetModule(clientdata) +#define SWIG_SetModule(clientdata, pointer) SWIG_NAPI_SetModule(clientdata, pointer) +#define SWIG_INIT_CLIENT_DATA_TYPE Napi::Env + +%} + +%insert(init) "swiginit.swg" + +// Open the initializer function definition here + +%fragment ("js_initializer_define", "templates") %{ +#define SWIG_NAPI_INIT $jsname_initialize +%} + +%insert(init) %{ +Napi::Object Init(Napi::Env env, Napi::Object exports) { + SWIG_InitializeModule(env); +%} + +/* ----------------------------------------------------------------------------- + * js_init_inheritance: template for enabling the inheritance + * ----------------------------------------------------------------------------- */ +%fragment("js_init_inheritance", "templates") +%{ + Napi::Value jsObjectValue, jsSetProtoValue; + Napi::Object jsObject; + Napi::Function setProto; + NAPI_CHECK_RESULT(env.Global().Get("Object"), jsObjectValue); + NAPI_CHECK_RESULT(jsObjectValue.ToObject(), jsObject); + NAPI_CHECK_RESULT(jsObject.Get("setPrototypeOf"), jsSetProtoValue); + setProto = jsSetProtoValue.As(); +%} + +/* ----------------------------------------------------------------------------- + * js_initializer: template for the module initializer function + * - $jsname: module name + * - $jsnapipreinheritance: the previous template + * - $jsnapinspaces: part with code creating namespace objects + * - $jsnapiwrappers: part with code that registers wrapper functions + * - $jsnapiinitinheritance: part with inherit statements + * - $jsnapistaticwrappers: part with code adding static functions to class objects + * - $jsnapiregisterclasses: part with code that registers class objects in namespaces + * - $jsnapiregisternspaces: part with code that registers namespaces in parent namespaces + * ----------------------------------------------------------------------------- */ +%fragment("js_initializer", "templates") +%{ + Napi::Function SWIG_NAPI_ObjectWrap_ctor = SWIG_NAPI_ObjectWrap_inst::GetClass(env); + Napi::FunctionReference *SWIG_NAPI_ObjectWrap_ctor_ref = new Napi::FunctionReference(); + *SWIG_NAPI_ObjectWrap_ctor_ref = Napi::Persistent(SWIG_NAPI_ObjectWrap_ctor); + env.GetInstanceData()->SWIG_NAPI_ObjectWrapCtor = SWIG_NAPI_ObjectWrap_ctor_ref; + + /* create objects for namespaces */ + $jsnapinspaces + + /* register classes */ + $jsnapiregisterclasses + + /* enable inheritance */ + $jsnapipreinheritance + + /* setup inheritances */ + $jsnapiinitinheritance + + /* create and register namespace objects */ + $jsnapiregisternspaces + + return exports; + goto fail; +fail: + return Napi::Object(); +} + +NODE_API_MODULE($jsname, Init) +%} diff --git a/usr/share/swig/4.2.1/javascript/napi/javascriptprimtypes.swg b/usr/share/swig/4.2.1/javascript/napi/javascriptprimtypes.swg new file mode 100644 index 00000000000..e6224f917d4 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/javascriptprimtypes.swg @@ -0,0 +1,387 @@ +/* ------------------------------------------------------------ + * Primitive Types + * ------------------------------------------------------------ */ + +/* boolean */ + +%fragment(SWIG_From_frag(bool),"header", "header") { +SWIGINTERN +Napi::Value SWIG_From_bool(Napi::Env env, bool val) +{ + return Napi::Boolean::New(env, val); +} +} + + +%fragment(SWIG_AsVal_frag(bool),"header", + fragment=SWIG_AsVal_frag(long)) { +SWIGINTERN +int SWIG_AsVal_dec(bool)(Napi::Value obj, bool *val) +{ + if(!obj.IsBoolean()) { + return SWIG_TypeError; + } + + Napi::Boolean b; + NAPI_CHECK_RESULT(obj.ToBoolean(), b); + if (val) *val = b.Value(); + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} +} + +/* char */ + +%fragment(SWIG_From_frag(unsigned char), "header") { +SWIGINTERNINLINE Napi::Value +SWIG_From_unsigned_SS_char(Napi::Env env, unsigned char c) +{ + return Napi::Number::New(env, static_cast(c)); +} +} + + +%fragment(SWIG_From_frag(signed char), "header") { +SWIGINTERNINLINE Napi::Value +SWIG_From_signed_SS_char(Napi::Env env, signed char c) +{ + return Napi::Number::New(env, static_cast(c)); +} +} + +/* int */ + +%fragment(SWIG_From_frag(int), "header") { +SWIGINTERN +Napi::Value SWIG_From_int(Napi::Env env, int val) +{ + return Napi::Number::New(env, val); +} +} + +%fragment(SWIG_AsVal_frag(int),"header") { +SWIGINTERN +int SWIG_AsVal_dec(int)(Napi::Value valRef, int* val) +{ + if (!valRef.IsNumber()) { + return SWIG_TypeError; + } + if (val) { + Napi::Number num; + NAPI_CHECK_RESULT(valRef.ToNumber(), num); + *val = static_cast(num.Int32Value()); + } + + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} +} + + +/* unsigned int */ + +%fragment(SWIG_From_frag(unsigned int), "header") { +SWIGINTERN +Napi::Value SWIG_From_unsigned_SS_int(Napi::Env env, unsigned int val) +{ + return Napi::Number::New(env, val); +} +} + +%fragment(SWIG_AsVal_frag(unsigned int),"header") { +SWIGINTERN +int SWIG_AsVal_dec(unsigned int)(Napi::Value valRef, unsigned int* val) +{ + if (!valRef.IsNumber()) { + return SWIG_TypeError; + } + if (val) { + Napi::Number num; + NAPI_CHECK_RESULT(valRef.ToNumber(), num); + if (num.Int64Value() < 0) { + return SWIG_TypeError; + } + *val = static_cast(num.Uint32Value()); + } + + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} +} + + +/* short */ + +%fragment("SWIG_Env_FromShort", "header") { +SWIGINTERN +Napi::Value SWIG_From_short(Napi::Env env, short val) +{ + return Napi::Number::New(env, val); +} +} + +%fragment(SWIG_AsVal_frag(short),"header") { +SWIGINTERN +int SWIG_AsVal_dec(short)(Napi::Value valRef, short* val) +{ + if (!valRef.IsNumber()) { + return SWIG_TypeError; + } + if (val) { + Napi::Number num; + NAPI_CHECK_RESULT(valRef.ToNumber(), num); + *val = static_cast(num.Int32Value()); + } + + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} +} + + +/* unsigned short */ + +%fragment(SWIG_From_frag(unsigned short), "header") { +SWIGINTERN +Napi::Value SWIG_From_unsigned_SS_short(Napi::Env env, unsigned short val) +{ + return Napi::Number::New(env, val); +} +} + +%fragment(SWIG_AsVal_frag(unsigned short),"header") { +SWIGINTERN +int SWIG_AsVal_dec(unsigned short)(Napi::Value valRef, unsigned short* val) +{ + if (!valRef.IsNumber()) { + return SWIG_TypeError; + } + if (val) { + Napi::Number num; + NAPI_CHECK_RESULT(valRef.ToNumber(), num); + if (num.Int64Value() < 0) { + return SWIG_TypeError; + } + *val = static_cast(num.Uint32Value()); + } + + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} +} + + +/* long */ + +%fragment(SWIG_From_frag(long), "header") { +SWIGINTERN +Napi::Value SWIG_From_long(Napi::Env env, long val) +{ + return Napi::Number::New(env, val); +} +} + +%fragment(SWIG_AsVal_frag(long),"header", + fragment="SWIG_CanCastAsInteger") { +SWIGINTERN +int SWIG_AsVal_dec(long)(Napi::Value obj, long* val) +{ + if (!obj.IsNumber()) { + return SWIG_TypeError; + } + if (val) { + Napi::Number num; + NAPI_CHECK_RESULT(obj.ToNumber(), num); + *val = static_cast(num.Int64Value()); + } + + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} +} + +/* unsigned long */ + +%fragment(SWIG_From_frag(unsigned long), "header") { +SWIGINTERN +Napi::Value SWIG_From_unsigned_SS_long(Napi::Env env, unsigned long val) +{ + return Napi::Number::New(env, val); +} +} + +%fragment(SWIG_AsVal_frag(unsigned long),"header", + fragment="SWIG_CanCastAsInteger") { +SWIGINTERN +int SWIG_AsVal_dec(unsigned long)(Napi::Value obj, unsigned long *val) +{ + if(!obj.IsNumber()) { + return SWIG_TypeError; + } + if (val) { + Napi::Number num; + NAPI_CHECK_RESULT(obj.ToNumber(), num); + if (num.Int64Value() < 0) { + return SWIG_TypeError; + } + *val = static_cast(num.Int64Value()); + } + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} +} + +/* long long */ + +%fragment(SWIG_From_frag(long long), "header", fragment="SWIG_LongLongAvailable") { +%#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERN +Napi::Value SWIG_From_long_SS_long(Napi::Env env, long long val) +{ + return Napi::Number::New(env, val); +} +%#endif +} + +%fragment(SWIG_AsVal_frag(long long),"header", + fragment=SWIG_AsVal_frag(long), + fragment="SWIG_CanCastAsInteger", + fragment="SWIG_LongLongAvailable") { +%#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERN +int SWIG_AsVal_dec(long long)(Napi::Value obj, long long* val) +{ + if(!obj.IsNumber()) { + return SWIG_TypeError; + } + + if (val) { + Napi::Number num; + NAPI_CHECK_RESULT(obj.ToNumber(), num); + *val = static_cast(num.Int64Value()); + } + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} +%#endif +} + +/* unsigned long long */ + +%fragment(SWIG_From_frag(unsigned long long), "header", fragment="SWIG_LongLongAvailable") { +%#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERN +Napi::Value SWIG_From_unsigned_SS_long_SS_long(Napi::Env env, unsigned long long val) +{ + return Napi::Number::New(env, val); +} +%#endif +} + + +%fragment(SWIG_AsVal_frag(unsigned long long),"header", + fragment=SWIG_AsVal_frag(unsigned long), + fragment="SWIG_CanCastAsInteger", + fragment="SWIG_LongLongAvailable") { +%#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERN +int SWIG_AsVal_dec(unsigned long long)(Napi::Value obj, unsigned long long *val) +{ + if(!obj.IsNumber()) { + return SWIG_TypeError; + } + if (obj.ToNumber().Int64Value() < 0) { + return SWIG_TypeError; + } + if (val) { + Napi::Number num; + NAPI_CHECK_RESULT(obj.ToNumber(), num); + *val = static_cast(num.Int64Value()); + } + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} +%#endif +} + + +/* float */ + +%fragment(SWIG_From_frag(float), "header") { +SWIGINTERN +Napi::Value SWIG_From_float(Napi::Env env, float val) +{ + return Napi::Number::New(env, val); +} +} + +%fragment(SWIG_AsVal_frag(float),"header") { +SWIGINTERN +int SWIG_AsVal_dec(float)(Napi::Value obj, float *val) +{ + if(!obj.IsNumber()) { + return SWIG_TypeError; + } + + if(val) { + Napi::Number num; + NAPI_CHECK_RESULT(obj.ToNumber(), num); + *val = static_cast(num.DoubleValue()); + } + + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} +} + + +/* double */ + +%fragment(SWIG_From_frag(double), "header") { +SWIGINTERN +Napi::Value SWIG_From_double(Napi::Env env, double val) +{ + return Napi::Number::New(env, val); +} +} + +%fragment(SWIG_AsVal_frag(double),"header") { +SWIGINTERN +int SWIG_AsVal_dec(double)(Napi::Value obj, double *val) +{ + if(!obj.IsNumber()) { + return SWIG_TypeError; + } + + if(val) { + Napi::Number num; + NAPI_CHECK_RESULT(obj.ToNumber(), num); + *val = static_cast(num.DoubleValue()); + } + + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} +} diff --git a/usr/share/swig/4.2.1/javascript/napi/javascriptrun.swg b/usr/share/swig/4.2.1/javascript/napi/javascriptrun.swg new file mode 100644 index 00000000000..ce698fe1054 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/javascriptrun.swg @@ -0,0 +1,446 @@ +/* --------------------------------------------------------------------------- + * Error handling + * + * ---------------------------------------------------------------------------*/ + +/* + * We support several forms: + * + * SWIG_Raise("Error message") + * which creates an Error object with the error message + * + * SWIG_Raise(SWIG_TypeError, "Type error") + * which creates the specified error type with the message + * + * SWIG_Raise(obj) + * which throws the object itself + * + * SWIG_Raise(obj, "Exception const &", SWIGType_p_Exception) + * which also throws the object itself and discards the unneeded extra type info + * + * These must be functions instead of macros to use the C++ overloading to + * resolve the arguments + */ +#define SWIG_exception(code, msg) SWIG_Error(code, msg) +#define SWIG_fail goto fail + +#ifdef NAPI_CPP_EXCEPTIONS + +#define SWIG_Error(code, msg) SWIG_NAPI_Raise(env, code, msg) +#define NAPI_CHECK_MAYBE(maybe) (maybe) +#define NAPI_CHECK_RESULT(maybe, result) (result = maybe) + +SWIGINTERN void SWIG_NAPI_Raise(Napi::Env env, const char *msg) { + throw Napi::Error::New(env, msg); +} + +SWIGINTERN void SWIG_NAPI_Raise(Napi::Env env, int type, const char *msg) { + switch(type) { + default: + case SWIG_IOError: + case SWIG_MemoryError: + case SWIG_SystemError: + case SWIG_RuntimeError: + case SWIG_DivisionByZero: + case SWIG_SyntaxError: + throw Napi::Error::New(env, msg); + case SWIG_OverflowError: + case SWIG_IndexError: + throw Napi::RangeError::New(env, msg); + case SWIG_ValueError: + case SWIG_TypeError: + throw Napi::TypeError::New(env, msg); + } +} + +SWIGINTERN void SWIG_NAPI_Raise(Napi::Env env, Napi::Value obj, + const char *msg = nullptr, swig_type_info *info = nullptr) { + throw Napi::Error(env, obj); +} + +#else + +#define SWIG_Error(code, msg) do { SWIG_NAPI_Raise(env, code, msg); SWIG_fail; } while (0) +#define NAPI_CHECK_MAYBE(maybe) do { if (maybe.IsNothing()) SWIG_fail; } while (0) +#define NAPI_CHECK_RESULT(maybe, result) \ + do { \ + auto r = maybe; \ + if (r.IsNothing()) SWIG_fail; \ + result = r.Unwrap(); \ + } while (0) + +SWIGINTERN void SWIG_NAPI_Raise(Napi::Env env, const char *msg) { + Napi::Error::New(env, msg).ThrowAsJavaScriptException(); +} + +SWIGINTERN void SWIG_NAPI_Raise(Napi::Env env, int type, const char *msg) { + switch(type) { + default: + case SWIG_IOError: + case SWIG_MemoryError: + case SWIG_SystemError: + case SWIG_RuntimeError: + case SWIG_DivisionByZero: + case SWIG_SyntaxError: + Napi::Error::New(env, msg).ThrowAsJavaScriptException(); + return; + case SWIG_OverflowError: + case SWIG_IndexError: + Napi::RangeError::New(env, msg).ThrowAsJavaScriptException(); + return; + case SWIG_ValueError: + case SWIG_TypeError: + Napi::TypeError::New(env, msg).ThrowAsJavaScriptException(); + return; + } +} + +SWIGINTERN void SWIG_NAPI_Raise(Napi::Env env, Napi::Value obj, + const char *msg = nullptr, swig_type_info *info = nullptr) { + Napi::Error(env, obj).ThrowAsJavaScriptException(); +} + +#endif + +void JS_veto_set_variable(const Napi::CallbackInfo &info) { + SWIG_NAPI_Raise(info.Env(), "Tried to write read-only variable."); +} + +struct EnvInstanceData { + Napi::Env env; + // Base class per-environment constructor, used to check + // if a JS object is a SWIG wrapper + Napi::FunctionReference *SWIG_NAPI_ObjectWrapCtor; + // Per-environment wrapper constructors, indexed by the number in + // swig_type->clientdata + Napi::FunctionReference **ctor; + swig_module_info *swig_module; + EnvInstanceData(Napi::Env, swig_module_info *); + ~EnvInstanceData(); +}; + +typedef size_t SWIG_NAPI_ClientData; + +// Base class for all wrapped objects, +// used mostly when unwrapping unknown objects +template +class SWIG_NAPI_ObjectWrap_templ : public Napi::ObjectWrap { + public: + void *self; + bool owned; + size_t size; + swig_type_info *info; + SWIG_NAPI_ObjectWrap_templ(const Napi::CallbackInfo &info); + SWIG_NAPI_ObjectWrap_templ(bool, const Napi::CallbackInfo &info) : + Napi::ObjectWrap(info), + self(nullptr), + owned(true), + size(0), + info(nullptr) + {} + virtual ~SWIG_NAPI_ObjectWrap_templ() {}; + + Napi::Value ToString(const Napi::CallbackInfo &info); +}; + +template +SWIG_NAPI_ObjectWrap_templ::SWIG_NAPI_ObjectWrap_templ(const Napi::CallbackInfo &info) : + Napi::ObjectWrap(info), size(0), info(nullptr) { + Napi::Env env = info.Env(); + if (info.Length() == 1 && info[0].IsExternal()) { + // This constructor has been called internally from C++/SWIG + // to wrap an already existing C++ object of unknown type in JS + this->self = info[0].As>().Data(); + this->owned = false; + } else { + SWIG_Error(SWIG_ERROR, "This constructor is not accessible from JS"); + } + return; + goto fail; +fail: + return; +} + +template +Napi::Value SWIG_NAPI_ObjectWrap_templ::ToString(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + static char repr[128]; + const char *name = SWIG_TypePrettyName(this->info); + snprintf(repr, sizeof(repr), "{SwigObject %s (%s) at %p %s}", + this->info ? this->info->name : "unknown", + name ? name : "unknown", + this->self, + this->owned ? "[owned]" : "[copy]"); + return Napi::String::New(env, repr); +} + +class SWIG_NAPI_ObjectWrap_inst : public SWIG_NAPI_ObjectWrap_templ { +public: + using SWIG_NAPI_ObjectWrap_templ::SWIG_NAPI_ObjectWrap_templ; + static Napi::Function GetClass(Napi::Env); + static void GetMembers( + Napi::Env, + std::map &, + std::map & + ); +}; + +void SWIG_NAPI_ObjectWrap_inst::GetMembers( + Napi::Env env, + std::map &members, + std::map & +) { + members.erase("toString"); + members.insert({"toString", SWIG_NAPI_ObjectWrap_templ::InstanceMethod("toString", &SWIG_NAPI_ObjectWrap_templ::ToString)}); +} + +Napi::Function SWIG_NAPI_ObjectWrap_inst::GetClass(Napi::Env env) { + return Napi::ObjectWrap::DefineClass(env, "SwigObject", {}); +} + +SWIGRUNTIME int SWIG_NAPI_ConvertInstancePtr(Napi::Object objRef, void **ptr, swig_type_info *info, int flags) { + SWIG_NAPI_ObjectWrap_inst *ow; + Napi::Env env = objRef.Env(); + if(!objRef.IsObject()) return SWIG_ERROR; + + // Check if this is a SWIG wrapper + Napi::FunctionReference *ctor = env.GetInstanceData()->SWIG_NAPI_ObjectWrapCtor; + bool instanceOf; + NAPI_CHECK_RESULT(objRef.InstanceOf(ctor->Value()), instanceOf); + if (!instanceOf) { + return SWIG_TypeError; + } + + ow = Napi::ObjectWrap::Unwrap(objRef); + + // Now check if the SWIG type is compatible unless the types match exactly or the type is unknown + if(info && ow->info != info && ow->info != nullptr) { + swig_cast_info *tc = SWIG_TypeCheckStruct(ow->info, info); + if (!tc && ow->info->name) { + tc = SWIG_TypeCheck(ow->info->name, info); + } + bool type_valid = tc != 0; + if(!type_valid) { + return SWIG_TypeError; + } + int newmemory = 0; + *ptr = SWIG_TypeCast(tc, ow->self, &newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } else { + *ptr = ow->self; + } + + if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !ow->owned) { + return SWIG_ERROR_RELEASE_NOT_OWNED; + } else { + if (flags & SWIG_POINTER_DISOWN) { + ow->owned = false; + } + if (flags & SWIG_POINTER_CLEAR) { + ow->self = nullptr; + } + } + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} + + +SWIGRUNTIME int SWIG_NAPI_GetInstancePtr(Napi::Value valRef, void **ptr) { + SWIG_NAPI_ObjectWrap_inst *ow; + if(!valRef.IsObject()) { + return SWIG_TypeError; + } + Napi::Object objRef; + NAPI_CHECK_RESULT(valRef.ToObject(), objRef); + ow = Napi::ObjectWrap::Unwrap(objRef); + + if(ow->self == nullptr) { + return SWIG_ERROR; + } + + *ptr = ow->self; + return SWIG_OK; + goto fail; +fail: + return SWIG_ERROR; +} + + +SWIGRUNTIME int SWIG_NAPI_ConvertPtr(Napi::Value valRef, void **ptr, swig_type_info *info, int flags) { + // special case: JavaScript null => C NULL pointer + if (valRef.IsNull()) { + *ptr=0; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; + } + + if (!valRef.IsObject()) { + return SWIG_TypeError; + } + + Napi::Object objRef; + NAPI_CHECK_RESULT(valRef.ToObject(), objRef); + return SWIG_NAPI_ConvertInstancePtr(objRef, ptr, info, flags); + goto fail; +fail: + return SWIG_ERROR; +} + +SWIGRUNTIME Napi::Value SWIG_NAPI_NewPointerObj(Napi::Env env, void *ptr, swig_type_info *info, int flags) { + Napi::External native; + Napi::FunctionReference *ctor; + + if (ptr == nullptr) { + return env.Null(); + } + native = Napi::External::New(env, ptr); + + size_t *idx = info != nullptr ? + reinterpret_cast(info->clientdata) : + nullptr; + if (idx == nullptr) { + // This type does not have a dedicated wrapper + ctor = env.GetInstanceData()->SWIG_NAPI_ObjectWrapCtor; + } else { + ctor = env.GetInstanceData()->ctor[*idx]; + } + + Napi::Value wrapped; + NAPI_CHECK_RESULT(ctor->New({native}), wrapped); + + // Preserve the type even if using the generic wrapper + if (idx == nullptr && info != nullptr) { + Napi::Object obj; + NAPI_CHECK_RESULT(wrapped.ToObject(), obj); + Napi::ObjectWrap::Unwrap(obj)->info = info; + } + + if ((flags & SWIG_POINTER_OWN) == SWIG_POINTER_OWN) { + Napi::Object obj; + NAPI_CHECK_RESULT(wrapped.ToObject(), obj); + Napi::ObjectWrap::Unwrap(obj)->owned = true; + } + + return wrapped; + goto fail; +fail: + return Napi::Value(); +} + +#define SWIG_ConvertPtr(obj, ptr, info, flags) SWIG_NAPI_ConvertPtr(obj, ptr, info, flags) +#define SWIG_NewPointerObj(ptr, info, flags) SWIG_NAPI_NewPointerObj(env, ptr, info, flags) + +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_NAPI_ConvertInstancePtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_NAPI_NewPointerObj(env, thisvalue, type, flags) + +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_NAPI_ConvertPtr(obj, pptr, type, 0) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NAPI_NewPointerObj(env, ptr, type, 0) + +#define SWIG_GetInstancePtr(obj, ptr) SWIG_NAPI_GetInstancePtr(obj, ptr) + +SWIGRUNTIME Napi::Value _SWIG_NAPI_wrap_equals(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Value jsresult; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + bool result; + int res1; + int res2; + + if(info.Length() != 1) SWIG_Error(SWIG_ERROR, "Illegal number of arguments for equals."); + + res1 = SWIG_GetInstancePtr(info.This(), &arg1); + if (!SWIG_IsOK(res1)) { + SWIG_Error(SWIG_ERROR, "Could not get pointer from 'this' object for equals."); + } + res2 = SWIG_GetInstancePtr(info[0], &arg2); + if (!SWIG_IsOK(res2)) { + SWIG_Error(SWIG_ArgError(res2), " in method '" "equals" "', argument " "1"" of type '" "void *""'"); + } + + result = (bool)(arg1 == arg2); + jsresult = Napi::Boolean::New(env, result); + + return jsresult; + goto fail; +fail: + return Napi::Value(); +} + +SWIGRUNTIME Napi::Value _wrap_getCPtr(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + Napi::Value jsresult; + void *arg1 = (void *) 0 ; + long result; + int res1; + + res1 = SWIG_GetInstancePtr(info.This(), &arg1); + if (!SWIG_IsOK(res1)) { + SWIG_Error(SWIG_ArgError(res1), " in method '" "getCPtr" "', argument " "1"" of type '" "void *""'"); + } + + result = (long)arg1; + jsresult = Napi::Number::New(env, result); + + return jsresult; + goto fail; +fail: + return Napi::Value(); +} + + +/* --------------------------------------------------------------------------- + * PackedData object + * (objects visible to JS that do not have a dedicated wrapper but must preserve type) + * ---------------------------------------------------------------------------*/ + +SWIGRUNTIME +Napi::Value SWIG_NAPI_NewPackedObj(Napi::Env env, void *data, size_t size, swig_type_info *type) { + void *data_copy = new uint8_t[size]; + memcpy(data_copy, data, size); + Napi::Value val = SWIG_NAPI_NewPointerObj(env, data_copy, type, SWIG_POINTER_OWN); + Napi::Object obj; + if (val.IsEmpty()) goto fail; + + NAPI_CHECK_RESULT(val.ToObject(), obj); + Napi::ObjectWrap::Unwrap(obj)->size = size; + +fail: + return val; +} + +SWIGRUNTIME +int SWIG_NAPI_ConvertPacked(Napi::Value valRef, void *ptr, size_t size, swig_type_info *type) { + void *tmp; + if (!SWIG_IsOK(SWIG_NAPI_ConvertPtr(valRef, &tmp, type, 0))) { + return SWIG_ERROR; + } + memcpy(ptr, tmp, size); + return SWIG_OK; +} + +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_NAPI_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NAPI_NewPackedObj(env, ptr, sz, type) + + +/* --------------------------------------------------------------------------- + * Support for IN/OUTPUT typemaps (see Lib/typemaps/inoutlist.swg) + * + * ---------------------------------------------------------------------------*/ + +SWIGRUNTIME + +Napi::Value SWIG_NAPI_AppendOutput(Napi::Env env, Napi::Value result, Napi::Value obj) { + if (result.IsUndefined()) { + result = Napi::Array::New(env); + } else if (!result.IsArray()) { + Napi::Array tmparr = Napi::Array::New(env); + tmparr.Set(static_cast(0), result); + result = tmparr; + } + + Napi::Array arr = result.As(); + arr.Set(arr.Length(), obj); + return arr; +} diff --git a/usr/share/swig/4.2.1/javascript/napi/javascriptruntime.swg b/usr/share/swig/4.2.1/javascript/napi/javascriptruntime.swg new file mode 100644 index 00000000000..42f11ed8c32 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/javascriptruntime.swg @@ -0,0 +1,40 @@ +/* ----------------------------------------------------------------------------- + * javascriptruntime.swg + * + * ----------------------------------------------------------------------------- */ + +// NAPI +// ---------- + +%insert(runtime) %{ +#if defined(_CPPUNWIND) || defined(__EXCEPTIONS) +#define NAPI_CPP_EXCEPTIONS +#else +#define NAPI_DISABLE_CPP_EXCEPTIONS +#define NODE_ADDON_API_ENABLE_MAYBE +#endif + +// This gives us +// Branch Node.js v10.x - from v10.20.0 +// Branch Node.js v12.x - from v12.17.0 +// Everything from Node.js v14.0.0 on +// Our limiting feature is napi_set_instance_data +#ifndef NAPI_VERSION +#define NAPI_VERSION 6 +#elif NAPI_VERSION < 6 +#error NAPI_VERSION 6 is the minimum supported target (Node.js >=14, >=12.17, >=10.20) +#endif +#include + +#include +#include +#include +#include +#include +%} + +%insert(runtime) "swigrun.swg"; /* SWIG API */ +%insert(runtime) "swigerrors.swg"; /* SWIG errors */ + +%insert(runtime) "javascriptrun.swg" + diff --git a/usr/share/swig/4.2.1/javascript/napi/javascriptstrings.swg b/usr/share/swig/4.2.1/javascript/napi/javascriptstrings.swg new file mode 100644 index 00000000000..7293c7b0fb9 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/javascriptstrings.swg @@ -0,0 +1,77 @@ + +/* ------------------------------------------------------------ + * utility methods for char strings + * ------------------------------------------------------------ */ +%fragment("SWIG_AsCharPtrAndSize", "header", fragment="SWIG_pchar_descriptor") { +SWIGINTERN int +SWIG_AsCharPtrAndSize(Napi::Value valRef, char** cptr, size_t* psize, int *alloc) +{ + if(valRef.IsString()) { + Napi::String js_str; + NAPI_CHECK_RESULT(valRef.ToString(), js_str); + + std::string str = js_str.Utf8Value(); + size_t len = str.size() + 1; + char* cstr = (char*) %new_array(len, char); + memcpy(cstr, str.data(), len); + + if(alloc) *alloc = SWIG_NEWOBJ; + if(psize) *psize = len; + if(cptr) *cptr = cstr; + + return SWIG_OK; + } else { + if(valRef.IsObject()) { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + Napi::Object obj; + NAPI_CHECK_RESULT(valRef.ToObject(), obj); + // try if the object is a wrapped char[] + if (pchar_descriptor) { + void* vptr = 0; + if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = (char *) vptr; + if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + } + } + goto fail; +fail: + return SWIG_TypeError; +} +} + + +%fragment(SWIG_From_frag(char), "header") { +SWIGINTERNINLINE Napi::Value +SWIG_From_char(Napi::Env env, char c) +{ + Napi::String js_str = Napi::String::New(env, &c, 1); + return js_str; +} +} + + +%fragment("SWIG_FromCharPtr", "header", fragment = "SWIG_FromCharPtrAndSize") { +// Override the default one with an empty one +} + +%fragment("SWIG_FromCharPtrAndSize", "header") { +SWIGINTERNINLINE Napi::Value +SWIG_Env_FromCharPtrAndSize(Napi::Env env, const char* carray, size_t size) +{ + if (carray) { + Napi::String js_str = Napi::String::New(env, carray, size); + return js_str; + } else { + return env.Undefined(); + } +} +} + +%insert(runtime) %{ +#define SWIG_FromCharPtrAndSize(cptr, size) SWIG_Env_FromCharPtrAndSize(env, cptr, size) +#define SWIG_FromCharPtr(cptr) SWIG_Env_FromCharPtrAndSize(env, cptr, strlen(cptr)) +%} diff --git a/usr/share/swig/4.2.1/javascript/napi/javascripttypemaps.swg b/usr/share/swig/4.2.1/javascript/napi/javascripttypemaps.swg new file mode 100644 index 00000000000..d7d21be2e71 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/javascripttypemaps.swg @@ -0,0 +1,56 @@ +/* ------------------------------------------------------------ + * Typemap specializations for Javascript + * ------------------------------------------------------------ */ + +/* ------------------------------------------------------------ + * Fragment section + * ------------------------------------------------------------ */ + +/* These macros are necessary to provide an extra parameter + to SWIG_AsVal_dec functions (Napi::Env environment). + They must be defined before including `typemaps/fragments.swg` +*/ +#define SWIG_FROM_DECL_ARGS SWIG_NAPI_FROM_DECL_ARGS +#define SWIG_FROM_CALL_ARGS SWIG_NAPI_FROM_CALL_ARGS + +/* Include fundamental fragemt definitions */ +%include + +/* Look for user fragments file. */ +%include + +/* Javascript fragments for fundamental types */ +%include + +/* Javascript fragments for char* strings */ +%include + + +/* ------------------------------------------------------------ + * Unified typemap section + * ------------------------------------------------------------ */ + +/* Javascript types */ + +#define SWIG_Object Napi::Value +#define VOID_Object env.Undefined() + +/* Overload of the output/constant/exception/dirout handling */ + +/* append output */ +#define SWIG_AppendOutput(result, obj) SWIG_NAPI_AppendOutput(env, result, obj) + +/* set constant */ +#define SWIG_SetConstant(name, obj) + +/* raise */ +#define SWIG_Raise(...) SWIG_NAPI_Raise(env, __VA_ARGS__) + +%insert("runtime") %{ +#define SWIG_NAPI_FROM_DECL_ARGS(arg1) (Napi::Env env, arg1) +#define SWIG_NAPI_FROM_CALL_ARGS(arg1) (env, arg1) +%} + + +/* Include the unified typemap library */ +%include diff --git a/usr/share/swig/4.2.1/javascript/napi/nodejs_buffer.i b/usr/share/swig/4.2.1/javascript/napi/nodejs_buffer.i new file mode 100644 index 00000000000..d95ba2d6529 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/napi/nodejs_buffer.i @@ -0,0 +1,47 @@ +/* + * To include generic versions of the in typemaps, add: + * + * %typemap(in) (void *, size_t) = (const void* buffer_data, const size_t buffer_len); + * %typemap(typecheck) (void *, size_t) = (const void* buffer_data, const size_t buffer_len); + * + * or to discriminate by argument names: + * %typemap(in) (void *data, size_t length) = (const void* buffer_data, const size_t buffer_len); + * %typemap(typecheck) (void *data, size_t length) = (const void* buffer_data, const size_t buffer_len); + */ + +%typemap(in) (const void* buffer_data, const size_t buffer_len) { + if ($input.IsBuffer()) { + Napi::Buffer buf = $input.As>(); + $1 = reinterpret_cast(buf.Data()); + $2 = buf.ByteLength(); + } else { + SWIG_exception_fail(SWIG_TypeError, "in method '$symname', argument is not a Buffer"); + } +} + +%typemap(typecheck, precedence=SWIG_TYPECHECK_VOIDPTR) (const void* buffer_data, const size_t buffer_len) { + $1 = $input.IsBuffer(); +} + + +/* + * In order to use the argout typemap, the function must have the following signature: + * + * void buffer(void **buffer_data, size_t *buffer_len) + * + * In this case, this function will be wrapped by a JS function that takes + * no arguments (because of numinputs=0) and returns a Buffer + */ + +%typemap(in, numinputs=0) (void **buffer_data, size_t *buffer_len) (void *temp_data, size_t temp_len) { + $1 = &temp_data; + $2 = &temp_len; +} +%typemap(argout) (void **buffer_data, size_t *buffer_len) { + if (*$1 != nullptr) { + Napi::Buffer buf = Napi::Buffer::Copy(env, reinterpret_cast(*$1), *$2); + NAPI_CHECK_RESULT(buf.As(), $result); + } else { + $result = env.Null(); + } +} diff --git a/usr/share/swig/4.1.1/javascript/v8/std_auto_ptr.i b/usr/share/swig/4.2.1/javascript/napi/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/std_auto_ptr.i rename to usr/share/swig/4.2.1/javascript/napi/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/javascript/v8/std_common.i b/usr/share/swig/4.2.1/javascript/napi/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/std_common.i rename to usr/share/swig/4.2.1/javascript/napi/std_common.i diff --git a/usr/share/swig/4.1.1/javascript/v8/std_complex.i b/usr/share/swig/4.2.1/javascript/napi/std_complex.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/std_complex.i rename to usr/share/swig/4.2.1/javascript/napi/std_complex.i diff --git a/usr/share/swig/4.1.1/javascript/v8/std_deque.i b/usr/share/swig/4.2.1/javascript/napi/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/std_deque.i rename to usr/share/swig/4.2.1/javascript/napi/std_deque.i diff --git a/usr/share/swig/4.1.1/javascript/v8/std_except.i b/usr/share/swig/4.2.1/javascript/napi/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/std_except.i rename to usr/share/swig/4.2.1/javascript/napi/std_except.i diff --git a/usr/share/swig/4.1.1/javascript/v8/std_map.i b/usr/share/swig/4.2.1/javascript/napi/std_map.i similarity index 77% rename from usr/share/swig/4.1.1/javascript/v8/std_map.i rename to usr/share/swig/4.2.1/javascript/napi/std_map.i index 3b8b0936978..a33e88683c5 100644 --- a/usr/share/swig/4.1.1/javascript/v8/std_map.i +++ b/usr/share/swig/4.2.1/javascript/napi/std_map.i @@ -48,7 +48,11 @@ namespace std { throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } void del(const K& key) throw (std::out_of_range) { std::map< K, T, C >::iterator i = self->find(key); @@ -64,17 +68,4 @@ namespace std { } }; -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - } diff --git a/usr/share/swig/4.1.1/javascript/v8/std_pair.i b/usr/share/swig/4.2.1/javascript/napi/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/std_pair.i rename to usr/share/swig/4.2.1/javascript/napi/std_pair.i diff --git a/usr/share/swig/4.1.1/javascript/v8/std_string.i b/usr/share/swig/4.2.1/javascript/napi/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/std_string.i rename to usr/share/swig/4.2.1/javascript/napi/std_string.i diff --git a/usr/share/swig/4.1.1/javascript/v8/std_unique_ptr.i b/usr/share/swig/4.2.1/javascript/napi/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/std_unique_ptr.i rename to usr/share/swig/4.2.1/javascript/napi/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/javascript/v8/std_vector.i b/usr/share/swig/4.2.1/javascript/napi/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/std_vector.i rename to usr/share/swig/4.2.1/javascript/napi/std_vector.i diff --git a/usr/share/swig/4.1.1/javascript/v8/stl.i b/usr/share/swig/4.2.1/javascript/napi/stl.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/stl.i rename to usr/share/swig/4.2.1/javascript/napi/stl.i diff --git a/usr/share/swig/4.1.1/javascript/v8/swigmove.i b/usr/share/swig/4.2.1/javascript/napi/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/swigmove.i rename to usr/share/swig/4.2.1/javascript/napi/swigmove.i diff --git a/usr/share/swig/4.1.1/javascript/jsc/typemaps.i b/usr/share/swig/4.2.1/javascript/napi/typemaps.i similarity index 95% rename from usr/share/swig/4.1.1/javascript/jsc/typemaps.i rename to usr/share/swig/4.2.1/javascript/napi/typemaps.i index b5b441bc751..08b58386373 100644 --- a/usr/share/swig/4.1.1/javascript/jsc/typemaps.i +++ b/usr/share/swig/4.2.1/javascript/napi/typemaps.i @@ -18,7 +18,7 @@ you would use a real value instead. int *INPUT short *INPUT long *INPUT - long long *INPUT + long long *INPUT unsigned int *INPUT unsigned short *INPUT unsigned long *INPUT @@ -139,10 +139,6 @@ to a Python variable you might do this : x = neg(x) -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - */ %include diff --git a/usr/share/swig/4.2.1/javascript/v8/argcargv.i b/usr/share/swig/4.2.1/javascript/v8/argcargv.i new file mode 100644 index 00000000000..b1396a4e89e --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/v8/argcargv.i @@ -0,0 +1,75 @@ +/* ------------------------------------------------------------ + * SWIG library containing argc and argv multi-argument typemaps + * ------------------------------------------------------------ */ + +%{ +#ifndef SWIGV8_VALUE_TO_ARRAY +# define SWIGV8_VALUE_TO_ARRAY(val) SWIGV8_ARRAY::Cast(val) +#endif +#ifndef SWIGV8_STRING +# define SWIGV8_STRING v8::Local +#endif + +SWIGINTERN int SWIG_AsVal_string (SWIGV8_VALUE valRef, SWIGV8_STRING *str) +{ + if (!valRef->IsString()) { + return SWIG_TypeError; + } + if(str != SWIG_NULLPTR) { + *str = SWIGV8_TO_STRING(valRef); + } + return SWIG_OK; +} +%} + +%typemap(in) (int ARGC, char **ARGV) { + $1_ltype i, len; + size_t arraysize; + SWIGV8_ARRAY array; + if (!$input->IsArray()) { + SWIG_exception_fail(SWIG_ERROR, "not array"); + } + array = SWIGV8_VALUE_TO_ARRAY($input); + len = array->Length(); + arraysize = (len+1)*sizeof($*2_ltype); + $1 = len; + $2 = ($2_ltype) malloc(arraysize); + if ($2 == SWIG_NULLPTR) { + SWIG_exception_fail(SWIG_ERROR, "memory allocation of array failed"); + } + memset($2, 0, arraysize); + for (i = 0; i < len; i++) { + int res, slen; + $*2_ltype pstr; + SWIGV8_STRING str; + SWIGV8_VALUE jsvalue = SWIGV8_ARRAY_GET(array, i); + res = SWIG_AsVal_string(jsvalue, &str); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ERROR, "failed to convert to string"); + } + slen = SWIGV8_UTF8_LENGTH(str); + pstr = ($*2_ltype) malloc(slen + 1); + if (pstr == SWIG_NULLPTR) { + SWIG_exception_fail(SWIG_ERROR, "memory allocation of a string failed"); + } + if (slen) { + res = SWIGV8_WRITE_UTF8(str, pstr, slen); + if (res != slen) { + SWIG_exception_fail(SWIG_ERROR, "wrong string length"); + } + } + pstr[slen] = 0; + $2[i] = pstr; + } + $2[i] = SWIG_NULLPTR; +} + +%typemap(freearg) (int ARGC, char **ARGV) { + if ($2 != SWIG_NULLPTR) { + $1_ltype i; + for (i = 0; i < $1; i++) { + free((void *)$2[i]); + } + free((void *)$2); + } +} diff --git a/usr/share/swig/4.1.1/javascript/v8/arrays_javascript.i b/usr/share/swig/4.2.1/javascript/v8/arrays_javascript.i similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/arrays_javascript.i rename to usr/share/swig/4.2.1/javascript/v8/arrays_javascript.i diff --git a/usr/share/swig/4.2.1/javascript/v8/ccomplex.i b/usr/share/swig/4.2.1/javascript/v8/ccomplex.i new file mode 100644 index 00000000000..e58dbf7190d --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/v8/ccomplex.i @@ -0,0 +1,27 @@ +/* ----------------------------------------------------------------------------- + * ccomplex.i + * + * C complex typemaps + * ISO C99: 7.3 Complex arithmetic + * ----------------------------------------------------------------------------- */ + + +%include + +%{ +#include +%} + +#define complex _Complex + +/* C complex constructor */ +#define CCplxConst(r, i) ((r) + I*(i)) + +%swig_cplxflt_convn(float _Complex, CCplxConst, creal, cimag); +%swig_cplxdbl_convn(double _Complex, CCplxConst, creal, cimag); +%swig_cplxdbl_convn(_Complex, CCplxConst, creal, cimag); + +/* declaring the typemaps */ +%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float _Complex); +%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double _Complex); +%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, _Complex); diff --git a/usr/share/swig/4.1.1/octave/cdata.i b/usr/share/swig/4.2.1/javascript/v8/cdata.i similarity index 100% rename from usr/share/swig/4.1.1/octave/cdata.i rename to usr/share/swig/4.2.1/javascript/v8/cdata.i diff --git a/usr/share/swig/4.1.1/python/cmalloc.i b/usr/share/swig/4.2.1/javascript/v8/cmalloc.i similarity index 100% rename from usr/share/swig/4.1.1/python/cmalloc.i rename to usr/share/swig/4.2.1/javascript/v8/cmalloc.i diff --git a/usr/share/swig/4.1.1/python/complex.i b/usr/share/swig/4.2.1/javascript/v8/complex.i similarity index 100% rename from usr/share/swig/4.1.1/python/complex.i rename to usr/share/swig/4.2.1/javascript/v8/complex.i diff --git a/usr/share/swig/4.2.1/javascript/v8/exception.i b/usr/share/swig/4.2.1/javascript/v8/exception.i new file mode 100644 index 00000000000..0246cfde879 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/v8/exception.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.1.1/python/factory.i b/usr/share/swig/4.2.1/javascript/v8/factory.i similarity index 100% rename from usr/share/swig/4.1.1/python/factory.i rename to usr/share/swig/4.2.1/javascript/v8/factory.i diff --git a/usr/share/swig/4.1.1/javascript/v8/javascript.swg b/usr/share/swig/4.2.1/javascript/v8/javascript.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/javascript.swg rename to usr/share/swig/4.2.1/javascript/v8/javascript.swg diff --git a/usr/share/swig/4.1.1/javascript/v8/javascriptcode.swg b/usr/share/swig/4.2.1/javascript/v8/javascriptcode.swg similarity index 91% rename from usr/share/swig/4.1.1/javascript/v8/javascriptcode.swg rename to usr/share/swig/4.2.1/javascript/v8/javascriptcode.swg index dcda0ee6332..77058653923 100644 --- a/usr/share/swig/4.1.1/javascript/v8/javascriptcode.swg +++ b/usr/share/swig/4.2.1/javascript/v8/javascriptcode.swg @@ -4,6 +4,7 @@ * - $jslocals: locals part of wrapper * - $jscode: code part of wrapper * - $jsargcount: number of arguments + * - $jsargrequired: required number of arguments * - $jsmangledtype: mangled type of class * ----------------------------------------------------------------------------- */ @@ -14,7 +15,7 @@ static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { SWIGV8_OBJECT self = args.Holder(); $jslocals if(self->InternalFieldCount() < 1) SWIG_exception_fail(SWIG_ERROR, "Illegal call of constructor $jswrapper."); - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + if(args.Length() < $jsargrequired || args.Length() > $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); $jscode SWIGV8_SetPrivateData(self, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); @@ -73,6 +74,7 @@ fail: * - $jslocals: locals part of wrapper * - $jscode: code part of wrapper * - $jsargcount: number of arguments + * - $jsargrequired: required number of arguments * - $jsmangledtype: mangled type of class * ----------------------------------------------------------------------------- */ %fragment("js_overloaded_ctor", "templates") %{ @@ -82,7 +84,7 @@ static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args, V8ErrorHandler SWIGV8_OBJECT self = args.Holder(); $jslocals if(self->InternalFieldCount() < 1) SWIG_exception_fail(SWIG_ERROR, "Illegal call of constructor $jswrapper."); - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + if(args.Length() < $jsargrequired || args.Length() > $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); $jscode SWIGV8_SetPrivateData(self, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); @@ -97,13 +99,14 @@ fail: /* ----------------------------------------------------------------------------- * js_ctor_dispatch_case: template for a dispatch case for calling an overloaded ctor. * - $jsargcount: number of arguments of called ctor + * - $jsargrequired: required number of arguments * - $jswrapper: wrapper of called ctor * * Note: a try-catch-like mechanism is used to switch cases * ----------------------------------------------------------------------------- */ %fragment ("js_ctor_dispatch_case", "templates") %{ - if(args.Length() == $jsargcount) { + if(args.Length() >= $jsargrequired && args.Length() <= $jsargcount) { errorHandler.err.Clear(); $jswrapper(args, errorHandler); if(errorHandler.err.IsEmpty()) { @@ -195,9 +198,11 @@ fail: /* ----------------------------------------------------------------------------- * js_function: template for function wrappers - * - $jswrapper: wrapper function name - * - $jslocals: locals part of wrapper - * - $jscode: code part of wrapper + * - $jswrapper: wrapper function name + * - $jslocals: locals part of wrapper + * - $jscode: code part of wrapper + * - $jsargcount: number of arguments + * - $jsargrequired: required number of arguments * ----------------------------------------------------------------------------- */ %fragment("js_function", "templates") %{ @@ -206,7 +211,7 @@ static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { SWIGV8_VALUE jsresult; $jslocals - if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + if (args.Length() < $jsargrequired || args.Length() > $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); $jscode SWIGV8_RETURN(jsresult); @@ -266,14 +271,15 @@ fail: /* ----------------------------------------------------------------------------- * js_function_dispatch_case: template for a case used in the function dispatcher - * - $jswrapper: wrapper function name - * - $jsargcount: number of arguments of overloaded function - * - $jscode: code part of wrapper + * - $jswrapper: wrapper function name + * - $jsargcount: number of arguments of overloaded function + * - $jsargrequired: required number of arguments + * - $jscode: code part of wrapper * ----------------------------------------------------------------------------- */ %fragment ("js_function_dispatch_case", "templates") %{ - if(args.Length() == $jsargcount) { + if(args.Length() >= $jsargrequired && args.Length() <= $jsargcount) { errorHandler.err.Clear(); $jswrapper(args, errorHandler); if(errorHandler.err.IsEmpty()) { @@ -282,6 +288,13 @@ fail: } %} +/* ----------------------------------------------------------------------------- + * js_check_arg: template for checking if an argument exists + * - $jsarg: number of argument + * ----------------------------------------------------------------------------- */ +%fragment ("js_check_arg", "templates") +%{if(args.Length() > $jsarg)%} + /* ----------------------------------------------------------------------------- * jsv8_declare_class_template: template for a class template declaration. * - $jsmangledname: mangled class name diff --git a/usr/share/swig/4.1.1/javascript/v8/javascriptcomplex.swg b/usr/share/swig/4.2.1/javascript/v8/javascriptcomplex.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/javascriptcomplex.swg rename to usr/share/swig/4.2.1/javascript/v8/javascriptcomplex.swg diff --git a/usr/share/swig/4.2.1/javascript/v8/javascriptfragments.swg b/usr/share/swig/4.2.1/javascript/v8/javascriptfragments.swg new file mode 100644 index 00000000000..4778bf0339d --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/v8/javascriptfragments.swg @@ -0,0 +1,23 @@ +/* + + Create a file with this name, 'javascriptfragments.swg', in your working + directory and add all the %fragments you want to take precedence + over the default ones defined by swig. + + For example, if you add: + + %fragment(SWIG_AsVal_frag(int),"header") { + SWIGINTERNINLINE int + SWIG_AsVal(int)(PyObject *obj, int *val) + { + ; + } + } + + this will replace the code used to retrieve an integer value for all + the typemaps that need it, including: + + int, std::vector, std::list >, etc. + + +*/ diff --git a/usr/share/swig/4.1.1/javascript/v8/javascripthelpers.swg b/usr/share/swig/4.2.1/javascript/v8/javascripthelpers.swg similarity index 97% rename from usr/share/swig/4.1.1/javascript/v8/javascripthelpers.swg rename to usr/share/swig/4.2.1/javascript/v8/javascripthelpers.swg index ea303fa3db5..7f704061340 100644 --- a/usr/share/swig/4.1.1/javascript/v8/javascripthelpers.swg +++ b/usr/share/swig/4.2.1/javascript/v8/javascripthelpers.swg @@ -70,7 +70,7 @@ SWIGRUNTIME void JS_veto_set_variable(v8::Local property, v8::Local sproperty; if (property->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocal(&sproperty)) { SWIGV8_WRITE_UTF8(sproperty, buffer, 256); - res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); + res = SWIG_snprintf(msg, sizeof(msg), "Tried to write read-only variable: %s.", buffer); } else { res = -1; diff --git a/usr/share/swig/4.1.1/javascript/v8/javascriptinit.swg b/usr/share/swig/4.2.1/javascript/v8/javascriptinit.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/javascriptinit.swg rename to usr/share/swig/4.2.1/javascript/v8/javascriptinit.swg diff --git a/usr/share/swig/4.1.1/javascript/v8/javascriptprimtypes.swg b/usr/share/swig/4.2.1/javascript/v8/javascriptprimtypes.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/javascriptprimtypes.swg rename to usr/share/swig/4.2.1/javascript/v8/javascriptprimtypes.swg diff --git a/usr/share/swig/4.1.1/javascript/v8/javascriptrun.swg b/usr/share/swig/4.2.1/javascript/v8/javascriptrun.swg similarity index 96% rename from usr/share/swig/4.1.1/javascript/v8/javascriptrun.swg rename to usr/share/swig/4.2.1/javascript/v8/javascriptrun.swg index f7627085569..4980863e449 100644 --- a/usr/share/swig/4.1.1/javascript/v8/javascriptrun.swg +++ b/usr/share/swig/4.2.1/javascript/v8/javascriptrun.swg @@ -53,6 +53,7 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; #define SWIGV8_FUNCTION_TEMPLATE v8::Local #define SWIGV8_OBJECT v8::Local #define SWIGV8_OBJECT_TEMPLATE v8::Local +#define SWIGV8_OBJECT_TEMPLATE_NEW() v8::ObjectTemplate::New(v8::Isolate::GetCurrent()) #define SWIGV8_VALUE v8::Local #define SWIGV8_NULL() v8::Null(v8::Isolate::GetCurrent()) #define SWIGV8_ARRAY_GET(array, index) (array)->Get(SWIGV8_CURRENT_CONTEXT(), index).ToLocalChecked() @@ -68,6 +69,7 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; #define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue() #define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(buffer, len) #define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length() +#define SWIGV8_OBJECT_TEMPLATE_INSTACE(tmpl) tmpl->NewInstance(); #else #define SWIGV8_TO_OBJECT(handle) (handle)->ToObject(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() #define SWIGV8_TO_STRING(handle) (handle)->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() @@ -75,6 +77,7 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; #define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() #define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(v8::Isolate::GetCurrent(), buffer, len) #define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length(v8::Isolate::GetCurrent()) +#define SWIGV8_OBJECT_TEMPLATE_INSTACE(tmpl) tmpl->NewInstance(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked(); #if (SWIG_V8_VERSION < 0x0704) #define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() #else @@ -370,9 +373,14 @@ fail: class SwigV8PackedData { public: - SwigV8PackedData(void *data, size_t size, swig_type_info *type): data(data), size(size), type(type) {}; + SwigV8PackedData(void *data, size_t size, swig_type_info *type): data(nullptr), size(size), type(type) { + this->data = malloc(size); + if (this->data != nullptr) + memcpy(this->data, data, size); + }; ~SwigV8PackedData() { + free(this->data); }; void *data; @@ -429,6 +437,7 @@ int SWIGV8_ConvertPacked(SWIGV8_VALUE valRef, void *ptr, size_t sz, swig_type_in SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackInfo &data) { SwigV8PackedData *cdata = data.GetParameter(); + cdata->handle.Reset(); delete cdata; } @@ -437,8 +446,9 @@ SWIGV8_VALUE SWIGV8_NewPackedObj(void *data, size_t size, swig_type_info *type) SWIGV8_HANDLESCOPE_ESC(); SwigV8PackedData *cdata = new SwigV8PackedData(data, size, type); -// v8::Handle obj = SWIGV8_OBJECT_NEW(); - v8::Local obj = SWIGV8_OBJECT_NEW(); + SWIGV8_OBJECT_TEMPLATE tmpl = SWIGV8_OBJECT_TEMPLATE_NEW(); + tmpl->SetInternalFieldCount(1); + v8::Local obj = SWIGV8_OBJECT_TEMPLATE_INSTACE(tmpl); v8::Local privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("__swig__packed_data__")); obj->SetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey, SWIGV8_BOOLEAN_NEW(true)); diff --git a/usr/share/swig/4.1.1/javascript/v8/javascriptruntime.swg b/usr/share/swig/4.2.1/javascript/v8/javascriptruntime.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/javascriptruntime.swg rename to usr/share/swig/4.2.1/javascript/v8/javascriptruntime.swg diff --git a/usr/share/swig/4.1.1/javascript/v8/javascriptstrings.swg b/usr/share/swig/4.2.1/javascript/v8/javascriptstrings.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/javascriptstrings.swg rename to usr/share/swig/4.2.1/javascript/v8/javascriptstrings.swg diff --git a/usr/share/swig/4.1.1/javascript/v8/javascripttypemaps.swg b/usr/share/swig/4.2.1/javascript/v8/javascripttypemaps.swg similarity index 100% rename from usr/share/swig/4.1.1/javascript/v8/javascripttypemaps.swg rename to usr/share/swig/4.2.1/javascript/v8/javascripttypemaps.swg diff --git a/usr/share/swig/4.1.1/octave/std_auto_ptr.i b/usr/share/swig/4.2.1/javascript/v8/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_auto_ptr.i rename to usr/share/swig/4.2.1/javascript/v8/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/lua/std_common.i b/usr/share/swig/4.2.1/javascript/v8/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/lua/std_common.i rename to usr/share/swig/4.2.1/javascript/v8/std_common.i diff --git a/usr/share/swig/4.2.1/javascript/v8/std_complex.i b/usr/share/swig/4.2.1/javascript/v8/std_complex.i new file mode 100644 index 00000000000..a252e0aa89e --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/v8/std_complex.i @@ -0,0 +1,26 @@ +/* + * STD C++ complex typemaps + */ + +%include + +%{ +#include +%} + +namespace std { + %naturalvar complex; + template class complex; + %template() complex; + %template() complex; +} + +/* defining the complex as/from converters */ + +%swig_cplxdbl_convn(std::complex, std::complex, std::real, std::imag) +%swig_cplxflt_convn(std::complex, std::complex, std::real, std::imag) + +/* defining the typemaps */ + +%typemaps_primitive(%checkcode(CPLXDBL), std::complex); +%typemaps_primitive(%checkcode(CPLXFLT), std::complex); diff --git a/usr/share/swig/4.1.1/lua/std_deque.i b/usr/share/swig/4.2.1/javascript/v8/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/lua/std_deque.i rename to usr/share/swig/4.2.1/javascript/v8/std_deque.i diff --git a/usr/share/swig/4.1.1/octave/std_except.i b/usr/share/swig/4.2.1/javascript/v8/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_except.i rename to usr/share/swig/4.2.1/javascript/v8/std_except.i diff --git a/usr/share/swig/4.2.1/javascript/v8/std_map.i b/usr/share/swig/4.2.1/javascript/v8/std_map.i new file mode 100644 index 00000000000..a33e88683c5 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/v8/std_map.i @@ -0,0 +1,71 @@ +/* ----------------------------------------------------------------------------- + * std_map.i + * + * SWIG typemaps for std::map + * ----------------------------------------------------------------------------- */ + +%include + +// ------------------------------------------------------------------------ +// std::map +// ------------------------------------------------------------------------ + +%{ +#include +#include +#include +%} + +// exported class + +namespace std { + + template > class map { + // add typemaps here + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef K key_type; + typedef T mapped_type; + typedef std::pair< const K, T > value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + + map(); + map(const map& other); + + unsigned int size() const; + bool empty() const; + void clear(); + %extend { + const T& get(const K& key) throw (std::out_of_range) { + std::map< K, T, C >::iterator i = self->find(key); + if (i != self->end()) + return i->second; + else + throw std::out_of_range("key not found"); + } + void set(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else + (*self)[key] = x; +%#endif + } + void del(const K& key) throw (std::out_of_range) { + std::map< K, T, C >::iterator i = self->find(key); + if (i != self->end()) + self->erase(i); + else + throw std::out_of_range("key not found"); + } + bool has_key(const K& key) { + std::map< K, T, C >::iterator i = self->find(key); + return i != self->end(); + } + } + }; + +} diff --git a/usr/share/swig/4.2.1/javascript/v8/std_pair.i b/usr/share/swig/4.2.1/javascript/v8/std_pair.i new file mode 100644 index 00000000000..b72c50b99e5 --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/v8/std_pair.i @@ -0,0 +1,35 @@ +/* ----------------------------------------------------------------------------- + * std_pair.i + * + * SWIG typemaps for std::pair + * ----------------------------------------------------------------------------- */ + +%include + +// ------------------------------------------------------------------------ +// std::pair +// ------------------------------------------------------------------------ + +%{ +#include +%} + +namespace std { + + template struct pair { + typedef T first_type; + typedef U second_type; + + pair(); + pair(T first, U second); + pair(const pair& other); + + template pair(const pair &other); + + T first; + U second; + }; + + // add specializations here + +} diff --git a/usr/share/swig/4.1.1/octave/std_string.i b/usr/share/swig/4.2.1/javascript/v8/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_string.i rename to usr/share/swig/4.2.1/javascript/v8/std_string.i diff --git a/usr/share/swig/4.1.1/octave/std_unique_ptr.i b/usr/share/swig/4.2.1/javascript/v8/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_unique_ptr.i rename to usr/share/swig/4.2.1/javascript/v8/std_unique_ptr.i diff --git a/usr/share/swig/4.2.1/javascript/v8/std_vector.i b/usr/share/swig/4.2.1/javascript/v8/std_vector.i new file mode 100644 index 00000000000..586ac5c601f --- /dev/null +++ b/usr/share/swig/4.2.1/javascript/v8/std_vector.i @@ -0,0 +1,99 @@ +/* ----------------------------------------------------------------------------- + * std_vector.i + * ----------------------------------------------------------------------------- */ + +%include + +%{ +#include +#include +%} + +namespace std { + + template class vector { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + + vector(); + vector(size_type n); + vector(const vector& other); + + size_type size() const; + size_type capacity() const; + void reserve(size_type n); + %rename(isEmpty) empty; + bool empty() const; + void clear(); + %rename(add) push_back; + void push_back(const value_type& x); + %extend { + const_reference get(int i) throw (std::out_of_range) { + int size = int(self->size()); + if (i>=0 && isize()); + if (i>=0 && i class vector { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef bool value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef bool const_reference; + + vector(); + vector(size_type n); + vector(const vector& other); + + size_type size() const; + size_type capacity() const; + void reserve(size_type n); + %rename(isEmpty) empty; + bool empty() const; + void clear(); + %rename(add) push_back; + void push_back(const value_type& x); + %extend { + bool get(int i) throw (std::out_of_range) { + int size = int(self->size()); + if (i>=0 && isize()); + if (i>=0 && i + double fadd(double *INPUT, double *INPUT); + +or you can use the %apply directive : + + %include + %apply double *INPUT { double *a, double *b }; + double fadd(double *a, double *b); + +*/ + +// OUTPUT typemaps. These typemaps are used for parameters that +// are output only. The output value is appended to the result as +// a list element. + +/* +The following methods can be applied to turn a pointer into an "output" +value. When calling a function, no input value would be given for +a parameter, but an output value would be returned. In the case of +multiple output values, they are returned in the form of a Python tuple. + + int *OUTPUT + short *OUTPUT + long *OUTPUT + long long *OUTPUT + unsigned int *OUTPUT + unsigned short *OUTPUT + unsigned long *OUTPUT + unsigned long long *OUTPUT + unsigned char *OUTPUT + bool *OUTPUT + float *OUTPUT + double *OUTPUT + +For example, suppose you were trying to wrap the modf() function in the +C math library which splits x into integral and fractional parts (and +returns the integer part in one of its parameters) : + + double modf(double x, double *ip); + +You could wrap it with SWIG as follows : + + %include + double modf(double x, double *OUTPUT); + +or you can use the %apply directive : + + %include + %apply double *OUTPUT { double *ip }; + double modf(double x, double *ip); + +The Python output of the function would be a tuple containing both +output values. + +*/ + +// INOUT +// Mappings for an argument that is both an input and output +// parameter + +/* +The following methods can be applied to make a function parameter both +an input and output value. This combines the behavior of both the +"INPUT" and "OUTPUT" methods described earlier. Output values are +returned in the form of a Python tuple. + + int *INOUT + short *INOUT + long *INOUT + long long *INOUT + unsigned int *INOUT + unsigned short *INOUT + unsigned long *INOUT + unsigned long long *INOUT + unsigned char *INOUT + bool *INOUT + float *INOUT + double *INOUT + +For example, suppose you were trying to wrap the following function : + + void neg(double *x) { + *x = -(*x); + } + +You could wrap it with SWIG as follows : + + %include + void neg(double *INOUT); + +or you can use the %apply directive : + + %include + %apply double *INOUT { double *x }; + void neg(double *x); + +Unlike C, this mapping does not directly modify the input value (since +this makes no sense in Python). Rather, the modified input value shows +up as the return value of the function. Thus, to apply this function +to a Python variable you might do this : + + x = neg(x) + +*/ + +%include diff --git a/usr/share/swig/4.1.1/javascript/jsc/javascriptkw.swg b/usr/share/swig/4.2.1/javascriptkw.swg similarity index 56% rename from usr/share/swig/4.1.1/javascript/jsc/javascriptkw.swg rename to usr/share/swig/4.2.1/javascriptkw.swg index c3c1183916c..81e1340e456 100644 --- a/usr/share/swig/4.1.1/javascript/jsc/javascriptkw.swg +++ b/usr/share/swig/4.2.1/javascriptkw.swg @@ -4,24 +4,46 @@ /* Warnings for Java keywords */ #define JAVASCRIPTKW(x) %keywordwarn("'" `x` "' is a javascript keyword, renaming to '_"`x`"'",rename="_%s") `x` -/* Taken from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Reserved_Words */ +/* Taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#keywords */ +/* This the union of all currently reserved keywords in ECMAScript 4 to 6 in both sloppy and strict mode */ +JAVASCRIPTKW(arguments); +JAVASCRIPTKW(await); JAVASCRIPTKW(break); JAVASCRIPTKW(case); JAVASCRIPTKW(catch); +JAVASCRIPTKW(class); +JAVASCRIPTKW(const); JAVASCRIPTKW(continue); +JAVASCRIPTKW(debugger); JAVASCRIPTKW(default); JAVASCRIPTKW(delete); JAVASCRIPTKW(do); JAVASCRIPTKW(else); +JAVASCRIPTKW(enum); +JAVASCRIPTKW(eval); +JAVASCRIPTKW(export); +JAVASCRIPTKW(extends); +JAVASCRIPTKW(false); JAVASCRIPTKW(finally); JAVASCRIPTKW(for); JAVASCRIPTKW(function); JAVASCRIPTKW(if); +JAVASCRIPTKW(implements); +JAVASCRIPTKW(import); JAVASCRIPTKW(in); JAVASCRIPTKW(instanceof); +JAVASCRIPTKW(interface); +JAVASCRIPTKW(let); JAVASCRIPTKW(new); +JAVASCRIPTKW(null); +JAVASCRIPTKW(package); +JAVASCRIPTKW(private); +JAVASCRIPTKW(protected); +JAVASCRIPTKW(public); JAVASCRIPTKW(return); +JAVASCRIPTKW(static); +JAVASCRIPTKW(super); JAVASCRIPTKW(switch); JAVASCRIPTKW(this); JAVASCRIPTKW(throw); @@ -31,6 +53,7 @@ JAVASCRIPTKW(var); JAVASCRIPTKW(void); JAVASCRIPTKW(while); JAVASCRIPTKW(with); +JAVASCRIPTKW(yield); /* others bad names if any*/ // for example %namewarn("321:clone() is a javascript bad method name") *::clone(); diff --git a/usr/share/swig/4.1.1/lua/_std_common.i b/usr/share/swig/4.2.1/lua/_std_common.i similarity index 100% rename from usr/share/swig/4.1.1/lua/_std_common.i rename to usr/share/swig/4.2.1/lua/_std_common.i diff --git a/usr/share/swig/4.1.1/lua/argcargv.i b/usr/share/swig/4.2.1/lua/argcargv.i similarity index 89% rename from usr/share/swig/4.1.1/lua/argcargv.i rename to usr/share/swig/4.2.1/lua/argcargv.i index 94cc8ed427d..605a24fd709 100644 --- a/usr/share/swig/4.1.1/lua/argcargv.i +++ b/usr/share/swig/4.2.1/lua/argcargv.i @@ -1,4 +1,4 @@ -/* ------------------------------------------------------------ +/* ------------------------------------------------------------- * SWIG library containing argc and argv multi-argument typemaps Use it as follows: @@ -11,7 +11,7 @@ args = { "arg0", "arg1" } mainApp(args) - * ------------------------------------------------------------ */ + * ------------------------------------------------------------- */ %{ SWIGINTERN int SWIG_argv_size(lua_State* L, int index) { diff --git a/usr/share/swig/4.1.1/lua/carrays.i b/usr/share/swig/4.2.1/lua/carrays.i similarity index 100% rename from usr/share/swig/4.1.1/lua/carrays.i rename to usr/share/swig/4.2.1/lua/carrays.i diff --git a/usr/share/swig/4.1.1/lua/factory.i b/usr/share/swig/4.2.1/lua/factory.i similarity index 100% rename from usr/share/swig/4.1.1/lua/factory.i rename to usr/share/swig/4.2.1/lua/factory.i diff --git a/usr/share/swig/4.1.1/lua/lua.swg b/usr/share/swig/4.2.1/lua/lua.swg similarity index 98% rename from usr/share/swig/4.1.1/lua/lua.swg rename to usr/share/swig/4.2.1/lua/lua.swg index 12c635d77ce..4244435a5de 100644 --- a/usr/share/swig/4.1.1/lua/lua.swg +++ b/usr/share/swig/4.2.1/lua/lua.swg @@ -18,8 +18,9 @@ * constants typemaps * ----------------------------------------------------------------------------- */ // this basically adds to a table of constants +/* Extra `(`...`)` here are to handle $value being e.g. `SizeOf< int,int >::size`. */ %typemap(consttab) int, unsigned int, short, unsigned short, long, unsigned long, unsigned char, signed char, bool, enum SWIGTYPE - {SWIG_LUA_CONSTTAB_INT("$symname", $value)} + {SWIG_LUA_CONSTTAB_INT("$symname", ($value))} %typemap(consttab) float, double {SWIG_LUA_CONSTTAB_FLOAT("$symname", $value)} diff --git a/usr/share/swig/4.1.1/lua/lua_fnptr.i b/usr/share/swig/4.2.1/lua/lua_fnptr.i similarity index 98% rename from usr/share/swig/4.1.1/lua/lua_fnptr.i rename to usr/share/swig/4.2.1/lua/lua_fnptr.i index 81fa54bd25e..b4c663c53d5 100644 --- a/usr/share/swig/4.1.1/lua/lua_fnptr.i +++ b/usr/share/swig/4.2.1/lua/lua_fnptr.i @@ -119,6 +119,6 @@ void swiglua_ref_get(SWIGLUA_REF* pref){ %{ swiglua_ref_set(&$1,L,$input); %} %typemap(out) SWIGLUA_REF -%{ if ($1.L!=0) {swiglua_ref_get(&$1);} else {lua_pushnil(L);} +%{ if ($1.L!=0) {swiglua_ref_get(&$1);} else {lua_pushnil(L);} SWIG_arg++; %} diff --git a/usr/share/swig/4.1.1/lua/luakw.swg b/usr/share/swig/4.2.1/lua/luakw.swg similarity index 100% rename from usr/share/swig/4.1.1/lua/luakw.swg rename to usr/share/swig/4.2.1/lua/luakw.swg diff --git a/usr/share/swig/4.1.1/lua/luarun.swg b/usr/share/swig/4.2.1/lua/luarun.swg similarity index 99% rename from usr/share/swig/4.1.1/lua/luarun.swg rename to usr/share/swig/4.2.1/lua/luarun.swg index f47fd4facd7..af6cd66f38d 100644 --- a/usr/share/swig/4.1.1/lua/luarun.swg +++ b/usr/share/swig/4.2.1/lua/luarun.swg @@ -149,6 +149,20 @@ typedef struct swig_elua_entry { # define lua_rawlen lua_objlen #endif +/* lua_tolstring() was added in Lua 5.1. It should be a little more + efficient than making two separate calls and it avoids problems with order + of evaluation so SWIG calls lua_tolstring() when it wants the length and + we provide a compatibility implementation for Lua 5.0. */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 +static const char *(lua_tolstring)(lua_State *L, int idx, size_t *len) { + /* Call lua_tostring() first as it may convert the value from number to + string. */ + const char *result = lua_tostring(L, idx); + if (len) *len = lua_strlen(L, idx); + return result; +} +#endif + /* lua_pushglobaltable is the recommended "future-proof" way to get the global table for Lua 5.2 and later. Here we define @@ -819,6 +833,7 @@ SWIGINTERN int SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, i int bases_search_result; int substack_start = lua_gettop(L)-2; assert(first_arg == substack_start+1); + (void)first_arg; lua_checkstack(L,5); assert(lua_isuserdata(L,-2)); /* just in case */ lua_getmetatable(L,-2); /* get the meta table */ @@ -857,6 +872,7 @@ SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SW int bases_search_result; int substack_start = lua_gettop(L)-2; assert(first_arg == substack_start+1); + (void)first_arg; lua_checkstack(L,5); assert(lua_isuserdata(L,-2)); /* just in case */ lua_getmetatable(L,-2); /* get the meta table */ diff --git a/usr/share/swig/4.1.1/lua/luaruntime.swg b/usr/share/swig/4.2.1/lua/luaruntime.swg similarity index 100% rename from usr/share/swig/4.1.1/lua/luaruntime.swg rename to usr/share/swig/4.2.1/lua/luaruntime.swg diff --git a/usr/share/swig/4.1.1/lua/luatypemaps.swg b/usr/share/swig/4.2.1/lua/luatypemaps.swg similarity index 100% rename from usr/share/swig/4.1.1/lua/luatypemaps.swg rename to usr/share/swig/4.2.1/lua/luatypemaps.swg diff --git a/usr/share/swig/4.1.1/lua/std_auto_ptr.i b/usr/share/swig/4.2.1/lua/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/lua/std_auto_ptr.i rename to usr/share/swig/4.2.1/lua/std_auto_ptr.i diff --git a/usr/share/swig/4.2.1/lua/std_common.i b/usr/share/swig/4.2.1/lua/std_common.i new file mode 100644 index 00000000000..cee11e8caa5 --- /dev/null +++ b/usr/share/swig/4.2.1/lua/std_common.i @@ -0,0 +1,5 @@ +%include + +%apply size_t { std::size_t }; +%apply const size_t& { const std::size_t& }; + diff --git a/usr/share/swig/4.1.1/mzscheme/std_deque.i b/usr/share/swig/4.2.1/lua/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/mzscheme/std_deque.i rename to usr/share/swig/4.2.1/lua/std_deque.i diff --git a/usr/share/swig/4.1.1/lua/std_except.i b/usr/share/swig/4.2.1/lua/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/lua/std_except.i rename to usr/share/swig/4.2.1/lua/std_except.i diff --git a/usr/share/swig/4.1.1/go/std_map.i b/usr/share/swig/4.2.1/lua/std_map.i similarity index 95% rename from usr/share/swig/4.1.1/go/std_map.i rename to usr/share/swig/4.2.1/lua/std_map.i index 773b6d0c31d..19281ad7d50 100644 --- a/usr/share/swig/4.1.1/go/std_map.i +++ b/usr/share/swig/4.2.1/lua/std_map.i @@ -48,7 +48,11 @@ namespace std { throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } void del(const K& key) throw (std::out_of_range) { std::map< K, T, C >::iterator i = self->find(key); diff --git a/usr/share/swig/4.1.1/lua/std_pair.i b/usr/share/swig/4.2.1/lua/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/lua/std_pair.i rename to usr/share/swig/4.2.1/lua/std_pair.i diff --git a/usr/share/swig/4.1.1/lua/std_string.i b/usr/share/swig/4.2.1/lua/std_string.i similarity index 91% rename from usr/share/swig/4.1.1/lua/std_string.i rename to usr/share/swig/4.2.1/lua/std_string.i index b95a8a4a2e5..795db71f265 100644 --- a/usr/share/swig/4.1.1/lua/std_string.i +++ b/usr/share/swig/4.2.1/lua/std_string.i @@ -43,19 +43,28 @@ but Similarly for getting the string $1 = (char*)lua_tostring(L, $input); becomes - $1.assign(lua_tostring(L,$input),lua_rawlen(L,$input)); - -Not using: lua_tolstring() as this is only found in Lua 5.1 & not 5.0.2 + size_t len; + const char *ptr = lua_tolstring(L, $input, &len); + $1.assign(ptr, len); */ %typemap(in,checkfn="lua_isstring") string -%{$1.assign(lua_tostring(L,$input),lua_rawlen(L,$input));%} +{ + size_t len; + const char *ptr = lua_tolstring(L, $input, &len); + $1.assign(ptr, len); +} %typemap(out) string %{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_arg++;%} %typemap(in,checkfn="lua_isstring") const string& ($*1_ltype temp) -%{temp.assign(lua_tostring(L,$input),lua_rawlen(L,$input)); $1=&temp;%} +{ + size_t len; + const char *ptr = lua_tolstring(L, $input, &len); + temp.assign(ptr, len); + $1=&temp; +} %typemap(out) const string& %{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} diff --git a/usr/share/swig/4.2.1/lua/std_string_view.i b/usr/share/swig/4.2.1/lua/std_string_view.i new file mode 100644 index 00000000000..5c8b6367b9a --- /dev/null +++ b/usr/share/swig/4.2.1/lua/std_string_view.i @@ -0,0 +1,50 @@ +/* ----------------------------------------------------------------------------- + * std_string_view.i + * + * std::string_view typemaps for LUA + * ----------------------------------------------------------------------------- */ + +%{ +#include +%} + +namespace std { + +%naturalvar string_view; + +%typemap(in,checkfn="lua_isstring") string_view +{ + size_t len; + const char *ptr = lua_tolstring(L, $input, &len); + $1 = std::string_view(ptr, len); +} + +%typemap(out) string_view +%{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_arg++;%} + +%typemap(in,checkfn="lua_isstring") const string_view& ($*1_ltype temp) +{ + size_t len; + const char *ptr = lua_tolstring(L, $input, &len); + temp = std::string_view(ptr, len); + $1=&temp; +} + +%typemap(out) const string_view& +%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} + +// for throwing of any kind of string_view, string_view ref's and string_view pointers +// we convert all to lua strings +%typemap(throws) string_view, string_view&, const string_view& +%{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_fail;%} + +%typemap(throws) string_view*, const string_view* +%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_fail;%} + +%typecheck(SWIG_TYPECHECK_STRINGVIEW) string_view, const string_view& { + $1 = lua_isstring(L,$input); +} + +class string_view; + +} diff --git a/usr/share/swig/4.1.1/lua/std_unique_ptr.i b/usr/share/swig/4.2.1/lua/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/lua/std_unique_ptr.i rename to usr/share/swig/4.2.1/lua/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/lua/std_vector.i b/usr/share/swig/4.2.1/lua/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/lua/std_vector.i rename to usr/share/swig/4.2.1/lua/std_vector.i diff --git a/usr/share/swig/4.1.1/mzscheme/stl.i b/usr/share/swig/4.2.1/lua/stl.i similarity index 100% rename from usr/share/swig/4.1.1/mzscheme/stl.i rename to usr/share/swig/4.2.1/lua/stl.i diff --git a/usr/share/swig/4.1.1/lua/swigmove.i b/usr/share/swig/4.2.1/lua/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/lua/swigmove.i rename to usr/share/swig/4.2.1/lua/swigmove.i diff --git a/usr/share/swig/4.1.1/lua/typemaps.i b/usr/share/swig/4.2.1/lua/typemaps.i similarity index 100% rename from usr/share/swig/4.1.1/lua/typemaps.i rename to usr/share/swig/4.2.1/lua/typemaps.i diff --git a/usr/share/swig/4.1.1/lua/wchar.i b/usr/share/swig/4.2.1/lua/wchar.i similarity index 100% rename from usr/share/swig/4.1.1/lua/wchar.i rename to usr/share/swig/4.2.1/lua/wchar.i diff --git a/usr/share/swig/4.1.1/math.i b/usr/share/swig/4.2.1/math.i similarity index 100% rename from usr/share/swig/4.1.1/math.i rename to usr/share/swig/4.2.1/math.i diff --git a/usr/share/swig/4.2.1/mzscheme/argcargv.i b/usr/share/swig/4.2.1/mzscheme/argcargv.i new file mode 100644 index 00000000000..eec1e0d05b9 --- /dev/null +++ b/usr/share/swig/4.2.1/mzscheme/argcargv.i @@ -0,0 +1,41 @@ +/* ------------------------------------------------------------- + * SWIG library containing argc and argv multi-argument typemaps + * ------------------------------------------------------------- */ + +%typemap(in) (int ARGC, char **ARGV) { + $1_ltype i, len; + Scheme_Object **elems; + SWIG_contract_assert($input != (Scheme_Object *)NULL && + $input != scheme_null && + SCHEME_TYPE($input) == scheme_vector_type, "null array"); + len = SCHEME_VEC_SIZE($input); + $1 = len; + $2 = ($2_ltype) SWIG_MzScheme_Malloc((size_t)(len+1)*sizeof($*2_ltype), FUNC_NAME); + elems = SCHEME_VEC_ELS($input); + for (i = 0; i < len; i++) { + SWIG_contract_assert(SCHEME_TYPE(elems[i]) == scheme_char_string_type, + "elements in array must be strings"); + $2[i] = ($*2_ltype)SCHEME_STR_VAL(elems[i]); + } + $2[i] = NULL; +} + +%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { + if ($input != (Scheme_Object *)NULL && $input != scheme_null && + SCHEME_TYPE($input) == scheme_vector_type) { + size_t len = SCHEME_VEC_SIZE($input); + size_t i; + Scheme_Object **elems = SCHEME_VEC_ELS($input); + for (i = 0; i < len; i++) { + if (SCHEME_TYPE(elems[i]) != scheme_char_string_type) { + break; + } + } + /* All elements are strings! */ + $1 = (i == len); + } +} + +%typemap(freearg) (int ARGC, char **ARGV) { + SWIG_free((void *)$2); +} diff --git a/usr/share/swig/4.1.1/mzscheme/mzrun.swg b/usr/share/swig/4.2.1/mzscheme/mzrun.swg similarity index 97% rename from usr/share/swig/4.1.1/mzscheme/mzrun.swg rename to usr/share/swig/4.2.1/mzscheme/mzrun.swg index 57d040812cf..8adae46b3aa 100644 --- a/usr/share/swig/4.1.1/mzscheme/mzrun.swg +++ b/usr/share/swig/4.2.1/mzscheme/mzrun.swg @@ -25,9 +25,10 @@ extern "C" { #define SWIG_contract_assert(expr,msg) \ do { \ if (!(expr)) { \ - char *m=(char *) scheme_malloc(strlen(msg)+1000); \ - sprintf(m,"SWIG contract, assertion failed: function=%s, message=%s", \ - (char *) FUNC_NAME,(char *) msg); \ + size_t len=strlen(msg)+1000; \ + char *m=(char *) scheme_malloc(len); \ + SWIG_snprintf2(m, len, "SWIG contract, assertion failed: function=%s, message=%s", \ + (char *) FUNC_NAME,(char *) msg); \ scheme_signal_error(m); \ } \ } while (0) @@ -217,7 +218,8 @@ SWIG_MzScheme_Malloc(size_t size, const char *func_name) { void *p = malloc(size); if (p == NULL) { scheme_signal_error("swig-memory-error"); - } else return p; + } + return p; } static Scheme_Object * @@ -420,10 +422,10 @@ SWIG_MzScheme_new_scheme_struct (Scheme_Env* env, const char* basename, int L=strlen(mz_dynload_libpaths[k])+strlen("\\")+strlen(mz_dlopen_libraries[i])+1; libp=(char *) malloc(L*sizeof(char)); #ifdef __OS_WIN32 - sprintf(libp,"%s\\%s",mz_dynload_libpaths[k],mz_dlopen_libraries[i]); + SWIG_snprintf2(libp,L,"%s\\%s",mz_dynload_libpaths[k],mz_dlopen_libraries[i]); mz_libraries[i]=(void *) LoadLibrary(libp); #else - sprintf(libp,"%s/%s",mz_dynload_libpaths[k],mz_dlopen_libraries[i]); + SWIG_snprintf2(libp,L,"%s/%s",mz_dynload_libpaths[k],mz_dlopen_libraries[i]); mz_libraries[i]=(void *) dlopen(libp,RTLD_LAZY); #endif if (mz_dynload_debug) { diff --git a/usr/share/swig/4.1.1/mzscheme/mzscheme.swg b/usr/share/swig/4.2.1/mzscheme/mzscheme.swg similarity index 100% rename from usr/share/swig/4.1.1/mzscheme/mzscheme.swg rename to usr/share/swig/4.2.1/mzscheme/mzscheme.swg diff --git a/usr/share/swig/4.1.1/mzscheme/std_auto_ptr.i b/usr/share/swig/4.2.1/mzscheme/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/mzscheme/std_auto_ptr.i rename to usr/share/swig/4.2.1/mzscheme/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/mzscheme/std_common.i b/usr/share/swig/4.2.1/mzscheme/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/mzscheme/std_common.i rename to usr/share/swig/4.2.1/mzscheme/std_common.i diff --git a/usr/share/swig/4.1.1/perl5/std_deque.i b/usr/share/swig/4.2.1/mzscheme/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/std_deque.i rename to usr/share/swig/4.2.1/mzscheme/std_deque.i diff --git a/usr/share/swig/4.2.1/mzscheme/std_map.i b/usr/share/swig/4.2.1/mzscheme/std_map.i new file mode 100644 index 00000000000..4d312f56d24 --- /dev/null +++ b/usr/share/swig/4.2.1/mzscheme/std_map.i @@ -0,0 +1,284 @@ +/* ----------------------------------------------------------------------------- + * std_map.i + * + * SWIG typemaps for std::map + * ----------------------------------------------------------------------------- */ + +%include +%include + +// ------------------------------------------------------------------------ +// std::map +// +// The aim of all that follows would be to integrate std::map with +// MzScheme as much as possible, namely, to allow the user to pass and +// be returned Scheme association lists. +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::map), f(const std::map&), f(const std::map*): +// the parameter being read-only, either a Scheme alist or a +// previously wrapped std::map can be passed. +// -- f(std::map&), f(std::map*): +// the parameter must be modified; therefore, only a wrapped std::map +// can be passed. +// -- std::map f(): +// the map is returned by copy; therefore, a Scheme alist +// is returned which is most easily used in other Scheme functions +// -- std::map& f(), std::map* f(), const std::map& f(), +// const std::map* f(): +// the map is returned by reference; therefore, a wrapped std::map +// is returned +// ------------------------------------------------------------------------ + +%{ +#include +#include +#include +%} + +// exported class + +namespace std { + + template > class map { + %typemap(in) map< K, T, C > (std::map< K, T, C >* m) { + if (SCHEME_NULLP($input)) { + $1 = std::map< K, T, C >(); + } else if (SCHEME_PAIRP($input)) { + $1 = std::map< K, T, C >(); + Scheme_Object* alist = $input; + while (!SCHEME_NULLP(alist)) { + K* k; + T* x; + Scheme_Object *entry, *key, *val; + entry = scheme_car(alist); + if (!SCHEME_PAIRP(entry)) + SWIG_exception(SWIG_TypeError,"alist expected"); + key = scheme_car(entry); + val = scheme_cdr(entry); + k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) == -1) { + if (!SCHEME_PAIRP(val)) + SWIG_exception(SWIG_TypeError,"alist expected"); + val = scheme_car(val); + x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); + } +%#ifdef __cpp_lib_map_try_emplace + (($1_type &)$1).insert_or_assign(*k, *x); +%#else + (($1_type &)$1)[*k] = *x; +%#endif + alist = scheme_cdr(alist); + } + } else { + $1 = *(($&1_type) + SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); + } + } + %typemap(in) const map< K, T, C >& (std::map< K, T, C > temp, + std::map< K, T, C >* m), + const map< K, T, C >* (std::map< K, T, C > temp, + std::map< K, T, C >* m) { + if (SCHEME_NULLP($input)) { + temp = std::map< K, T, C >(); + $1 = &temp; + } else if (SCHEME_PAIRP($input)) { + temp = std::map< K, T, C >(); + $1 = &temp; + Scheme_Object* alist = $input; + while (!SCHEME_NULLP(alist)) { + K* k; + T* x; + Scheme_Object *entry, *key, *val; + entry = scheme_car(alist); + if (!SCHEME_PAIRP(entry)) + SWIG_exception(SWIG_TypeError,"alist expected"); + key = scheme_car(entry); + val = scheme_cdr(entry); + k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) == -1) { + if (!SCHEME_PAIRP(val)) + SWIG_exception(SWIG_TypeError,"alist expected"); + val = scheme_car(val); + x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); + } +%#ifdef __cpp_lib_map_try_emplace + temp.insert_or_assign(*k, *x); +%#else + temp[*k] = *x; +%#endif + alist = scheme_cdr(alist); + } + } else { + $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); + } + } + %typemap(out) map< K, T, C > { + Scheme_Object* alist = scheme_null; + for (std::map< K, T, C >::reverse_iterator i=$1.rbegin(); + i!=$1.rend(); ++i) { + K* key = new K(i->first); + T* val = new T(i->second); + Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); + Scheme_Object* x = SWIG_NewPointerObj(val,$descriptor(T *), 1); + Scheme_Object* entry = scheme_make_pair(k,x); + alist = scheme_make_pair(entry,alist); + } + $result = alist; + } + %typecheck(SWIG_TYPECHECK_MAP) map< K, T, C > { + /* native sequence? */ + if (SCHEME_NULLP($input)) { + /* an empty sequence can be of any type */ + $1 = 1; + } else if (SCHEME_PAIRP($input)) { + /* check the first element only */ + K* k; + T* x; + Scheme_Object* head = scheme_car($input); + if (SCHEME_PAIRP(head)) { + Scheme_Object* key = scheme_car(head); + Scheme_Object* val = scheme_cdr(head); + if (SWIG_ConvertPtr(key,(void**) &k, + $descriptor(K *), 0) == -1) { + $1 = 0; + } else { + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) != -1) { + $1 = 1; + } else if (SCHEME_PAIRP(val)) { + val = scheme_car(val); + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) != -1) + $1 = 1; + else + $1 = 0; + } else { + $1 = 0; + } + } + } else { + $1 = 0; + } + } else { + /* wrapped map? */ + std::map< K, T, C >* m; + if (SWIG_ConvertPtr($input,(void **) &m, + $&1_descriptor, 0) != -1) + $1 = 1; + else + $1 = 0; + } + } + %typecheck(SWIG_TYPECHECK_MAP) const map< K, T, C >&, + const map< K, T, C >* { + /* native sequence? */ + if (SCHEME_NULLP($input)) { + /* an empty sequence can be of any type */ + $1 = 1; + } else if (SCHEME_PAIRP($input)) { + /* check the first element only */ + K* k; + T* x; + Scheme_Object* head = scheme_car($input); + if (SCHEME_PAIRP(head)) { + Scheme_Object* key = scheme_car(head); + Scheme_Object* val = scheme_cdr(head); + if (SWIG_ConvertPtr(key,(void**) &k, + $descriptor(K *), 0) == -1) { + $1 = 0; + } else { + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) != -1) { + $1 = 1; + } else if (SCHEME_PAIRP(val)) { + val = scheme_car(val); + if (SWIG_ConvertPtr(val,(void**) &x, + $descriptor(T *), 0) != -1) + $1 = 1; + else + $1 = 0; + } else { + $1 = 0; + } + } + } else { + $1 = 0; + } + } else { + /* wrapped map? */ + std::map< K, T, C >* m; + if (SWIG_ConvertPtr($input,(void **) &m, + $1_descriptor, 0) != -1) + $1 = 1; + else + $1 = 0; + } + } + %rename("length") size; + %rename("null?") empty; + %rename("clear!") clear; + %rename("ref") __getitem__; + %rename("set!") __setitem__; + %rename("delete!") __delitem__; + %rename("has-key?") has_key; + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef K key_type; + typedef T mapped_type; + typedef std::pair< const K, T > value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + + map(); + map(const map& other); + + unsigned int size() const; + bool empty() const; + void clear(); + %extend { + T& __getitem__(const K& key) throw (std::out_of_range) { + std::map< K, T, C >::iterator i = self->find(key); + if (i != self->end()) + return i->second; + else + throw std::out_of_range("key not found"); + } + void __setitem__(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else + (*self)[key] = x; +%#endif + } + void __delitem__(const K& key) throw (std::out_of_range) { + std::map< K, T, C >::iterator i = self->find(key); + if (i != self->end()) + self->erase(i); + else + throw std::out_of_range("key not found"); + } + bool has_key(const K& key) { + std::map< K, T, C >::iterator i = self->find(key); + return i != self->end(); + } + Scheme_Object* keys() { + Scheme_Object* result = scheme_null; + for (std::map< K, T, C >::reverse_iterator i=self->rbegin(); + i!=self->rend(); ++i) { + K* key = new K(i->first); + Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1); + result = scheme_make_pair(k,result); + } + return result; + } + } + }; + +} diff --git a/usr/share/swig/4.1.1/mzscheme/std_pair.i b/usr/share/swig/4.2.1/mzscheme/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/mzscheme/std_pair.i rename to usr/share/swig/4.2.1/mzscheme/std_pair.i diff --git a/usr/share/swig/4.1.1/mzscheme/std_string.i b/usr/share/swig/4.2.1/mzscheme/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/mzscheme/std_string.i rename to usr/share/swig/4.2.1/mzscheme/std_string.i diff --git a/usr/share/swig/4.1.1/mzscheme/std_unique_ptr.i b/usr/share/swig/4.2.1/mzscheme/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/mzscheme/std_unique_ptr.i rename to usr/share/swig/4.2.1/mzscheme/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/mzscheme/std_vector.i b/usr/share/swig/4.2.1/mzscheme/std_vector.i similarity index 99% rename from usr/share/swig/4.1.1/mzscheme/std_vector.i rename to usr/share/swig/4.2.1/mzscheme/std_vector.i index 0ef5edb15f6..ae886b7b84a 100644 --- a/usr/share/swig/4.1.1/mzscheme/std_vector.i +++ b/usr/share/swig/4.2.1/mzscheme/std_vector.i @@ -421,6 +421,9 @@ namespace std { } }; %enddef + %typemap(throws) std::out_of_range { + scheme_signal_error("%s: %s", FUNC_NAME, $1.what()); + } specialize_std_vector(bool,SCHEME_BOOLP,SCHEME_TRUEP,\ swig_make_boolean); diff --git a/usr/share/swig/4.1.1/ocaml/stl.i b/usr/share/swig/4.2.1/mzscheme/stl.i similarity index 100% rename from usr/share/swig/4.1.1/ocaml/stl.i rename to usr/share/swig/4.2.1/mzscheme/stl.i diff --git a/usr/share/swig/4.1.1/mzscheme/swigmove.i b/usr/share/swig/4.2.1/mzscheme/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/mzscheme/swigmove.i rename to usr/share/swig/4.2.1/mzscheme/swigmove.i diff --git a/usr/share/swig/4.1.1/mzscheme/typemaps.i b/usr/share/swig/4.2.1/mzscheme/typemaps.i similarity index 99% rename from usr/share/swig/4.1.1/mzscheme/typemaps.i rename to usr/share/swig/4.2.1/mzscheme/typemaps.i index 6c31aea52e9..7ceffb20e66 100644 --- a/usr/share/swig/4.1.1/mzscheme/typemaps.i +++ b/usr/share/swig/4.2.1/mzscheme/typemaps.i @@ -207,8 +207,6 @@ s = C_TO_MZ(*$1); SWIG_APPEND_VALUE(s); } -%typemap(in) C_NAME *BOTH = C_NAME *INPUT; -%typemap(argout) C_NAME *BOTH = C_NAME *OUTPUT; %typemap(in) C_NAME *INOUT = C_NAME *INPUT; %typemap(argout) C_NAME *INOUT = C_NAME *OUTPUT; %enddef diff --git a/usr/share/swig/4.1.1/ocaml/carray.i b/usr/share/swig/4.2.1/ocaml/carray.i similarity index 97% rename from usr/share/swig/4.1.1/ocaml/carray.i rename to usr/share/swig/4.2.1/ocaml/carray.i index 4378f7333e1..71631aab85e 100644 --- a/usr/share/swig/4.1.1/ocaml/carray.i +++ b/usr/share/swig/4.2.1/ocaml/carray.i @@ -77,7 +77,7 @@ type _value = c_obj %typemap(out) SWIGTYPE [] { int i; - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); + const value *fromval = caml_named_value("create_$ntype_from_ptr"); $result = caml_array_new($1_dim0); for( i = 0; i < $1_dim0; i++ ) { diff --git a/usr/share/swig/4.1.1/ocaml/class.swg b/usr/share/swig/4.2.1/ocaml/class.swg similarity index 100% rename from usr/share/swig/4.1.1/ocaml/class.swg rename to usr/share/swig/4.2.1/ocaml/class.swg diff --git a/usr/share/swig/4.1.1/ocaml/cstring.i b/usr/share/swig/4.2.1/ocaml/cstring.i similarity index 92% rename from usr/share/swig/4.1.1/ocaml/cstring.i rename to usr/share/swig/4.2.1/ocaml/cstring.i index f1190ad5c89..3f680a2817f 100644 --- a/usr/share/swig/4.1.1/ocaml/cstring.i +++ b/usr/share/swig/4.2.1/ocaml/cstring.i @@ -25,13 +25,13 @@ * * %cstring_bounded_output(char *outx, 512); * void foo(char *outx) { - * sprintf(outx,"blah blah\n"); + * strcpy(outx,"blah blah\n"); * } * */ %define %cstring_bounded_output(TYPEMAP,MAX) -%typemap(ignore) TYPEMAP(char temp[MAX+1]) { +%typemap(in,numinputs=0) TYPEMAP(char temp[MAX+1]) { $1 = ($1_ltype) temp; } %typemap(argout) TYPEMAP { @@ -54,7 +54,7 @@ */ %define %cstring_chunk_output(TYPEMAP,SIZE) -%typemap(ignore) TYPEMAP(char temp[SIZE]) { +%typemap(in,numinputs=0) TYPEMAP(char temp[SIZE]) { $1 = ($1_ltype) temp; } %typemap(argout) TYPEMAP { @@ -144,7 +144,7 @@ * * %cstring_output_maxsize(char *outx, int max) { * void foo(char *outx, int max) { - * sprintf(outx,"blah blah\n"); + * strcpy(outx,"blah blah\n"); * } */ @@ -175,7 +175,7 @@ * * %cstring_output_maxsize(char *outx, int *max) { * void foo(char *outx, int *max) { - * sprintf(outx,"blah blah\n"); + * strcpy(outx,"blah blah\n"); * *max = strlen(outx); * } */ @@ -213,12 +213,12 @@ * %cstring_output_allocated(char **outx, free($1)); * void foo(char **outx) { * *outx = (char *) malloc(512); - * sprintf(outx,"blah blah\n"); + * strcpy(outx,"blah blah\n"); * } */ %define %cstring_output_allocate(TYPEMAP, RELEASE) -%typemap(ignore) TYPEMAP($*1_ltype temp = 0) { +%typemap(in,numinputs=0) TYPEMAP($*1_ltype temp = 0) { $1 = &temp; } @@ -241,13 +241,13 @@ * %cstring_output_allocated(char **outx, int *sz, free($1)); * void foo(char **outx, int *sz) { * *outx = (char *) malloc(512); - * sprintf(outx,"blah blah\n"); + * strcpy(outx,"blah blah\n"); * *sz = strlen(outx); * } */ %define %cstring_output_allocate_size(TYPEMAP, SIZE, RELEASE) -%typemap(ignore) (TYPEMAP, SIZE) ($*1_ltype temp = 0, $*2_ltype tempn) { +%typemap(in,numinputs=0) (TYPEMAP, SIZE) ($*1_ltype temp = 0, $*2_ltype tempn) { $1 = &temp; $2 = &tempn; } diff --git a/usr/share/swig/4.1.1/ocaml/director.swg b/usr/share/swig/4.2.1/ocaml/director.swg similarity index 95% rename from usr/share/swig/4.1.1/ocaml/director.swg rename to usr/share/swig/4.2.1/ocaml/director.swg index eb91aaf4b3f..4cdb0c6239a 100644 --- a/usr/share/swig/4.1.1/ocaml/director.swg +++ b/usr/share/swig/4.2.1/ocaml/director.swg @@ -67,13 +67,13 @@ namespace Swig { class Director { private: /* pointer to the wrapped ocaml object */ - CAML_VALUE swig_self; + value swig_self; /* flag indicating whether the object is owned by ocaml or c++ */ mutable bool swig_disown_flag; public: /* wrap a ocaml object. */ - Director(CAML_VALUE self) : swig_self(self), swig_disown_flag(false) { + Director(value self) : swig_self(self), swig_disown_flag(false) { caml_register_global_root(&swig_self); } @@ -85,7 +85,7 @@ namespace Swig { } /* return a pointer to the wrapped ocaml object */ - CAML_VALUE swig_get_self() const { + value swig_get_self() const { return swig_self; } diff --git a/usr/share/swig/4.1.1/ocaml/ocaml.i b/usr/share/swig/4.2.1/ocaml/ocaml.i similarity index 100% rename from usr/share/swig/4.1.1/ocaml/ocaml.i rename to usr/share/swig/4.2.1/ocaml/ocaml.i diff --git a/usr/share/swig/4.1.1/ocaml/ocaml.swg b/usr/share/swig/4.2.1/ocaml/ocaml.swg similarity index 97% rename from usr/share/swig/4.1.1/ocaml/ocaml.swg rename to usr/share/swig/4.2.1/ocaml/ocaml.swg index 703b7e44889..b3ccab59478 100644 --- a/usr/share/swig/4.1.1/ocaml/ocaml.swg +++ b/usr/share/swig/4.2.1/ocaml/ocaml.swg @@ -63,7 +63,7 @@ #if 0 %typemap(argout) SWIGTYPE & { - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); + const value *fromval = caml_named_value("create_$ntype_from_ptr"); if( fromval ) { swig_result = caml_list_append(swig_result, @@ -76,7 +76,7 @@ } } %typemap(argout) SWIGTYPE && { - const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); + const value *fromval = caml_named_value("create_$ntype_from_ptr"); if( fromval ) { swig_result = caml_list_append(swig_result, @@ -193,8 +193,8 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); /* Pass through value */ -%typemap (in) CAML_VALUE "$1=$input;" -%typemap (out) CAML_VALUE "$result=$1;" +%typemap (in) value "$1=$input;" +%typemap (out) value "$result=$1;" #if 0 %include diff --git a/usr/share/swig/4.1.1/ocaml/ocamlkw.swg b/usr/share/swig/4.2.1/ocaml/ocamlkw.swg similarity index 100% rename from usr/share/swig/4.1.1/ocaml/ocamlkw.swg rename to usr/share/swig/4.2.1/ocaml/ocamlkw.swg diff --git a/usr/share/swig/4.1.1/ocaml/ocamlrun.swg b/usr/share/swig/4.2.1/ocaml/ocamlrun.swg similarity index 57% rename from usr/share/swig/4.1.1/ocaml/ocamlrun.swg rename to usr/share/swig/4.2.1/ocaml/ocamlrun.swg index 53ad952fba6..95350eacd88 100644 --- a/usr/share/swig/4.1.1/ocaml/ocamlrun.swg +++ b/usr/share/swig/4.2.1/ocaml/ocamlrun.swg @@ -91,20 +91,20 @@ extern "C" { } } - SWIGINTERN void caml_print_list( CAML_VALUE v ); + SWIGINTERN void caml_print_list( value v ); - SWIGINTERN void caml_print_val( CAML_VALUE v ) { - switch( SWIG_Tag_val(v) ) { + SWIGINTERN void caml_print_val( value v ) { + switch( Tag_val(v) ) { case C_bool: - if( Bool_val(SWIG_Field(v,0)) ) fprintf( stderr, "true " ); + if( Bool_val(Field(v,0)) ) fprintf( stderr, "true " ); else fprintf( stderr, "false " ); break; case C_char: case C_uchar: fprintf( stderr, "'%c' (\\%03d) ", - (Int_val(SWIG_Field(v,0)) >= ' ' && - Int_val(SWIG_Field(v,0)) < 127) ? Int_val(SWIG_Field(v,0)) : '.', - Int_val(SWIG_Field(v,0)) ); + (Int_val(Field(v,0)) >= ' ' && + Int_val(Field(v,0)) < 127) ? Int_val(Field(v,0)) : '.', + Int_val(Field(v,0)) ); break; case C_short: case C_ushort: @@ -127,7 +127,7 @@ extern "C" { case C_ptr: { void *vout = 0; - swig_type_info *ty = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1)); + swig_type_info *ty = (swig_type_info *)(long)Int64_val(Field(v,1)); caml_ptr_val_internal(v,&vout,0); fprintf( stderr, "PTR(%p,%s) ", vout, @@ -137,15 +137,15 @@ extern "C" { case C_array: { unsigned int i; - for( i = 0; i < Wosize_val( SWIG_Field(v,0) ); i++ ) - caml_print_val( SWIG_Field(SWIG_Field(v,0),i) ); + for( i = 0; i < Wosize_val( Field(v,0) ); i++ ) + caml_print_val( Field(Field(v,0),i) ); } break; case C_list: - caml_print_list( SWIG_Field(v,0) ); + caml_print_list( Field(v,0) ); break; case C_obj: - fprintf( stderr, "OBJ(%p) ", (void *)SWIG_Field(v,0) ); + fprintf( stderr, "OBJ(%p) ", (void *)Field(v,0) ); break; case C_string: { @@ -157,30 +157,30 @@ extern "C" { } } - SWIGINTERN void caml_print_list( CAML_VALUE v ) { + SWIGINTERN void caml_print_list( value v ) { CAMLparam1(v); while( v && Is_block(v) ) { fprintf( stderr, "[ " ); - caml_print_val( SWIG_Field(v,0) ); + caml_print_val( Field(v,0) ); fprintf( stderr, "]\n" ); - v = SWIG_Field(v,1); + v = Field(v,1); } CAMLreturn0; } - SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ) { + SWIGINTERN value caml_list_nth( value lst, int n ) { CAMLparam1(lst); int i = 0; while( i < n && lst && Is_block(lst) ) { - i++; lst = SWIG_Field(lst,1); + i++; lst = Field(lst,1); } if( lst == Val_unit ) CAMLreturn(Val_unit); - else CAMLreturn(SWIG_Field(lst,0)); + else CAMLreturn(Field(lst,0)); } - SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ) { + SWIGINTERN value caml_list_append( value lst, value elt ) { CAMLparam2(lst,elt); - SWIG_CAMLlocal3(v,vt,lh); + CAMLlocal3(v,vt,lh); lh = Val_unit; v = Val_unit; @@ -190,224 +190,224 @@ extern "C" { while( lst && Is_block(lst) ) { if( v && v != Val_unit ) { vt = caml_alloc_tuple(2); - SWIG_Store_field(v,1,vt); + Store_field(v,1,vt); v = vt; } else { v = lh = caml_alloc_tuple(2); } - SWIG_Store_field(v,0,SWIG_Field(lst,0)); - lst = SWIG_Field(lst,1); + Store_field(v,0,Field(lst,0)); + lst = Field(lst,1); } if( v && Is_block(v) ) { vt = caml_alloc_tuple(2); - SWIG_Store_field(v,1,vt); + Store_field(v,1,vt); v = vt; } else { v = lh = caml_alloc_tuple(2); } - SWIG_Store_field(v,0,elt); - SWIG_Store_field(v,1,Val_unit); + Store_field(v,0,elt); + Store_field(v,1,Val_unit); CAMLreturn(lh); } - SWIGINTERN int caml_list_length( CAML_VALUE lst ) { + SWIGINTERN int caml_list_length( value lst ) { CAMLparam1(lst); int i = 0; - while( lst && Is_block(lst) ) { i++; lst = SWIG_Field(lst,1); } + while( lst && Is_block(lst) ) { i++; lst = Field(lst,1); } CAMLreturn(i); } - SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ) { + SWIGINTERN void caml_array_set( value arr, int n, value item ) { CAMLparam2(arr,item); - SWIG_Store_field(SWIG_Field(arr,0),n,item); + Store_field(Field(arr,0),n,item); CAMLreturn0; } - SWIGINTERN value caml_array_nth( CAML_VALUE arr, int n ) { + SWIGINTERN value caml_array_nth( value arr, int n ) { CAMLparam1(arr); - if( SWIG_Tag_val(arr) == C_array ) - CAMLreturn(SWIG_Field(SWIG_Field(arr,0),n)); - else if( SWIG_Tag_val(arr) == C_list ) + if( Tag_val(arr) == C_array ) + CAMLreturn(Field(Field(arr,0),n)); + else if( Tag_val(arr) == C_list ) CAMLreturn(caml_list_nth(arr,0)); else caml_failwith("Need array or list"); } - SWIGINTERN int caml_array_len( CAML_VALUE arr ) { + SWIGINTERN int caml_array_len( value arr ) { CAMLparam1(arr); - if( SWIG_Tag_val(arr) == C_array ) - CAMLreturn(Wosize_val(SWIG_Field(arr,0))); - else if( SWIG_Tag_val(arr) == C_list ) + if( Tag_val(arr) == C_array ) + CAMLreturn(Wosize_val(Field(arr,0))); + else if( Tag_val(arr) == C_list ) CAMLreturn(caml_list_length(arr)); else caml_failwith("Need array or list"); } - SWIGINTERN CAML_VALUE caml_swig_alloc(int x,int y) { + SWIGINTERN value caml_swig_alloc(int x,int y) { return caml_alloc(x,y); } SWIGINTERN value caml_array_new( int n ) { CAMLparam0(); - SWIG_CAMLlocal1(vv); + CAMLlocal1(vv); vv = caml_swig_alloc(1,C_array); - SWIG_Store_field(vv,0,caml_alloc_tuple(n)); + Store_field(vv,0,caml_alloc_tuple(n)); CAMLreturn(vv); } - SWIGINTERN CAML_VALUE caml_val_bool( int b ) { + SWIGINTERN value caml_val_bool( int b ) { CAMLparam0(); - SWIG_CAMLlocal1(bv); + CAMLlocal1(bv); bv = caml_swig_alloc(1,C_bool); - SWIG_Store_field(bv,0,Val_bool(b)); + Store_field(bv,0,Val_bool(b)); CAMLreturn(bv); } - SWIGINTERN CAML_VALUE caml_val_char( char c ) { + SWIGINTERN value caml_val_char( char c ) { CAMLparam0(); - SWIG_CAMLlocal1(cv); + CAMLlocal1(cv); cv = caml_swig_alloc(1,C_char); - SWIG_Store_field(cv,0,Val_int(c)); + Store_field(cv,0,Val_int(c)); CAMLreturn(cv); } - SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char uc ) { + SWIGINTERN value caml_val_uchar( unsigned char uc ) { CAMLparam0(); - SWIG_CAMLlocal1(ucv); + CAMLlocal1(ucv); ucv = caml_swig_alloc(1,C_uchar); - SWIG_Store_field(ucv,0,Val_int(uc)); + Store_field(ucv,0,Val_int(uc)); CAMLreturn(ucv); } - SWIGINTERN CAML_VALUE caml_val_short( short s ) { + SWIGINTERN value caml_val_short( short s ) { CAMLparam0(); - SWIG_CAMLlocal1(sv); + CAMLlocal1(sv); sv = caml_swig_alloc(1,C_short); - SWIG_Store_field(sv,0,Val_int(s)); + Store_field(sv,0,Val_int(s)); CAMLreturn(sv); } - SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short us ) { + SWIGINTERN value caml_val_ushort( unsigned short us ) { CAMLparam0(); - SWIG_CAMLlocal1(usv); + CAMLlocal1(usv); usv = caml_swig_alloc(1,C_ushort); - SWIG_Store_field(usv,0,Val_int(us)); + Store_field(usv,0,Val_int(us)); CAMLreturn(usv); } - SWIGINTERN CAML_VALUE caml_val_int( int i ) { + SWIGINTERN value caml_val_int( int i ) { CAMLparam0(); - SWIG_CAMLlocal1(iv); + CAMLlocal1(iv); iv = caml_swig_alloc(1,C_int); - SWIG_Store_field(iv,0,Val_int(i)); + Store_field(iv,0,Val_int(i)); CAMLreturn(iv); } - SWIGINTERN CAML_VALUE caml_val_uint( unsigned int ui ) { + SWIGINTERN value caml_val_uint( unsigned int ui ) { CAMLparam0(); - SWIG_CAMLlocal1(uiv); + CAMLlocal1(uiv); uiv = caml_swig_alloc(1,C_int); - SWIG_Store_field(uiv,0,Val_int(ui)); + Store_field(uiv,0,Val_int(ui)); CAMLreturn(uiv); } - SWIGINTERN CAML_VALUE caml_val_long( long l ) { + SWIGINTERN value caml_val_long( long l ) { CAMLparam0(); - SWIG_CAMLlocal1(lv); + CAMLlocal1(lv); lv = caml_swig_alloc(1,C_int64); - SWIG_Store_field(lv,0,caml_copy_int64(l)); + Store_field(lv,0,caml_copy_int64(l)); CAMLreturn(lv); } - SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long ul ) { + SWIGINTERN value caml_val_ulong( unsigned long ul ) { CAMLparam0(); - SWIG_CAMLlocal1(ulv); + CAMLlocal1(ulv); ulv = caml_swig_alloc(1,C_int64); - SWIG_Store_field(ulv,0,caml_copy_int64(ul)); + Store_field(ulv,0,caml_copy_int64(ul)); CAMLreturn(ulv); } - SWIGINTERN CAML_VALUE caml_val_float( float f ) { + SWIGINTERN value caml_val_float( float f ) { CAMLparam0(); - SWIG_CAMLlocal1(fv); + CAMLlocal1(fv); fv = caml_swig_alloc(1,C_float); - SWIG_Store_field(fv,0,caml_copy_double((double)f)); + Store_field(fv,0,caml_copy_double((double)f)); CAMLreturn(fv); } - SWIGINTERN CAML_VALUE caml_val_double( double d ) { + SWIGINTERN value caml_val_double( double d ) { CAMLparam0(); - SWIG_CAMLlocal1(fv); + CAMLlocal1(fv); fv = caml_swig_alloc(1,C_double); - SWIG_Store_field(fv,0,caml_copy_double(d)); + Store_field(fv,0,caml_copy_double(d)); CAMLreturn(fv); } - SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *info ) { + SWIGINTERN value caml_val_ptr( void *p, swig_type_info *info ) { CAMLparam0(); - SWIG_CAMLlocal1(vv); + CAMLlocal1(vv); vv = caml_swig_alloc(2,C_ptr); - SWIG_Store_field(vv,0,caml_copy_int64((long)p)); - SWIG_Store_field(vv,1,caml_copy_int64((long)info)); + Store_field(vv,0,caml_copy_int64((long)p)); + Store_field(vv,1,caml_copy_int64((long)info)); CAMLreturn(vv); } - SWIGINTERN CAML_VALUE caml_val_string( const char *p ) { + SWIGINTERN value caml_val_string( const char *p ) { CAMLparam0(); - SWIG_CAMLlocal1(vv); + CAMLlocal1(vv); if( !p ) CAMLreturn(caml_val_ptr( (void *)p, 0 )); vv = caml_swig_alloc(1,C_string); - SWIG_Store_field(vv,0,caml_copy_string(p)); + Store_field(vv,0,caml_copy_string(p)); CAMLreturn(vv); } - SWIGINTERN CAML_VALUE caml_val_string_len( const char *p, int len ) { + SWIGINTERN value caml_val_string_len( const char *p, int len ) { CAMLparam0(); - SWIG_CAMLlocal1(vv); + CAMLlocal1(vv); if( !p || len < 0 ) CAMLreturn(caml_val_ptr( (void *)p, 0 )); vv = caml_swig_alloc(1,C_string); - SWIG_Store_field(vv,0,caml_alloc_string(len)); - memcpy(Bp_val(SWIG_Field(vv,0)),p,len); + Store_field(vv,0,caml_alloc_string(len)); + memcpy(Bp_val(Field(vv,0)),p,len); CAMLreturn(vv); } #define caml_val_obj(v, name) caml_val_obj_helper(v, SWIG_TypeQuery((name)), name) - SWIGINTERN CAML_VALUE caml_val_obj_helper( void *v, swig_type_info *type, char *name) { + SWIGINTERN value caml_val_obj_helper( void *v, swig_type_info *type, char *name) { CAMLparam0(); CAMLreturn(caml_callback2(*caml_named_value("caml_create_object_fn"), caml_val_ptr(v,type), caml_copy_string(name))); } - SWIGINTERN long caml_long_val_full( CAML_VALUE v, const char *name ) { + SWIGINTERN long caml_long_val_full( value v, const char *name ) { CAMLparam1(v); if( !Is_block(v) ) return 0; - switch( SWIG_Tag_val(v) ) { + switch( Tag_val(v) ) { case C_bool: case C_char: case C_uchar: case C_short: case C_ushort: case C_int: - CAMLreturn(Int_val(SWIG_Field(v,0))); + CAMLreturn(Int_val(Field(v,0))); case C_uint: case C_int32: - CAMLreturn(Int32_val(SWIG_Field(v,0))); + CAMLreturn(Int32_val(Field(v,0))); case C_int64: - CAMLreturn((long)SWIG_Int64_val(SWIG_Field(v,0))); + CAMLreturn((long)Int64_val(Field(v,0))); case C_float: case C_double: - CAMLreturn((long)Double_val(SWIG_Field(v,0))); + CAMLreturn((long)Double_val(Field(v,0))); case C_string: - CAMLreturn((long)String_val(SWIG_Field(v,0))); + CAMLreturn((long)String_val(Field(v,0))); case C_ptr: - CAMLreturn((long)SWIG_Int64_val(SWIG_Field(SWIG_Field(v,0),0))); + CAMLreturn((long)Int64_val(Field(Field(v,0),0))); case C_enum: { - SWIG_CAMLlocal1(ret); - const CAML_VALUE *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int"); + CAMLlocal1(ret); + const value *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int"); if( !name ) caml_failwith( "Not an enum conversion" ); ret = caml_callback2(*enum_to_int,*caml_named_value(name),v); CAMLreturn(caml_long_val(ret)); @@ -417,100 +417,100 @@ extern "C" { } } - SWIGINTERN long caml_long_val( CAML_VALUE v ) { + SWIGINTERN long caml_long_val( value v ) { return caml_long_val_full(v,0); } - SWIGINTERN double caml_double_val( CAML_VALUE v ) { + SWIGINTERN double caml_double_val( value v ) { CAMLparam1(v); if( !Is_block(v) ) return 0.0; - switch( SWIG_Tag_val(v) ) { + switch( Tag_val(v) ) { case C_bool: case C_char: case C_uchar: case C_short: case C_ushort: case C_int: - CAMLreturn_type(Int_val(SWIG_Field(v,0))); + CAMLreturnT(double, Int_val(Field(v,0))); case C_uint: case C_int32: - CAMLreturn_type(Int32_val(SWIG_Field(v,0))); + CAMLreturnT(double, Int32_val(Field(v,0))); case C_int64: - CAMLreturn_type(SWIG_Int64_val(SWIG_Field(v,0))); + CAMLreturnT(double, Int64_val(Field(v,0))); case C_float: case C_double: - CAMLreturn_type(Double_val(SWIG_Field(v,0))); + CAMLreturnT(double, Double_val(Field(v,0))); default: - fprintf( stderr, "Unknown block tag %d\n", SWIG_Tag_val(v) ); + fprintf( stderr, "Unknown block tag %d\n", Tag_val(v) ); caml_failwith("No conversion to double"); } } - SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out, + SWIGINTERN int caml_ptr_val_internal( value v, void **out, swig_type_info *descriptor ) { CAMLparam1(v); void *outptr = NULL; swig_type_info *outdescr = NULL; - static const CAML_VALUE *func_val = NULL; + static const value *func_val = NULL; if( v == Val_unit ) { *out = 0; - CAMLreturn_type(0); + CAMLreturnT(int, 0); } if( !Is_block(v) ) return -1; - switch( SWIG_Tag_val(v) ) { + switch( Tag_val(v) ) { case C_obj: if (!func_val) { func_val = caml_named_value("caml_obj_ptr"); } - CAMLreturn_type(caml_ptr_val_internal(caml_callback(*func_val, v), out, descriptor)); + CAMLreturnT(int, caml_ptr_val_internal(caml_callback(*func_val, v), out, descriptor)); case C_string: - outptr = (void *)String_val(SWIG_Field(v,0)); + outptr = (void *)String_val(Field(v,0)); break; case C_ptr: - outptr = (void *)(long)SWIG_Int64_val(SWIG_Field(v,0)); - outdescr = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1)); + outptr = (void *)(long)Int64_val(Field(v,0)); + outdescr = (swig_type_info *)(long)Int64_val(Field(v,1)); break; default: *out = 0; - CAMLreturn_type(1); + CAMLreturnT(int, 1); break; } - CAMLreturn_type(SWIG_GetPtr(outptr, out, outdescr, descriptor)); + CAMLreturnT(int, SWIG_GetPtr(outptr, out, outdescr, descriptor)); } - SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ) { + SWIGINTERN void *caml_ptr_val( value v, swig_type_info *descriptor ) { CAMLparam0(); #ifdef TYPE_CAST_VERBOSE caml_print_val( v ); #endif void *out = NULL; if( !caml_ptr_val_internal( v, &out, descriptor ) ) - CAMLreturn_type(out); + CAMLreturnT(void*, out); else caml_failwith( "No appropriate conversion found." ); } - SWIGINTERN char *caml_string_val( CAML_VALUE v ) { + SWIGINTERN char *caml_string_val( value v ) { return (char *)caml_ptr_val( v, 0 ); } - SWIGINTERN int caml_string_len( CAML_VALUE v ) { - switch( SWIG_Tag_val(v) ) { + SWIGINTERN int caml_string_len( value v ) { + switch( Tag_val(v) ) { case C_string: - return caml_string_length(SWIG_Field(v,0)); + return caml_string_length(Field(v,0)); default: return strlen((char *)caml_ptr_val(v,0)); } } - SWIGINTERN int caml_bool_check( CAML_VALUE v ) { + SWIGINTERN int caml_bool_check( value v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; - switch( SWIG_Tag_val(v) ) { + switch( Tag_val(v) ) { case C_bool: case C_ptr: case C_string: @@ -520,12 +520,12 @@ extern "C" { } } - SWIGINTERN int caml_int_check( CAML_VALUE v ) { + SWIGINTERN int caml_int_check( value v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; - switch( SWIG_Tag_val(v) ) { + switch( Tag_val(v) ) { case C_char: case C_uchar: case C_short: @@ -541,11 +541,11 @@ extern "C" { } } - SWIGINTERN int caml_float_check( CAML_VALUE v ) { + SWIGINTERN int caml_float_check( value v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; - switch( SWIG_Tag_val(v) ) { + switch( Tag_val(v) ) { case C_float: case C_double: CAMLreturn(1); @@ -555,11 +555,11 @@ extern "C" { } } - SWIGINTERN int caml_ptr_check( CAML_VALUE v ) { + SWIGINTERN int caml_ptr_check( value v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; - switch( SWIG_Tag_val(v) ) { + switch( Tag_val(v) ) { case C_string: case C_ptr: case C_int64: @@ -570,11 +570,11 @@ extern "C" { } } - SWIGINTERN CAML_VALUE SWIG_Ocaml_ptr_to_val(const char *name, void *ptr, swig_type_info *descriptor) { + SWIGINTERN value SWIG_Ocaml_ptr_to_val(const char *name, void *ptr, swig_type_info *descriptor) { CAMLparam0(); - SWIG_CAMLlocal1(result); + CAMLlocal1(result); - const CAML_VALUE *fromval = caml_named_value(name); + const value *fromval = caml_named_value(name); if (fromval) { result = caml_callback(*fromval, caml_val_ptr(ptr, descriptor)); } else { @@ -584,17 +584,17 @@ extern "C" { } static swig_module_info *SWIG_Ocaml_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - CAML_VALUE pointer; + value pointer; pointer = caml_callback(*caml_named_value("swig_find_type_info"), caml_val_int(0)); - if (Is_block(pointer) && SWIG_Tag_val(pointer) == C_ptr) { - return (swig_module_info *)(void *)(long)SWIG_Int64_val(SWIG_Field(pointer,0)); + if (Is_block(pointer) && Tag_val(pointer) == C_ptr) { + return (swig_module_info *)(void *)(long)Int64_val(Field(pointer,0)); } return 0; } static void SWIG_Ocaml_SetModule(swig_module_info *pointer) { - CAML_VALUE mod_pointer; + value mod_pointer; mod_pointer = caml_val_ptr(pointer, NULL); caml_callback(*caml_named_value("swig_set_type_info"), mod_pointer); @@ -603,5 +603,3 @@ extern "C" { #ifdef __cplusplus } #endif -#undef value - diff --git a/usr/share/swig/4.2.1/ocaml/ocamlrundec.swg b/usr/share/swig/4.2.1/ocaml/ocamlrundec.swg new file mode 100644 index 00000000000..4d20f34b261 --- /dev/null +++ b/usr/share/swig/4.2.1/ocaml/ocamlrundec.swg @@ -0,0 +1,121 @@ +/* ----------------------------------------------------------------------------- + * ocamlrundec.swg + * + * Ocaml runtime code -- declarations + * ----------------------------------------------------------------------------- */ + +#include +#include +#include + +#ifdef __cplusplus +#define SWIGEXT extern "C" +SWIGEXT { +#else +#define SWIGEXT +#endif +#define CAML_NAME_SPACE +#include +#include +#include +#include +#include +#include +#include + +#if defined(CAMLassert) +/* Both this macro and version.h were introduced in version 4.02.0 */ +#include +#else +#define OCAML_VERSION 0 /* Unknown, but < 40200 */ +#endif + +#define caml_array_set swig_caml_array_set + +#define SWIG_NewPointerObj(p,type,flags) caml_val_ptr(p,type) +#define SWIG_GetModule(clientdata) SWIG_Ocaml_GetModule(clientdata) +#define SWIG_SetModule(clientdata, pointer) SWIG_Ocaml_SetModule(pointer) + +typedef enum { + SWIG_OCamlArithmeticException, + SWIG_OCamlDirectorPureVirtual, + SWIG_OCamlOutOfMemoryError, + SWIG_OCamlOverflowException, + SWIG_OCamlIllegalArgumentException, + SWIG_OCamlIndexOutOfBoundsException, + SWIG_OCamlRuntimeException, + SWIG_OCamlSystemException, + SWIG_OCamlUnknownError +} SWIG_OCamlExceptionCodes; + +SWIGINTERN void SWIG_OCamlThrowException(SWIG_OCamlExceptionCodes code, const char *msg) { + CAMLparam0(); + CAMLlocal1(str); + + switch (code) { + case SWIG_OCamlIllegalArgumentException: + caml_invalid_argument(msg); + break; + case SWIG_OCamlSystemException: + str = caml_copy_string(msg); + caml_raise_sys_error(str); + break; + case SWIG_OCamlArithmeticException: + case SWIG_OCamlIndexOutOfBoundsException: + case SWIG_OCamlOutOfMemoryError: + case SWIG_OCamlOverflowException: + case SWIG_OCamlRuntimeException: + case SWIG_OCamlUnknownError: + default: + caml_failwith(msg); + break; + } + CAMLreturn0; +} + +#define SWIG_contract_assert(expr, msg) do { if(!(expr)) {SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, msg);} } while (0) + + SWIGINTERN int + SWIG_GetPtr(void *source, void **result, swig_type_info *type, swig_type_info *result_type); + + SWIGINTERN value caml_list_nth( value lst, int n ); + SWIGINTERN value caml_list_append( value lst, value elt ); + SWIGINTERN int caml_list_length( value lst ); + SWIGINTERN value caml_array_new( int n ); + SWIGINTERN void caml_array_set( value arr, int n, value item ); + SWIGINTERN value caml_array_nth( value arr, int n ); + SWIGINTERN int caml_array_len( value arr ); + + SWIGINTERN value caml_val_char( char c ); + SWIGINTERN value caml_val_uchar( unsigned char c ); + + SWIGINTERN value caml_val_short( short s ); + SWIGINTERN value caml_val_ushort( unsigned short s ); + + SWIGINTERN value caml_val_int( int x ); + SWIGINTERN value caml_val_uint( unsigned int x ); + + SWIGINTERN value caml_val_long( long x ); + SWIGINTERN value caml_val_ulong( unsigned long x ); + + SWIGINTERN value caml_val_float( float f ); + SWIGINTERN value caml_val_double( double d ); + + SWIGINTERN value caml_val_ptr( void *p, swig_type_info *descriptor ); + + SWIGINTERN value caml_val_string( const char *str ); + SWIGINTERN value caml_val_string_len( const char *str, int len ); + + SWIGINTERN long caml_long_val( value v ); + SWIGINTERN double caml_double_val( value v ); + + SWIGINTERN int caml_ptr_val_internal( value v, void **out, + swig_type_info *descriptor ); + SWIGINTERN void *caml_ptr_val( value v, swig_type_info *descriptor ); + + SWIGINTERN char *caml_string_val( value v ); + SWIGINTERN int caml_string_len( value v ); + +#ifdef __cplusplus +} +#endif diff --git a/usr/share/swig/4.1.1/ocaml/preamble.swg b/usr/share/swig/4.2.1/ocaml/preamble.swg similarity index 100% rename from usr/share/swig/4.1.1/ocaml/preamble.swg rename to usr/share/swig/4.2.1/ocaml/preamble.swg diff --git a/usr/share/swig/4.1.1/ocaml/std_common.i b/usr/share/swig/4.2.1/ocaml/std_common.i similarity index 82% rename from usr/share/swig/4.1.1/ocaml/std_common.i rename to usr/share/swig/4.2.1/ocaml/std_common.i index 7e64607d914..62a8d3cd212 100644 --- a/usr/share/swig/4.1.1/ocaml/std_common.i +++ b/usr/share/swig/4.2.1/ocaml/std_common.i @@ -12,12 +12,12 @@ %{ #include SWIGINTERNINLINE -CAML_VALUE SwigString_FromString(const std::string &s) { +value SwigString_FromString(const std::string &s) { return caml_val_string((char *)s.c_str()); } SWIGINTERNINLINE -std::string SwigString_AsString(CAML_VALUE o) { +std::string SwigString_AsString(value o) { return std::string((char *)caml_ptr_val(o,0)); } %} diff --git a/usr/share/swig/4.1.1/ocaml/std_complex.i b/usr/share/swig/4.2.1/ocaml/std_complex.i similarity index 100% rename from usr/share/swig/4.1.1/ocaml/std_complex.i rename to usr/share/swig/4.2.1/ocaml/std_complex.i diff --git a/usr/share/swig/4.1.1/ocaml/std_deque.i b/usr/share/swig/4.2.1/ocaml/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/ocaml/std_deque.i rename to usr/share/swig/4.2.1/ocaml/std_deque.i diff --git a/usr/share/swig/4.1.1/ocaml/std_except.i b/usr/share/swig/4.2.1/ocaml/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/ocaml/std_except.i rename to usr/share/swig/4.2.1/ocaml/std_except.i diff --git a/usr/share/swig/4.1.1/ocaml/std_list.i b/usr/share/swig/4.2.1/ocaml/std_list.i similarity index 100% rename from usr/share/swig/4.1.1/ocaml/std_list.i rename to usr/share/swig/4.2.1/ocaml/std_list.i diff --git a/usr/share/swig/4.2.1/ocaml/std_map.i b/usr/share/swig/4.2.1/ocaml/std_map.i new file mode 100644 index 00000000000..b6a98c6e092 --- /dev/null +++ b/usr/share/swig/4.2.1/ocaml/std_map.i @@ -0,0 +1,70 @@ +/* ----------------------------------------------------------------------------- + * std_map.i + * + * SWIG typemaps for std::map + * ----------------------------------------------------------------------------- */ + +%include + +// ------------------------------------------------------------------------ +// std::map +// ------------------------------------------------------------------------ + +%{ +#include +#include +#include +%} + +// exported class + +namespace std { + template > class map { + // add typemaps here + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef K key_type; + typedef T mapped_type; + typedef std::pair< const K, T > value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + + map(); + map(const map& other); + + unsigned int size() const; + bool empty() const; + void clear(); + %extend { + const T& get(const K& key) throw (std::out_of_range) { + std::map< K, T, C >::iterator i = self->find(key); + if (i != self->end()) + return i->second; + else + throw std::out_of_range("key not found"); + } + void set(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else + (*self)[key] = x; +%#endif + } + void del(const K& key) throw (std::out_of_range) { + std::map< K, T, C >::iterator i = self->find(key); + if (i != self->end()) + self->erase(i); + else + throw std::out_of_range("key not found"); + } + bool has_key(const K& key) { + std::map< K, T, C >::iterator i = self->find(key); + return i != self->end(); + } + } + }; + +} diff --git a/usr/share/swig/4.1.1/ocaml/std_pair.i b/usr/share/swig/4.2.1/ocaml/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/ocaml/std_pair.i rename to usr/share/swig/4.2.1/ocaml/std_pair.i diff --git a/usr/share/swig/4.1.1/ocaml/std_string.i b/usr/share/swig/4.2.1/ocaml/std_string.i similarity index 70% rename from usr/share/swig/4.1.1/ocaml/std_string.i rename to usr/share/swig/4.2.1/ocaml/std_string.i index 2564cfb38d5..6cf918c6f7e 100644 --- a/usr/share/swig/4.1.1/ocaml/std_string.i +++ b/usr/share/swig/4.2.1/ocaml/std_string.i @@ -4,18 +4,11 @@ * SWIG typemaps for std::string * ----------------------------------------------------------------------------- */ -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - %{ #include #include %} - + %include %include @@ -23,10 +16,10 @@ namespace std { %naturalvar string; %naturalvar wstring; - + class string; class wstring; - + /* Overloading check */ %typemap(in) string { if (caml_ptr_check($input)) @@ -44,15 +37,6 @@ class wstring; } } -%typemap(in) string & ($*1_ltype temp) { - if (caml_ptr_check($input)) { - temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "string expected"); - } -} - %typemap(in) string * ($*1_ltype *temp) { if (caml_ptr_check($input)) { temp = new $*1_ltype((char *)caml_ptr_val($input,0), caml_string_len($input)); @@ -66,12 +50,12 @@ class wstring; delete temp; } -%typemap(argout) string & { - swig_result = caml_list_append(swig_result,caml_val_string_len((*$1).c_str(), (*$1).size())); +%typemap(out) const string & { + $result = caml_val_string_len((*$1).data(), (*$1).size()); } %typemap(directorin) string { - swig_result = caml_val_string_len($1.c_str(), $1.size()); + swig_result = caml_val_string_len($1.data(), $1.size()); args = caml_list_append(args, swig_result); } @@ -80,25 +64,39 @@ class wstring; } %typemap(out) string { - $result = caml_val_string_len($1.c_str(),$1.size()); + $result = caml_val_string_len($1.data(),$1.size()); } %typemap(varout) string { - $result = caml_val_string_len($1.c_str(),$1.size()); + $result = caml_val_string_len($1.data(),$1.size()); } %typemap(out) string * { - $result = caml_val_string_len((*$1).c_str(),(*$1).size()); + $result = caml_val_string_len((*$1).data(),(*$1).size()); } %typemap(varout) string * { - $result = caml_val_string_len((*$1).c_str(),(*$1).size()); + $result = caml_val_string_len((*$1).data(),(*$1).size()); } %typemap(typecheck) string, const string & = char *; %typemap(throws) string, const string & "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.c_str());" +%typemap(in) string &INPUT = const string &; +%typemap(in, numinputs=0) string &OUTPUT ($*1_ltype temp) +%{ $1 = &temp; %} +%typemap(argout) string &OUTPUT { + swig_result = caml_list_append(swig_result, caml_val_string_len((*$1).data(), (*$1).size())); +} +%typemap(in) string &INOUT = const string &; +%typemap(argout) string &INOUT = string &OUTPUT; + +%typemap(typecheck) string, const string & = char *; + +%typemap(throws) string, const string & { + SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.c_str()); +} } #ifdef ENABLE_CHARPTR_ARRAY diff --git a/usr/share/swig/4.1.1/ocaml/std_vector.i b/usr/share/swig/4.2.1/ocaml/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/ocaml/std_vector.i rename to usr/share/swig/4.2.1/ocaml/std_vector.i diff --git a/usr/share/swig/4.1.1/octave/stl.i b/usr/share/swig/4.2.1/ocaml/stl.i similarity index 100% rename from usr/share/swig/4.1.1/octave/stl.i rename to usr/share/swig/4.2.1/ocaml/stl.i diff --git a/usr/share/swig/4.1.1/ocaml/swig.ml b/usr/share/swig/4.2.1/ocaml/swig.ml similarity index 100% rename from usr/share/swig/4.1.1/ocaml/swig.ml rename to usr/share/swig/4.2.1/ocaml/swig.ml diff --git a/usr/share/swig/4.1.1/ocaml/swig.mli b/usr/share/swig/4.2.1/ocaml/swig.mli similarity index 100% rename from usr/share/swig/4.1.1/ocaml/swig.mli rename to usr/share/swig/4.2.1/ocaml/swig.mli diff --git a/usr/share/swig/4.1.1/ocaml/swigmove.i b/usr/share/swig/4.2.1/ocaml/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/ocaml/swigmove.i rename to usr/share/swig/4.2.1/ocaml/swigmove.i diff --git a/usr/share/swig/4.1.1/ocaml/swigp4.ml b/usr/share/swig/4.2.1/ocaml/swigp4.ml similarity index 100% rename from usr/share/swig/4.1.1/ocaml/swigp4.ml rename to usr/share/swig/4.2.1/ocaml/swigp4.ml diff --git a/usr/share/swig/4.1.1/ocaml/typecheck.i b/usr/share/swig/4.2.1/ocaml/typecheck.i similarity index 84% rename from usr/share/swig/4.1.1/ocaml/typecheck.i rename to usr/share/swig/4.2.1/ocaml/typecheck.i index 0c0a600a006..1466d1c5f01 100644 --- a/usr/share/swig/4.1.1/ocaml/typecheck.i +++ b/usr/share/swig/4.2.1/ocaml/typecheck.i @@ -7,7 +7,7 @@ %typecheck(SWIG_TYPECHECK_INT8) char, signed char, const char &, const signed char & { if( !Is_block($input) ) $1 = 0; else { - switch( SWIG_Tag_val($input) ) { + switch( Tag_val($input) ) { case C_char: $1 = 1; break; default: $1 = 0; break; } @@ -17,7 +17,7 @@ %typecheck(SWIG_TYPECHECK_UINT8) unsigned char, const unsigned char & { if( !Is_block($input) ) $1 = 0; else { - switch( SWIG_Tag_val($input) ) { + switch( Tag_val($input) ) { case C_uchar: $1 = 1; break; default: $1 = 0; break; } @@ -27,7 +27,7 @@ %typecheck(SWIG_TYPECHECK_INT16) short, signed short, const short &, const signed short &, wchar_t { if( !Is_block($input) ) $1 = 0; else { - switch( SWIG_Tag_val($input) ) { + switch( Tag_val($input) ) { case C_short: $1 = 1; break; default: $1 = 0; break; } @@ -37,7 +37,7 @@ %typecheck(SWIG_TYPECHECK_UINT16) unsigned short, const unsigned short & { if( !Is_block($input) ) $1 = 0; else { - switch( SWIG_Tag_val($input) ) { + switch( Tag_val($input) ) { case C_ushort: $1 = 1; break; default: $1 = 0; break; } @@ -50,7 +50,7 @@ %typecheck(SWIG_TYPECHECK_INT32) int, signed int, const int &, const signed int &, enum SWIGTYPE { if( !Is_block($input) ) $1 = 0; else { - switch( SWIG_Tag_val($input) ) { + switch( Tag_val($input) ) { case C_int: $1 = 1; break; default: $1 = 0; break; } @@ -60,7 +60,7 @@ %typecheck(SWIG_TYPECHECK_UINT32) unsigned int, const unsigned int & { if( !Is_block($input) ) $1 = 0; else { - switch( SWIG_Tag_val($input) ) { + switch( Tag_val($input) ) { case C_uint: $1 = 1; break; case C_int32: $1 = 1; break; default: $1 = 0; break; @@ -77,7 +77,7 @@ { if( !Is_block($input) ) $1 = 0; else { - switch( SWIG_Tag_val($input) ) { + switch( Tag_val($input) ) { case C_int64: $1 = 1; break; default: $1 = 0; break; } @@ -87,7 +87,7 @@ %typecheck(SWIG_TYPECHECK_BOOL) bool, const bool & { if( !Is_block($input) ) $1 = 0; else { - switch( SWIG_Tag_val($input) ) { + switch( Tag_val($input) ) { case C_bool: $1 = 1; break; default: $1 = 0; break; } @@ -97,7 +97,7 @@ %typecheck(SWIG_TYPECHECK_FLOAT) float, const float & { if( !Is_block($input) ) $1 = 0; else { - switch( SWIG_Tag_val($input) ) { + switch( Tag_val($input) ) { case C_float: $1 = 1; break; default: $1 = 0; break; } @@ -107,7 +107,7 @@ %typecheck(SWIG_TYPECHECK_DOUBLE) double, const double & { if( !Is_block($input) ) $1 = 0; else { - switch( SWIG_Tag_val($input) ) { + switch( Tag_val($input) ) { case C_double: $1 = 1; break; default: $1 = 0; break; } @@ -117,11 +117,11 @@ %typecheck(SWIG_TYPECHECK_STRING) char * { if( !Is_block($input) ) $1 = 0; else { - switch( SWIG_Tag_val($input) ) { + switch( Tag_val($input) ) { case C_string: $1 = 1; break; case C_ptr: { swig_type_info *typeinfo = - (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field($input,1)); + (swig_type_info *)(long)Int64_val(Field($input,1)); $1 = SWIG_TypeCheck("char *",typeinfo) || SWIG_TypeCheck("signed char *",typeinfo) || SWIG_TypeCheck("unsigned char *",typeinfo) || @@ -136,7 +136,7 @@ } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { - if (!Is_block($input) || !(SWIG_Tag_val($input) == C_obj || SWIG_Tag_val($input) == C_ptr)) { + if (!Is_block($input) || !(Tag_val($input) == C_obj || Tag_val($input) == C_ptr)) { $1 = 0; } else { void *ptr; @@ -149,14 +149,14 @@ if (!Is_block($input)) { $1 = 0; } else { - switch (SWIG_Tag_val($input)) { + switch (Tag_val($input)) { case C_obj: { void *ptr; $1 = !caml_ptr_val_internal($input, &ptr, $&1_descriptor); break; } case C_ptr: { - typeinfo = (swig_type_info *)SWIG_Int64_val(SWIG_Field($input, 1)); + typeinfo = (swig_type_info *)Int64_val(Field($input, 1)); $1 = SWIG_TypeCheck("$1_type", typeinfo) != NULL; break; } @@ -170,7 +170,7 @@ $1 = !caml_ptr_val_internal($input, &ptr, 0); } -%typecheck(SWIG_TYPECHECK_SWIGOBJECT) CAML_VALUE "$1 = 1;" +%typecheck(SWIG_TYPECHECK_SWIGOBJECT) value "$1 = 1;" /* ------------------------------------------------------------ * Exception handling @@ -183,7 +183,7 @@ unsigned long, unsigned short { char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); + SWIG_snprintf(error_msg, sizeof(error_msg), "C++ $1_type exception thrown, value: %d", $1); SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, error_msg); } diff --git a/usr/share/swig/4.1.1/ocaml/typemaps.i b/usr/share/swig/4.2.1/ocaml/typemaps.i similarity index 100% rename from usr/share/swig/4.1.1/ocaml/typemaps.i rename to usr/share/swig/4.2.1/ocaml/typemaps.i diff --git a/usr/share/swig/4.1.1/ocaml/typeregister.swg b/usr/share/swig/4.2.1/ocaml/typeregister.swg similarity index 100% rename from usr/share/swig/4.1.1/ocaml/typeregister.swg rename to usr/share/swig/4.2.1/ocaml/typeregister.swg diff --git a/usr/share/swig/4.1.1/octave/argcargv.i b/usr/share/swig/4.2.1/octave/argcargv.i similarity index 73% rename from usr/share/swig/4.1.1/octave/argcargv.i rename to usr/share/swig/4.2.1/octave/argcargv.i index 8d455e5866e..8ddca59a4ef 100644 --- a/usr/share/swig/4.1.1/octave/argcargv.i +++ b/usr/share/swig/4.2.1/octave/argcargv.i @@ -1,6 +1,6 @@ -/* ------------------------------------------------------------ +/* ------------------------------------------------------------- * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ + * ------------------------------------------------------------- */ %typemap(in) (int ARGC, char **ARGV) { if ($input.is_scalar_type()) { @@ -16,7 +16,11 @@ $1 = 0; %argument_fail(SWIG_TypeError, "'int ARGC, char **ARGV' use a non-string", $symname, $argnum); } - $2[i] = (char *)list(i).string_value().c_str(); + const std::string & s = list(i).string_value(); + size_t slen = s.size() + 1; + char * p = (char*)malloc(slen); + $2[i] = p; + memcpy(p, s.c_str(), slen); } $2[i] = NULL; } @@ -39,6 +43,10 @@ %typemap(freearg) (int ARGC, char **ARGV) { if ($2 != NULL) { + $1_ltype i; + for (i = 0; i < $1; i++) { + free((void *)$2[i]); + } free((void *)$2); } } diff --git a/usr/share/swig/4.1.1/octave/attribute.i b/usr/share/swig/4.2.1/octave/attribute.i similarity index 100% rename from usr/share/swig/4.1.1/octave/attribute.i rename to usr/share/swig/4.2.1/octave/attribute.i diff --git a/usr/share/swig/4.1.1/octave/boost_shared_ptr.i b/usr/share/swig/4.2.1/octave/boost_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/octave/boost_shared_ptr.i rename to usr/share/swig/4.2.1/octave/boost_shared_ptr.i diff --git a/usr/share/swig/4.1.1/octave/carrays.i b/usr/share/swig/4.2.1/octave/carrays.i similarity index 100% rename from usr/share/swig/4.1.1/octave/carrays.i rename to usr/share/swig/4.2.1/octave/carrays.i diff --git a/usr/share/swig/4.1.1/perl5/cdata.i b/usr/share/swig/4.2.1/octave/cdata.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/cdata.i rename to usr/share/swig/4.2.1/octave/cdata.i diff --git a/usr/share/swig/4.1.1/ruby/cmalloc.i b/usr/share/swig/4.2.1/octave/cmalloc.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/cmalloc.i rename to usr/share/swig/4.2.1/octave/cmalloc.i diff --git a/usr/share/swig/4.1.1/octave/director.swg b/usr/share/swig/4.2.1/octave/director.swg similarity index 100% rename from usr/share/swig/4.1.1/octave/director.swg rename to usr/share/swig/4.2.1/octave/director.swg diff --git a/usr/share/swig/4.1.1/octave/exception.i b/usr/share/swig/4.2.1/octave/exception.i similarity index 100% rename from usr/share/swig/4.1.1/octave/exception.i rename to usr/share/swig/4.2.1/octave/exception.i diff --git a/usr/share/swig/4.1.1/ruby/factory.i b/usr/share/swig/4.2.1/octave/factory.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/factory.i rename to usr/share/swig/4.2.1/octave/factory.i diff --git a/usr/share/swig/4.1.1/octave/implicit.i b/usr/share/swig/4.2.1/octave/implicit.i similarity index 100% rename from usr/share/swig/4.1.1/octave/implicit.i rename to usr/share/swig/4.2.1/octave/implicit.i diff --git a/usr/share/swig/4.1.1/octave/octave.swg b/usr/share/swig/4.2.1/octave/octave.swg similarity index 100% rename from usr/share/swig/4.1.1/octave/octave.swg rename to usr/share/swig/4.2.1/octave/octave.swg diff --git a/usr/share/swig/4.1.1/octave/octcomplex.swg b/usr/share/swig/4.2.1/octave/octcomplex.swg similarity index 100% rename from usr/share/swig/4.1.1/octave/octcomplex.swg rename to usr/share/swig/4.2.1/octave/octcomplex.swg diff --git a/usr/share/swig/4.1.1/octave/octcontainer.swg b/usr/share/swig/4.2.1/octave/octcontainer.swg similarity index 96% rename from usr/share/swig/4.1.1/octave/octcontainer.swg rename to usr/share/swig/4.2.1/octave/octcontainer.swg index 394c90bacab..97a345eba2d 100644 --- a/usr/share/swig/4.1.1/octave/octcontainer.swg +++ b/usr/share/swig/4.2.1/octave/octcontainer.swg @@ -66,7 +66,11 @@ namespace std { bool operator()(const octave_value& v, const octave_value& w) const { +%#if SWIG_OCTAVE_PREREQ(7,0,0) + octave_value res = octave::binary_op(octave_value::op_le,v,w); +%#else octave_value res = do_binary_op(octave_value::op_le,v,w); +%#endif return res.is_true(); } }; @@ -102,7 +106,7 @@ namespace swig { template inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { + getpos(Sequence* self, Difference i) { typename Sequence::iterator pos = self->begin(); std::advance(pos, check_index(i,self->size())); return pos; @@ -110,7 +114,7 @@ namespace swig { template inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { + cgetpos(const Sequence* self, Difference i) { typename Sequence::const_iterator pos = self->begin(); std::advance(pos, check_index(i,self->size())); return pos; @@ -136,25 +140,29 @@ namespace swig { template inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { + setslice(Sequence* self, Difference i, Difference j, const InputSeq& is) { typename Sequence::size_type size = self->size(); typename Sequence::size_type ii = swig::check_index(i, size, true); typename Sequence::size_type jj = swig::slice_index(j, size); if (jj < ii) jj = ii; size_t ssize = jj - ii; - if (ssize <= v.size()) { + if (ssize <= is.size()) { + // expanding/staying the same size typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); + typename InputSeq::const_iterator vmid = is.begin(); std::advance(sb,ii); std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); + self->insert(std::copy(is.begin(), vmid, sb), vmid, is.end()); } else { + // shrinking typename Sequence::iterator sb = self->begin(); typename Sequence::iterator se = self->begin(); std::advance(sb,ii); std::advance(se,jj); self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); + sb = self->begin(); + std::advance(sb,ii); + self->insert(sb, is.begin(), is.end()); } } @@ -198,7 +206,7 @@ namespace swig return swig::as(item); } catch (const std::exception& e) { char msg[1024]; - sprintf(msg, "in sequence element %d ", _index); + SWIG_snprintf(msg, sizeof(msg), "in sequence element %d ", _index); if (!Octave_Error_Occurred()) { %type_error(swig::type_name()); } diff --git a/usr/share/swig/4.1.1/octave/octfragments.swg b/usr/share/swig/4.2.1/octave/octfragments.swg similarity index 100% rename from usr/share/swig/4.1.1/octave/octfragments.swg rename to usr/share/swig/4.2.1/octave/octfragments.swg diff --git a/usr/share/swig/4.1.1/octave/octheaders.hpp b/usr/share/swig/4.2.1/octave/octheaders.hpp similarity index 100% rename from usr/share/swig/4.1.1/octave/octheaders.hpp rename to usr/share/swig/4.2.1/octave/octheaders.hpp diff --git a/usr/share/swig/4.1.1/octave/octiterators.swg b/usr/share/swig/4.2.1/octave/octiterators.swg similarity index 100% rename from usr/share/swig/4.1.1/octave/octiterators.swg rename to usr/share/swig/4.2.1/octave/octiterators.swg diff --git a/usr/share/swig/4.1.1/octave/octopers.swg b/usr/share/swig/4.2.1/octave/octopers.swg similarity index 100% rename from usr/share/swig/4.1.1/octave/octopers.swg rename to usr/share/swig/4.2.1/octave/octopers.swg diff --git a/usr/share/swig/4.1.1/octave/octprimtypes.swg b/usr/share/swig/4.2.1/octave/octprimtypes.swg similarity index 100% rename from usr/share/swig/4.1.1/octave/octprimtypes.swg rename to usr/share/swig/4.2.1/octave/octprimtypes.swg diff --git a/usr/share/swig/4.1.1/octave/octrun.swg b/usr/share/swig/4.2.1/octave/octrun.swg similarity index 98% rename from usr/share/swig/4.1.1/octave/octrun.swg rename to usr/share/swig/4.2.1/octave/octrun.swg index 2973318c44c..5865c921b3e 100644 --- a/usr/share/swig/4.1.1/octave/octrun.swg +++ b/usr/share/swig/4.2.1/octave/octrun.swg @@ -402,7 +402,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); } static octave_value make_value_hack(const octave_base_value &x) { +#if SWIG_OCTAVE_PREREQ(9,0,0) + ((octave_swig_type &) x).m_count++; +#else ((octave_swig_type &) x).count++; +#endif return octave_value((octave_base_value *) &x); } @@ -427,7 +431,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); ~octave_swig_type() { if (thisown) { +#if SWIG_OCTAVE_PREREQ(9,0,0) + ++m_count; +#else ++count; +#endif for (unsigned int j = 0; j < types.size(); ++j) { if (!types[j].first || !types[j].first->clientdata) continue; @@ -515,16 +523,28 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); } octave_value as_value() { +#if SWIG_OCTAVE_PREREQ(9,0,0) + ++m_count; +#else ++count; +#endif return Swig::swig_value_ref(this); } void incref() { +#if SWIG_OCTAVE_PREREQ(9,0,0) + ++m_count; +#else ++count; +#endif } void decref() { +#if SWIG_OCTAVE_PREREQ(9,0,0) + if (!--m_count) +#else if (!--count) +#endif delete this; } @@ -1123,8 +1143,13 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); :ptr(_ptr) { // Ensure type_id() is set correctly +#if SWIG_OCTAVE_PREREQ(9,0,0) + if (s_t_id == -1) { + s_t_id = octave_swig_ref::static_type_id(); +#else if (t_id == -1) { t_id = octave_swig_ref::static_type_id(); +#endif } } @@ -1254,8 +1279,12 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); #endif { return ptr->print(os, pr_as_read_syntax); } -#if SWIG_OCTAVE_PREREQ(4,4,0) +#if SWIG_OCTAVE_PREREQ(9,0,0) + static void set_type_id(int type_id) { s_t_id=type_id; } +#else +# if SWIG_OCTAVE_PREREQ(4,4,0) static void set_type_id(int type_id) { t_id=type_id; } +# endif #endif virtual type_conv_info numeric_conversion_function(void) const { @@ -1288,8 +1317,13 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); : type(_type), buf((const char*)_buf, (const char*)_buf + _buf_len) { // Ensure type_id() is set correctly +#if SWIG_OCTAVE_PREREQ(9,0,0) + if (s_t_id == -1) { + s_t_id = octave_swig_packed::static_type_id(); +#else if (t_id == -1) { t_id = octave_swig_packed::static_type_id(); +#endif } } @@ -1369,8 +1403,12 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); # endif #endif -#if SWIG_OCTAVE_PREREQ(4,4,0) +#if SWIG_OCTAVE_PREREQ(9,0,0) + static void set_type_id(int type_id) { s_t_id=type_id; } +#else +# if SWIG_OCTAVE_PREREQ(4,4,0) static void set_type_id(int type_id) { t_id=type_id; } +# endif #endif private: @@ -1630,8 +1668,12 @@ SWIGRUNTIME void SWIG_Octave_LinkGlobalValue(std::string name) { octave::interpreter *interp = octave::interpreter::the_interpreter (); interp->assign(name, interp->global_varval(name)); octave::tree_evaluator& tree_eval = interp->get_evaluator(); +#if SWIG_OCTAVE_PREREQ(8,0,0) + std::shared_ptr stackFrame = tree_eval.get_current_stack_frame(); +#else octave::call_stack& callStack = tree_eval.get_call_stack(); - std::shared_ptr stackFrame = callStack.get_current_stack_frame(); + std::shared_ptr stackFrame = tree_eval.get_current_stack_frame(); +#endif octave::symbol_record sym=symscope.lookup_symbol(name); stackFrame->mark_global(sym); #else diff --git a/usr/share/swig/4.1.1/octave/octruntime.swg b/usr/share/swig/4.2.1/octave/octruntime.swg similarity index 98% rename from usr/share/swig/4.1.1/octave/octruntime.swg rename to usr/share/swig/4.2.1/octave/octruntime.swg index e76151f146b..94e2ca4fb9b 100644 --- a/usr/share/swig/4.1.1/octave/octruntime.swg +++ b/usr/share/swig/4.2.1/octave/octruntime.swg @@ -318,7 +318,10 @@ DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) { SWIG_InitializeModule(0); SWIG_PropagateClientData(); -#if SWIG_OCTAVE_PREREQ(6,0,0) +#if SWIG_OCTAVE_PREREQ(8,0,0) + octave::tree_evaluator& tree_eval = octave::interpreter::the_interpreter()->get_evaluator(); + octave_function *me = tree_eval.current_function(); +#elif SWIG_OCTAVE_PREREQ(6,0,0) octave::tree_evaluator& tree_eval = octave::interpreter::the_interpreter()->get_evaluator(); octave::call_stack& stack = tree_eval.get_call_stack(); octave_function *me = stack.current_function(); diff --git a/usr/share/swig/4.1.1/octave/octstdcommon.swg b/usr/share/swig/4.2.1/octave/octstdcommon.swg similarity index 100% rename from usr/share/swig/4.1.1/octave/octstdcommon.swg rename to usr/share/swig/4.2.1/octave/octstdcommon.swg diff --git a/usr/share/swig/4.1.1/octave/octtypemaps.swg b/usr/share/swig/4.2.1/octave/octtypemaps.swg similarity index 100% rename from usr/share/swig/4.1.1/octave/octtypemaps.swg rename to usr/share/swig/4.2.1/octave/octtypemaps.swg diff --git a/usr/share/swig/4.1.1/octave/octuserdir.swg b/usr/share/swig/4.2.1/octave/octuserdir.swg similarity index 100% rename from usr/share/swig/4.1.1/octave/octuserdir.swg rename to usr/share/swig/4.2.1/octave/octuserdir.swg diff --git a/usr/share/swig/4.1.1/octave/std_alloc.i b/usr/share/swig/4.2.1/octave/std_alloc.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_alloc.i rename to usr/share/swig/4.2.1/octave/std_alloc.i diff --git a/usr/share/swig/4.1.1/perl5/std_auto_ptr.i b/usr/share/swig/4.2.1/octave/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/std_auto_ptr.i rename to usr/share/swig/4.2.1/octave/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/octave/std_basic_string.i b/usr/share/swig/4.2.1/octave/std_basic_string.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_basic_string.i rename to usr/share/swig/4.2.1/octave/std_basic_string.i diff --git a/usr/share/swig/4.1.1/octave/std_char_traits.i b/usr/share/swig/4.2.1/octave/std_char_traits.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_char_traits.i rename to usr/share/swig/4.2.1/octave/std_char_traits.i diff --git a/usr/share/swig/4.1.1/octave/std_common.i b/usr/share/swig/4.2.1/octave/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_common.i rename to usr/share/swig/4.2.1/octave/std_common.i diff --git a/usr/share/swig/4.1.1/octave/std_complex.i b/usr/share/swig/4.2.1/octave/std_complex.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_complex.i rename to usr/share/swig/4.2.1/octave/std_complex.i diff --git a/usr/share/swig/4.1.1/octave/std_container.i b/usr/share/swig/4.2.1/octave/std_container.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_container.i rename to usr/share/swig/4.2.1/octave/std_container.i diff --git a/usr/share/swig/4.1.1/octave/std_deque.i b/usr/share/swig/4.2.1/octave/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_deque.i rename to usr/share/swig/4.2.1/octave/std_deque.i diff --git a/usr/share/swig/4.1.1/perl5/std_except.i b/usr/share/swig/4.2.1/octave/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/std_except.i rename to usr/share/swig/4.2.1/octave/std_except.i diff --git a/usr/share/swig/4.1.1/octave/std_list.i b/usr/share/swig/4.2.1/octave/std_list.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_list.i rename to usr/share/swig/4.2.1/octave/std_list.i diff --git a/usr/share/swig/4.1.1/octave/std_map.i b/usr/share/swig/4.2.1/octave/std_map.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_map.i rename to usr/share/swig/4.2.1/octave/std_map.i diff --git a/usr/share/swig/4.1.1/octave/std_pair.i b/usr/share/swig/4.2.1/octave/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_pair.i rename to usr/share/swig/4.2.1/octave/std_pair.i diff --git a/usr/share/swig/4.1.1/octave/std_shared_ptr.i b/usr/share/swig/4.2.1/octave/std_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_shared_ptr.i rename to usr/share/swig/4.2.1/octave/std_shared_ptr.i diff --git a/usr/share/swig/4.1.1/python/std_string.i b/usr/share/swig/4.2.1/octave/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_string.i rename to usr/share/swig/4.2.1/octave/std_string.i diff --git a/usr/share/swig/4.1.1/perl5/std_unique_ptr.i b/usr/share/swig/4.2.1/octave/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/std_unique_ptr.i rename to usr/share/swig/4.2.1/octave/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/octave/std_vector.i b/usr/share/swig/4.2.1/octave/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_vector.i rename to usr/share/swig/4.2.1/octave/std_vector.i diff --git a/usr/share/swig/4.1.1/octave/std_wstring.i b/usr/share/swig/4.2.1/octave/std_wstring.i similarity index 100% rename from usr/share/swig/4.1.1/octave/std_wstring.i rename to usr/share/swig/4.2.1/octave/std_wstring.i diff --git a/usr/share/swig/4.1.1/perl5/stl.i b/usr/share/swig/4.2.1/octave/stl.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/stl.i rename to usr/share/swig/4.2.1/octave/stl.i diff --git a/usr/share/swig/4.1.1/perl5/swigmove.i b/usr/share/swig/4.2.1/octave/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/swigmove.i rename to usr/share/swig/4.2.1/octave/swigmove.i diff --git a/usr/share/swig/4.1.1/octave/typemaps.i b/usr/share/swig/4.2.1/octave/typemaps.i similarity index 100% rename from usr/share/swig/4.1.1/octave/typemaps.i rename to usr/share/swig/4.2.1/octave/typemaps.i diff --git a/usr/share/swig/4.1.1/perl5/Makefile.pl b/usr/share/swig/4.2.1/perl5/Makefile.pl similarity index 100% rename from usr/share/swig/4.1.1/perl5/Makefile.pl rename to usr/share/swig/4.2.1/perl5/Makefile.pl diff --git a/usr/share/swig/4.1.1/perl5/argcargv.i b/usr/share/swig/4.2.1/perl5/argcargv.i similarity index 78% rename from usr/share/swig/4.1.1/perl5/argcargv.i rename to usr/share/swig/4.2.1/perl5/argcargv.i index 48a6047b857..ee238130b5a 100644 --- a/usr/share/swig/4.1.1/perl5/argcargv.i +++ b/usr/share/swig/4.2.1/perl5/argcargv.i @@ -1,10 +1,10 @@ -/* ------------------------------------------------------------ +/* ------------------------------------------------------------- * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ + * ------------------------------------------------------------- */ %typemap(in) (int ARGC, char **ARGV) { int i; - I32 len; + SSize_t len; AV *av = (AV *)SvRV($input); if (SvTYPE(av) != SVt_PVAV) { SWIG_croak("in method '$symname', Expecting reference to argv array"); @@ -26,7 +26,5 @@ } %typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } + free((void *)$2); } diff --git a/usr/share/swig/4.1.1/perl5/attribute.i b/usr/share/swig/4.2.1/perl5/attribute.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/attribute.i rename to usr/share/swig/4.2.1/perl5/attribute.i diff --git a/usr/share/swig/4.1.1/perl5/carrays.i b/usr/share/swig/4.2.1/perl5/carrays.i similarity index 96% rename from usr/share/swig/4.1.1/perl5/carrays.i rename to usr/share/swig/4.2.1/perl5/carrays.i index 8be67abcea1..c1e6db3f0b4 100644 --- a/usr/share/swig/4.1.1/perl5/carrays.i +++ b/usr/share/swig/4.2.1/perl5/carrays.i @@ -1,2 +1 @@ %include - diff --git a/usr/share/swig/4.1.1/python/cdata.i b/usr/share/swig/4.2.1/perl5/cdata.i similarity index 100% rename from usr/share/swig/4.1.1/python/cdata.i rename to usr/share/swig/4.2.1/perl5/cdata.i diff --git a/usr/share/swig/4.1.1/scilab/cmalloc.i b/usr/share/swig/4.2.1/perl5/cmalloc.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/cmalloc.i rename to usr/share/swig/4.2.1/perl5/cmalloc.i diff --git a/usr/share/swig/4.1.1/perl5/cpointer.i b/usr/share/swig/4.2.1/perl5/cpointer.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/cpointer.i rename to usr/share/swig/4.2.1/perl5/cpointer.i diff --git a/usr/share/swig/4.1.1/perl5/cstring.i b/usr/share/swig/4.2.1/perl5/cstring.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/cstring.i rename to usr/share/swig/4.2.1/perl5/cstring.i diff --git a/usr/share/swig/4.1.1/perl5/director.swg b/usr/share/swig/4.2.1/perl5/director.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/director.swg rename to usr/share/swig/4.2.1/perl5/director.swg diff --git a/usr/share/swig/4.1.1/perl5/exception.i b/usr/share/swig/4.2.1/perl5/exception.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/exception.i rename to usr/share/swig/4.2.1/perl5/exception.i diff --git a/usr/share/swig/4.1.1/tcl/factory.i b/usr/share/swig/4.2.1/perl5/factory.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/factory.i rename to usr/share/swig/4.2.1/perl5/factory.i diff --git a/usr/share/swig/4.1.1/perl5/noembed.h b/usr/share/swig/4.2.1/perl5/noembed.h similarity index 100% rename from usr/share/swig/4.1.1/perl5/noembed.h rename to usr/share/swig/4.2.1/perl5/noembed.h diff --git a/usr/share/swig/4.1.1/perl5/perl5.swg b/usr/share/swig/4.2.1/perl5/perl5.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/perl5.swg rename to usr/share/swig/4.2.1/perl5/perl5.swg diff --git a/usr/share/swig/4.1.1/perl5/perlerrors.swg b/usr/share/swig/4.2.1/perl5/perlerrors.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/perlerrors.swg rename to usr/share/swig/4.2.1/perl5/perlerrors.swg diff --git a/usr/share/swig/4.1.1/perl5/perlfragments.swg b/usr/share/swig/4.2.1/perl5/perlfragments.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/perlfragments.swg rename to usr/share/swig/4.2.1/perl5/perlfragments.swg diff --git a/usr/share/swig/4.1.1/perl5/perlhead.swg b/usr/share/swig/4.2.1/perl5/perlhead.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/perlhead.swg rename to usr/share/swig/4.2.1/perl5/perlhead.swg diff --git a/usr/share/swig/4.1.1/perl5/perlinit.swg b/usr/share/swig/4.2.1/perl5/perlinit.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/perlinit.swg rename to usr/share/swig/4.2.1/perl5/perlinit.swg diff --git a/usr/share/swig/4.1.1/perl5/perlkw.swg b/usr/share/swig/4.2.1/perl5/perlkw.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/perlkw.swg rename to usr/share/swig/4.2.1/perl5/perlkw.swg diff --git a/usr/share/swig/4.1.1/perl5/perlmacros.swg b/usr/share/swig/4.2.1/perl5/perlmacros.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/perlmacros.swg rename to usr/share/swig/4.2.1/perl5/perlmacros.swg diff --git a/usr/share/swig/4.1.1/perl5/perlmain.i b/usr/share/swig/4.2.1/perl5/perlmain.i similarity index 64% rename from usr/share/swig/4.1.1/perl5/perlmain.i rename to usr/share/swig/4.2.1/perl5/perlmain.i index 18ecb7eb5a5..14f1cf2191a 100644 --- a/usr/share/swig/4.1.1/perl5/perlmain.i +++ b/usr/share/swig/4.2.1/perl5/perlmain.i @@ -4,25 +4,20 @@ * Code to statically rebuild perl5. * ----------------------------------------------------------------------------- */ -#ifdef AUTODOC -%subsection "perlmain.i" -%text %{ -This module provides support for building a new version of the -Perl executable. This will be necessary on systems that do -not support shared libraries and may be necessary with C++ -extensions. - -This module may only build a stripped down version of the -Perl executable. Thus, it may be necessary (or desirable) -to hand-edit this file for your particular application. To -do this, simply copy this file from swig_lib/perl5/perlmain.i -to your working directory and make the appropriate modifications. - -This library file works with Perl 5.003. It may work with earlier -versions, but it hasn't been tested. As far as I know, this -library is C++ safe. -%} -#endif +// This module provides support for building a new version of the +// Perl executable. This will be necessary on systems that do +// not support shared libraries and may be necessary with C++ +// extensions. +// +// This module may only build a stripped down version of the +// Perl executable. Thus, it may be necessary (or desirable) +// to hand-edit this file for your particular application. To +// do this, simply copy this file from swig_lib/perl5/perlmain.i +// to your working directory and make the appropriate modifications. +// +// This library file works with Perl 5.003. It may work with earlier +// versions, but it hasn't been tested. As far as I know, this +// library is C++ safe. %{ diff --git a/usr/share/swig/4.1.1/perl5/perlopers.swg b/usr/share/swig/4.2.1/perl5/perlopers.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/perlopers.swg rename to usr/share/swig/4.2.1/perl5/perlopers.swg diff --git a/usr/share/swig/4.1.1/perl5/perlprimtypes.swg b/usr/share/swig/4.2.1/perl5/perlprimtypes.swg similarity index 98% rename from usr/share/swig/4.1.1/perl5/perlprimtypes.swg rename to usr/share/swig/4.2.1/perl5/perlprimtypes.swg index 4cb675671c1..57f390a2549 100644 --- a/usr/share/swig/4.1.1/perl5/perlprimtypes.swg +++ b/usr/share/swig/4.2.1/perl5/perlprimtypes.swg @@ -179,7 +179,7 @@ SWIG_From_dec(long long)(long long value) else { //sv = newSVpvf("%lld", value); doesn't work in non 64bit Perl char temp[256]; - sprintf(temp, "%lld", value); + SWIG_snprintf(temp, sizeof(temp), "%lld", value); sv = newSVpv(temp, 0); } return sv_2mortal(sv); @@ -259,7 +259,7 @@ SWIG_From_dec(unsigned long long)(unsigned long long value) else { //sv = newSVpvf("%llu", value); doesn't work in non 64bit Perl char temp[256]; - sprintf(temp, "%llu", value); + SWIG_snprintf(temp, sizeof(temp), "%llu", value); sv = newSVpv(temp, 0); } return sv_2mortal(sv); @@ -280,7 +280,7 @@ SWIG_AsVal_dec(unsigned long long)(SV *obj, unsigned long long *val) * (UVSIZE <= sizeof(*val) || v <= ULLONG_MAX) */ if (val) *val = SvUV(obj); return SWIG_OK; - } else if (SvIOK(obj)) { + } else if (SvIOK(obj)) { IV v = SvIV(obj); if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULLONG_MAX)) { if (val) *val = v; diff --git a/usr/share/swig/4.1.1/perl5/perlrun.swg b/usr/share/swig/4.2.1/perl5/perlrun.swg similarity index 99% rename from usr/share/swig/4.1.1/perl5/perlrun.swg rename to usr/share/swig/4.2.1/perl5/perlrun.swg index 71f19cbf859..dfb2c8ee2d8 100644 --- a/usr/share/swig/4.1.1/perl5/perlrun.swg +++ b/usr/share/swig/4.2.1/perl5/perlrun.swg @@ -198,7 +198,7 @@ SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { /* Acquire a pointer value */ SWIGRUNTIME int -SWIG_Perl_AcquirePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, int own) { +SWIG_Perl_AcquirePtr(SWIG_MAYBE_PERL_OBJECT SV *SWIGUNUSEDPARM(sv), int SWIGUNUSEDPARM(own)) { /* TODO */ return 0; } @@ -452,7 +452,7 @@ SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interp #endif { MAGIC *mg; - sv_magic(sv,sv,'U',name,strlen(name)); + sv_magic(sv,sv,'U',name,(I32)strlen(name)); mg = mg_find(sv,'U'); mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); mg->mg_virtual->svt_get = (SwigMagicFunc) get; diff --git a/usr/share/swig/4.1.1/perl5/perlruntime.swg b/usr/share/swig/4.2.1/perl5/perlruntime.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/perlruntime.swg rename to usr/share/swig/4.2.1/perl5/perlruntime.swg diff --git a/usr/share/swig/4.1.1/perl5/perlstrings.swg b/usr/share/swig/4.2.1/perl5/perlstrings.swg similarity index 98% rename from usr/share/swig/4.1.1/perl5/perlstrings.swg rename to usr/share/swig/4.2.1/perl5/perlstrings.swg index 242a9c96734..d21b75afbb2 100644 --- a/usr/share/swig/4.1.1/perl5/perlstrings.swg +++ b/usr/share/swig/4.2.1/perl5/perlstrings.swg @@ -15,7 +15,7 @@ SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) STRLEN len = 0; char *cstr = SvPV(obj, len); size_t size = len + 1; - if (cptr) { + if (cptr) { if (alloc) { if (*alloc == SWIG_NEWOBJ) { *cptr = %new_copy_array(cstr, size, char); diff --git a/usr/share/swig/4.1.1/perl5/perltypemaps.swg b/usr/share/swig/4.2.1/perl5/perltypemaps.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/perltypemaps.swg rename to usr/share/swig/4.2.1/perl5/perltypemaps.swg diff --git a/usr/share/swig/4.1.1/perl5/perluserdir.swg b/usr/share/swig/4.2.1/perl5/perluserdir.swg similarity index 100% rename from usr/share/swig/4.1.1/perl5/perluserdir.swg rename to usr/share/swig/4.2.1/perl5/perluserdir.swg diff --git a/usr/share/swig/4.1.1/perl5/reference.i b/usr/share/swig/4.2.1/perl5/reference.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/reference.i rename to usr/share/swig/4.2.1/perl5/reference.i diff --git a/usr/share/swig/4.1.1/python/std_auto_ptr.i b/usr/share/swig/4.2.1/perl5/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_auto_ptr.i rename to usr/share/swig/4.2.1/perl5/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/perl5/std_common.i b/usr/share/swig/4.2.1/perl5/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/std_common.i rename to usr/share/swig/4.2.1/perl5/std_common.i diff --git a/usr/share/swig/4.1.1/php/std_deque.i b/usr/share/swig/4.2.1/perl5/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/php/std_deque.i rename to usr/share/swig/4.2.1/perl5/std_deque.i diff --git a/usr/share/swig/4.1.1/python/std_except.i b/usr/share/swig/4.2.1/perl5/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_except.i rename to usr/share/swig/4.2.1/perl5/std_except.i diff --git a/usr/share/swig/4.1.1/perl5/std_list.i b/usr/share/swig/4.2.1/perl5/std_list.i similarity index 97% rename from usr/share/swig/4.1.1/perl5/std_list.i rename to usr/share/swig/4.2.1/perl5/std_list.i index 36678add2cc..76f789b96ea 100644 --- a/usr/share/swig/4.1.1/perl5/std_list.i +++ b/usr/share/swig/4.2.1/perl5/std_list.i @@ -55,7 +55,7 @@ namespace std { SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); SV **tv; - I32 len = av_len(av) + 1; + SSize_t len = av_len(av) + 1; T* obj; for (int i=0; i::iterator i = self->find(key); @@ -64,17 +68,4 @@ namespace std { } }; -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - } diff --git a/usr/share/swig/4.1.1/perl5/std_pair.i b/usr/share/swig/4.2.1/perl5/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/std_pair.i rename to usr/share/swig/4.2.1/perl5/std_pair.i diff --git a/usr/share/swig/4.1.1/perl5/std_string.i b/usr/share/swig/4.2.1/perl5/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/perl5/std_string.i rename to usr/share/swig/4.2.1/perl5/std_string.i diff --git a/usr/share/swig/4.2.1/perl5/std_string_view.i b/usr/share/swig/4.2.1/perl5/std_string_view.i new file mode 100644 index 00000000000..b1afffcc034 --- /dev/null +++ b/usr/share/swig/4.2.1/perl5/std_string_view.i @@ -0,0 +1,2 @@ +%include +%include diff --git a/usr/share/swig/4.1.1/python/std_unique_ptr.i b/usr/share/swig/4.2.1/perl5/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_unique_ptr.i rename to usr/share/swig/4.2.1/perl5/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/perl5/std_vector.i b/usr/share/swig/4.2.1/perl5/std_vector.i similarity index 97% rename from usr/share/swig/4.1.1/perl5/std_vector.i rename to usr/share/swig/4.2.1/perl5/std_vector.i index 5bfd2c5ac8a..06bc6f38347 100644 --- a/usr/share/swig/4.1.1/perl5/std_vector.i +++ b/usr/share/swig/4.2.1/perl5/std_vector.i @@ -51,7 +51,7 @@ namespace std { SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); SV **tv; - I32 len = av_len(av) + 1; + SSize_t len = av_len(av) + 1; T* obj; for (int i=0; i= items) { EXTEND(sp, argvi+1); } - sprintf(temp,"%lld", (long long)*($1)); + SWIG_snprintf(temp, sizeof(temp),"%lld", (long long)*($1)); $result = sv_newmortal(); sv_setpv($result,temp); argvi++; @@ -217,7 +217,7 @@ output values. if (argvi >= items) { EXTEND(sp, argvi+1); } - sprintf(temp,"%llu", (unsigned long long)*($1)); + SWIG_snprintf(temp, sizeof(temp),"%llu", (unsigned long long)*($1)); $result = sv_newmortal(); sv_setpv($result,temp); argvi++; diff --git a/usr/share/swig/4.1.1/php/argcargv.i b/usr/share/swig/4.2.1/php/argcargv.i similarity index 84% rename from usr/share/swig/4.1.1/php/argcargv.i rename to usr/share/swig/4.2.1/php/argcargv.i index e0093c21484..2a0d745deb5 100644 --- a/usr/share/swig/4.1.1/php/argcargv.i +++ b/usr/share/swig/4.2.1/php/argcargv.i @@ -1,6 +1,6 @@ -/* ------------------------------------------------------------ +/* ------------------------------------------------------------- * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ + * ------------------------------------------------------------- */ %typemap(in) (int ARGC, char **ARGV) { int len, i; @@ -34,7 +34,5 @@ } %typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } + free((void *)$2); } diff --git a/usr/share/swig/4.1.1/php/const.i b/usr/share/swig/4.2.1/php/const.i similarity index 98% rename from usr/share/swig/4.1.1/php/const.i rename to usr/share/swig/4.2.1/php/const.i index a74af0d7811..1e1fe9cadbd 100644 --- a/usr/share/swig/4.1.1/php/const.i +++ b/usr/share/swig/4.2.1/php/const.i @@ -95,7 +95,7 @@ SWIG_SetPointerZval(&c.value, (void*)($value), $1_descriptor, 0); zval_copy_ctor(&c.value); c.name = zend_string_init("$symname", sizeof("$symname") - 1, 0); - SWIG_ZEND_CONSTANT_SET_FLAGS(&c, CONST_CS, module_number); + ZEND_CONSTANT_SET_FLAGS(&c, CONST_CS, module_number); zend_register_constant(&c); } diff --git a/usr/share/swig/4.1.1/php/director.swg b/usr/share/swig/4.2.1/php/director.swg similarity index 100% rename from usr/share/swig/4.1.1/php/director.swg rename to usr/share/swig/4.2.1/php/director.swg diff --git a/usr/share/swig/4.1.1/php/factory.i b/usr/share/swig/4.2.1/php/factory.i similarity index 100% rename from usr/share/swig/4.1.1/php/factory.i rename to usr/share/swig/4.2.1/php/factory.i diff --git a/usr/share/swig/4.1.1/php/php.swg b/usr/share/swig/4.2.1/php/php.swg similarity index 91% rename from usr/share/swig/4.1.1/php/php.swg rename to usr/share/swig/4.2.1/php/php.swg index fd09280766b..ca8704fd8fc 100644 --- a/usr/share/swig/4.1.1/php/php.swg +++ b/usr/share/swig/4.2.1/php/php.swg @@ -4,6 +4,8 @@ * PHP configuration file * ----------------------------------------------------------------------------- */ +%include + // Default to generating PHP type declarations (for PHP >= 8) except for // cases which are liable to cause compatibility issues with existing // bindings. @@ -497,20 +499,31 @@ " $1 = (Z_TYPE($input) == is1 || Z_TYPE($input) == is2);" %enddef -%php_typecheck(int,SWIG_TYPECHECK_INTEGER,IS_LONG) -%php_typecheck(unsigned int,SWIG_TYPECHECK_UINT32,IS_LONG) -%php_typecheck(short,SWIG_TYPECHECK_INT16,IS_LONG) -%php_typecheck(unsigned short,SWIG_TYPECHECK_UINT16,IS_LONG) -%php_typecheck(long,SWIG_TYPECHECK_INT32,IS_LONG) -%php_typecheck(unsigned long,SWIG_TYPECHECK_UINT32,IS_LONG) -%php_typecheck(long long,SWIG_TYPECHECK_INT64,IS_LONG) -%php_typecheck(unsigned long long,SWIG_TYPECHECK_UINT64,IS_LONG) -%php_typecheck(signed char,SWIG_TYPECHECK_INT8,IS_LONG) -%php_typecheck(unsigned char,SWIG_TYPECHECK_UINT8,IS_LONG) -%php_typecheck(size_t,SWIG_TYPECHECK_SIZE,IS_LONG) +%define %php_typecheck_long(_type,_prec,_min,_max) +%typemap(typecheck,precedence=_prec) _type, const _type & %{ + $1 = (Z_TYPE($input) == IS_LONG && + (_min <= ZEND_LONG_MIN || (zend_long)_min <= Z_LVAL($input)) && + (_max >= ZEND_LONG_MAX || (zend_long)_max >= Z_LVAL($input))); +%} +%enddef + +%php_typecheck_long(int,SWIG_TYPECHECK_INTEGER,INT_MIN,INT_MAX) +%php_typecheck_long(unsigned int,SWIG_TYPECHECK_UINT32,0,UINT_MAX) +%php_typecheck_long(short,SWIG_TYPECHECK_INT16,SHRT_MIN,SHRT_MAX) +%php_typecheck_long(unsigned short,SWIG_TYPECHECK_UINT16,0,USHRT_MAX) +%php_typecheck_long(long,SWIG_TYPECHECK_INT32,LONG_MIN,LONG_MAX) +%php_typecheck_long(unsigned long,SWIG_TYPECHECK_UINT32,0,ULONG_MAX) +%php_typecheck_long(long long,SWIG_TYPECHECK_INT64,LLONG_MIN,LLONG_MAX) +%php_typecheck_long(unsigned long long,SWIG_TYPECHECK_UINT64,0,ULLONG_MAX) +%php_typecheck_long(signed char,SWIG_TYPECHECK_INT8,SCHAR_MIN,SCHAR_MAX) +%php_typecheck_long(unsigned char,SWIG_TYPECHECK_UINT8,0,UCHAR_MAX) +%php_typecheck_long(size_t,SWIG_TYPECHECK_SIZE,0,(size_t)-1) %php_typecheck(enum SWIGTYPE,SWIG_TYPECHECK_INTEGER,IS_LONG) %php_typecheck2(bool,SWIG_TYPECHECK_BOOL,IS_TRUE,IS_FALSE) -%php_typecheck(float,SWIG_TYPECHECK_FLOAT,IS_DOUBLE) +%typemap(typecheck,precedence=SWIG_TYPECHECK_FLOAT,fragment="SWIG_Float_Overflow_Check") float, const float & %{ + $1 = (Z_TYPE($input) == IS_DOUBLE && !SWIG_Float_Overflow_Check(Z_DVAL($input))); +%} +/* Don't range check here since PHP stores this as C/C++ double. */ %php_typecheck(double,SWIG_TYPECHECK_DOUBLE,IS_DOUBLE) %php_typecheck(char,SWIG_TYPECHECK_CHAR,IS_STRING) diff --git a/usr/share/swig/4.1.1/php/phpinit.swg b/usr/share/swig/4.2.1/php/phpinit.swg similarity index 100% rename from usr/share/swig/4.1.1/php/phpinit.swg rename to usr/share/swig/4.2.1/php/phpinit.swg diff --git a/usr/share/swig/4.1.1/php/phpinterfaces.i b/usr/share/swig/4.2.1/php/phpinterfaces.i similarity index 93% rename from usr/share/swig/4.1.1/php/phpinterfaces.i rename to usr/share/swig/4.2.1/php/phpinterfaces.i index 5b1da8b79b7..e1029b645b2 100644 --- a/usr/share/swig/4.1.1/php/phpinterfaces.i +++ b/usr/share/swig/4.2.1/php/phpinterfaces.i @@ -54,9 +54,7 @@ #define SWIG_PHP_INTERFACE_JsonSerializable_HEADER "ext/json/php_json.h" // New in PHP 8.0. -#if PHP_MAJOR_VERSION >= 8 -# define SWIG_PHP_INTERFACE_Stringable_CE zend_ce_stringable -# define SWIG_PHP_INTERFACE_Stringable_HEADER "zend_interfaces.h" -#endif +#define SWIG_PHP_INTERFACE_Stringable_CE zend_ce_stringable +#define SWIG_PHP_INTERFACE_Stringable_HEADER "zend_interfaces.h" %} diff --git a/usr/share/swig/4.1.1/php/phpkw.swg b/usr/share/swig/4.2.1/php/phpkw.swg similarity index 100% rename from usr/share/swig/4.1.1/php/phpkw.swg rename to usr/share/swig/4.2.1/php/phpkw.swg diff --git a/usr/share/swig/4.1.1/php/phppointers.i b/usr/share/swig/4.2.1/php/phppointers.i similarity index 100% rename from usr/share/swig/4.1.1/php/phppointers.i rename to usr/share/swig/4.2.1/php/phppointers.i diff --git a/usr/share/swig/4.1.1/php/phprun.swg b/usr/share/swig/4.2.1/php/phprun.swg similarity index 71% rename from usr/share/swig/4.1.1/php/phprun.swg rename to usr/share/swig/4.2.1/php/phprun.swg index d3ad0d26a1c..588701f9b04 100644 --- a/usr/share/swig/4.1.1/php/phprun.swg +++ b/usr/share/swig/4.2.1/php/phprun.swg @@ -10,35 +10,14 @@ extern "C" { #endif -#if PHP_MAJOR_VERSION < 7 -# error These bindings need PHP 7 or later - to generate PHP5 bindings use: SWIG < 4.0.0 and swig -php5 +#if PHP_MAJOR_VERSION < 8 +# error These bindings need PHP 8 or later - to generate PHP7 bindings use SWIG < 4.1.0; to generate PHP5 bindings use: SWIG < 4.0.0 and swig -php5 #endif #include "zend_inheritance.h" #include "zend_exceptions.h" #include "zend_inheritance.h" -#if PHP_MAJOR_VERSION == 7 -/* These macros were new in PHP 8.0. For PHP 7.x we define them to give the - * same result except without any type declarations. PHP 7.x supports type - * declarations, but not for the return type, and alternate types aren't - * supported, so we don't try to support these. - */ -# define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(name, byref, num_req, classes, types) \ - ZEND_BEGIN_ARG_INFO_EX(name, 0, byref, num_req) -# define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, byref, num_req, types) \ - ZEND_BEGIN_ARG_INFO_EX(name, 0, byref, num_req) - -/* NB We can just ignore `default` here we currently always pass NULL for it - * (this mechanism for specifying default parameter values was new in PHP 8.0 - * so it's not useful while we still want to support PHP7 too). - */ -# define ZEND_ARG_OBJ_TYPE_MASK(byref, name, classes, types, default) \ - ZEND_ARG_INFO(byref, name) -# define ZEND_ARG_TYPE_MASK(byref, name, types, default) \ - ZEND_ARG_INFO(byref, name) -#endif - #include /* for abort(), used in generated code. */ #define SWIG_BOOL_CONSTANT(N, V) REGISTER_BOOL_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) @@ -50,27 +29,6 @@ extern "C" { REGISTER_STRINGL_CONSTANT(#N, &swig_char, 1, CONST_CS | CONST_PERSISTENT);\ } while (0) -/* ZEND_CONSTANT_SET_FLAGS was new in PHP 7.3. */ -#ifdef ZEND_CONSTANT_SET_FLAGS -# define SWIG_ZEND_CONSTANT_SET_FLAGS ZEND_CONSTANT_SET_FLAGS -#else -# define SWIG_ZEND_CONSTANT_SET_FLAGS(C, F, N) do { (C)->flags = (F); (C)->module_number = (N); } while (0) -#endif - -/* zend_object_alloc was new in PHP 7.3. */ -#if PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION < 3 -static zend_always_inline void *zend_object_alloc(size_t obj_size, zend_class_entry *ce) { - void *obj = emalloc(obj_size + zend_object_properties_size(ce)); - memset(obj, 0, obj_size - sizeof(zval)); - return obj; -} -#endif - -/* ZEND_THIS was new in PHP 7.4. */ -#ifndef ZEND_THIS -# define ZEND_THIS &EX(This) -#endif - #ifdef __cplusplus } #endif @@ -93,27 +51,6 @@ static int default_error_code = E_ERROR; static zend_class_entry SWIG_Php_swig_wrapped_interface_ce; -#if PHP_MAJOR_VERSION == 7 -/* zend_class_implements_interface() was new in PHP 8.0. - * - * We could use instanceof_function_ex(C, I, 1) here for 7.4, but for 7.3 - * and earlier that doesn't work, so instead we just provide a compatibility - * implementation which does what zend_class_implements_interface() does in 8.x - * and use that for all 7.x so there are fewer variants to worry about testing. - */ -static int zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce) { - uint32_t i; - if (class_ce->num_interfaces) { - for (i = 0; i < class_ce->num_interfaces; i++) { - if (class_ce->interfaces[i] == interface_ce) { - return 1; - } - } - } - return 0; -} -#endif - /* used to wrap returned objects in so we know whether they are newobject and need freeing, or not */ typedef struct { diff --git a/usr/share/swig/4.1.1/php/std_auto_ptr.i b/usr/share/swig/4.2.1/php/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/php/std_auto_ptr.i rename to usr/share/swig/4.2.1/php/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/php/std_common.i b/usr/share/swig/4.2.1/php/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/php/std_common.i rename to usr/share/swig/4.2.1/php/std_common.i diff --git a/usr/share/swig/4.1.1/tcl/std_deque.i b/usr/share/swig/4.2.1/php/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/std_deque.i rename to usr/share/swig/4.2.1/php/std_deque.i diff --git a/usr/share/swig/4.1.1/php/std_map.i b/usr/share/swig/4.2.1/php/std_map.i similarity index 78% rename from usr/share/swig/4.1.1/php/std_map.i rename to usr/share/swig/4.2.1/php/std_map.i index fed3cf0b344..6904efc6e4e 100644 --- a/usr/share/swig/4.1.1/php/std_map.i +++ b/usr/share/swig/4.2.1/php/std_map.i @@ -47,7 +47,11 @@ namespace std { throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } void del(const K& key) throw (std::out_of_range) { std::map< K, T, C >::iterator i = self->find(key); @@ -66,17 +70,4 @@ namespace std { } }; -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - } diff --git a/usr/share/swig/4.1.1/php/std_pair.i b/usr/share/swig/4.2.1/php/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/php/std_pair.i rename to usr/share/swig/4.2.1/php/std_pair.i diff --git a/usr/share/swig/4.1.1/php/std_string.i b/usr/share/swig/4.2.1/php/std_string.i similarity index 51% rename from usr/share/swig/4.1.1/php/std_string.i rename to usr/share/swig/4.2.1/php/std_string.i index b2039786c7b..5abbbbbefeb 100644 --- a/usr/share/swig/4.1.1/php/std_string.i +++ b/usr/share/swig/4.2.1/php/std_string.i @@ -4,19 +4,21 @@ * SWIG typemaps for std::string types * ----------------------------------------------------------------------------- */ -// ------------------------------------------------------------------------ -// std::string is typemapped by value -// This can prevent exporting methods which return a string -// in order for the user to modify it. -// However, I think I'll wait until someone asks for it... -// ------------------------------------------------------------------------ - -%include - %{ #include %} +/* std::string and const std::string& are converted to/from PHP string + * automatically. + * + * A C++ std::string& parameter is wrapped as a pass-by-reference PHP + * string parameter by default, but the INPUT/INOUT/OUTPUT typemaps + * below provide other options (see below). + * + * std::string* is not wrapped by default, but INPUT/INOUT/OUTPUT typemaps + * are provided (see below). + */ + namespace std { %naturalvar string; @@ -45,7 +47,7 @@ namespace std { ZVAL_STRINGL($input, $1.data(), $1.size()); %} - %typemap(out, phptype="string") const string & %{ + %typemap(out, phptype="string") const string& %{ ZVAL_STRINGL($result, $1->data(), $1->size()); %} @@ -54,15 +56,22 @@ namespace std { goto fail; %} - %typemap(in, phptype="string") const string & ($*1_ltype temp) %{ + %typemap(throws) string*, const string* %{ + zend_throw_exception(NULL, $1->c_str(), 0); + goto fail; + %} + + %typemap(in, phptype="string") const string& ($*1_ltype temp) %{ convert_to_string(&$input); temp.assign(Z_STRVAL($input), Z_STRLEN($input)); $1 = &temp; %} - /* These next two handle a function which takes a non-const reference to - * a std::string and modifies the string. */ - %typemap(in,byref=1, phptype="string") string & ($*1_ltype temp) %{ + /*************************************************************************/ + + /* These next four typemaps handle a function which takes a non-const + * reference to a std::string and modifies the string. */ + %typemap(in,byref=1, phptype="string") string& ($*1_ltype temp) %{ { zval * p = Z_ISREF($input) ? Z_REFVAL($input) : &$input; convert_to_string(p); @@ -71,14 +80,14 @@ namespace std { } %} - %typemap(directorout) string & ($*1_ltype *temp) %{ + %typemap(directorout) string& ($*1_ltype *temp) %{ convert_to_string($input); temp = new $*1_ltype(Z_STRVAL_P($input), Z_STRLEN_P($input)); swig_acquire_ownership(temp); $result = temp; %} - %typemap(argout) string & %{ + %typemap(argout) string& %{ if (Z_ISREF($input)) { ZVAL_STRINGL(Z_REFVAL($input), $1->data(), $1->size()); } @@ -86,5 +95,27 @@ namespace std { /* SWIG will apply the non-const typemap above to const string& without * this more specific typemap. */ - %typemap(argout) const string & "" + %typemap(argout) const string& "" + + /*************************************************************************/ + + /* Alternative ways to handle string& - you can specify how to wrap based + * on the parameter name, e.g. this handles parameters named `str` as + * INOUT: + * + * %apply (std::string& INOUT) (std::string& str); + */ + + %typemap(in) string& INPUT = const string&; + %typemap(in, numinputs=0) string& OUTPUT ($*1_ltype temp) + %{ $1 = &temp; %} + %typemap(argout,fragment="t_output_helper") string& OUTPUT + { + zval o; + ZVAL_STRINGL(&o, $1->data(), $1->size()); + t_output_helper($result, &o); + } + %typemap(in) string& INOUT = const string&; + %typemap(argout) string& INOUT = string& OUTPUT; + } diff --git a/usr/share/swig/4.2.1/php/std_string_view.i b/usr/share/swig/4.2.1/php/std_string_view.i new file mode 100644 index 00000000000..8fff6e100e0 --- /dev/null +++ b/usr/share/swig/4.2.1/php/std_string_view.i @@ -0,0 +1,69 @@ +/* ----------------------------------------------------------------------------- + * std_string_view.i + * + * SWIG typemaps for std::string_view types + * ----------------------------------------------------------------------------- */ + +%include + +%{ +#include +%} + +namespace std { + + %naturalvar string_view; + + class string_view; + + %typemap(typecheck,precedence=SWIG_TYPECHECK_STRINGVIEW) string_view, const string_view& %{ + $1 = (Z_TYPE($input) == IS_STRING) ? 1 : 0; + %} + + %typemap(in, phptype="string") string_view %{ + convert_to_string(&$input); + $1 = std::string_view(Z_STRVAL($input), Z_STRLEN($input)); + %} + + %typemap(in, phptype="string") const string_view& ($*1_ltype temp) %{ + convert_to_string(&$input); + temp = std::string_view(Z_STRVAL($input), Z_STRLEN($input)); + $1 = &temp; + %} + + %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) string_view %{ + convert_to_string($input); + $result = std::string_view(Z_STRVAL_P($input), Z_STRLEN_P($input)); + %} + + %typemap(out, phptype="string") string_view %{ + ZVAL_STRINGL($result, $1.data(), $1.size()); + %} + + %typemap(directorin) string_view, const string_view& %{ + ZVAL_STRINGL($input, $1.data(), $1.size()); + %} + + %typemap(out, phptype="string") const string_view& %{ + ZVAL_STRINGL($result, $1->data(), $1->size()); + %} + + %typemap(throws) string_view, const string_view& %{ + { + zval swig_exception; + ZVAL_STRINGL(&swig_exception, $1.data(), $1.size()); + zend_throw_exception_object(&swig_exception); + goto fail; + } + %} + + %typemap(throws) string_view*, const string_view* %{ + { + zval swig_exception; + ZVAL_STRINGL(&swig_exception, $1->data(), $1->size()); + zend_throw_exception_object(&swig_exception); + goto fail; + } + %} + +} diff --git a/usr/share/swig/4.1.1/php/std_unique_ptr.i b/usr/share/swig/4.2.1/php/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/php/std_unique_ptr.i rename to usr/share/swig/4.2.1/php/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/php/std_vector.i b/usr/share/swig/4.2.1/php/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/php/std_vector.i rename to usr/share/swig/4.2.1/php/std_vector.i diff --git a/usr/share/swig/4.1.1/php/stl.i b/usr/share/swig/4.2.1/php/stl.i similarity index 100% rename from usr/share/swig/4.1.1/php/stl.i rename to usr/share/swig/4.2.1/php/stl.i diff --git a/usr/share/swig/4.1.1/php/swigmove.i b/usr/share/swig/4.2.1/php/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/php/swigmove.i rename to usr/share/swig/4.2.1/php/swigmove.i diff --git a/usr/share/swig/4.1.1/php/typemaps.i b/usr/share/swig/4.2.1/php/typemaps.i similarity index 100% rename from usr/share/swig/4.1.1/php/typemaps.i rename to usr/share/swig/4.2.1/php/typemaps.i diff --git a/usr/share/swig/4.1.1/php/utils.i b/usr/share/swig/4.2.1/php/utils.i similarity index 100% rename from usr/share/swig/4.1.1/php/utils.i rename to usr/share/swig/4.2.1/php/utils.i diff --git a/usr/share/swig/4.1.1/python/argcargv.i b/usr/share/swig/4.2.1/python/argcargv.i similarity index 95% rename from usr/share/swig/4.1.1/python/argcargv.i rename to usr/share/swig/4.2.1/python/argcargv.i index 419803a8159..af71840f58c 100644 --- a/usr/share/swig/4.1.1/python/argcargv.i +++ b/usr/share/swig/4.2.1/python/argcargv.i @@ -1,6 +1,6 @@ -/* ------------------------------------------------------------ +/* ------------------------------------------------------------- * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ + * ------------------------------------------------------------- */ %fragment("SWIG_AsArgcArgv","header",fragment="SWIG_AsCharPtrAndSize") { SWIGINTERN int diff --git a/usr/share/swig/4.1.1/python/attribute.i b/usr/share/swig/4.2.1/python/attribute.i similarity index 100% rename from usr/share/swig/4.1.1/python/attribute.i rename to usr/share/swig/4.2.1/python/attribute.i diff --git a/usr/share/swig/4.1.1/python/boost_shared_ptr.i b/usr/share/swig/4.2.1/python/boost_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/python/boost_shared_ptr.i rename to usr/share/swig/4.2.1/python/boost_shared_ptr.i diff --git a/usr/share/swig/4.1.1/python/builtin.swg b/usr/share/swig/4.2.1/python/builtin.swg similarity index 98% rename from usr/share/swig/4.1.1/python/builtin.swg rename to usr/share/swig/4.2.1/python/builtin.swg index 5cff6835f8e..6c2c311e65d 100644 --- a/usr/share/swig/4.1.1/python/builtin.swg +++ b/usr/share/swig/4.2.1/python/builtin.swg @@ -270,6 +270,9 @@ SwigPyStaticVar_Type(void) { #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) 0, /* tp_print */ #endif +#if PY_VERSION_HEX >= 0x030c0000 + 0, /* tp_watched */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -358,6 +361,9 @@ SwigPyObjectType(void) { #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) 0, /* tp_print */ #endif +#if PY_VERSION_HEX >= 0x030c0000 + 0, /* tp_watched */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -534,8 +540,10 @@ SwigPyBuiltin_ternaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py assert(tuple); Py_INCREF(b); PyTuple_SET_ITEM(tuple, 0, b); - Py_INCREF(c); - PyTuple_SET_ITEM(tuple, 1, c); + if (c) { + Py_INCREF(c); + PyTuple_SET_ITEM(tuple, 1, c); + } result = wrapper(a, tuple); Py_DECREF(tuple); return result; @@ -650,8 +658,10 @@ SwigPyBuiltin_ssizeobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a tuple = PyTuple_New(2); assert(tuple); PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); - Py_INCREF(c); - PyTuple_SET_ITEM(tuple, 1, c); + if (c) { + Py_INCREF(c); + PyTuple_SET_ITEM(tuple, 1, c); + } resultobj = wrapper(a, tuple); result = resultobj ? 0 : -1; Py_XDECREF(resultobj); diff --git a/usr/share/swig/4.1.1/python/carrays.i b/usr/share/swig/4.2.1/python/carrays.i similarity index 98% rename from usr/share/swig/4.1.1/python/carrays.i rename to usr/share/swig/4.2.1/python/carrays.i index 74b2be9c4b6..a7b6120d38e 100644 --- a/usr/share/swig/4.1.1/python/carrays.i +++ b/usr/share/swig/4.2.1/python/carrays.i @@ -7,7 +7,3 @@ %enddef %include - - - - diff --git a/usr/share/swig/4.1.1/python/ccomplex.i b/usr/share/swig/4.2.1/python/ccomplex.i similarity index 100% rename from usr/share/swig/4.1.1/python/ccomplex.i rename to usr/share/swig/4.2.1/python/ccomplex.i diff --git a/usr/share/swig/4.1.1/r/cdata.i b/usr/share/swig/4.2.1/python/cdata.i similarity index 100% rename from usr/share/swig/4.1.1/r/cdata.i rename to usr/share/swig/4.2.1/python/cdata.i diff --git a/usr/share/swig/4.1.1/tcl/cmalloc.i b/usr/share/swig/4.2.1/python/cmalloc.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/cmalloc.i rename to usr/share/swig/4.2.1/python/cmalloc.i diff --git a/usr/share/swig/4.2.1/python/complex.i b/usr/share/swig/4.2.1/python/complex.i new file mode 100644 index 00000000000..4c3b3c5e2b1 --- /dev/null +++ b/usr/share/swig/4.2.1/python/complex.i @@ -0,0 +1,6 @@ +#ifdef __cplusplus +%include +#else +%include +#endif + diff --git a/usr/share/swig/4.1.1/python/cpointer.i b/usr/share/swig/4.2.1/python/cpointer.i similarity index 100% rename from usr/share/swig/4.1.1/python/cpointer.i rename to usr/share/swig/4.2.1/python/cpointer.i diff --git a/usr/share/swig/4.1.1/python/cstring.i b/usr/share/swig/4.2.1/python/cstring.i similarity index 100% rename from usr/share/swig/4.1.1/python/cstring.i rename to usr/share/swig/4.2.1/python/cstring.i diff --git a/usr/share/swig/4.1.1/python/cwstring.i b/usr/share/swig/4.2.1/python/cwstring.i similarity index 100% rename from usr/share/swig/4.1.1/python/cwstring.i rename to usr/share/swig/4.2.1/python/cwstring.i diff --git a/usr/share/swig/4.1.1/python/director.swg b/usr/share/swig/4.2.1/python/director.swg similarity index 84% rename from usr/share/swig/4.1.1/python/director.swg rename to usr/share/swig/4.2.1/python/director.swg index 9694c6233be..a1dd00f6db1 100644 --- a/usr/share/swig/4.1.1/python/director.swg +++ b/usr/share/swig/4.2.1/python/director.swg @@ -14,6 +14,24 @@ #include #include +#if defined(SWIG_PYTHON_THREADS) +/* __THREAD__ is the old macro to activate some thread support */ +# if !defined(__THREAD__) +# define __THREAD__ 1 +# endif +#endif + +#ifdef __THREAD__ +#ifndef Py_LIMITED_API +# include "pythread.h" +#else +# if defined(_WIN32) +# include +# else +# include +# endif +#endif +#endif /* Use -DSWIG_PYTHON_DIRECTOR_NO_VTABLE if you don't want to generate a 'virtual @@ -173,7 +191,7 @@ namespace Swig { swig_msg += msg; } if (!PyErr_Occurred()) { - PyErr_SetString(error, what()); + PyErr_SetString(error, swig_msg.c_str()); } SWIG_PYTHON_THREAD_END_BLOCK; } @@ -244,25 +262,89 @@ namespace Swig { }; -#if defined(SWIG_PYTHON_THREADS) -/* __THREAD__ is the old macro to activate some thread support */ -# if !defined(__THREAD__) -# define __THREAD__ 1 -# endif -#endif - #ifdef __THREAD__ -# include "pythread.h" +#ifndef Py_LIMITED_API + class Mutex + { + public: + Mutex() { + mutex_ = PyThread_allocate_lock(); + } + + ~Mutex() { + PyThread_release_lock(mutex_); + } + + private: + void Lock() { + PyThread_acquire_lock(mutex_, WAIT_LOCK); + } + + void Unlock() { + PyThread_free_lock(mutex_); + } + + PyThread_type_lock mutex_; + + friend class Guard; + }; +#elif defined(_WIN32) + class Mutex : private CRITICAL_SECTION { + public: + Mutex() { + InitializeCriticalSection(this); + } + + ~Mutex() { + DeleteCriticalSection(this); + } + + private: + void Lock() { + EnterCriticalSection(this); + } + + void Unlock() { + LeaveCriticalSection(this); + } + + friend class Guard; + }; +#else + class Mutex { + public: + Mutex() { + pthread_mutex_init(&mutex_, NULL); + } + + ~Mutex() { + pthread_mutex_destroy(&mutex_); + } + + private: + void Lock() { + pthread_mutex_lock(&mutex_); + } + + void Unlock() { + pthread_mutex_unlock(&mutex_); + } + + friend class Guard; + + pthread_mutex_t mutex_; + }; +#endif class Guard { - PyThread_type_lock &mutex_; + Mutex &mutex_; public: - Guard(PyThread_type_lock & mutex) : mutex_(mutex) { - PyThread_acquire_lock(mutex_, WAIT_LOCK); + Guard(Mutex & mutex) : mutex_(mutex) { + mutex_.Lock(); } ~Guard() { - PyThread_release_lock(mutex_); + mutex_.Unlock(); } }; # define SWIG_GUARD(mutex) Guard _guard(mutex) @@ -330,7 +412,7 @@ namespace Swig { typedef std::map swig_ownership_map; mutable swig_ownership_map swig_owner; #ifdef __THREAD__ - static PyThread_type_lock swig_mutex_own; + static Mutex swig_mutex_own; #endif public: @@ -382,7 +464,7 @@ namespace Swig { }; #ifdef __THREAD__ - PyThread_type_lock Director::swig_mutex_own = PyThread_allocate_lock(); + Mutex Director::swig_mutex_own; #endif } diff --git a/usr/share/swig/4.1.1/python/embed.i b/usr/share/swig/4.2.1/python/embed.i similarity index 73% rename from usr/share/swig/4.1.1/python/embed.i rename to usr/share/swig/4.2.1/python/embed.i index 3fc2d14e5b8..e5ee601d92f 100644 --- a/usr/share/swig/4.1.1/python/embed.i +++ b/usr/share/swig/4.2.1/python/embed.i @@ -2,31 +2,24 @@ // embed.i // SWIG file embedding the Python interpreter in something else. // This file is deprecated and no longer actively maintained, but it still -// seems to work with Python 2.7. Status with Python 3 is unknown. +// seems to work with Python 2.7. It doesn't work with Python 3. // // This file makes it possible to extend Python and all of its // built-in functions without having to hack its setup script. // - - -#ifdef AUTODOC -%subsection "embed.i" -%text %{ -This module provides support for building a new version of the -Python executable. This will be necessary on systems that do -not support shared libraries and may be necessary with C++ -extensions. This file contains everything you need to build -a new version of Python from include files and libraries normally -installed with the Python language. - -This module will automatically grab all of the Python modules -present in your current Python executable (including any special -purpose modules you have enabled such as Tkinter). Thus, you -may need to provide additional link libraries when compiling. - -As far as I know, this module is C++ safe. -%} -#endif +// This module provides support for building a new version of the +// Python executable. This will be necessary on systems that do +// not support shared libraries and may be necessary with C++ +// extensions. This file contains everything you need to build +// a new version of Python from include files and libraries normally +// installed with the Python language. +// +// This module will automatically grab all of the Python modules +// present in your current Python executable (including any special +// purpose modules you have enabled such as Tkinter). Thus, you +// may need to provide additional link libraries when compiling. +// +// As far as I know, this module is C++ safe. %wrapper %{ #if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) diff --git a/usr/share/swig/4.1.1/python/exception.i b/usr/share/swig/4.2.1/python/exception.i similarity index 100% rename from usr/share/swig/4.1.1/python/exception.i rename to usr/share/swig/4.2.1/python/exception.i diff --git a/usr/share/swig/4.2.1/python/factory.i b/usr/share/swig/4.2.1/python/factory.i new file mode 100644 index 00000000000..46a0a8733e7 --- /dev/null +++ b/usr/share/swig/4.2.1/python/factory.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.1.1/python/file.i b/usr/share/swig/4.2.1/python/file.i similarity index 100% rename from usr/share/swig/4.1.1/python/file.i rename to usr/share/swig/4.2.1/python/file.i diff --git a/usr/share/swig/4.1.1/python/implicit.i b/usr/share/swig/4.2.1/python/implicit.i similarity index 100% rename from usr/share/swig/4.1.1/python/implicit.i rename to usr/share/swig/4.2.1/python/implicit.i diff --git a/usr/share/swig/4.1.1/python/pyabc.i b/usr/share/swig/4.2.1/python/pyabc.i similarity index 100% rename from usr/share/swig/4.1.1/python/pyabc.i rename to usr/share/swig/4.2.1/python/pyabc.i diff --git a/usr/share/swig/4.1.1/python/pyapi.swg b/usr/share/swig/4.2.1/python/pyapi.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pyapi.swg rename to usr/share/swig/4.2.1/python/pyapi.swg diff --git a/usr/share/swig/4.1.1/python/pybackward.swg b/usr/share/swig/4.2.1/python/pybackward.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pybackward.swg rename to usr/share/swig/4.2.1/python/pybackward.swg diff --git a/usr/share/swig/4.1.1/python/pybuffer.i b/usr/share/swig/4.2.1/python/pybuffer.i similarity index 51% rename from usr/share/swig/4.1.1/python/pybuffer.i rename to usr/share/swig/4.2.1/python/pybuffer.i index 2fdaa6d6e5f..9ebc36a8c4e 100644 --- a/usr/share/swig/4.1.1/python/pybuffer.i +++ b/usr/share/swig/4.2.1/python/pybuffer.i @@ -12,18 +12,43 @@ * } */ +/* Note that in Py_LIMITED_API case we have no choice, but to use deprecated + * functions, as they provides the only way to access buffer data with limited + * API, which doesn't include Py_buffer definition. We also disable the + * warnings about doing this because they're not useful in our case. + */ + %define %pybuffer_mutable_binary(TYPEMAP, SIZE) %typemap(in) (TYPEMAP, SIZE) { int res; Py_ssize_t size = 0; void *buf = 0; +%#ifndef Py_LIMITED_API Py_buffer view; res = PyObject_GetBuffer($input, &view, PyBUF_WRITABLE); +%#else + %#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + %#pragma GCC diagnostic push + %#pragma GCC diagnostic ignored "-Wdeprecated" + %#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + %#elif defined(_MSC_VER) + %#pragma warning(push) + %#pragma warning(disable: 4996) + %#endif + res = PyObject_AsWriteBuffer($input, &buf, &size); + %#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + %#pragma GCC diagnostic pop + %#elif defined(_MSC_VER) + %#pragma warning(pop) + %#endif +%#endif if (res < 0) { PyErr_Clear(); %argument_fail(res, "(TYPEMAP, SIZE)", $symname, $argnum); } +%#ifndef Py_LIMITED_API size = view.len; buf = view.buf; PyBuffer_Release(&view); +%#endif $1 = ($1_ltype) buf; $2 = ($2_ltype) (size/sizeof($*1_type)); } @@ -45,14 +70,34 @@ %define %pybuffer_mutable_string(TYPEMAP) %typemap(in) (TYPEMAP) { int res; void *buf = 0; +%#ifndef Py_LIMITED_API Py_buffer view; res = PyObject_GetBuffer($input, &view, PyBUF_WRITABLE); +%#else + %#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + %#pragma GCC diagnostic push + %#pragma GCC diagnostic ignored "-Wdeprecated" + %#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + %#elif defined(_MSC_VER) + %#pragma warning(push) + %#pragma warning(disable: 4996) + %#endif + Py_ssize_t size; + res = PyObject_AsWriteBuffer($input, &buf, &size); + %#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + %#pragma GCC diagnostic pop + %#elif defined(_MSC_VER) + %#pragma warning(pop) + %#endif +%#endif if (res < 0) { PyErr_Clear(); %argument_fail(res, "(TYPEMAP)", $symname, $argnum); } +%#ifndef Py_LIMITED_API buf = view.buf; PyBuffer_Release(&view); +%#endif $1 = ($1_ltype) buf; } %enddef @@ -74,15 +119,34 @@ %define %pybuffer_binary(TYPEMAP, SIZE) %typemap(in) (TYPEMAP, SIZE) { int res; Py_ssize_t size = 0; const void *buf = 0; +%#ifndef Py_LIMITED_API Py_buffer view; res = PyObject_GetBuffer($input, &view, PyBUF_CONTIG_RO); +%#else + %#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + %#pragma GCC diagnostic push + %#pragma GCC diagnostic ignored "-Wdeprecated" + %#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + %#elif defined(_MSC_VER) + %#pragma warning(push) + %#pragma warning(disable: 4996) + %#endif + res = PyObject_AsReadBuffer($input, &buf, &size); + %#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + %#pragma GCC diagnostic pop + %#elif defined(_MSC_VER) + %#pragma warning(pop) + %#endif +%#endif if (res < 0) { PyErr_Clear(); %argument_fail(res, "(TYPEMAP, SIZE)", $symname, $argnum); } +%#ifndef Py_LIMITED_API size = view.len; buf = view.buf; PyBuffer_Release(&view); +%#endif $1 = ($1_ltype) buf; $2 = ($2_ltype) (size / sizeof($*1_type)); } @@ -106,14 +170,34 @@ %define %pybuffer_string(TYPEMAP) %typemap(in) (TYPEMAP) { int res; const void *buf = 0; +%#ifndef Py_LIMITED_API Py_buffer view; res = PyObject_GetBuffer($input, &view, PyBUF_CONTIG_RO); +%#else + %#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + %#pragma GCC diagnostic push + %#pragma GCC diagnostic ignored "-Wdeprecated" + %#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + %#elif defined(_MSC_VER) + %#pragma warning(push) + %#pragma warning(disable: 4996) + %#endif + Py_ssize_t size; + res = PyObject_AsReadBuffer($input, &buf, &size); + %#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + %#pragma GCC diagnostic pop + %#elif defined(_MSC_VER) + %#pragma warning(pop) + %#endif +%#endif if (res < 0) { PyErr_Clear(); %argument_fail(res, "(TYPEMAP)", $symname, $argnum); } +%#ifndef Py_LIMITED_API buf = view.buf; PyBuffer_Release(&view); +%#endif $1 = ($1_ltype) buf; } %enddef diff --git a/usr/share/swig/4.1.1/python/pyclasses.swg b/usr/share/swig/4.2.1/python/pyclasses.swg similarity index 99% rename from usr/share/swig/4.1.1/python/pyclasses.swg rename to usr/share/swig/4.2.1/python/pyclasses.swg index 31ebdd2a151..39c4e0316be 100644 --- a/usr/share/swig/4.1.1/python/pyclasses.swg +++ b/usr/share/swig/4.2.1/python/pyclasses.swg @@ -11,7 +11,7 @@ or as a member variable: struct A { - SwigPtr_PyObject obj; + SwigPtr_PyObject _obj; A(PyObject *o) : _obj(o) { } }; diff --git a/usr/share/swig/4.1.1/python/pycomplex.swg b/usr/share/swig/4.2.1/python/pycomplex.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pycomplex.swg rename to usr/share/swig/4.2.1/python/pycomplex.swg diff --git a/usr/share/swig/4.1.1/python/pycontainer.swg b/usr/share/swig/4.2.1/python/pycontainer.swg similarity index 80% rename from usr/share/swig/4.1.1/python/pycontainer.swg rename to usr/share/swig/4.2.1/python/pycontainer.swg index d6fdff08711..6916c618e1b 100644 --- a/usr/share/swig/4.1.1/python/pycontainer.swg +++ b/usr/share/swig/4.2.1/python/pycontainer.swg @@ -386,7 +386,7 @@ namespace swig { size_t replacecount = (jj - ii + step - 1) / step; if (is.size() != replacecount) { char msg[1024]; - sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); + PyOS_snprintf(msg, sizeof(msg), "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); throw std::invalid_argument(msg); } typename Sequence::const_iterator isit = is.begin(); @@ -402,7 +402,7 @@ namespace swig { size_t replacecount = (ii - jj - step - 1) / -step; if (is.size() != replacecount) { char msg[1024]; - sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); + PyOS_snprintf(msg, sizeof(msg), "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); throw std::invalid_argument(msg); } typename Sequence::const_iterator isit = is.begin(); @@ -456,239 +456,6 @@ namespace swig { } } -%fragment("SwigPySequence_Cont","header", - fragment="StdTraits", - fragment="SwigPySequence_Base", - fragment="SwigPyIterator_T") -{ -namespace swig -{ - template - struct SwigPySequence_Ref - { - SwigPySequence_Ref(PyObject* seq, Py_ssize_t index) - : _seq(seq), _index(index) - { - } - - operator T () const - { - swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index); - try { - return swig::as(item); - } catch (const std::invalid_argument& e) { - char msg[1024]; - sprintf(msg, "in sequence element %d ", (int)_index); - if (!PyErr_Occurred()) { - ::%type_error(swig::type_name()); - } - SWIG_Python_AddErrorMsg(msg); - SWIG_Python_AddErrorMsg(e.what()); - throw; - } - } - - SwigPySequence_Ref& operator=(const T& v) - { - PySequence_SetItem(_seq, _index, swig::from(v)); - return *this; - } - - private: - PyObject* _seq; - Py_ssize_t _index; - }; - - template - struct SwigPySequence_ArrowProxy - { - SwigPySequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; - }; - - template - struct SwigPySequence_InputIterator - { - typedef SwigPySequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef Py_ssize_t difference_type; - - SwigPySequence_InputIterator() - { - } - - SwigPySequence_InputIterator(PyObject* seq, Py_ssize_t index) - : _seq(seq), _index(index) - { - } - - reference operator*() const - { - return reference(_seq, _index); - } - - SwigPySequence_ArrowProxy - operator->() const { - return SwigPySequence_ArrowProxy(operator*()); - } - - bool operator==(const self& ri) const - { - return (_index == ri._index) && (_seq == ri._seq); - } - - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } - - self& operator ++ () - { - ++_index; - return *this; - } - - self& operator -- () - { - --_index; - return *this; - } - - self& operator += (difference_type n) - { - _index += n; - return *this; - } - - self operator +(difference_type n) const - { - return self(_seq, _index + n); - } - - self& operator -= (difference_type n) - { - _index -= n; - return *this; - } - - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } - - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } - - bool operator < (const self& ri) const - { - return _index < ri._index; - } - - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); - } - - private: - PyObject* _seq; - difference_type _index; - }; - - // STL container wrapper around a Python sequence - template - struct SwigPySequence_Cont - { - typedef SwigPySequence_Ref reference; - typedef const SwigPySequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef Py_ssize_t difference_type; - typedef size_t size_type; - typedef const pointer const_pointer; - typedef SwigPySequence_InputIterator iterator; - typedef SwigPySequence_InputIterator const_iterator; - - SwigPySequence_Cont(PyObject* seq) : _seq(0) - { - if (!PySequence_Check(seq)) { - throw std::invalid_argument("a sequence is expected"); - } - _seq = seq; - Py_INCREF(_seq); - } - - ~SwigPySequence_Cont() - { - Py_XDECREF(_seq); - } - - size_type size() const - { - return static_cast(PySequence_Size(_seq)); - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } - - const_iterator begin() const - { - return const_iterator(_seq, 0); - } - - iterator end() - { - return iterator(_seq, size()); - } - - const_iterator end() const - { - return const_iterator(_seq, size()); - } - - reference operator[](difference_type n) - { - return reference(_seq, n); - } - - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); - } - - bool check() const - { - Py_ssize_t s = size(); - for (Py_ssize_t i = 0; i < s; ++i) { - swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i); - if (!swig::check(item)) - return false; - } - return true; - } - - private: - PyObject* _seq; - }; - -} -} - %define %swig_sequence_iterator(Sequence...) %swig_sequence_iterator_with_making_function(swig::make_output_iterator,Sequence...) %enddef @@ -704,12 +471,12 @@ namespace swig class const_iterator; class const_reverse_iterator; - %typemap(out,noblock=1,fragment="SwigPySequence_Cont") + %typemap(out,noblock=1,fragment="SwigPyIterator_T") iterator, reverse_iterator, const_iterator, const_reverse_iterator { $result = SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &)), swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); } - %typemap(out,noblock=1,fragment="SwigPySequence_Cont") + %typemap(out,noblock=1,fragment="SwigPyIterator_T") std::pair, std::pair { $result = PyTuple_New(2); PyTuple_SetItem($result,0,SWIG_NewPointerObj(Make_output_iterator(%static_cast($1,const $type &).first), @@ -718,7 +485,7 @@ namespace swig swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN)); } - %fragment("SwigPyPairBoolOutputIterator","header",fragment=SWIG_From_frag(bool),fragment="SwigPySequence_Cont") {} + %fragment("SwigPyPairBoolOutputIterator","header",fragment=SWIG_From_frag(bool),fragment="SwigPyIterator_T") {} %typemap(out,noblock=1,fragment="SwigPyPairBoolOutputIterator") std::pair, std::pair { @@ -728,7 +495,7 @@ namespace swig PyTuple_SetItem($result,1,SWIG_From(bool)(%static_cast($1,const $type &).second)); } - %typemap(in,noblock=1,fragment="SwigPySequence_Cont") + %typemap(in,noblock=1,fragment="SwigPyIterator_T") iterator(swig::SwigPyIterator *iter = 0, int res), reverse_iterator(swig::SwigPyIterator *iter = 0, int res), const_iterator(swig::SwigPyIterator *iter = 0, int res), @@ -746,14 +513,14 @@ namespace swig } } - %typecheck(%checkcode(ITERATOR),noblock=1,fragment="SwigPySequence_Cont") + %typecheck(%checkcode(ITERATOR),noblock=1,fragment="SwigPyIterator_T") iterator, reverse_iterator, const_iterator, const_reverse_iterator { swig::SwigPyIterator *iter = 0; int res = SWIG_ConvertPtr($input, %as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); $1 = (SWIG_IsOK(res) && iter && (dynamic_cast *>(iter) != 0)); } - %fragment("SwigPySequence_Cont"); + %fragment("SwigPyIterator_T"); %newobject iterator(PyObject **PYTHON_SELF); %extend { @@ -999,26 +766,50 @@ namespace swig %fragment("StdSequenceTraits","header", fragment="StdTraits", - fragment="SwigPySequence_Cont") + fragment="SwigPySequence_Base") { namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, Seq* seq) { - // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); + template + struct IteratorProtocol { + static void assign(PyObject *obj, Seq *seq) { + SwigVar_PyObject iter = PyObject_GetIter(obj); + if (iter) { + SwigVar_PyObject item = PyIter_Next(iter); + while (item) { + seq->insert(seq->end(), swig::as(item)); + item = PyIter_Next(iter); + } + } } - } + + static bool check(PyObject *obj) { + bool ret = false; + SwigVar_PyObject iter = PyObject_GetIter(obj); + if (iter) { + SwigVar_PyObject item = PyIter_Next(iter); + ret = true; + while (item) { + ret = swig::check(item); + item = ret ? PyIter_Next(iter) : 0; + } + } + return ret; + } + }; template struct traits_asptr_stdseq { typedef Seq sequence; typedef T value_type; + static bool is_iterable(PyObject *obj) { + SwigVar_PyObject iter = PyObject_GetIter(obj); + PyErr_Clear(); + return iter != 0; + } + static int asptr(PyObject *obj, sequence **seq) { + int ret = SWIG_ERROR; if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) { sequence *p; swig_type_info *descriptor = swig::type_info(); @@ -1026,27 +817,25 @@ namespace swig { if (seq) *seq = p; return SWIG_OLDOBJ; } - } else if (PySequence_Check(obj)) { + } else if (is_iterable(obj)) { try { - SwigPySequence_Cont swigpyseq(obj); if (seq) { - sequence *pseq = new sequence(); - assign(swigpyseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; + *seq = new sequence(); + IteratorProtocol::assign(obj, *seq); + if (!PyErr_Occurred()) + return SWIG_NEWOBJ; } else { - return swigpyseq.check() ? SWIG_OK : SWIG_ERROR; + return IteratorProtocol::check(obj) ? SWIG_OK : SWIG_ERROR; } } catch (std::exception& e) { - if (seq) { - if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, e.what()); - } - } - return SWIG_ERROR; + if (seq && !PyErr_Occurred()) + PyErr_SetString(PyExc_TypeError, e.what()); } + if (seq) + delete *seq; + return SWIG_ERROR; } - return SWIG_ERROR; + return ret; } }; diff --git a/usr/share/swig/4.1.1/python/pydocs.swg b/usr/share/swig/4.2.1/python/pydocs.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pydocs.swg rename to usr/share/swig/4.2.1/python/pydocs.swg diff --git a/usr/share/swig/4.1.1/python/pyerrors.swg b/usr/share/swig/4.2.1/python/pyerrors.swg similarity index 95% rename from usr/share/swig/4.1.1/python/pyerrors.swg rename to usr/share/swig/4.2.1/python/pyerrors.swg index 10b694cde61..dfa55e061ad 100644 --- a/usr/share/swig/4.1.1/python/pyerrors.swg +++ b/usr/share/swig/4.2.1/python/pyerrors.swg @@ -57,13 +57,15 @@ SWIG_Python_AddErrorMsg(const char* mesg) PyErr_Fetch(&type, &value, &traceback); if (value) { PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); + PyObject *bytes = NULL; + const char *tmp = SWIG_PyUnicode_AsUTF8AndSize(old_str, NULL, &bytes); PyErr_Clear(); Py_XINCREF(type); if (tmp) PyErr_Format(type, "%s %s", tmp, mesg); else PyErr_Format(type, "%s", mesg); + Py_XDECREF(bytes); Py_DECREF(old_str); Py_DECREF(value); } else { diff --git a/usr/share/swig/4.1.1/python/pyfragments.swg b/usr/share/swig/4.2.1/python/pyfragments.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pyfragments.swg rename to usr/share/swig/4.2.1/python/pyfragments.swg diff --git a/usr/share/swig/4.1.1/python/pyhead.swg b/usr/share/swig/4.2.1/python/pyhead.swg similarity index 58% rename from usr/share/swig/4.1.1/python/pyhead.swg rename to usr/share/swig/4.2.1/python/pyhead.swg index 6f37160bb23..46891d9e88e 100644 --- a/usr/share/swig/4.1.1/python/pyhead.swg +++ b/usr/share/swig/4.2.1/python/pyhead.swg @@ -30,21 +30,29 @@ #endif -SWIGINTERN char* -SWIG_Python_str_AsChar(PyObject *str) +/* Wrapper around PyUnicode_AsUTF8AndSize - call Py_XDECREF on the returned pbytes when finished with the returned string */ +SWIGINTERN const char * +SWIG_PyUnicode_AsUTF8AndSize(PyObject *str, Py_ssize_t *psize, PyObject **pbytes) { #if PY_VERSION_HEX >= 0x03030000 - return (char *)PyUnicode_AsUTF8(str); +# if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000 + *pbytes = NULL; + return PyUnicode_AsUTF8AndSize(str, psize); +# else + *pbytes = PyUnicode_AsUTF8String(str); + const char *chars = *pbytes ? PyBytes_AsString(*pbytes) : NULL; + if (chars && psize) + *psize = PyBytes_Size(*pbytes); + return chars; +# endif #else - return PyString_AsString(str); + char *chars = NULL; + *pbytes = NULL; + PyString_AsStringAndSize(str, &chars, psize); + return chars; #endif } -/* Was useful for Python 3.0.x-3.2.x - now provided only for compatibility - * with any uses in user interface files. */ -#define SWIG_Python_str_DelForPy3(x) - - SWIGINTERN PyObject* SWIG_Python_str_FromChar(const char *c) { @@ -73,3 +81,17 @@ SWIG_Python_str_FromChar(const char *c) #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) #define Py_hash_t long #endif + +#ifdef Py_LIMITED_API +# define PyTuple_GET_ITEM PyTuple_GetItem +/* Note that PyTuple_SetItem() has different semantics from PyTuple_SET_ITEM as it decref's the original tuple item, so in general they cannot be used + interchangeably. However in SWIG-generated code PyTuple_SET_ITEM is only used with newly initialized tuples without any items and for them this does work. */ +# define PyTuple_SET_ITEM PyTuple_SetItem +# define PyTuple_GET_SIZE PyTuple_Size +# define PyCFunction_GET_FLAGS PyCFunction_GetFlags +# define PyCFunction_GET_FUNCTION PyCFunction_GetFunction +# define PyCFunction_GET_SELF PyCFunction_GetSelf +# define PyList_GET_ITEM PyList_GetItem +# define PyList_SET_ITEM PyList_SetItem +# define PySliceObject PyObject +#endif diff --git a/usr/share/swig/4.1.1/python/pyinit.swg b/usr/share/swig/4.2.1/python/pyinit.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pyinit.swg rename to usr/share/swig/4.2.1/python/pyinit.swg diff --git a/usr/share/swig/4.1.1/python/pyiterators.swg b/usr/share/swig/4.2.1/python/pyiterators.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pyiterators.swg rename to usr/share/swig/4.2.1/python/pyiterators.swg diff --git a/usr/share/swig/4.1.1/python/pymacros.swg b/usr/share/swig/4.2.1/python/pymacros.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pymacros.swg rename to usr/share/swig/4.2.1/python/pymacros.swg diff --git a/usr/share/swig/4.1.1/python/pyname_compat.i b/usr/share/swig/4.2.1/python/pyname_compat.i similarity index 92% rename from usr/share/swig/4.1.1/python/pyname_compat.i rename to usr/share/swig/4.2.1/python/pyname_compat.i index a9630dbe71d..789b2844351 100644 --- a/usr/share/swig/4.1.1/python/pyname_compat.i +++ b/usr/share/swig/4.2.1/python/pyname_compat.i @@ -25,7 +25,6 @@ */ %fragment("PySequence_Base", "header", fragment="SwigPySequence_Base") {} -%fragment("PySequence_Cont", "header", fragment="SwigPySequence_Cont") {} %fragment("PySwigIterator_T", "header", fragment="SwigPyIterator_T") {} %fragment("PyPairBoolOutputIterator", "header", fragment="SwigPyPairBoolOutputIterator") {} %fragment("PySwigIterator", "header", fragment="SwigPyIterator") {} @@ -38,11 +37,6 @@ #define PyObject_ptr SwigPtr_PyObject #define PyObject_var SwigVar_PyObject #define PyOper SwigPyOper -#define PySeq SwigPySeq -#define PySequence_ArrowProxy SwigPySequence_ArrowProxy -#define PySequence_Cont SwigPySequence_Cont -#define PySequence_InputIterator SwigPySequence_InputIterator -#define PySequence_Ref SwigPySequence_Ref #define PySwigClientData SwigPyClientData #define PySwigClientData_Del SwigPyClientData_Del #define PySwigClientData_New SwigPyClientData_New @@ -79,7 +73,6 @@ #define PySwigPacked_repr SwigPyPacked_repr #define PySwigPacked_str SwigPyPacked_str #define PySwigPacked_type SwigPyPacked_type -#define pyseq swigpyseq #define pyswigobject_type swigpyobject_type #define pyswigpacked_type swigpypacked_type %} diff --git a/usr/share/swig/4.1.1/python/pyopers.swg b/usr/share/swig/4.2.1/python/pyopers.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pyopers.swg rename to usr/share/swig/4.2.1/python/pyopers.swg diff --git a/usr/share/swig/4.1.1/python/pyprimtypes.swg b/usr/share/swig/4.2.1/python/pyprimtypes.swg similarity index 89% rename from usr/share/swig/4.1.1/python/pyprimtypes.swg rename to usr/share/swig/4.2.1/python/pyprimtypes.swg index 6a01af17cfa..7f372753fb3 100644 --- a/usr/share/swig/4.1.1/python/pyprimtypes.swg +++ b/usr/share/swig/4.2.1/python/pyprimtypes.swg @@ -104,7 +104,12 @@ SWIG_AsVal_dec(long)(PyObject *obj, long* val) if (!dispatch) { double d; int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { + // Largest double not larger than LONG_MAX (not portably calculated easily) + // Note that double(LONG_MAX) is stored in a double rounded up by one (for 64-bit long) + // 0x7ffffffffffffc00LL == (int64_t)std::nextafter(double(__uint128_t(LONG_MAX)+1), double(0)) + const double long_max = sizeof(long) == 8 ? 0x7ffffffffffffc00LL : LONG_MAX; + // No equivalent needed for 64-bit double(LONG_MIN) is exactly LONG_MIN + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, long_max)) { if (val) *val = (long)(d); return res; } @@ -166,7 +171,11 @@ SWIG_AsVal_dec(unsigned long)(PyObject *obj, unsigned long *val) if (!dispatch) { double d; int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { + // Largest double not larger than ULONG_MAX (not portably calculated easily) + // Note that double(ULONG_MAX) is stored in a double rounded up by one (for 64-bit unsigned long) + // 0xfffffffffffff800ULL == (uint64_t)std::nextafter(double(__uint128_t(ULONG_MAX)+1), double(0)) + const double ulong_max = sizeof(unsigned long) == 8 ? 0xfffffffffffff800ULL : ULONG_MAX; + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ulong_max)) { if (val) *val = (unsigned long)(d); return res; } diff --git a/usr/share/swig/4.1.1/python/pyrun.swg b/usr/share/swig/4.2.1/python/pyrun.swg similarity index 92% rename from usr/share/swig/4.1.1/python/pyrun.swg rename to usr/share/swig/4.2.1/python/pyrun.swg index 6b119be1c43..af60c2b0856 100644 --- a/usr/share/swig/4.1.1/python/pyrun.swg +++ b/usr/share/swig/4.2.1/python/pyrun.swg @@ -338,6 +338,7 @@ swig_varlink_setattr(PyObject *o, char *n, PyObject *p) { SWIGINTERN PyTypeObject* swig_varlink_type(void) { static char varlink__doc__[] = "Swig var link object"; +#ifndef Py_LIMITED_API static PyTypeObject varlink_type; static int type_init = 0; if (!type_init) { @@ -388,6 +389,9 @@ swig_varlink_type(void) { #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) 0, /* tp_print */ #endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, /* tp_watched */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -402,12 +406,31 @@ swig_varlink_type(void) { return NULL; } return &varlink_type; +#else + PyType_Slot slots[] = { + { Py_tp_dealloc, (void *)swig_varlink_dealloc }, + { Py_tp_repr, (void *)swig_varlink_repr }, + { Py_tp_getattr, (void *)swig_varlink_getattr }, + { Py_tp_setattr, (void *)swig_varlink_setattr }, + { Py_tp_str, (void *)swig_varlink_str }, + { Py_tp_doc, (void *)varlink__doc__ }, + { 0, NULL } + }; + PyType_Spec spec = { + "swigvarlink", + sizeof(swig_varlinkobject), + 0, + Py_TPFLAGS_DEFAULT, + slots + }; + return (PyTypeObject *)PyType_FromSpec(&spec); +#endif } /* Create a variable linking object for use later */ SWIGINTERN PyObject * SWIG_Python_newvarlink(void) { - swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); + swig_varlinkobject *result = PyObject_New(swig_varlinkobject, swig_varlink_type()); if (result) { result->vars = 0; } @@ -680,12 +703,14 @@ SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) SWIGRUNTIME PyObject* SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) { - PyObject* res; - if( op != Py_EQ && op != Py_NE ) { - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; + PyObject* res = NULL; + if (!PyErr_Occurred()) { + if (op != Py_EQ && op != Py_NE) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); } - res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); return res; } @@ -713,14 +738,26 @@ SwigPyObject_type(void) { SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op) { -#ifdef SWIGPYTHON_BUILTIN PyTypeObject *target_tp = SwigPyObject_type(); - if (PyType_IsSubtype(op->ob_type, target_tp)) + PyTypeObject *op_type = Py_TYPE(op); +#ifdef SWIGPYTHON_BUILTIN + if (PyType_IsSubtype(op_type, target_tp)) return 1; - return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); + return (strcmp(op_type->tp_name, "SwigPyObject") == 0); #else - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); + if (op_type == target_tp) + return 1; +# ifdef Py_LIMITED_API + int cmp; + PyObject *tp_name = PyObject_GetAttrString((PyObject *)op_type, "__name__"); + if (!tp_name) + return 0; + cmp = PyUnicode_CompareWithASCIIString(tp_name, "SwigPyObject"); + Py_DECREF(tp_name); + return cmp == 0; +# else + return (strcmp(op_type->tp_name, "SwigPyObject") == 0); +# endif #endif } @@ -864,7 +901,7 @@ swigobject_methods[] = { SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - +#ifndef Py_LIMITED_API static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ @@ -982,6 +1019,9 @@ SwigPyObject_TypeOnce(void) { #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) 0, /* tp_print */ #endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, /* tp_watched */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -996,12 +1036,32 @@ SwigPyObject_TypeOnce(void) { return NULL; } return &swigpyobject_type; +#else + PyType_Slot slots[] = { + { Py_tp_dealloc, (void *)SwigPyObject_dealloc }, + { Py_tp_repr, (void *)SwigPyObject_repr }, + { Py_tp_getattro, (void *)PyObject_GenericGetAttr }, + { Py_tp_doc, (void *)swigobject_doc }, + { Py_tp_richcompare, (void *)SwigPyObject_richcompare }, + { Py_tp_methods, (void *)swigobject_methods }, + { Py_nb_int, (void *)SwigPyObject_long }, + { 0, NULL } + }; + PyType_Spec spec = { + "SwigPyObject", + sizeof(SwigPyObject), + 0, + Py_TPFLAGS_DEFAULT, + slots + }; + return (PyTypeObject *)PyType_FromSpec(&spec); +#endif } SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); + SwigPyObject *sobj = PyObject_New(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; @@ -1072,8 +1132,20 @@ SwigPyPacked_type(void) { SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == SwigPyPacked_TypeOnce()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); + PyTypeObject* op_type = Py_TYPE(op); + if (op_type == SwigPyPacked_TypeOnce()) + return 1; +#ifdef Py_LIMITED_API + int cmp; + PyObject *tp_name = PyObject_GetAttrString((PyObject *)op_type, "__name__"); + if (!tp_name) + return 0; + cmp = PyUnicode_CompareWithASCIIString(tp_name, "SwigPyPacked"); + Py_DECREF(tp_name); + return cmp == 0; +#else + return (strcmp(op_type->tp_name, "SwigPyPacked") == 0); +#endif } SWIGRUNTIME void @@ -1089,6 +1161,7 @@ SwigPyPacked_dealloc(PyObject *v) SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; +#ifndef Py_LIMITED_API static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { @@ -1162,6 +1235,9 @@ SwigPyPacked_TypeOnce(void) { #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) 0, /* tp_print */ #endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, /* tp_watched */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -1176,12 +1252,30 @@ SwigPyPacked_TypeOnce(void) { return NULL; } return &swigpypacked_type; +#else + PyType_Slot slots[] = { + { Py_tp_dealloc, (void *)SwigPyPacked_dealloc }, + { Py_tp_repr, (void *)SwigPyPacked_repr }, + { Py_tp_str, (void *)SwigPyPacked_str }, + { Py_tp_getattro, (void *)PyObject_GenericGetAttr }, + { Py_tp_doc, (void *)swigpacked_doc }, + { 0, NULL } + }; + PyType_Spec spec = { + "SwigPyPacked", + sizeof(SwigPyPacked), + 0, + Py_TPFLAGS_DEFAULT, + slots + }; + return (PyTypeObject *)PyType_FromSpec(&spec); +#endif } SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); + SwigPyPacked *sobj = PyObject_New(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { @@ -1433,10 +1527,20 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { swig_cast_info *tc; /* here we get the method pointer for callbacks */ +#ifndef Py_LIMITED_API const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); +#else + PyObject* pystr_doc = PyObject_GetAttrString(obj, "__doc__"); + PyObject *bytes = NULL; + const char *doc = pystr_doc ? SWIG_PyUnicode_AsUTF8AndSize(pystr_doc, NULL, &bytes) : 0; +#endif const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; +#ifdef Py_LIMITED_API + Py_XDECREF(bytes); + Py_XDECREF(pystr_doc); +#endif if (!desc) return SWIG_ERROR; tc = SWIG_TypeCheck(desc,ty); @@ -1512,7 +1616,12 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) if (empty_args) { PyObject *empty_kwargs = PyDict_New(); if (empty_kwargs) { - inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs); +#ifndef Py_LIMITED_API + newfunc newfn = ((PyTypeObject *)data->newargs)->tp_new; +#else + newfunc newfn = (newfunc)PyType_GetSlot((PyTypeObject *)data->newargs, Py_tp_new); +#endif + inst = newfn((PyTypeObject *)data->newargs, empty_args, empty_kwargs); Py_DECREF(empty_kwargs); if (inst) { if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { @@ -1594,7 +1703,12 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f if (flags & SWIG_BUILTIN_TP_INIT) { newobj = (SwigPyObject*) self; if (newobj->ptr) { - PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); +#ifndef Py_LIMITED_API + allocfunc alloc = clientdata->pytype->tp_alloc; +#else + allocfunc alloc = (allocfunc)PyType_GetSlot(clientdata->pytype, Py_tp_alloc); +#endif + PyObject *next_self = alloc(clientdata->pytype, 0); while (newobj->next) newobj = (SwigPyObject *) newobj->next; newobj->next = next_self; @@ -1677,7 +1791,7 @@ SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { } -static int interpreter_counter = 0; // how many (sub-)interpreters are using swig_module's types +static int interpreter_counter = 0; /* how many (sub-)interpreters are using swig_module's types */ SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject *obj) @@ -1685,7 +1799,7 @@ SWIG_Python_DestroyModule(PyObject *obj) swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); swig_type_info **types = swig_module->types; size_t i; - if (--interpreter_counter != 0) // another sub-interpreter may still be using the swig_module's types + if (--interpreter_counter != 0) /* another sub-interpreter may still be using the swig_module's types */ return; for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; @@ -1767,7 +1881,8 @@ SWIG_Python_AddErrMesg(const char* mesg, int infront) PyErr_Fetch(&type, &value, &traceback); if (value) { PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); + PyObject *bytes = NULL; + const char *tmp = SWIG_PyUnicode_AsUTF8AndSize(old_str, NULL, &bytes); const char *errmesg = tmp ? tmp : "Invalid error message"; Py_XINCREF(type); PyErr_Clear(); @@ -1776,6 +1891,7 @@ SWIG_Python_AddErrMesg(const char* mesg, int infront) } else { PyErr_Format(type, "%s %s", errmesg, mesg); } + Py_XDECREF(bytes); Py_DECREF(old_str); } return 1; @@ -1820,10 +1936,13 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) } else #endif { +#ifndef Py_LIMITED_API + /* tp_name is not accessible */ const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); - const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; + PyObject *bytes = NULL; + const char *cstr = str ? SWIG_PyUnicode_AsUTF8AndSize(str, NULL, &bytes) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); @@ -1831,9 +1950,11 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } + Py_XDECREF(bytes); Py_XDECREF(str); return; } +#endif } PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); } else { diff --git a/usr/share/swig/4.1.1/python/pyruntime.swg b/usr/share/swig/4.2.1/python/pyruntime.swg similarity index 98% rename from usr/share/swig/4.1.1/python/pyruntime.swg rename to usr/share/swig/4.2.1/python/pyruntime.swg index 1d028adaf0b..3f45af890fa 100644 --- a/usr/share/swig/4.1.1/python/pyruntime.swg +++ b/usr/share/swig/4.2.1/python/pyruntime.swg @@ -34,6 +34,8 @@ #if __GNUC__ >= 7 #pragma GCC diagnostic pop #endif + +#include %} %insert(runtime) "swigrun.swg"; /* SWIG API */ diff --git a/usr/share/swig/4.1.1/python/pystdcommon.swg b/usr/share/swig/4.2.1/python/pystdcommon.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pystdcommon.swg rename to usr/share/swig/4.2.1/python/pystdcommon.swg diff --git a/usr/share/swig/4.1.1/python/pystrings.swg b/usr/share/swig/4.2.1/python/pystrings.swg similarity index 70% rename from usr/share/swig/4.1.1/python/pystrings.swg rename to usr/share/swig/4.2.1/python/pystrings.swg index 64ed685e8c9..1cb4e993aa9 100644 --- a/usr/share/swig/4.1.1/python/pystrings.swg +++ b/usr/share/swig/4.2.1/python/pystrings.swg @@ -2,8 +2,10 @@ * utility methods for char strings * ------------------------------------------------------------ */ %fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { +/* Return string from Python obj. NOTE: obj must remain in scope in order + to use the returned cptr (but only when alloc is set to SWIG_OLDOBJ) */ SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) +SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc) { %#if PY_VERSION_HEX>=0x03000000 %#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) @@ -16,55 +18,31 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) %#endif { char *cstr; Py_ssize_t len; + PyObject *bytes = NULL; int ret = SWIG_OK; -%#if PY_VERSION_HEX>=0x03000000 -%#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (!alloc && cptr) { - /* We can't allow converting without allocation, since the internal - representation of string in Python 3 is UCS-2/UCS-4 but we require - a UTF-8 representation. - TODO(bhy) More detailed explanation */ - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (!obj) - return SWIG_TypeError; if (alloc) - *alloc = SWIG_NEWOBJ; -%#endif + *alloc = SWIG_OLDOBJ; +%#if PY_VERSION_HEX>=0x03000000 && defined(SWIG_PYTHON_STRICT_BYTE_CHAR) if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1) return SWIG_TypeError; %#else - if (PyString_AsStringAndSize(obj, &cstr, &len) == -1) + cstr = (char *)SWIG_PyUnicode_AsUTF8AndSize(obj, &len, &bytes); + if (!cstr) return SWIG_TypeError; -%#endif - if (cptr) { + /* The returned string is only duplicated if the char * returned is not owned and memory managed by obj */ + if (bytes && cptr) { if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = %new_copy_array(cstr, len + 1, char); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } + cstr = %new_copy_array(cstr, len + 1, char); + *alloc = SWIG_NEWOBJ; } else { -%#if PY_VERSION_HEX>=0x03000000 -%#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - *cptr = PyBytes_AsString(obj); -%#else - assert(0); /* Should never reach here with Unicode strings in Python 3 */ -%#endif -%#else - *cptr = SWIG_Python_str_AsChar(obj); - if (!*cptr) - ret = SWIG_TypeError; -%#endif + /* alloc must be set in order to clean up allocated memory */ + return SWIG_RuntimeError; } } - if (psize) *psize = len + 1; -%#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - Py_XDECREF(obj); %#endif + if (cptr) *cptr = cstr; + if (psize) *psize = len + 1; + Py_XDECREF(bytes); return ret; } else { %#if defined(SWIG_PYTHON_2_UNICODE) diff --git a/usr/share/swig/4.1.1/python/python.swg b/usr/share/swig/4.2.1/python/python.swg similarity index 100% rename from usr/share/swig/4.1.1/python/python.swg rename to usr/share/swig/4.2.1/python/python.swg diff --git a/usr/share/swig/4.1.1/python/pythonkw.swg b/usr/share/swig/4.2.1/python/pythonkw.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pythonkw.swg rename to usr/share/swig/4.2.1/python/pythonkw.swg diff --git a/usr/share/swig/4.1.1/python/pythreads.swg b/usr/share/swig/4.2.1/python/pythreads.swg similarity index 97% rename from usr/share/swig/4.1.1/python/pythreads.swg rename to usr/share/swig/4.2.1/python/pythreads.swg index 8d6c5ab49e1..96a64710c38 100644 --- a/usr/share/swig/4.1.1/python/pythreads.swg +++ b/usr/share/swig/4.2.1/python/pythreads.swg @@ -28,7 +28,7 @@ bool status; PyThreadState *save; public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} + void end() { if (status) { status = false; PyEval_RestoreThread(save); }} SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} ~SWIG_Python_Thread_Allow() { end(); } }; diff --git a/usr/share/swig/4.1.1/python/pytuplehlp.swg b/usr/share/swig/4.2.1/python/pytuplehlp.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pytuplehlp.swg rename to usr/share/swig/4.2.1/python/pytuplehlp.swg diff --git a/usr/share/swig/4.1.1/python/pytypemaps.swg b/usr/share/swig/4.2.1/python/pytypemaps.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pytypemaps.swg rename to usr/share/swig/4.2.1/python/pytypemaps.swg diff --git a/usr/share/swig/4.1.1/python/pyuserdir.swg b/usr/share/swig/4.2.1/python/pyuserdir.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pyuserdir.swg rename to usr/share/swig/4.2.1/python/pyuserdir.swg diff --git a/usr/share/swig/4.1.1/python/pywstrings.swg b/usr/share/swig/4.2.1/python/pywstrings.swg similarity index 100% rename from usr/share/swig/4.1.1/python/pywstrings.swg rename to usr/share/swig/4.2.1/python/pywstrings.swg diff --git a/usr/share/swig/4.1.1/python/std_alloc.i b/usr/share/swig/4.2.1/python/std_alloc.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_alloc.i rename to usr/share/swig/4.2.1/python/std_alloc.i diff --git a/usr/share/swig/4.1.1/python/std_array.i b/usr/share/swig/4.2.1/python/std_array.i similarity index 73% rename from usr/share/swig/4.1.1/python/std_array.i rename to usr/share/swig/4.2.1/python/std_array.i index a3de3125b55..707b354750b 100644 --- a/usr/share/swig/4.1.1/python/std_array.i +++ b/usr/share/swig/4.2.1/python/std_array.i @@ -19,15 +19,43 @@ } }; - template - inline void - assign(const SwigPySeq& swigpyseq, std::array* seq) { - if (swigpyseq.size() < seq->size()) - throw std::invalid_argument("std::array cannot be expanded in size"); - else if (swigpyseq.size() > seq->size()) - throw std::invalid_argument("std::array cannot be reduced in size"); - std::copy(swigpyseq.begin(), swigpyseq.end(), seq->begin()); - } + template + struct IteratorProtocol, T> { + + static void assign(PyObject *obj, std::array *seq) { + SwigVar_PyObject iter = PyObject_GetIter(obj); + if (iter) { + SwigVar_PyObject item = PyIter_Next(iter); + size_t count = 0; + typename std::array::iterator array_iter = seq->begin(); + while (item && (count < N)) { + ++count; + *array_iter++ = swig::as(item); + item = PyIter_Next(iter); + } + if (count != N || item) + throw std::invalid_argument("std::array size does not match source container size"); + } + } + + static bool check(PyObject *obj) { + bool ret = false; + SwigVar_PyObject iter = PyObject_GetIter(obj); + if (iter) { + SwigVar_PyObject item = PyIter_Next(iter); + size_t count = 0; + ret = true; + while (item && (count < N)) { + ++count; + ret = swig::check(item); + item = ret ? PyIter_Next(iter) : 0; + } + if (count != N || item) + ret = false; + } + return ret; + } + }; template inline void diff --git a/usr/share/swig/4.1.1/ruby/std_auto_ptr.i b/usr/share/swig/4.2.1/python/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_auto_ptr.i rename to usr/share/swig/4.2.1/python/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/python/std_basic_string.i b/usr/share/swig/4.2.1/python/std_basic_string.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_basic_string.i rename to usr/share/swig/4.2.1/python/std_basic_string.i diff --git a/usr/share/swig/4.1.1/python/std_char_traits.i b/usr/share/swig/4.2.1/python/std_char_traits.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_char_traits.i rename to usr/share/swig/4.2.1/python/std_char_traits.i diff --git a/usr/share/swig/4.1.1/python/std_common.i b/usr/share/swig/4.2.1/python/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_common.i rename to usr/share/swig/4.2.1/python/std_common.i diff --git a/usr/share/swig/4.1.1/python/std_complex.i b/usr/share/swig/4.2.1/python/std_complex.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_complex.i rename to usr/share/swig/4.2.1/python/std_complex.i diff --git a/usr/share/swig/4.1.1/python/std_container.i b/usr/share/swig/4.2.1/python/std_container.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_container.i rename to usr/share/swig/4.2.1/python/std_container.i diff --git a/usr/share/swig/4.1.1/python/std_deque.i b/usr/share/swig/4.2.1/python/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_deque.i rename to usr/share/swig/4.2.1/python/std_deque.i diff --git a/usr/share/swig/4.1.1/r/std_except.i b/usr/share/swig/4.2.1/python/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/r/std_except.i rename to usr/share/swig/4.2.1/python/std_except.i diff --git a/usr/share/swig/4.2.1/python/std_filesystem.i b/usr/share/swig/4.2.1/python/std_filesystem.i new file mode 100644 index 00000000000..5b9f3358969 --- /dev/null +++ b/usr/share/swig/4.2.1/python/std_filesystem.i @@ -0,0 +1,121 @@ +/* ----------------------------------------------------------------------------- + * std_filesystem.i + * + * SWIG typemaps for std::filesystem::path + * ----------------------------------------------------------------------------- */ + +%{ +#include +%} + +%fragment("SWIG_std_filesystem", "header") { +SWIGINTERN PyObject *SWIG_std_filesystem_importPathClass() { + PyObject *module = PyImport_ImportModule("pathlib"); + PyObject *cls = PyObject_GetAttrString(module, "Path"); + Py_DECREF(module); + return cls; +} + +SWIGINTERN bool SWIG_std_filesystem_isPathInstance(PyObject *obj) { + PyObject *cls = SWIG_std_filesystem_importPathClass(); + bool is_instance = PyObject_IsInstance(obj, cls); + Py_DECREF(cls); + return is_instance; +} +} + +%typemap(in, fragment="SWIG_std_filesystem", fragment="") std::filesystem::path { + if (PyUnicode_Check($input)) { + PyObject *bytes = NULL; + const char *s = SWIG_PyUnicode_AsUTF8AndSize($input, NULL, &bytes); + $1 = std::filesystem::path(s); + Py_XDECREF(bytes); + } else if (SWIG_std_filesystem_isPathInstance($input)) { + PyObject *str_obj = PyObject_Str($input); + if constexpr (std::is_same_v) { + Py_ssize_t size = 0; + wchar_t *ws = PyUnicode_AsWideCharString(str_obj, &size); + if (!ws) SWIG_fail; + $1 = std::filesystem::path(std::wstring(ws, static_cast(size))); + PyMem_Free(ws); + } else { + PyObject *bytes = NULL; + const char *s = SWIG_PyUnicode_AsUTF8AndSize(str_obj, NULL, &bytes); + $1 = std::filesystem::path(s); + Py_XDECREF(bytes); + } + Py_DECREF(str_obj); + } else { + void *argp = 0; + int res = SWIG_ConvertPtr($input, &argp, $descriptor(std::filesystem::path *), $disown | 0); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$type", $symname, $argnum); + } + std::filesystem::path *temp = %reinterpret_cast(argp, $1_ltype*); + $1 = *temp; + } +} + +%typemap(in, fragment="SWIG_std_filesystem", fragment="") const std::filesystem::path &(std::filesystem::path temp_path) { + if (PyUnicode_Check($input)) { + PyObject *bytes = NULL; + const char *s = SWIG_PyUnicode_AsUTF8AndSize($input, NULL, &bytes); + temp_path = std::filesystem::path(s); + $1 = &temp_path; + Py_XDECREF(bytes); + } else if (SWIG_std_filesystem_isPathInstance($input)) { + PyObject *str_obj = PyObject_Str($input); + if constexpr (std::is_same_v) { + Py_ssize_t size = 0; + wchar_t *ws = PyUnicode_AsWideCharString(str_obj, &size); + if (!ws) SWIG_fail; + temp_path = std::filesystem::path(std::wstring(ws, static_cast(size))); + $1 = &temp_path; + PyMem_Free(ws); + } else { + PyObject *bytes = NULL; + const char *s = SWIG_PyUnicode_AsUTF8AndSize(str_obj, NULL, &bytes); + temp_path = std::filesystem::path(s); + $1 = &temp_path; + Py_XDECREF(bytes); + } + Py_DECREF(str_obj); + } else { + void *argp = 0; + int res = SWIG_ConvertPtr($input, &argp, $descriptor, $disown | 0); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$type", $symname, $argnum); + } + $1 = %reinterpret_cast(argp, $1_ltype); + } +} + +%typemap(out, fragment="SWIG_std_filesystem", fragment="") std::filesystem::path { + PyObject *args; + if constexpr (std::is_same_v) { + std::wstring s = $1.generic_wstring(); + args = Py_BuildValue("(u)", s.data()); + } else { + std::string s = $1.generic_string(); + args = Py_BuildValue("(s)", s.data()); + } + PyObject *cls = SWIG_std_filesystem_importPathClass(); + $result = PyObject_CallObject(cls, args); + Py_DECREF(cls); + Py_DECREF(args); +} + +%typemap(out, fragment="SWIG_std_filesystem", fragment="") const std::filesystem::path & { + PyObject *args; + if constexpr (std::is_same_v) { + std::wstring s = $1->generic_wstring(); + args = Py_BuildValue("(u)", s.data()); + } else { + std::string s = $1->generic_string(); + args = Py_BuildValue("(s)", s.data()); + } + PyObject *cls = SWIG_std_filesystem_importPathClass(); + $result = PyObject_CallObject(cls, args); + Py_DECREF(cls); + Py_DECREF(args); +} diff --git a/usr/share/swig/4.1.1/python/std_ios.i b/usr/share/swig/4.2.1/python/std_ios.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_ios.i rename to usr/share/swig/4.2.1/python/std_ios.i diff --git a/usr/share/swig/4.1.1/python/std_iostream.i b/usr/share/swig/4.2.1/python/std_iostream.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_iostream.i rename to usr/share/swig/4.2.1/python/std_iostream.i diff --git a/usr/share/swig/4.1.1/python/std_list.i b/usr/share/swig/4.2.1/python/std_list.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_list.i rename to usr/share/swig/4.2.1/python/std_list.i diff --git a/usr/share/swig/4.1.1/python/std_map.i b/usr/share/swig/4.2.1/python/std_map.i similarity index 95% rename from usr/share/swig/4.1.1/python/std_map.i rename to usr/share/swig/4.2.1/python/std_map.i index e0b7d69dcd3..954e7eb2d9a 100644 --- a/usr/share/swig/4.1.1/python/std_map.i +++ b/usr/share/swig/4.2.1/python/std_map.i @@ -2,7 +2,7 @@ Maps */ -%fragment("StdMapCommonTraits","header",fragment="StdSequenceTraits") +%fragment("StdMapCommonTraits","header",fragment="StdSequenceTraits",fragment="SwigPyIterator_T") { namespace swig { template @@ -77,16 +77,6 @@ %fragment("StdMapTraits","header",fragment="StdMapCommonTraits") { namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::map *map) { - typedef typename std::map::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - map->insert(value_type(it->first, it->second)); - } - } - template struct traits_asptr > { typedef std::map map_type; @@ -295,7 +285,11 @@ } void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } PyObject* asdict() { diff --git a/usr/share/swig/4.1.1/python/std_multimap.i b/usr/share/swig/4.2.1/python/std_multimap.i similarity index 87% rename from usr/share/swig/4.1.1/python/std_multimap.i rename to usr/share/swig/4.2.1/python/std_multimap.i index bbffb6bcdb4..75b4d7fcfac 100644 --- a/usr/share/swig/4.1.1/python/std_multimap.i +++ b/usr/share/swig/4.2.1/python/std_multimap.i @@ -6,16 +6,6 @@ %fragment("StdMultimapTraits","header",fragment="StdMapCommonTraits") { namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::multimap *multimap) { - typedef typename std::multimap::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - multimap->insert(value_type(it->first, it->second)); - } - } - template struct traits_asptr > { typedef std::multimap multimap_type; diff --git a/usr/share/swig/4.1.1/python/std_multiset.i b/usr/share/swig/4.2.1/python/std_multiset.i similarity index 59% rename from usr/share/swig/4.1.1/python/std_multiset.i rename to usr/share/swig/4.2.1/python/std_multiset.i index ac430334c8c..b79f64e5a31 100644 --- a/usr/share/swig/4.1.1/python/std_multiset.i +++ b/usr/share/swig/4.2.1/python/std_multiset.i @@ -7,17 +7,6 @@ %fragment("StdMultisetTraits","header",fragment="StdSequenceTraits") %{ namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::multiset* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - template struct traits_asptr > { static int asptr(PyObject *obj, std::multiset **m) { diff --git a/usr/share/swig/4.1.1/python/std_pair.i b/usr/share/swig/4.2.1/python/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_pair.i rename to usr/share/swig/4.2.1/python/std_pair.i diff --git a/usr/share/swig/4.1.1/python/std_set.i b/usr/share/swig/4.2.1/python/std_set.i similarity index 74% rename from usr/share/swig/4.1.1/python/std_set.i rename to usr/share/swig/4.2.1/python/std_set.i index 0ef0119981f..3f80daff686 100644 --- a/usr/share/swig/4.1.1/python/std_set.i +++ b/usr/share/swig/4.2.1/python/std_set.i @@ -5,17 +5,6 @@ %fragment("StdSetTraits","header",fragment="StdSequenceTraits") %{ namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::set* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - template struct traits_asptr > { static int asptr(PyObject *obj, std::set **s) { diff --git a/usr/share/swig/4.1.1/python/std_shared_ptr.i b/usr/share/swig/4.2.1/python/std_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_shared_ptr.i rename to usr/share/swig/4.2.1/python/std_shared_ptr.i diff --git a/usr/share/swig/4.1.1/python/std_sstream.i b/usr/share/swig/4.2.1/python/std_sstream.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_sstream.i rename to usr/share/swig/4.2.1/python/std_sstream.i diff --git a/usr/share/swig/4.1.1/python/std_streambuf.i b/usr/share/swig/4.2.1/python/std_streambuf.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_streambuf.i rename to usr/share/swig/4.2.1/python/std_streambuf.i diff --git a/usr/share/swig/4.1.1/r/std_string.i b/usr/share/swig/4.2.1/python/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/r/std_string.i rename to usr/share/swig/4.2.1/python/std_string.i diff --git a/usr/share/swig/4.2.1/python/std_string_view.i b/usr/share/swig/4.2.1/python/std_string_view.i new file mode 100644 index 00000000000..a3069f839cd --- /dev/null +++ b/usr/share/swig/4.2.1/python/std_string_view.i @@ -0,0 +1,135 @@ +/* ----------------------------------------------------------------------------- + * std_string_view.i + * + * SWIG typemaps for std::string_view types + * ----------------------------------------------------------------------------- */ + +%include + +%{ +#include + +#if PY_VERSION_HEX < 0x03000000 +# error std_string_view.i not supported for Python 2 +#endif +%} + +namespace std { + + %naturalvar string_view; + + class string_view; + + %typemap(typecheck,precedence=SWIG_TYPECHECK_STRINGVIEW) string_view, const string_view & %{ +#ifdef SWIG_PYTHON_STRICT_BYTE_CHAR + $1 = PyBytes_Check($input); +#else + $1 = PyUnicode_Check($input) || PyBytes_Check($input); +#endif + %} + + %typemap(in) string_view (PyObject *bytes = NULL) %{ + Py_ssize_t len; +#ifdef SWIG_PYTHON_STRICT_BYTE_CHAR + const char *p = PyBytes_AsString($input); + if (!p) SWIG_fail; + len = PyBytes_Size($input); +#else + const char *p; + if (PyUnicode_Check($input)) { + p = SWIG_PyUnicode_AsUTF8AndSize($input, &len, &bytes); + if (!p) SWIG_fail; + } else { + p = PyBytes_AsString($input); + if (!p) SWIG_fail; + len = PyBytes_Size($input); + } +#endif + $1 = std::string_view(p, len); + %} + + %typemap(freearg) string_view %{ + Py_XDECREF(bytes$argnum); + %} + + %typemap(in) const string_view & ($*1_ltype temp, PyObject *bytes = NULL) %{ + Py_ssize_t len; +#ifdef SWIG_PYTHON_STRICT_BYTE_CHAR + const char *p = PyBytes_AsString($input); + if (!p) SWIG_fail; + len = PyBytes_Size($input); +#else + const char *p; + if (PyUnicode_Check($input)) { + p = SWIG_PyUnicode_AsUTF8AndSize($input, &len, &bytes); + if (!p) SWIG_fail; + } else { + p = PyBytes_AsString($input); + if (!p) SWIG_fail; + len = PyBytes_Size($input); + } +#endif + temp = std::string_view(p, len); + $1 = &temp; + %} + + %typemap(freearg) const string_view & %{ + Py_XDECREF(bytes$argnum); + %} + + %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) string_view { + Py_ssize_t len; +%#ifdef SWIG_PYTHON_STRICT_BYTE_CHAR + const char *p = PyBytes_AsString($input); + if (p) len = PyBytes_Size($input); +%#else + const char *p; + PyObject *bytes = NULL; + if (PyUnicode_Check($input)) { + p = SWIG_PyUnicode_AsUTF8AndSize($input, &len, &bytes); + // Avoid undefined behaviour (p will be pointing to a temporary + // if bytes is not NULL which happens when Py_LIMITED_API is defined + // and < 0x030A0000) and just leak by not calling Py_XDECREF. + // Py_XDECREF(bytes); + } else { + p = PyBytes_AsString($input); + if (p) len = PyBytes_Size($input); + } +%#endif + if (p) $result = std::string_view(p, len); + } + + + %typemap(out) string_view %{ +#ifdef SWIG_PYTHON_STRICT_BYTE_CHAR + $result = PyBytes_FromStringAndSize($1.data(), $1.size()); +#else + $result = PyUnicode_FromStringAndSize($1.data(), $1.size()); +#endif + %} + + %typemap(varout) string_view %{ +#ifdef SWIG_PYTHON_STRICT_BYTE_CHAR + $result = PyBytes_FromStringAndSize($1.data(), $1.size()); +#else + $result = PyUnicode_FromStringAndSize($1.data(), $1.size()); +#endif + %} + + %typemap(directorin) string_view, const string_view & %{ +#ifdef SWIG_PYTHON_STRICT_BYTE_CHAR + $input = PyBytes_FromStringAndSize($1.data(), $1.size()); +#else + $input = PyUnicode_FromStringAndSize($1.data(), $1.size()); +#endif + %} + + %typemap(out) const string_view & %{ +#ifdef SWIG_PYTHON_STRICT_BYTE_CHAR + $result = PyBytes_FromStringAndSize($1->data(), $1->size()); +#else + $result = PyUnicode_FromStringAndSize($1->data(), $1->size()); +#endif + %} + +} diff --git a/usr/share/swig/4.1.1/ruby/std_unique_ptr.i b/usr/share/swig/4.2.1/python/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_unique_ptr.i rename to usr/share/swig/4.2.1/python/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/python/std_unordered_map.i b/usr/share/swig/4.2.1/python/std_unordered_map.i similarity index 95% rename from usr/share/swig/4.1.1/python/std_unordered_map.i rename to usr/share/swig/4.2.1/python/std_unordered_map.i index 784be4c8f95..4321735561e 100644 --- a/usr/share/swig/4.1.1/python/std_unordered_map.i +++ b/usr/share/swig/4.2.1/python/std_unordered_map.i @@ -56,16 +56,6 @@ %fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits") { namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_map *unordered_map) { - typedef typename std::unordered_map::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - unordered_map->insert(value_type(it->first, it->second)); - } - } - template struct traits_reserve > { static void reserve(std::unordered_map &seq, typename std::unordered_map::size_type n) { @@ -281,7 +271,11 @@ } void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { +%#ifdef __cpp_lib_unordered_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } PyObject* asdict() { diff --git a/usr/share/swig/4.1.1/python/std_unordered_multimap.i b/usr/share/swig/4.2.1/python/std_unordered_multimap.i similarity index 87% rename from usr/share/swig/4.1.1/python/std_unordered_multimap.i rename to usr/share/swig/4.2.1/python/std_unordered_multimap.i index bc095ea488b..816ec0933a8 100644 --- a/usr/share/swig/4.1.1/python/std_unordered_multimap.i +++ b/usr/share/swig/4.2.1/python/std_unordered_multimap.i @@ -6,16 +6,6 @@ %fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits") { namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_multimap *unordered_multimap) { - typedef typename std::unordered_multimap::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - unordered_multimap->insert(value_type(it->first, it->second)); - } - } - template struct traits_reserve > { static void reserve(std::unordered_multimap &seq, typename std::unordered_multimap::size_type n) { diff --git a/usr/share/swig/4.1.1/python/std_unordered_multiset.i b/usr/share/swig/4.2.1/python/std_unordered_multiset.i similarity index 71% rename from usr/share/swig/4.1.1/python/std_unordered_multiset.i rename to usr/share/swig/4.2.1/python/std_unordered_multiset.i index b0f3f096b87..0542247b23a 100644 --- a/usr/share/swig/4.1.1/python/std_unordered_multiset.i +++ b/usr/share/swig/4.2.1/python/std_unordered_multiset.i @@ -7,17 +7,6 @@ %fragment("StdUnorderedMultisetTraits","header",fragment="StdSequenceTraits") %{ namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_multiset* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - template struct traits_reserve > { static void reserve(std::unordered_multiset &seq, typename std::unordered_multiset::size_type n) { diff --git a/usr/share/swig/4.1.1/python/std_unordered_set.i b/usr/share/swig/4.2.1/python/std_unordered_set.i similarity index 77% rename from usr/share/swig/4.1.1/python/std_unordered_set.i rename to usr/share/swig/4.2.1/python/std_unordered_set.i index 79fca6c2ff4..fd866b14aa0 100644 --- a/usr/share/swig/4.1.1/python/std_unordered_set.i +++ b/usr/share/swig/4.2.1/python/std_unordered_set.i @@ -5,17 +5,6 @@ %fragment("StdUnorderedSetTraits","header",fragment="StdSequenceTraits") %{ namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, std::unordered_set* seq) { - // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - template struct traits_reserve > { static void reserve(std::unordered_set &seq, typename std::unordered_set::size_type n) { diff --git a/usr/share/swig/4.1.1/python/std_vector.i b/usr/share/swig/4.2.1/python/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_vector.i rename to usr/share/swig/4.2.1/python/std_vector.i diff --git a/usr/share/swig/4.1.1/python/std_vectora.i b/usr/share/swig/4.2.1/python/std_vectora.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_vectora.i rename to usr/share/swig/4.2.1/python/std_vectora.i diff --git a/usr/share/swig/4.1.1/python/std_wios.i b/usr/share/swig/4.2.1/python/std_wios.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_wios.i rename to usr/share/swig/4.2.1/python/std_wios.i diff --git a/usr/share/swig/4.1.1/python/std_wiostream.i b/usr/share/swig/4.2.1/python/std_wiostream.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_wiostream.i rename to usr/share/swig/4.2.1/python/std_wiostream.i diff --git a/usr/share/swig/4.1.1/python/std_wsstream.i b/usr/share/swig/4.2.1/python/std_wsstream.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_wsstream.i rename to usr/share/swig/4.2.1/python/std_wsstream.i diff --git a/usr/share/swig/4.1.1/python/std_wstreambuf.i b/usr/share/swig/4.2.1/python/std_wstreambuf.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_wstreambuf.i rename to usr/share/swig/4.2.1/python/std_wstreambuf.i diff --git a/usr/share/swig/4.1.1/python/std_wstring.i b/usr/share/swig/4.2.1/python/std_wstring.i similarity index 100% rename from usr/share/swig/4.1.1/python/std_wstring.i rename to usr/share/swig/4.2.1/python/std_wstring.i diff --git a/usr/share/swig/4.1.1/ruby/stl.i b/usr/share/swig/4.2.1/python/stl.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/stl.i rename to usr/share/swig/4.2.1/python/stl.i diff --git a/usr/share/swig/4.1.1/r/swigmove.i b/usr/share/swig/4.2.1/python/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/r/swigmove.i rename to usr/share/swig/4.2.1/python/swigmove.i diff --git a/usr/share/swig/4.1.1/python/typemaps.i b/usr/share/swig/4.2.1/python/typemaps.i similarity index 96% rename from usr/share/swig/4.1.1/python/typemaps.i rename to usr/share/swig/4.2.1/python/typemaps.i index dba63dd59e0..75592036b22 100644 --- a/usr/share/swig/4.1.1/python/typemaps.i +++ b/usr/share/swig/4.2.1/python/typemaps.i @@ -139,10 +139,6 @@ to a Python variable you might do this : x = neg(x) -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - */ %include diff --git a/usr/share/swig/4.1.1/python/wchar.i b/usr/share/swig/4.2.1/python/wchar.i similarity index 100% rename from usr/share/swig/4.1.1/python/wchar.i rename to usr/share/swig/4.2.1/python/wchar.i diff --git a/usr/share/swig/4.2.1/r/argcargv.i b/usr/share/swig/4.2.1/r/argcargv.i new file mode 100644 index 00000000000..1753f6e3f87 --- /dev/null +++ b/usr/share/swig/4.2.1/r/argcargv.i @@ -0,0 +1,38 @@ +/* ------------------------------------------------------------- + * SWIG library containing argc and argv multi-argument typemaps + * ------------------------------------------------------------- */ + +/* Preserve string vector as is */ +%typemap(scoercein) (int ARGC, char **ARGV) "" +/* Verify we pass the proper string vector */ +%typemap(scheck) (int ARGC, char **ARGV) %{ + assert(is.null($input) || (is.vector($input) && is.character($input))) +%} +/* Check argument is null or a string vector for dispatcher */ +%typemap(rtypecheck) (int ARGC, char **ARGV) %{ + is.null($arg) || (is.vector($arg) && is.character($arg)) +%} +%typemap(in) (int ARGC, char **ARGV) { + $1_ltype i; + SEXP *pstr; + if ($input == R_NilValue) { + /* Empty array */ + $1 = 0; + } else if (!Rf_isVectorAtomic($input) || TYPEOF($input) != STRSXP) { + SWIG_exception_fail(SWIG_RuntimeError, "Wrong array type."); + } else { + $1 = Rf_length($input); + pstr = CHARACTER_POINTER($input); + } + $2 = ($2_ltype) malloc(($1+1)*sizeof($*2_ltype)); + if ($2 == SWIG_NULLPTR) { + SWIG_exception_fail(SWIG_MemoryError, "Memory allocation failed."); + } + for (i = 0; i < $1; i++) { + $2[i] = ($*2_ltype)STRING_VALUE(pstr[i]); + } + $2[i] = SWIG_NULLPTR; +} +%typemap(freearg,noblock=1) (int ARGC, char **ARGV) { + free((void *)$2); +} diff --git a/usr/share/swig/4.1.1/r/boost_shared_ptr.i b/usr/share/swig/4.2.1/r/boost_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/r/boost_shared_ptr.i rename to usr/share/swig/4.2.1/r/boost_shared_ptr.i diff --git a/usr/share/swig/4.1.1/ruby/cdata.i b/usr/share/swig/4.2.1/r/cdata.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/cdata.i rename to usr/share/swig/4.2.1/r/cdata.i diff --git a/usr/share/swig/4.1.1/r/exception.i b/usr/share/swig/4.2.1/r/exception.i similarity index 100% rename from usr/share/swig/4.1.1/r/exception.i rename to usr/share/swig/4.2.1/r/exception.i diff --git a/usr/share/swig/4.1.1/r/r.swg b/usr/share/swig/4.2.1/r/r.swg similarity index 100% rename from usr/share/swig/4.1.1/r/r.swg rename to usr/share/swig/4.2.1/r/r.swg diff --git a/usr/share/swig/4.1.1/r/rcontainer.swg b/usr/share/swig/4.2.1/r/rcontainer.swg similarity index 93% rename from usr/share/swig/4.1.1/r/rcontainer.swg rename to usr/share/swig/4.2.1/r/rcontainer.swg index 54b31b39a44..84a6c6908cf 100644 --- a/usr/share/swig/4.1.1/r/rcontainer.swg +++ b/usr/share/swig/4.2.1/r/rcontainer.swg @@ -75,25 +75,29 @@ namespace swig { template inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { + setslice(Sequence* self, Difference i, Difference j, const InputSeq& is) { typename Sequence::size_type size = self->size(); typename Sequence::size_type ii = swig::check_index(i, size, true); typename Sequence::size_type jj = swig::slice_index(j, size); if (jj < ii) jj = ii; size_t ssize = jj - ii; - if (ssize <= v.size()) { + if (ssize <= is.size()) { + // expanding/staying the same size typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); + typename InputSeq::const_iterator vmid = is.begin(); std::advance(sb,ii); std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); + self->insert(std::copy(is.begin(), vmid, sb), vmid, is.end()); } else { + // shrinking typename Sequence::iterator sb = self->begin(); typename Sequence::iterator se = self->begin(); std::advance(sb,ii); std::advance(se,jj); self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); + sb = self->begin(); + std::advance(sb,ii); + self->insert(sb, is.begin(), is.end()); } } @@ -148,9 +152,9 @@ namespace swig { return swig::getslice(self, i, j); } - void __setslice__(difference_type i, difference_type j, const Sequence& v) + void __setslice__(difference_type i, difference_type j, const Sequence& is) throw (std::out_of_range, std::invalid_argument) { - swig::setslice(self, i, j, v); + swig::setslice(self, i, j, is); } void __delslice__(difference_type i, difference_type j) throw (std::out_of_range) { diff --git a/usr/share/swig/4.1.1/r/rfragments.swg b/usr/share/swig/4.2.1/r/rfragments.swg similarity index 100% rename from usr/share/swig/4.1.1/r/rfragments.swg rename to usr/share/swig/4.2.1/r/rfragments.swg diff --git a/usr/share/swig/4.1.1/r/rkw.swg b/usr/share/swig/4.2.1/r/rkw.swg similarity index 100% rename from usr/share/swig/4.1.1/r/rkw.swg rename to usr/share/swig/4.2.1/r/rkw.swg diff --git a/usr/share/swig/4.1.1/r/ropers.swg b/usr/share/swig/4.2.1/r/ropers.swg similarity index 100% rename from usr/share/swig/4.1.1/r/ropers.swg rename to usr/share/swig/4.2.1/r/ropers.swg diff --git a/usr/share/swig/4.1.1/r/rrun.swg b/usr/share/swig/4.2.1/r/rrun.swg similarity index 100% rename from usr/share/swig/4.1.1/r/rrun.swg rename to usr/share/swig/4.2.1/r/rrun.swg diff --git a/usr/share/swig/4.1.1/r/rstdcommon.swg b/usr/share/swig/4.2.1/r/rstdcommon.swg similarity index 100% rename from usr/share/swig/4.1.1/r/rstdcommon.swg rename to usr/share/swig/4.2.1/r/rstdcommon.swg diff --git a/usr/share/swig/4.1.1/r/rtype.swg b/usr/share/swig/4.2.1/r/rtype.swg similarity index 99% rename from usr/share/swig/4.1.1/r/rtype.swg rename to usr/share/swig/4.2.1/r/rtype.swg index c9d68bec83a..1d666329208 100644 --- a/usr/share/swig/4.1.1/r/rtype.swg +++ b/usr/share/swig/4.2.1/r/rtype.swg @@ -60,8 +60,6 @@ %typemap("rtypecheck") enum SWIGTYPE * %{ is.character($arg) %} -#if 0 -// Replacement rtypecheck typemaps (for swig-4.2, see r.cxx) %typemap("rtypecheck") SWIGTYPE * %{ extends($argtype, '$R_class') || is.null($arg) %} @@ -73,7 +71,6 @@ %typemap("rtypecheck") SWIGTYPE %{ extends($argtype, '$&R_class') && length($arg) == 1 %} -#endif /* Set up type checks to insure overloading precedence. diff --git a/usr/share/swig/4.1.1/r/srun.swg b/usr/share/swig/4.2.1/r/srun.swg similarity index 100% rename from usr/share/swig/4.1.1/r/srun.swg rename to usr/share/swig/4.2.1/r/srun.swg diff --git a/usr/share/swig/4.1.1/r/std_alloc.i b/usr/share/swig/4.2.1/r/std_alloc.i similarity index 100% rename from usr/share/swig/4.1.1/r/std_alloc.i rename to usr/share/swig/4.2.1/r/std_alloc.i diff --git a/usr/share/swig/4.1.1/r/std_common.i b/usr/share/swig/4.2.1/r/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/r/std_common.i rename to usr/share/swig/4.2.1/r/std_common.i diff --git a/usr/share/swig/4.1.1/r/std_container.i b/usr/share/swig/4.2.1/r/std_container.i similarity index 100% rename from usr/share/swig/4.1.1/r/std_container.i rename to usr/share/swig/4.2.1/r/std_container.i diff --git a/usr/share/swig/4.1.1/r/std_deque.i b/usr/share/swig/4.2.1/r/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/r/std_deque.i rename to usr/share/swig/4.2.1/r/std_deque.i diff --git a/usr/share/swig/4.1.1/ruby/std_except.i b/usr/share/swig/4.2.1/r/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_except.i rename to usr/share/swig/4.2.1/r/std_except.i diff --git a/usr/share/swig/4.1.1/r/std_list.i b/usr/share/swig/4.2.1/r/std_list.i similarity index 100% rename from usr/share/swig/4.1.1/r/std_list.i rename to usr/share/swig/4.2.1/r/std_list.i diff --git a/usr/share/swig/4.1.1/r/std_map.i b/usr/share/swig/4.2.1/r/std_map.i similarity index 100% rename from usr/share/swig/4.1.1/r/std_map.i rename to usr/share/swig/4.2.1/r/std_map.i diff --git a/usr/share/swig/4.1.1/r/std_pair.i b/usr/share/swig/4.2.1/r/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/r/std_pair.i rename to usr/share/swig/4.2.1/r/std_pair.i diff --git a/usr/share/swig/4.1.1/r/std_shared_ptr.i b/usr/share/swig/4.2.1/r/std_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/r/std_shared_ptr.i rename to usr/share/swig/4.2.1/r/std_shared_ptr.i diff --git a/usr/share/swig/4.2.1/r/std_string.i b/usr/share/swig/4.2.1/r/std_string.i new file mode 100644 index 00000000000..dc1378ae6de --- /dev/null +++ b/usr/share/swig/4.2.1/r/std_string.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.1.1/r/std_vector.i b/usr/share/swig/4.2.1/r/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/r/std_vector.i rename to usr/share/swig/4.2.1/r/std_vector.i diff --git a/usr/share/swig/4.1.1/r/stl.i b/usr/share/swig/4.2.1/r/stl.i similarity index 100% rename from usr/share/swig/4.1.1/r/stl.i rename to usr/share/swig/4.2.1/r/stl.i diff --git a/usr/share/swig/4.1.1/ruby/swigmove.i b/usr/share/swig/4.2.1/r/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/swigmove.i rename to usr/share/swig/4.2.1/r/swigmove.i diff --git a/usr/share/swig/4.1.1/r/typemaps.i b/usr/share/swig/4.2.1/r/typemaps.i similarity index 100% rename from usr/share/swig/4.1.1/r/typemaps.i rename to usr/share/swig/4.2.1/r/typemaps.i diff --git a/usr/share/swig/4.1.1/ruby/Makefile.swig b/usr/share/swig/4.2.1/ruby/Makefile.swig similarity index 100% rename from usr/share/swig/4.1.1/ruby/Makefile.swig rename to usr/share/swig/4.2.1/ruby/Makefile.swig diff --git a/usr/share/swig/4.1.1/ruby/argcargv.i b/usr/share/swig/4.2.1/ruby/argcargv.i similarity index 88% rename from usr/share/swig/4.1.1/ruby/argcargv.i rename to usr/share/swig/4.2.1/ruby/argcargv.i index 24df9c94a01..b8efcffb7d4 100644 --- a/usr/share/swig/4.1.1/ruby/argcargv.i +++ b/usr/share/swig/4.2.1/ruby/argcargv.i @@ -1,4 +1,4 @@ -/* ------------------------------------------------------------ +/* ------------------------------------------------------------- * SWIG library containing argc and argv multi-argument typemaps Use it as follows: @@ -16,7 +16,7 @@ $args = ["asdf", "asdf2"] mainApp(args) - * ------------------------------------------------------------ */ + * ------------------------------------------------------------- */ %typemap(in) (int ARGC, char **ARGV) { if (rb_obj_is_kind_of($input,rb_cArray)) { diff --git a/usr/share/swig/4.1.1/ruby/attribute.i b/usr/share/swig/4.2.1/ruby/attribute.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/attribute.i rename to usr/share/swig/4.2.1/ruby/attribute.i diff --git a/usr/share/swig/4.1.1/ruby/boost_shared_ptr.i b/usr/share/swig/4.2.1/ruby/boost_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/boost_shared_ptr.i rename to usr/share/swig/4.2.1/ruby/boost_shared_ptr.i diff --git a/usr/share/swig/4.1.1/ruby/carrays.i b/usr/share/swig/4.2.1/ruby/carrays.i similarity index 99% rename from usr/share/swig/4.1.1/ruby/carrays.i rename to usr/share/swig/4.2.1/ruby/carrays.i index 8f74cd9baf2..7e1e66a7fbe 100644 --- a/usr/share/swig/4.1.1/ruby/carrays.i +++ b/usr/share/swig/4.2.1/ruby/carrays.i @@ -3,4 +3,3 @@ %enddef %include - diff --git a/usr/share/swig/4.1.1/tcl/cdata.i b/usr/share/swig/4.2.1/ruby/cdata.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/cdata.i rename to usr/share/swig/4.2.1/ruby/cdata.i diff --git a/usr/share/swig/4.2.1/ruby/cmalloc.i b/usr/share/swig/4.2.1/ruby/cmalloc.i new file mode 100644 index 00000000000..248f06b961b --- /dev/null +++ b/usr/share/swig/4.2.1/ruby/cmalloc.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.1.1/ruby/cpointer.i b/usr/share/swig/4.2.1/ruby/cpointer.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/cpointer.i rename to usr/share/swig/4.2.1/ruby/cpointer.i diff --git a/usr/share/swig/4.1.1/ruby/cstring.i b/usr/share/swig/4.2.1/ruby/cstring.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/cstring.i rename to usr/share/swig/4.2.1/ruby/cstring.i diff --git a/usr/share/swig/4.1.1/ruby/director.swg b/usr/share/swig/4.2.1/ruby/director.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/director.swg rename to usr/share/swig/4.2.1/ruby/director.swg diff --git a/usr/share/swig/4.1.1/ruby/embed.i b/usr/share/swig/4.2.1/ruby/embed.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/embed.i rename to usr/share/swig/4.2.1/ruby/embed.i diff --git a/usr/share/swig/4.1.1/ruby/exception.i b/usr/share/swig/4.2.1/ruby/exception.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/exception.i rename to usr/share/swig/4.2.1/ruby/exception.i diff --git a/usr/share/swig/4.1.1/ruby/extconf.rb b/usr/share/swig/4.2.1/ruby/extconf.rb similarity index 100% rename from usr/share/swig/4.1.1/ruby/extconf.rb rename to usr/share/swig/4.2.1/ruby/extconf.rb diff --git a/usr/share/swig/4.2.1/ruby/factory.i b/usr/share/swig/4.2.1/ruby/factory.i new file mode 100644 index 00000000000..46a0a8733e7 --- /dev/null +++ b/usr/share/swig/4.2.1/ruby/factory.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.1.1/ruby/file.i b/usr/share/swig/4.2.1/ruby/file.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/file.i rename to usr/share/swig/4.2.1/ruby/file.i diff --git a/usr/share/swig/4.1.1/ruby/progargcargv.i b/usr/share/swig/4.2.1/ruby/progargcargv.i similarity index 90% rename from usr/share/swig/4.1.1/ruby/progargcargv.i rename to usr/share/swig/4.2.1/ruby/progargcargv.i index a2843c34426..36f1c9ada0a 100644 --- a/usr/share/swig/4.1.1/ruby/progargcargv.i +++ b/usr/share/swig/4.2.1/ruby/progargcargv.i @@ -3,7 +3,7 @@ int PROG_ARGC char **PROG_ARGV Some C function receive argc and argv from C main function. - This typemap provides ignore typemap which pass Ruby ARGV contents + This file provides typemaps which pass Ruby ARGV contents as argc and argv to C function. */ diff --git a/usr/share/swig/4.1.1/ruby/ruby.swg b/usr/share/swig/4.2.1/ruby/ruby.swg similarity index 95% rename from usr/share/swig/4.1.1/ruby/ruby.swg rename to usr/share/swig/4.2.1/ruby/ruby.swg index d1335974e43..cf7c10926c5 100644 --- a/usr/share/swig/4.1.1/ruby/ruby.swg +++ b/usr/share/swig/4.2.1/ruby/ruby.swg @@ -17,7 +17,7 @@ /* SWIG only considers static class members with inline initializers to be constants. For examples of what is and isn't considered a constant by SWIG see naming.i in the Ruby test suite. */ -%rename("%(uppercase)s", %$ismember, %$isvariable,%$isimmutable,%$isstatic,%$hasvalue,%$hasconsttype) ""; +%rename("%(uppercase)s", %$ismember, %$isvariable, %$isstatic, %$hasvalue, %$hasconsttype) ""; /* Enums are mapped to constants but all we do is make sure the first letter is uppercase */ diff --git a/usr/share/swig/4.1.1/ruby/rubyapi.swg b/usr/share/swig/4.2.1/ruby/rubyapi.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubyapi.swg rename to usr/share/swig/4.2.1/ruby/rubyapi.swg diff --git a/usr/share/swig/4.1.1/ruby/rubyautodoc.swg b/usr/share/swig/4.2.1/ruby/rubyautodoc.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubyautodoc.swg rename to usr/share/swig/4.2.1/ruby/rubyautodoc.swg diff --git a/usr/share/swig/4.1.1/ruby/rubyclasses.swg b/usr/share/swig/4.2.1/ruby/rubyclasses.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubyclasses.swg rename to usr/share/swig/4.2.1/ruby/rubyclasses.swg diff --git a/usr/share/swig/4.1.1/ruby/rubycomplex.swg b/usr/share/swig/4.2.1/ruby/rubycomplex.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubycomplex.swg rename to usr/share/swig/4.2.1/ruby/rubycomplex.swg diff --git a/usr/share/swig/4.1.1/ruby/rubycontainer.swg b/usr/share/swig/4.2.1/ruby/rubycontainer.swg similarity index 97% rename from usr/share/swig/4.1.1/ruby/rubycontainer.swg rename to usr/share/swig/4.2.1/ruby/rubycontainer.swg index 597ae83d2e9..cd912d959bb 100644 --- a/usr/share/swig/4.1.1/ruby/rubycontainer.swg +++ b/usr/share/swig/4.2.1/ruby/rubycontainer.swg @@ -101,7 +101,7 @@ namespace swig { inline Sequence* getslice(const Sequence* self, Difference i, Difference j) { typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, (i == size && j == size)); + typename Sequence::size_type ii = swig::check_index(i, size, (i == (Difference)size && j == (Difference)size)); typename Sequence::size_type jj = swig::slice_index(j, size); if (jj > ii) { @@ -117,25 +117,29 @@ namespace swig { template inline void - setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { + setslice(Sequence* self, Difference i, Difference j, const InputSeq& is) { typename Sequence::size_type size = self->size(); typename Sequence::size_type ii = swig::check_index(i, size, true); typename Sequence::size_type jj = swig::slice_index(j, size); if (jj < ii) jj = ii; size_t ssize = jj - ii; - if (ssize <= v.size()) { + if (ssize <= is.size()) { + // expanding/staying the same size typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator vmid = v.begin(); + typename InputSeq::const_iterator vmid = is.begin(); std::advance(sb,ii); std::advance(vmid, jj - ii); - self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); + self->insert(std::copy(is.begin(), vmid, sb), vmid, is.end()); } else { + // shrinking typename Sequence::iterator sb = self->begin(); typename Sequence::iterator se = self->begin(); std::advance(sb,ii); std::advance(se,jj); self->erase(sb,se); - self->insert(sb, v.begin(), v.end()); + sb = self->begin(); + std::advance(sb,ii); + self->insert(sb, is.begin(), is.end()); } } @@ -186,7 +190,7 @@ namespace swig return swig::as(item); } catch (const std::invalid_argument& e) { char msg[1024]; - sprintf(msg, "in sequence element %d ", _index); + SWIG_snprintf(msg, sizeof(msg), "in sequence element %d ", _index); VALUE lastErr = rb_gv_get("$!"); if ( lastErr == Qnil ) { %type_error(swig::type_name()); @@ -338,7 +342,7 @@ namespace swig typedef T value_type; typedef T* pointer; typedef int difference_type; - typedef int size_type; + typedef std::size_t size_type; typedef const pointer const_pointer; typedef RubySequence_InputIterator iterator; typedef RubySequence_InputIterator const_iterator; @@ -837,7 +841,7 @@ namespace swig return swig::from< Sequence::value_type >( x ); } - VALUE __setitem__(difference_type i, difference_type length, const Sequence& v) throw (std::invalid_argument) { + VALUE __setitem__(difference_type i, difference_type length, const Sequence& is) throw (std::invalid_argument) { if ( length < 0 ) return Qnil; @@ -849,13 +853,13 @@ namespace swig i = len + i; } Sequence::difference_type j = length + i; - if ( j > static_cast(len) ) { - swig::resize( $self, j, *(v.begin()) ); + if ( j > static_cast(len) && is.size() > 0 ) { + swig::resize( $self, j, *(is.begin()) ); } VALUE r = Qnil; - swig::setslice($self, i, j, v); - r = swig::from< const Sequence* >( &v ); + swig::setslice($self, i, j, is); + r = swig::from< const Sequence* >( &is ); return r; } } diff --git a/usr/share/swig/4.1.1/ruby/rubycontainer_extended.swg b/usr/share/swig/4.2.1/ruby/rubycontainer_extended.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubycontainer_extended.swg rename to usr/share/swig/4.2.1/ruby/rubycontainer_extended.swg diff --git a/usr/share/swig/4.1.1/ruby/rubydef.swg b/usr/share/swig/4.2.1/ruby/rubydef.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubydef.swg rename to usr/share/swig/4.2.1/ruby/rubydef.swg diff --git a/usr/share/swig/4.1.1/ruby/rubyerrors.swg b/usr/share/swig/4.2.1/ruby/rubyerrors.swg similarity index 98% rename from usr/share/swig/4.1.1/ruby/rubyerrors.swg rename to usr/share/swig/4.2.1/ruby/rubyerrors.swg index 434544bc92a..ad71d1d3986 100644 --- a/usr/share/swig/4.1.1/ruby/rubyerrors.swg +++ b/usr/share/swig/4.2.1/ruby/rubyerrors.swg @@ -110,7 +110,7 @@ const char* Ruby_Format_TypeError( const char* msg, } str = rb_str_cat2( str, "Expected argument " ); - sprintf( buf, "%d of type ", argn-1 ); + SWIG_snprintf( buf, sizeof( buf), "%d of type ", argn-1 ); str = rb_str_cat2( str, buf ); str = rb_str_cat2( str, type ); str = rb_str_cat2( str, ", but got " ); diff --git a/usr/share/swig/4.1.1/ruby/rubyfragments.swg b/usr/share/swig/4.2.1/ruby/rubyfragments.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubyfragments.swg rename to usr/share/swig/4.2.1/ruby/rubyfragments.swg diff --git a/usr/share/swig/4.1.1/ruby/rubyhead.swg b/usr/share/swig/4.2.1/ruby/rubyhead.swg similarity index 94% rename from usr/share/swig/4.1.1/ruby/rubyhead.swg rename to usr/share/swig/4.2.1/ruby/rubyhead.swg index e4d9e21473d..39196d4e0ed 100644 --- a/usr/share/swig/4.1.1/ruby/rubyhead.swg +++ b/usr/share/swig/4.2.1/ruby/rubyhead.swg @@ -12,6 +12,7 @@ #endif #include +#include /* For RUBY_API_VERSION_CODE */ #if __GNUC__ >= 7 #pragma GCC diagnostic pop @@ -117,9 +118,9 @@ /* * The following macros are used for providing the correct type of a * function pointer to the Ruby C API. - * Starting with Ruby 2.7 (corresponding to RB_METHOD_DEFINITION_DECL being - * defined) these macros act transparently due to Ruby's moving away from - * ANYARGS and instead employing strict function signatures. + * + * Starting with Ruby 2.7 these macros act transparently due to Ruby's moving + * moving away from ANYARGS and instead employing strict function signatures. * * Note: In case of C (not C++) the macros are transparent even before * Ruby 2.7 due to the fact that the Ruby C API used function declarators @@ -143,7 +144,7 @@ * SWIG_RUBY_INT_ANYARGS_FUNC(f) is used for the function pointer * argument(s) of Ruby C API functions like st_foreach(). */ -#if defined(__cplusplus) && !defined(RB_METHOD_DEFINITION_DECL) +#if defined(__cplusplus) && RUBY_API_VERSION_CODE < 20700 # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f) # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f) # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f) diff --git a/usr/share/swig/4.1.1/ruby/rubyinit.swg b/usr/share/swig/4.2.1/ruby/rubyinit.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubyinit.swg rename to usr/share/swig/4.2.1/ruby/rubyinit.swg diff --git a/usr/share/swig/4.1.1/ruby/rubyiterators.swg b/usr/share/swig/4.2.1/ruby/rubyiterators.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubyiterators.swg rename to usr/share/swig/4.2.1/ruby/rubyiterators.swg diff --git a/usr/share/swig/4.1.1/ruby/rubykw.swg b/usr/share/swig/4.2.1/ruby/rubykw.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubykw.swg rename to usr/share/swig/4.2.1/ruby/rubykw.swg diff --git a/usr/share/swig/4.1.1/ruby/rubymacros.swg b/usr/share/swig/4.2.1/ruby/rubymacros.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubymacros.swg rename to usr/share/swig/4.2.1/ruby/rubymacros.swg diff --git a/usr/share/swig/4.1.1/ruby/rubyopers.swg b/usr/share/swig/4.2.1/ruby/rubyopers.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubyopers.swg rename to usr/share/swig/4.2.1/ruby/rubyopers.swg diff --git a/usr/share/swig/4.1.1/ruby/rubyprimtypes.swg b/usr/share/swig/4.2.1/ruby/rubyprimtypes.swg similarity index 96% rename from usr/share/swig/4.1.1/ruby/rubyprimtypes.swg rename to usr/share/swig/4.2.1/ruby/rubyprimtypes.swg index 4b078deea0e..d5d9d7339fd 100644 --- a/usr/share/swig/4.1.1/ruby/rubyprimtypes.swg +++ b/usr/share/swig/4.2.1/ruby/rubyprimtypes.swg @@ -113,6 +113,8 @@ SWIG_AsVal_dec(unsigned long)(VALUE obj, unsigned long *val) a[0] = obj; a[1] = (VALUE)(&v); if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { + if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse) + return SWIG_OverflowError; if (val) *val = v; return SWIG_OK; } @@ -189,6 +191,8 @@ SWIG_AsVal_dec(unsigned long long)(VALUE obj, unsigned long long *val) a[0] = obj; a[1] = (VALUE)(&v); if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { + if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse) + return SWIG_OverflowError; if (val) *val = v; return SWIG_OK; } diff --git a/usr/share/swig/4.1.1/ruby/rubyrun.swg b/usr/share/swig/4.2.1/ruby/rubyrun.swg similarity index 96% rename from usr/share/swig/4.1.1/ruby/rubyrun.swg rename to usr/share/swig/4.2.1/ruby/rubyrun.swg index 6cac4626a46..d72102af319 100644 --- a/usr/share/swig/4.1.1/ruby/rubyrun.swg +++ b/usr/share/swig/4.2.1/ruby/rubyrun.swg @@ -80,6 +80,7 @@ static VALUE swig_runtime_data_type_pointer = Qnil; /* Global IDs used to keep some internal SWIG stuff */ static ID swig_arity_id = 0; static ID swig_call_id = 0; +static ID swig_lowerthan_id = 0; /* If your swig extension is to be run within an embedded ruby and has @@ -131,7 +132,7 @@ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) { VALUE exceptionClass = getExceptionClass(); if (rb_obj_is_kind_of(obj, exceptionClass)) { return obj; - } else { + } else { return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj)); } } @@ -144,6 +145,7 @@ SWIG_Ruby_InitRuntime(void) _mSWIG = rb_define_module("SWIG"); swig_call_id = rb_intern("call"); swig_arity_id = rb_intern("arity"); + swig_lowerthan_id = rb_intern("<"); } } @@ -151,13 +153,14 @@ SWIG_Ruby_InitRuntime(void) SWIGRUNTIME void SWIG_Ruby_define_class(swig_type_info *type) { - char *klass_name = (char *) malloc(4 + strlen(type->name) + 1); - sprintf(klass_name, "TYPE%s", type->name); + size_t klass_len = 4 + strlen(type->name) + 1; + char *klass_name = (char *) malloc(klass_len); + SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name); if (NIL_P(_cSWIG_Pointer)) { _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject); rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new"); } - rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer); + rb_undef_alloc_func(rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer)); free((void *) klass_name); } @@ -208,8 +211,9 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags) SWIG_RubyAddTracking(ptr, obj); } } else { - klass_name = (char *) malloc(4 + strlen(type->name) + 1); - sprintf(klass_name, "TYPE%s", type->name); + size_t klass_len = 4 + strlen(type->name) + 1; + klass_name = (char *) malloc(klass_len); + SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name); klass = rb_const_get(_mSWIG, rb_intern(klass_name)); free((void *) klass_name); obj = Data_Wrap_Struct(klass, 0, 0, ptr); diff --git a/usr/share/swig/4.1.1/ruby/rubyruntime.swg b/usr/share/swig/4.2.1/ruby/rubyruntime.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubyruntime.swg rename to usr/share/swig/4.2.1/ruby/rubyruntime.swg diff --git a/usr/share/swig/4.1.1/ruby/rubystdautodoc.swg b/usr/share/swig/4.2.1/ruby/rubystdautodoc.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubystdautodoc.swg rename to usr/share/swig/4.2.1/ruby/rubystdautodoc.swg diff --git a/usr/share/swig/4.1.1/ruby/rubystdcommon.swg b/usr/share/swig/4.2.1/ruby/rubystdcommon.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubystdcommon.swg rename to usr/share/swig/4.2.1/ruby/rubystdcommon.swg diff --git a/usr/share/swig/4.1.1/ruby/rubystdcommon_forward.swg b/usr/share/swig/4.2.1/ruby/rubystdcommon_forward.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubystdcommon_forward.swg rename to usr/share/swig/4.2.1/ruby/rubystdcommon_forward.swg diff --git a/usr/share/swig/4.1.1/ruby/rubystdfunctors.swg b/usr/share/swig/4.2.1/ruby/rubystdfunctors.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubystdfunctors.swg rename to usr/share/swig/4.2.1/ruby/rubystdfunctors.swg diff --git a/usr/share/swig/4.1.1/ruby/rubystrings.swg b/usr/share/swig/4.2.1/ruby/rubystrings.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubystrings.swg rename to usr/share/swig/4.2.1/ruby/rubystrings.swg diff --git a/usr/share/swig/4.1.1/ruby/rubytracking.swg b/usr/share/swig/4.2.1/ruby/rubytracking.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubytracking.swg rename to usr/share/swig/4.2.1/ruby/rubytracking.swg diff --git a/usr/share/swig/4.1.1/ruby/rubytypemaps.swg b/usr/share/swig/4.2.1/ruby/rubytypemaps.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubytypemaps.swg rename to usr/share/swig/4.2.1/ruby/rubytypemaps.swg diff --git a/usr/share/swig/4.1.1/ruby/rubyuserdir.swg b/usr/share/swig/4.2.1/ruby/rubyuserdir.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubyuserdir.swg rename to usr/share/swig/4.2.1/ruby/rubyuserdir.swg diff --git a/usr/share/swig/4.1.1/ruby/rubywstrings.swg b/usr/share/swig/4.2.1/ruby/rubywstrings.swg similarity index 100% rename from usr/share/swig/4.1.1/ruby/rubywstrings.swg rename to usr/share/swig/4.2.1/ruby/rubywstrings.swg diff --git a/usr/share/swig/4.1.1/ruby/std_alloc.i b/usr/share/swig/4.2.1/ruby/std_alloc.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_alloc.i rename to usr/share/swig/4.2.1/ruby/std_alloc.i diff --git a/usr/share/swig/4.1.1/ruby/std_array.i b/usr/share/swig/4.2.1/ruby/std_array.i similarity index 98% rename from usr/share/swig/4.1.1/ruby/std_array.i rename to usr/share/swig/4.2.1/ruby/std_array.i index a4d3ef54b8b..c00685f273e 100644 --- a/usr/share/swig/4.1.1/ruby/std_array.i +++ b/usr/share/swig/4.2.1/ruby/std_array.i @@ -41,7 +41,7 @@ getslice(const std::array* self, Difference i, Difference j) { typedef std::array Sequence; typename Sequence::size_type size = self->size(); - typename Sequence::size_type ii = swig::check_index(i, size, (i == size && j == size)); + typename Sequence::size_type ii = swig::check_index(i, size, (i == (Difference)size && j == (Difference)size)); typename Sequence::size_type jj = swig::slice_index(j, size); if (ii == 0 && jj == size) { diff --git a/usr/share/swig/4.2.1/ruby/std_auto_ptr.i b/usr/share/swig/4.2.1/ruby/std_auto_ptr.i new file mode 100644 index 00000000000..3d7ae8ba16e --- /dev/null +++ b/usr/share/swig/4.2.1/ruby/std_auto_ptr.i @@ -0,0 +1,39 @@ +/* ----------------------------------------------------------------------------- + * std_auto_ptr.i + * + * SWIG library file for handling std::auto_ptr. + * Memory ownership is passed from the std::auto_ptr C++ layer to the proxy + * class when returning a std::auto_ptr from a function. + * Memory ownership is passed from the proxy class to the std::auto_ptr in the + * C++ layer when passed as a parameter to a wrapped function. + * ----------------------------------------------------------------------------- */ + +%define %auto_ptr(TYPE) +%typemap(in, noblock=1) std::auto_ptr< TYPE > (void *argp = 0, int res = 0) { + res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); + if (!SWIG_IsOK(res)) { + if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { + %releasenotowned_fail(res, "TYPE *", $symname, $argnum); + } else { + %argument_fail(res, "TYPE *", $symname, $argnum); + } + } + $1.reset((TYPE *)argp); +} + +%typemap (out) std::auto_ptr< TYPE > %{ + %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); +%} + +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + +%template() std::auto_ptr< TYPE >; +%enddef + +namespace std { + template class auto_ptr {}; +} diff --git a/usr/share/swig/4.1.1/ruby/std_basic_string.i b/usr/share/swig/4.2.1/ruby/std_basic_string.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_basic_string.i rename to usr/share/swig/4.2.1/ruby/std_basic_string.i diff --git a/usr/share/swig/4.1.1/ruby/std_char_traits.i b/usr/share/swig/4.2.1/ruby/std_char_traits.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_char_traits.i rename to usr/share/swig/4.2.1/ruby/std_char_traits.i diff --git a/usr/share/swig/4.1.1/ruby/std_common.i b/usr/share/swig/4.2.1/ruby/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_common.i rename to usr/share/swig/4.2.1/ruby/std_common.i diff --git a/usr/share/swig/4.1.1/ruby/std_complex.i b/usr/share/swig/4.2.1/ruby/std_complex.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_complex.i rename to usr/share/swig/4.2.1/ruby/std_complex.i diff --git a/usr/share/swig/4.1.1/ruby/std_container.i b/usr/share/swig/4.2.1/ruby/std_container.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_container.i rename to usr/share/swig/4.2.1/ruby/std_container.i diff --git a/usr/share/swig/4.1.1/ruby/std_deque.i b/usr/share/swig/4.2.1/ruby/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_deque.i rename to usr/share/swig/4.2.1/ruby/std_deque.i diff --git a/usr/share/swig/4.1.1/scilab/std_except.i b/usr/share/swig/4.2.1/ruby/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_except.i rename to usr/share/swig/4.2.1/ruby/std_except.i diff --git a/usr/share/swig/4.1.1/ruby/std_functors.i b/usr/share/swig/4.2.1/ruby/std_functors.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_functors.i rename to usr/share/swig/4.2.1/ruby/std_functors.i diff --git a/usr/share/swig/4.1.1/ruby/std_ios.i b/usr/share/swig/4.2.1/ruby/std_ios.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_ios.i rename to usr/share/swig/4.2.1/ruby/std_ios.i diff --git a/usr/share/swig/4.1.1/ruby/std_iostream.i b/usr/share/swig/4.2.1/ruby/std_iostream.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_iostream.i rename to usr/share/swig/4.2.1/ruby/std_iostream.i diff --git a/usr/share/swig/4.1.1/ruby/std_list.i b/usr/share/swig/4.2.1/ruby/std_list.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_list.i rename to usr/share/swig/4.2.1/ruby/std_list.i diff --git a/usr/share/swig/4.1.1/ruby/std_map.i b/usr/share/swig/4.2.1/ruby/std_map.i similarity index 99% rename from usr/share/swig/4.1.1/ruby/std_map.i rename to usr/share/swig/4.2.1/ruby/std_map.i index 6dd2ffa72b4..99e3d40bde7 100644 --- a/usr/share/swig/4.1.1/ruby/std_map.i +++ b/usr/share/swig/4.2.1/ruby/std_map.i @@ -344,7 +344,11 @@ } void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } VALUE inspect() diff --git a/usr/share/swig/4.1.1/ruby/std_multimap.i b/usr/share/swig/4.2.1/ruby/std_multimap.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_multimap.i rename to usr/share/swig/4.2.1/ruby/std_multimap.i diff --git a/usr/share/swig/4.1.1/ruby/std_multiset.i b/usr/share/swig/4.2.1/ruby/std_multiset.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_multiset.i rename to usr/share/swig/4.2.1/ruby/std_multiset.i diff --git a/usr/share/swig/4.1.1/ruby/std_pair.i b/usr/share/swig/4.2.1/ruby/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_pair.i rename to usr/share/swig/4.2.1/ruby/std_pair.i diff --git a/usr/share/swig/4.1.1/ruby/std_queue.i b/usr/share/swig/4.2.1/ruby/std_queue.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_queue.i rename to usr/share/swig/4.2.1/ruby/std_queue.i diff --git a/usr/share/swig/4.1.1/ruby/std_set.i b/usr/share/swig/4.2.1/ruby/std_set.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_set.i rename to usr/share/swig/4.2.1/ruby/std_set.i diff --git a/usr/share/swig/4.1.1/ruby/std_shared_ptr.i b/usr/share/swig/4.2.1/ruby/std_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_shared_ptr.i rename to usr/share/swig/4.2.1/ruby/std_shared_ptr.i diff --git a/usr/share/swig/4.1.1/ruby/std_sstream.i b/usr/share/swig/4.2.1/ruby/std_sstream.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_sstream.i rename to usr/share/swig/4.2.1/ruby/std_sstream.i diff --git a/usr/share/swig/4.1.1/ruby/std_stack.i b/usr/share/swig/4.2.1/ruby/std_stack.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_stack.i rename to usr/share/swig/4.2.1/ruby/std_stack.i diff --git a/usr/share/swig/4.1.1/ruby/std_streambuf.i b/usr/share/swig/4.2.1/ruby/std_streambuf.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_streambuf.i rename to usr/share/swig/4.2.1/ruby/std_streambuf.i diff --git a/usr/share/swig/4.1.1/ruby/std_string.i b/usr/share/swig/4.2.1/ruby/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_string.i rename to usr/share/swig/4.2.1/ruby/std_string.i diff --git a/usr/share/swig/4.2.1/ruby/std_string_view.i b/usr/share/swig/4.2.1/ruby/std_string_view.i new file mode 100644 index 00000000000..cbfc428973b --- /dev/null +++ b/usr/share/swig/4.2.1/ruby/std_string_view.i @@ -0,0 +1,6 @@ + +%warnfilter(SWIGWARN_RUBY_WRONG_NAME) std::basic_string_view; + +AUTODOC(substr, "Return a portion of the String"); + +%include diff --git a/usr/share/swig/4.2.1/ruby/std_unique_ptr.i b/usr/share/swig/4.2.1/ruby/std_unique_ptr.i new file mode 100644 index 00000000000..f988714df8c --- /dev/null +++ b/usr/share/swig/4.2.1/ruby/std_unique_ptr.i @@ -0,0 +1,39 @@ +/* ----------------------------------------------------------------------------- + * std_unique_ptr.i + * + * SWIG library file for handling std::unique_ptr. + * Memory ownership is passed from the std::unique_ptr C++ layer to the proxy + * class when returning a std::unique_ptr from a function. + * Memory ownership is passed from the proxy class to the std::unique_ptr in the + * C++ layer when passed as a parameter to a wrapped function. + * ----------------------------------------------------------------------------- */ + +%define %unique_ptr(TYPE) +%typemap(in, noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) { + res = SWIG_ConvertPtr($input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE | %convertptr_flags); + if (!SWIG_IsOK(res)) { + if (res == SWIG_ERROR_RELEASE_NOT_OWNED) { + %releasenotowned_fail(res, "TYPE *", $symname, $argnum); + } else { + %argument_fail(res, "TYPE *", $symname, $argnum); + } + } + $1.reset((TYPE *)argp); +} + +%typemap (out) std::unique_ptr< TYPE > %{ + %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); +%} + +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + +%template() std::unique_ptr< TYPE >; +%enddef + +namespace std { + template class unique_ptr {}; +} diff --git a/usr/share/swig/4.1.1/ruby/std_unordered_map.i b/usr/share/swig/4.2.1/ruby/std_unordered_map.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_unordered_map.i rename to usr/share/swig/4.2.1/ruby/std_unordered_map.i diff --git a/usr/share/swig/4.1.1/ruby/std_unordered_multimap.i b/usr/share/swig/4.2.1/ruby/std_unordered_multimap.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_unordered_multimap.i rename to usr/share/swig/4.2.1/ruby/std_unordered_multimap.i diff --git a/usr/share/swig/4.1.1/ruby/std_unordered_multiset.i b/usr/share/swig/4.2.1/ruby/std_unordered_multiset.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_unordered_multiset.i rename to usr/share/swig/4.2.1/ruby/std_unordered_multiset.i diff --git a/usr/share/swig/4.1.1/ruby/std_unordered_set.i b/usr/share/swig/4.2.1/ruby/std_unordered_set.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_unordered_set.i rename to usr/share/swig/4.2.1/ruby/std_unordered_set.i diff --git a/usr/share/swig/4.1.1/ruby/std_vector.i b/usr/share/swig/4.2.1/ruby/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_vector.i rename to usr/share/swig/4.2.1/ruby/std_vector.i diff --git a/usr/share/swig/4.1.1/ruby/std_vectora.i b/usr/share/swig/4.2.1/ruby/std_vectora.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_vectora.i rename to usr/share/swig/4.2.1/ruby/std_vectora.i diff --git a/usr/share/swig/4.1.1/ruby/std_wstring.i b/usr/share/swig/4.2.1/ruby/std_wstring.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/std_wstring.i rename to usr/share/swig/4.2.1/ruby/std_wstring.i diff --git a/usr/share/swig/4.1.1/scilab/stl.i b/usr/share/swig/4.2.1/ruby/stl.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/stl.i rename to usr/share/swig/4.2.1/ruby/stl.i diff --git a/usr/share/swig/4.1.1/scilab/swigmove.i b/usr/share/swig/4.2.1/ruby/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/swigmove.i rename to usr/share/swig/4.2.1/ruby/swigmove.i diff --git a/usr/share/swig/4.1.1/ruby/timeval.i b/usr/share/swig/4.2.1/ruby/timeval.i similarity index 100% rename from usr/share/swig/4.1.1/ruby/timeval.i rename to usr/share/swig/4.2.1/ruby/timeval.i diff --git a/usr/share/swig/4.1.1/ruby/typemaps.i b/usr/share/swig/4.2.1/ruby/typemaps.i similarity index 98% rename from usr/share/swig/4.1.1/ruby/typemaps.i rename to usr/share/swig/4.2.1/ruby/typemaps.i index 68343646981..a3eaa0c16da 100644 --- a/usr/share/swig/4.1.1/ruby/typemaps.i +++ b/usr/share/swig/4.2.1/ruby/typemaps.i @@ -214,10 +214,6 @@ to a Ruby variable you might do this : x = neg(x) -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - */ %typemap(in) int *INOUT = int *INPUT; diff --git a/usr/share/swig/4.1.1/runtime.swg b/usr/share/swig/4.2.1/runtime.swg similarity index 100% rename from usr/share/swig/4.1.1/runtime.swg rename to usr/share/swig/4.2.1/runtime.swg diff --git a/usr/share/swig/4.2.1/scilab/argcargv.i b/usr/share/swig/4.2.1/scilab/argcargv.i new file mode 100644 index 00000000000..9aeda1a72bc --- /dev/null +++ b/usr/share/swig/4.2.1/scilab/argcargv.i @@ -0,0 +1,109 @@ +/* ------------------------------------------------------------- + * SWIG library containing argc and argv multi-argument typemaps + * ------------------------------------------------------------- */ + +%{ +SWIGINTERN int SWIG_AsVal_strings (SwigSciObject iVar, int **array, int report) { + int iType = 0; + SciErr sciErr = getVarAddressFromPosition(pvApiCtx, iVar, array); + if (sciErr.iErr) { + if (report) printError(&sciErr, 0); + return SWIG_ERROR; + } + sciErr = getVarType(pvApiCtx, *array, &iType); + if (sciErr.iErr) { + if (report) printError(&sciErr, 0); + return SWIG_ERROR; + } + if (iType != sci_strings) { + /* An empty matrix has type sci_matrix. */ + if (!isEmptyMatrix(pvApiCtx, *array)) { + return SWIG_TypeError; + } + *array = SWIG_NULLPTR; + } + return SWIG_OK; +} +%} + +%typemap(in) (int ARGC, char **ARGV) { + SciErr sciErr; + size_t memsize; + int i, rows, cols, res, len, *aLen, *array; + res = SWIG_AsVal_strings ($input, &array, 1); + if (!SWIG_IsOK(res)) { + if (res == SWIG_TypeError) { + SWIG_exception_fail(SWIG_TypeError, "not a string matrix"); + } + SWIG_fail; + } + + if (array == SWIG_NULLPTR) { + /* Special case for empty matrix. */ + $1 = 0; + $2 = ($2_ltype) malloc(sizeof($*2_ltype)); + $2[0] = SWIG_NULLPTR; + } else { + /* first call to retrieve dimensions */ + rows = 0; + cols = 0; + sciErr = getMatrixOfString(pvApiCtx, array, &rows, &cols, SWIG_NULLPTR, SWIG_NULLPTR); + if (sciErr.iErr) { + printError(&sciErr, 0); + SWIG_fail; + } + len = rows * cols; + memsize = sizeof(int) * len; + aLen = (int*)malloc(memsize); + if (aLen == SWIG_NULLPTR) { + SWIG_exception_fail(SWIG_MemoryError, "fail allocate sizes array"); + } + memset(aLen, 0, memsize); + /*second call to retrieve length of each string */ + sciErr = getMatrixOfString(pvApiCtx, array, &rows, &cols, aLen, SWIG_NULLPTR); + if (sciErr.iErr) { + printError(&sciErr, 0); + free((void *)aLen); + SWIG_fail; + } + memsize = sizeof($*2_ltype) * (len + 1); + $1 = ($1_ltype) len; + $2 = ($2_ltype) malloc(memsize); + if ($2 == SWIG_NULLPTR) { + free((void *)aLen); + SWIG_exception_fail(SWIG_MemoryError, "fail allocate array"); + } + memset($2, 0, memsize); + for(i = 0 ; i < len ; i++) { + $2[i] = ($*2_ltype)malloc(aLen[i] + 1); + if ($2[i] == SWIG_NULLPTR) { + free((void *)aLen); + SWIG_exception_fail(SWIG_MemoryError, "fail allocate array string element"); + } + } + /* third call to retrieve data */ + sciErr = getMatrixOfString(pvApiCtx, array, &rows, &cols, aLen, $2); + if(sciErr.iErr) { + printError(&sciErr, 0); + free((void *)aLen); + SWIG_fail; + } + $2[len] = SWIG_NULLPTR; + free((void *)aLen); + } +} + +%typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { + int *array; + $1 = SWIG_IsOK(SWIG_AsVal_strings ($input, &array, 0)); +} + +%typemap(freearg) (int ARGC, char **ARGV) { + if ($2 != SWIG_NULLPTR) { + $1_ltype i; + for (i = 0; i < $1; i++) { + free((void *)$2[i]); + } + free((void *)$2); + } +} diff --git a/usr/share/swig/4.1.1/scilab/boost_shared_ptr.i b/usr/share/swig/4.2.1/scilab/boost_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/boost_shared_ptr.i rename to usr/share/swig/4.2.1/scilab/boost_shared_ptr.i diff --git a/usr/share/swig/4.1.1/scilab/carrays.i b/usr/share/swig/4.2.1/scilab/carrays.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/carrays.i rename to usr/share/swig/4.2.1/scilab/carrays.i diff --git a/usr/share/swig/4.2.1/scilab/cmalloc.i b/usr/share/swig/4.2.1/scilab/cmalloc.i new file mode 100644 index 00000000000..248f06b961b --- /dev/null +++ b/usr/share/swig/4.2.1/scilab/cmalloc.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.1.1/scilab/cpointer.i b/usr/share/swig/4.2.1/scilab/cpointer.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/cpointer.i rename to usr/share/swig/4.2.1/scilab/cpointer.i diff --git a/usr/share/swig/4.1.1/scilab/exception.i b/usr/share/swig/4.2.1/scilab/exception.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/exception.i rename to usr/share/swig/4.2.1/scilab/exception.i diff --git a/usr/share/swig/4.1.1/scilab/matrix.i b/usr/share/swig/4.2.1/scilab/matrix.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/matrix.i rename to usr/share/swig/4.2.1/scilab/matrix.i diff --git a/usr/share/swig/4.1.1/scilab/sciarray.swg b/usr/share/swig/4.2.1/scilab/sciarray.swg similarity index 96% rename from usr/share/swig/4.1.1/scilab/sciarray.swg rename to usr/share/swig/4.2.1/scilab/sciarray.swg index c00e3837eab..97b30a29e82 100644 --- a/usr/share/swig/4.1.1/scilab/sciarray.swg +++ b/usr/share/swig/4.2.1/scilab/sciarray.swg @@ -40,8 +40,8 @@ } else { char errmsg[100]; - sprintf(errmsg, "Size of input data (%d) is too big (maximum is %d)", - iRows*iCols, $1_dim0); + SWIG_snprintf2(errmsg, sizeof(errmsg), "Size of input data (%d) is too big (maximum is %d)", + iRows*iCols, $1_dim0); SWIG_exception_fail(SWIG_OverflowError, errmsg); } } diff --git a/usr/share/swig/4.1.1/scilab/scibool.swg b/usr/share/swig/4.2.1/scilab/scibool.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scibool.swg rename to usr/share/swig/4.2.1/scilab/scibool.swg diff --git a/usr/share/swig/4.1.1/scilab/scichar.swg b/usr/share/swig/4.2.1/scilab/scichar.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scichar.swg rename to usr/share/swig/4.2.1/scilab/scichar.swg diff --git a/usr/share/swig/4.1.1/scilab/scicontainer.swg b/usr/share/swig/4.2.1/scilab/scicontainer.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scicontainer.swg rename to usr/share/swig/4.2.1/scilab/scicontainer.swg diff --git a/usr/share/swig/4.1.1/scilab/scidouble.swg b/usr/share/swig/4.2.1/scilab/scidouble.swg similarity index 91% rename from usr/share/swig/4.1.1/scilab/scidouble.swg rename to usr/share/swig/4.2.1/scilab/scidouble.swg index 1b826330645..e14c84647f5 100644 --- a/usr/share/swig/4.1.1/scilab/scidouble.swg +++ b/usr/share/swig/4.2.1/scilab/scidouble.swg @@ -56,6 +56,7 @@ SWIG_SciDouble_FromDouble(void *pvApiCtx, int iVarOut, double dblValue, char *fn SWIGINTERN int SWIG_SciDouble_AsDoubleArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, double **pdValue, char *fname) { SciErr sciErr; + int iType = 0; int *piAddrVar = NULL; sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); @@ -64,13 +65,24 @@ SWIG_SciDouble_AsDoubleArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *i return SWIG_ERROR; } - if (isDoubleType(pvApiCtx, piAddrVar) && !isVarComplex(pvApiCtx, piAddrVar)) { + sciErr = getVarType(pvApiCtx, piAddrVar, &iType); + if (sciErr.iErr) { + printError(&sciErr, 0); + return SWIG_ERROR; + } + + if (iType == sci_matrix && !isVarComplex(pvApiCtx, piAddrVar)) { sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, pdValue); if (sciErr.iErr) { printError(&sciErr, 0); return SWIG_ERROR; } } + else if (iType == sci_implicit_poly) { + *iRows = -1; + *iCols = 0; + *pdValue = NULL; + } else { Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A real matrix expected.\n"), fname, iVar); return SWIG_ERROR; diff --git a/usr/share/swig/4.1.1/scilab/scienum.swg b/usr/share/swig/4.2.1/scilab/scienum.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scienum.swg rename to usr/share/swig/4.2.1/scilab/scienum.swg diff --git a/usr/share/swig/4.1.1/scilab/sciexception.swg b/usr/share/swig/4.2.1/scilab/sciexception.swg similarity index 90% rename from usr/share/swig/4.1.1/scilab/sciexception.swg rename to usr/share/swig/4.2.1/scilab/sciexception.swg index 1d653b31496..9b842cf2f46 100644 --- a/usr/share/swig/4.1.1/scilab/sciexception.swg +++ b/usr/share/swig/4.2.1/scilab/sciexception.swg @@ -17,20 +17,20 @@ size_t, size_t&, ptrdiff_t, ptrdiff_t& { char obj[20]; - sprintf(obj, "%d", (int)$1); + SWIG_snprintf(obj, sizeof(obj), "%d", (int)$1); SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); } %typemap(throws, noblock=1) enum SWIGTYPE { char obj[20]; - sprintf(obj, "%d", (int)$1); + SWIG_snprintf(obj, sizeof(obj), "%d", (int)$1); SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); } %typemap(throws, noblock=1) float, double, float&, double& { char obj[20]; - sprintf(obj, "%5.3f", (double)$1); + SWIG_snprintf(obj, sizeof(obj), "%5.3f", (double)$1); SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); } @@ -44,7 +44,8 @@ %typemap(throws, noblock=1) char, char& { char obj[2]; - sprintf(obj, "%c", (char)$1); + obj[0] = (char)$1; + obj[1] = 0; SWIG_Scilab_Raise_Ex(obj, "$type", $descriptor); } diff --git a/usr/share/swig/4.1.1/scilab/scifloat.swg b/usr/share/swig/4.2.1/scilab/scifloat.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scifloat.swg rename to usr/share/swig/4.2.1/scilab/scifloat.swg diff --git a/usr/share/swig/4.1.1/scilab/sciint.swg b/usr/share/swig/4.2.1/scilab/sciint.swg similarity index 98% rename from usr/share/swig/4.1.1/scilab/sciint.swg rename to usr/share/swig/4.2.1/scilab/sciint.swg index 2d6993569f8..b7b2563e8b0 100644 --- a/usr/share/swig/4.1.1/scilab/sciint.swg +++ b/usr/share/swig/4.2.1/scilab/sciint.swg @@ -157,6 +157,11 @@ SWIG_SciDoubleOrInt32_AsIntArrayAndSize(void *pvApiCtx, int iVar, int *iRows, in return SWIG_ERROR; } } + else if (iType == sci_implicit_poly) { + *iRows = -1; + *iCols = 0; + *piValue = NULL; + } else { Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double matrix expected.\n"), fname, iVar); return SWIG_ERROR; diff --git a/usr/share/swig/4.1.1/scilab/sciiterators.swg b/usr/share/swig/4.2.1/scilab/sciiterators.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/sciiterators.swg rename to usr/share/swig/4.2.1/scilab/sciiterators.swg diff --git a/usr/share/swig/4.1.1/scilab/scilab.swg b/usr/share/swig/4.2.1/scilab/scilab.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scilab.swg rename to usr/share/swig/4.2.1/scilab/scilab.swg diff --git a/usr/share/swig/4.1.1/scilab/scilist.swg b/usr/share/swig/4.2.1/scilab/scilist.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scilist.swg rename to usr/share/swig/4.2.1/scilab/scilist.swg diff --git a/usr/share/swig/4.1.1/scilab/scilong.swg b/usr/share/swig/4.2.1/scilab/scilong.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scilong.swg rename to usr/share/swig/4.2.1/scilab/scilong.swg diff --git a/usr/share/swig/4.1.1/scilab/scilonglong.swg b/usr/share/swig/4.2.1/scilab/scilonglong.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scilonglong.swg rename to usr/share/swig/4.2.1/scilab/scilonglong.swg diff --git a/usr/share/swig/4.1.1/scilab/scimacros.swg b/usr/share/swig/4.2.1/scilab/scimacros.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scimacros.swg rename to usr/share/swig/4.2.1/scilab/scimacros.swg diff --git a/usr/share/swig/4.1.1/scilab/scimatrixbool.swg b/usr/share/swig/4.2.1/scilab/scimatrixbool.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scimatrixbool.swg rename to usr/share/swig/4.2.1/scilab/scimatrixbool.swg diff --git a/usr/share/swig/4.1.1/scilab/scimatrixchar.swg b/usr/share/swig/4.2.1/scilab/scimatrixchar.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scimatrixchar.swg rename to usr/share/swig/4.2.1/scilab/scimatrixchar.swg diff --git a/usr/share/swig/4.1.1/scilab/scimatrixdouble.swg b/usr/share/swig/4.2.1/scilab/scimatrixdouble.swg similarity index 95% rename from usr/share/swig/4.1.1/scilab/scimatrixdouble.swg rename to usr/share/swig/4.2.1/scilab/scimatrixdouble.swg index 9444a80782a..bb9403edd86 100644 --- a/usr/share/swig/4.1.1/scilab/scimatrixdouble.swg +++ b/usr/share/swig/4.2.1/scilab/scimatrixdouble.swg @@ -28,7 +28,11 @@ %typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_SIZE) (int rowCount, int colCount) { if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; + if (rowCount < 0) { + $2 = rowCount; + } else { + $2 = rowCount * colCount; + } } else { return SWIG_ERROR; @@ -40,7 +44,11 @@ %typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_SIZE, double *IN) (int rowCount, int colCount) { if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; + if (rowCount < 0) { + $1 = rowCount; + } else { + $1 = rowCount * colCount; + } } else { return SWIG_ERROR; diff --git a/usr/share/swig/4.1.1/scilab/scimatrixint.swg b/usr/share/swig/4.2.1/scilab/scimatrixint.swg similarity index 95% rename from usr/share/swig/4.1.1/scilab/scimatrixint.swg rename to usr/share/swig/4.2.1/scilab/scimatrixint.swg index e304d4f6440..057710725b3 100644 --- a/usr/share/swig/4.1.1/scilab/scimatrixint.swg +++ b/usr/share/swig/4.2.1/scilab/scimatrixint.swg @@ -30,7 +30,11 @@ %typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_SIZE) (int rowCount, int colCount) { if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; + if (rowCount < 0) { + $2 = rowCount; + } else { + $2 = rowCount * colCount; + } } else { return SWIG_ERROR; @@ -43,7 +47,11 @@ %typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_SIZE, int *IN) (int rowCount, int colCount) { if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; + if (rowCount < 0) { + $1 = rowCount; + } else { + $1 = rowCount * colCount; + } } else { return SWIG_ERROR; diff --git a/usr/share/swig/4.1.1/scilab/scimisctypes.swg b/usr/share/swig/4.2.1/scilab/scimisctypes.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scimisctypes.swg rename to usr/share/swig/4.2.1/scilab/scimisctypes.swg diff --git a/usr/share/swig/4.1.1/scilab/scipointer.swg b/usr/share/swig/4.2.1/scilab/scipointer.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scipointer.swg rename to usr/share/swig/4.2.1/scilab/scipointer.swg diff --git a/usr/share/swig/4.1.1/scilab/sciprimtypes.swg b/usr/share/swig/4.2.1/scilab/sciprimtypes.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/sciprimtypes.swg rename to usr/share/swig/4.2.1/scilab/sciprimtypes.swg diff --git a/usr/share/swig/4.1.1/scilab/scirun.swg b/usr/share/swig/4.2.1/scilab/scirun.swg similarity index 98% rename from usr/share/swig/4.1.1/scilab/scirun.swg rename to usr/share/swig/4.2.1/scilab/scirun.swg index 586d5f16f86..481aac7ac01 100644 --- a/usr/share/swig/4.1.1/scilab/scirun.swg +++ b/usr/share/swig/4.2.1/scilab/scirun.swg @@ -5,7 +5,6 @@ /* Scilab version macro */ #include "version.h" -#define SWIG_SCILAB_VERSION (SCI_VERSION_MAJOR * 100) + (SCI_VERSION_MINOR * 10) + SCI_VERSION_MAINTENANCE /* Scilab standard headers */ @@ -13,11 +12,11 @@ extern "C" { #endif #include "api_scilab.h" -#if SWIG_SCILAB_VERSION < 540 +#if SCI_VERSION_MAJOR < 5 || SCI_VERSION_MAJOR == 5 && SCI_VERSION_MINOR < 4 #define __USE_DEPRECATED_STACK_FUNCTIONS__ #include "stack-c.h" #endif -#if SWIG_SCILAB_VERSION < 600 +#if SCI_VERSION_MAJOR < 6 #include "MALLOC.h" #endif #include "Scierror.h" @@ -31,12 +30,12 @@ extern "C" { /* Gateway signature */ -#if SWIG_SCILAB_VERSION >= 600 -#define SWIG_GatewayParameters char* fname, void *pvApiCtx -#define SWIG_GatewayArguments fname, pvApiCtx -#else +#if SCI_VERSION_MAJOR < 6 #define SWIG_GatewayParameters char* fname, unsigned long fname_len #define SWIG_GatewayArguments fname, fname_len +# else +#define SWIG_GatewayParameters char* fname, void *pvApiCtx +#define SWIG_GatewayArguments fname, pvApiCtx #endif /* Function name management functions */ @@ -58,29 +57,29 @@ static void SWIG_Scilab_SetFuncName(char *funcName) { /* Api context management functions */ -#if SWIG_SCILAB_VERSION >= 600 +#if SCI_VERSION_MAJOR < 6 +#define SWIG_Scilab_SetApiContext(apiCtx) +#else static void *pvApiCtx = NULL; static void SWIG_Scilab_SetApiContext(void *apiCtx) { pvApiCtx = apiCtx; } -#else -#define SWIG_Scilab_SetApiContext(apiCtx) #endif /* Argument management functions */ -#if SWIG_SCILAB_VERSION >= 540 -#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) -#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) -#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) -#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx) -#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos -#else +#if SCI_VERSION_MAJOR < 5 || SCI_VERSION_MAJOR == 5 && SCI_VERSION_MINOR < 4 #define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckRhs(minInputArgument, maxInputArgument) #define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckRhs(minInputArgument, 256) #define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckLhs(minOutputArgument, maxOutputArgument) #define SWIG_NbInputArgument(pvApiCtx) Rhs #define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) LhsVar(outputArgumentPos) = argumentPos +#else +#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) +#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) +#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) +#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx) +#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos #endif typedef int SwigSciObject; diff --git a/usr/share/swig/4.1.1/scilab/sciruntime.swg b/usr/share/swig/4.2.1/scilab/sciruntime.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/sciruntime.swg rename to usr/share/swig/4.2.1/scilab/sciruntime.swg diff --git a/usr/share/swig/4.1.1/scilab/scisequence.swg b/usr/share/swig/4.2.1/scilab/scisequence.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scisequence.swg rename to usr/share/swig/4.2.1/scilab/scisequence.swg diff --git a/usr/share/swig/4.1.1/scilab/scisequencebool.swg b/usr/share/swig/4.2.1/scilab/scisequencebool.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scisequencebool.swg rename to usr/share/swig/4.2.1/scilab/scisequencebool.swg diff --git a/usr/share/swig/4.1.1/scilab/scisequencedouble.swg b/usr/share/swig/4.2.1/scilab/scisequencedouble.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scisequencedouble.swg rename to usr/share/swig/4.2.1/scilab/scisequencedouble.swg diff --git a/usr/share/swig/4.1.1/scilab/scisequencefloat.swg b/usr/share/swig/4.2.1/scilab/scisequencefloat.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scisequencefloat.swg rename to usr/share/swig/4.2.1/scilab/scisequencefloat.swg diff --git a/usr/share/swig/4.1.1/scilab/scisequenceint.swg b/usr/share/swig/4.2.1/scilab/scisequenceint.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scisequenceint.swg rename to usr/share/swig/4.2.1/scilab/scisequenceint.swg diff --git a/usr/share/swig/4.1.1/scilab/scisequencepointer.swg b/usr/share/swig/4.2.1/scilab/scisequencepointer.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scisequencepointer.swg rename to usr/share/swig/4.2.1/scilab/scisequencepointer.swg diff --git a/usr/share/swig/4.1.1/scilab/scisequencestring.swg b/usr/share/swig/4.2.1/scilab/scisequencestring.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scisequencestring.swg rename to usr/share/swig/4.2.1/scilab/scisequencestring.swg diff --git a/usr/share/swig/4.1.1/scilab/scishort.swg b/usr/share/swig/4.2.1/scilab/scishort.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scishort.swg rename to usr/share/swig/4.2.1/scilab/scishort.swg diff --git a/usr/share/swig/4.1.1/scilab/scisignedchar.swg b/usr/share/swig/4.2.1/scilab/scisignedchar.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scisignedchar.swg rename to usr/share/swig/4.2.1/scilab/scisignedchar.swg diff --git a/usr/share/swig/4.1.1/scilab/scistdcommon.swg b/usr/share/swig/4.2.1/scilab/scistdcommon.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scistdcommon.swg rename to usr/share/swig/4.2.1/scilab/scistdcommon.swg diff --git a/usr/share/swig/4.1.1/scilab/scitypemaps.swg b/usr/share/swig/4.2.1/scilab/scitypemaps.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/scitypemaps.swg rename to usr/share/swig/4.2.1/scilab/scitypemaps.swg diff --git a/usr/share/swig/4.1.1/scilab/sciunsignedchar.swg b/usr/share/swig/4.2.1/scilab/sciunsignedchar.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/sciunsignedchar.swg rename to usr/share/swig/4.2.1/scilab/sciunsignedchar.swg diff --git a/usr/share/swig/4.1.1/scilab/sciunsignedint.swg b/usr/share/swig/4.2.1/scilab/sciunsignedint.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/sciunsignedint.swg rename to usr/share/swig/4.2.1/scilab/sciunsignedint.swg diff --git a/usr/share/swig/4.1.1/scilab/sciunsignedlong.swg b/usr/share/swig/4.2.1/scilab/sciunsignedlong.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/sciunsignedlong.swg rename to usr/share/swig/4.2.1/scilab/sciunsignedlong.swg diff --git a/usr/share/swig/4.1.1/scilab/sciunsignedshort.swg b/usr/share/swig/4.2.1/scilab/sciunsignedshort.swg similarity index 100% rename from usr/share/swig/4.1.1/scilab/sciunsignedshort.swg rename to usr/share/swig/4.2.1/scilab/sciunsignedshort.swg diff --git a/usr/share/swig/4.1.1/scilab/std_alloc.i b/usr/share/swig/4.2.1/scilab/std_alloc.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_alloc.i rename to usr/share/swig/4.2.1/scilab/std_alloc.i diff --git a/usr/share/swig/4.1.1/scilab/std_basic_string.i b/usr/share/swig/4.2.1/scilab/std_basic_string.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_basic_string.i rename to usr/share/swig/4.2.1/scilab/std_basic_string.i diff --git a/usr/share/swig/4.1.1/scilab/std_char_traits.i b/usr/share/swig/4.2.1/scilab/std_char_traits.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_char_traits.i rename to usr/share/swig/4.2.1/scilab/std_char_traits.i diff --git a/usr/share/swig/4.1.1/scilab/std_common.i b/usr/share/swig/4.2.1/scilab/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_common.i rename to usr/share/swig/4.2.1/scilab/std_common.i diff --git a/usr/share/swig/4.1.1/scilab/std_container.i b/usr/share/swig/4.2.1/scilab/std_container.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_container.i rename to usr/share/swig/4.2.1/scilab/std_container.i diff --git a/usr/share/swig/4.1.1/scilab/std_deque.i b/usr/share/swig/4.2.1/scilab/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_deque.i rename to usr/share/swig/4.2.1/scilab/std_deque.i diff --git a/usr/share/swig/4.1.1/tcl/std_except.i b/usr/share/swig/4.2.1/scilab/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/std_except.i rename to usr/share/swig/4.2.1/scilab/std_except.i diff --git a/usr/share/swig/4.1.1/scilab/std_list.i b/usr/share/swig/4.2.1/scilab/std_list.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_list.i rename to usr/share/swig/4.2.1/scilab/std_list.i diff --git a/usr/share/swig/4.1.1/scilab/std_map.i b/usr/share/swig/4.2.1/scilab/std_map.i similarity index 76% rename from usr/share/swig/4.1.1/scilab/std_map.i rename to usr/share/swig/4.2.1/scilab/std_map.i index 07eb63fda08..aeede60762b 100644 --- a/usr/share/swig/4.1.1/scilab/std_map.i +++ b/usr/share/swig/4.2.1/scilab/std_map.i @@ -47,7 +47,11 @@ namespace std { throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } void del(const K& key) throw (std::out_of_range) { std::map< K, T, C >::iterator i = self->find(key); @@ -63,17 +67,4 @@ namespace std { } }; -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - } diff --git a/usr/share/swig/4.1.1/scilab/std_multiset.i b/usr/share/swig/4.2.1/scilab/std_multiset.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_multiset.i rename to usr/share/swig/4.2.1/scilab/std_multiset.i diff --git a/usr/share/swig/4.1.1/scilab/std_pair.i b/usr/share/swig/4.2.1/scilab/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_pair.i rename to usr/share/swig/4.2.1/scilab/std_pair.i diff --git a/usr/share/swig/4.1.1/scilab/std_set.i b/usr/share/swig/4.2.1/scilab/std_set.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_set.i rename to usr/share/swig/4.2.1/scilab/std_set.i diff --git a/usr/share/swig/4.1.1/scilab/std_shared_ptr.i b/usr/share/swig/4.2.1/scilab/std_shared_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_shared_ptr.i rename to usr/share/swig/4.2.1/scilab/std_shared_ptr.i diff --git a/usr/share/swig/4.1.1/scilab/std_string.i b/usr/share/swig/4.2.1/scilab/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_string.i rename to usr/share/swig/4.2.1/scilab/std_string.i diff --git a/usr/share/swig/4.1.1/scilab/std_vector.i b/usr/share/swig/4.2.1/scilab/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/std_vector.i rename to usr/share/swig/4.2.1/scilab/std_vector.i diff --git a/usr/share/swig/4.1.1/tcl/stl.i b/usr/share/swig/4.2.1/scilab/stl.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/stl.i rename to usr/share/swig/4.2.1/scilab/stl.i diff --git a/usr/share/swig/4.1.1/tcl/swigmove.i b/usr/share/swig/4.2.1/scilab/swigmove.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/swigmove.i rename to usr/share/swig/4.2.1/scilab/swigmove.i diff --git a/usr/share/swig/4.1.1/scilab/typemaps.i b/usr/share/swig/4.2.1/scilab/typemaps.i similarity index 100% rename from usr/share/swig/4.1.1/scilab/typemaps.i rename to usr/share/swig/4.2.1/scilab/typemaps.i diff --git a/usr/share/swig/4.1.1/shared_ptr.i b/usr/share/swig/4.2.1/shared_ptr.i similarity index 84% rename from usr/share/swig/4.1.1/shared_ptr.i rename to usr/share/swig/4.2.1/shared_ptr.i index eada0b9e7e7..b450229cf5a 100644 --- a/usr/share/swig/4.1.1/shared_ptr.i +++ b/usr/share/swig/4.2.1/shared_ptr.i @@ -55,15 +55,3 @@ struct SWIG_null_deleter { SWIG_SHARED_PTR_TYPEMAPS(, TYPE) SWIG_SHARED_PTR_TYPEMAPS(const, TYPE) %enddef - -// Legacy macros -%define SWIG_SHARED_PTR(PROXYCLASS, TYPE...) -#warning "SWIG_SHARED_PTR(PROXYCLASS, TYPE) is deprecated. Please use %shared_ptr(TYPE) instead." -%shared_ptr(TYPE) -%enddef - -%define SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE...) -#warning "SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE) is deprecated. Please use %shared_ptr(TYPE) instead." -%shared_ptr(TYPE) -%enddef - diff --git a/usr/share/swig/4.1.1/std/_std_deque.i b/usr/share/swig/4.2.1/std/_std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/std/_std_deque.i rename to usr/share/swig/4.2.1/std/_std_deque.i diff --git a/usr/share/swig/4.1.1/std/std_alloc.i b/usr/share/swig/4.2.1/std/std_alloc.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_alloc.i rename to usr/share/swig/4.2.1/std/std_alloc.i diff --git a/usr/share/swig/4.1.1/std/std_array.i b/usr/share/swig/4.2.1/std/std_array.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_array.i rename to usr/share/swig/4.2.1/std/std_array.i diff --git a/usr/share/swig/4.1.1/std/std_basic_string.i b/usr/share/swig/4.2.1/std/std_basic_string.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_basic_string.i rename to usr/share/swig/4.2.1/std/std_basic_string.i diff --git a/usr/share/swig/4.1.1/std/std_char_traits.i b/usr/share/swig/4.2.1/std/std_char_traits.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_char_traits.i rename to usr/share/swig/4.2.1/std/std_char_traits.i diff --git a/usr/share/swig/4.1.1/std/std_common.i b/usr/share/swig/4.2.1/std/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_common.i rename to usr/share/swig/4.2.1/std/std_common.i diff --git a/usr/share/swig/4.1.1/std/std_container.i b/usr/share/swig/4.2.1/std/std_container.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_container.i rename to usr/share/swig/4.2.1/std/std_container.i diff --git a/usr/share/swig/4.1.1/std/std_deque.i b/usr/share/swig/4.2.1/std/std_deque.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_deque.i rename to usr/share/swig/4.2.1/std/std_deque.i diff --git a/usr/share/swig/4.1.1/std/std_except.i b/usr/share/swig/4.2.1/std/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_except.i rename to usr/share/swig/4.2.1/std/std_except.i diff --git a/usr/share/swig/4.1.1/std/std_ios.i b/usr/share/swig/4.2.1/std/std_ios.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_ios.i rename to usr/share/swig/4.2.1/std/std_ios.i diff --git a/usr/share/swig/4.1.1/std/std_iostream.i b/usr/share/swig/4.2.1/std/std_iostream.i similarity index 99% rename from usr/share/swig/4.1.1/std/std_iostream.i rename to usr/share/swig/4.2.1/std/std_iostream.i index 38a22963fa5..4c1269898df 100644 --- a/usr/share/swig/4.1.1/std/std_iostream.i +++ b/usr/share/swig/4.2.1/std/std_iostream.i @@ -264,6 +264,14 @@ namespace std seekg(off_type, ios_base::seekdir); }; + %template(ostream) basic_ostream; + %template(istream) basic_istream; + +#if defined(SWIG_WCHAR) + %template(wostream) basic_ostream; + %template(wistream) basic_istream; +#endif + // 27.6.1.5 Template class basic_iostream template > class basic_iostream @@ -318,8 +326,6 @@ namespace std } namespace std { - %template(ostream) basic_ostream; - %template(istream) basic_istream; %template(iostream) basic_iostream; %template(endl) endl >; @@ -327,8 +333,6 @@ namespace std { %template(flush) flush >; #if defined(SWIG_WCHAR) - %template(wostream) basic_ostream; - %template(wistream) basic_istream; %template(wiostream) basic_iostream; %template(wendl) endl >; diff --git a/usr/share/swig/4.1.1/std/std_list.i b/usr/share/swig/4.2.1/std/std_list.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_list.i rename to usr/share/swig/4.2.1/std/std_list.i diff --git a/usr/share/swig/4.1.1/std/std_map.i b/usr/share/swig/4.2.1/std/std_map.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_map.i rename to usr/share/swig/4.2.1/std/std_map.i diff --git a/usr/share/swig/4.1.1/std/std_multimap.i b/usr/share/swig/4.2.1/std/std_multimap.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_multimap.i rename to usr/share/swig/4.2.1/std/std_multimap.i diff --git a/usr/share/swig/4.1.1/std/std_multiset.i b/usr/share/swig/4.2.1/std/std_multiset.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_multiset.i rename to usr/share/swig/4.2.1/std/std_multiset.i diff --git a/usr/share/swig/4.1.1/std/std_pair.i b/usr/share/swig/4.2.1/std/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_pair.i rename to usr/share/swig/4.2.1/std/std_pair.i diff --git a/usr/share/swig/4.1.1/std/std_queue.i b/usr/share/swig/4.2.1/std/std_queue.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_queue.i rename to usr/share/swig/4.2.1/std/std_queue.i diff --git a/usr/share/swig/4.1.1/std/std_set.i b/usr/share/swig/4.2.1/std/std_set.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_set.i rename to usr/share/swig/4.2.1/std/std_set.i diff --git a/usr/share/swig/4.1.1/std/std_sstream.i b/usr/share/swig/4.2.1/std/std_sstream.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_sstream.i rename to usr/share/swig/4.2.1/std/std_sstream.i diff --git a/usr/share/swig/4.1.1/std/std_stack.i b/usr/share/swig/4.2.1/std/std_stack.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_stack.i rename to usr/share/swig/4.2.1/std/std_stack.i diff --git a/usr/share/swig/4.1.1/std/std_streambuf.i b/usr/share/swig/4.2.1/std/std_streambuf.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_streambuf.i rename to usr/share/swig/4.2.1/std/std_streambuf.i diff --git a/usr/share/swig/4.1.1/std/std_string.i b/usr/share/swig/4.2.1/std/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_string.i rename to usr/share/swig/4.2.1/std/std_string.i diff --git a/usr/share/swig/4.1.1/std/std_unordered_map.i b/usr/share/swig/4.2.1/std/std_unordered_map.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_unordered_map.i rename to usr/share/swig/4.2.1/std/std_unordered_map.i diff --git a/usr/share/swig/4.1.1/std/std_unordered_multimap.i b/usr/share/swig/4.2.1/std/std_unordered_multimap.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_unordered_multimap.i rename to usr/share/swig/4.2.1/std/std_unordered_multimap.i diff --git a/usr/share/swig/4.1.1/std/std_unordered_multiset.i b/usr/share/swig/4.2.1/std/std_unordered_multiset.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_unordered_multiset.i rename to usr/share/swig/4.2.1/std/std_unordered_multiset.i diff --git a/usr/share/swig/4.1.1/std/std_unordered_set.i b/usr/share/swig/4.2.1/std/std_unordered_set.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_unordered_set.i rename to usr/share/swig/4.2.1/std/std_unordered_set.i diff --git a/usr/share/swig/4.1.1/std/std_vector.i b/usr/share/swig/4.2.1/std/std_vector.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_vector.i rename to usr/share/swig/4.2.1/std/std_vector.i diff --git a/usr/share/swig/4.1.1/std/std_vectora.i b/usr/share/swig/4.2.1/std/std_vectora.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_vectora.i rename to usr/share/swig/4.2.1/std/std_vectora.i diff --git a/usr/share/swig/4.1.1/std/std_wios.i b/usr/share/swig/4.2.1/std/std_wios.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_wios.i rename to usr/share/swig/4.2.1/std/std_wios.i diff --git a/usr/share/swig/4.1.1/std/std_wiostream.i b/usr/share/swig/4.2.1/std/std_wiostream.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_wiostream.i rename to usr/share/swig/4.2.1/std/std_wiostream.i diff --git a/usr/share/swig/4.1.1/std/std_wsstream.i b/usr/share/swig/4.2.1/std/std_wsstream.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_wsstream.i rename to usr/share/swig/4.2.1/std/std_wsstream.i diff --git a/usr/share/swig/4.1.1/std/std_wstreambuf.i b/usr/share/swig/4.2.1/std/std_wstreambuf.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_wstreambuf.i rename to usr/share/swig/4.2.1/std/std_wstreambuf.i diff --git a/usr/share/swig/4.1.1/std/std_wstring.i b/usr/share/swig/4.2.1/std/std_wstring.i similarity index 100% rename from usr/share/swig/4.1.1/std/std_wstring.i rename to usr/share/swig/4.2.1/std/std_wstring.i diff --git a/usr/share/swig/4.1.1/std_except.i b/usr/share/swig/4.2.1/std_except.i similarity index 100% rename from usr/share/swig/4.1.1/std_except.i rename to usr/share/swig/4.2.1/std_except.i diff --git a/usr/share/swig/4.1.1/stdint.i b/usr/share/swig/4.2.1/stdint.i similarity index 100% rename from usr/share/swig/4.1.1/stdint.i rename to usr/share/swig/4.2.1/stdint.i diff --git a/usr/share/swig/4.1.1/stl.i b/usr/share/swig/4.2.1/stl.i similarity index 100% rename from usr/share/swig/4.1.1/stl.i rename to usr/share/swig/4.2.1/stl.i diff --git a/usr/share/swig/4.1.1/swig.swg b/usr/share/swig/4.2.1/swig.swg similarity index 95% rename from usr/share/swig/4.1.1/swig.swg rename to usr/share/swig/4.2.1/swig.swg index 9f9d5334986..db7e08cf67c 100644 --- a/usr/share/swig/4.1.1/swig.swg +++ b/usr/share/swig/4.2.1/swig.swg @@ -9,20 +9,6 @@ * User Directives * ----------------------------------------------------------------------------- */ -/* Deprecated SWIG-1.1 directives */ - -#define %disabledoc %warn "104:%disabledoc is deprecated" -#define %enabledoc %warn "105:%enabledoc is deprecated" -#define %doconly %warn "106:%doconly is deprecated" -#define %style %warn "107:%style is deprecated" /##/ -#define %localstyle %warn "108:%localstyle is deprecated" /##/ -#define %title %warn "109:%title is deprecated" /##/ -#define %section %warn "110:%section is deprecated" /##/ -#define %subsection %warn "111:%subsection is deprecated" /##/ -#define %subsubsection %warn "112:%subsubsection is deprecated" /##/ -#define %new %warn "117:%new is deprecated. Use %newobject" -#define %text %insert("null") - /* Code insertion directives such as %wrapper %{ ... %} */ #define %begin %insert("begin") @@ -31,10 +17,6 @@ #define %wrapper %insert("wrapper") #define %init %insert("init") -/* Class extension */ - -#define %addmethods %warn "113:%addmethods is now %extend" %extend - /* %ignore directive */ #define %ignore %rename($ignore) @@ -42,9 +24,6 @@ /* Access control directives */ -#define %readonly %warn "114:%readonly is deprecated. Use %immutable; " %feature("immutable"); -#define %readwrite %warn "115:%readwrite is deprecated. Use %mutable; " %feature("immutable",""); - #define %immutable %feature("immutable") #define %noimmutable %feature("immutable","0") #define %clearimmutable %feature("immutable","") @@ -361,6 +340,11 @@ static int NAME(TYPE x) { %define SWIG_TYPECHECK_STDUNISTRING 115 %enddef %define SWIG_TYPECHECK_UNISTRING 120 %enddef %define SWIG_TYPECHECK_CHAR 130 %enddef +/* Give std::string_view a slightly higher precedence because if there are + * overloaded forms then it may be more efficient to pass as std::string_view + * (e.g. to pass as std::string requires copying the data into a std::string). + */ +%define SWIG_TYPECHECK_STRINGVIEW 134 %enddef %define SWIG_TYPECHECK_STDSTRING 135 %enddef %define SWIG_TYPECHECK_STRING 140 %enddef %define SWIG_TYPECHECK_PAIR 150 %enddef @@ -560,13 +544,13 @@ namespace std { /* memberin/globalin typemap for arrays. */ -%typemap(memberin,fragment="") SWIGTYPE [ANY] { +%typemap(memberin) SWIGTYPE [ANY] { size_t ii; $1_basetype *b = ($1_basetype *) $1; for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii); } -%typemap(globalin,fragment="") SWIGTYPE [ANY] { +%typemap(globalin) SWIGTYPE [ANY] { size_t ii; $1_basetype *b = ($1_basetype *) $1; for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii); @@ -574,7 +558,7 @@ namespace std { /* memberin/globalin typemap for double arrays. */ -%typemap(memberin,fragment="") SWIGTYPE [ANY][ANY] { +%typemap(memberin) SWIGTYPE [ANY][ANY] { $basetype (*inp)[$1_dim1] = ($basetype (*)[$1_dim1])($input); $basetype (*dest)[$1_dim1] = ($basetype (*)[$1_dim1])($1); size_t ii = 0; @@ -586,7 +570,7 @@ namespace std { } } -%typemap(globalin,fragment="") SWIGTYPE [ANY][ANY] { +%typemap(globalin) SWIGTYPE [ANY][ANY] { $basetype (*inp)[$1_dim1] = ($basetype (*)[$1_dim1])($input); $basetype (*dest)[$1_dim1] = ($basetype (*)[$1_dim1])($1); size_t ii = 0; @@ -727,3 +711,4 @@ template T SwigValueInit() { %} #endif +%insert("runtime") "swigcompat.swg" diff --git a/usr/share/swig/4.2.1/swigarch.i b/usr/share/swig/4.2.1/swigarch.i new file mode 100644 index 00000000000..2f7614940fc --- /dev/null +++ b/usr/share/swig/4.2.1/swigarch.i @@ -0,0 +1,33 @@ +/* ----------------------------------------------------------------------------- + * swigarch.i + * + * SWIG library file for 32bit/64bit code specialization and checking. + * + * Use only in extreme cases, when no arch. independent code can be + * generated + * + * To activate 32-bit architecture checks, use + * + * swig -DSWIGWORDSIZE32 + * + * This adds checks that long is 32-bits when compiling the generated wrappers. + * + * To activate 64-bit architecture specific code, use + * + * swig -DSWIGWORDSIZE64 + * + * This adds checks that long is 64-bits when compiling the generated wrappers. + * Some target languages also generate code that expects long to be 64-bits. + * + * If you don't specify the SWIGWORDSIZE (the default case), SWIG will + * generate architecture independent and/or 32bits code, with no extra + * checks for the sizeof long. + * ----------------------------------------------------------------------------- */ + +#ifdef SWIGWORDSIZE32 +%fragment("long_check_wordsize32"); +#endif + +#ifdef SWIGWORDSIZE64 +%fragment("long_check_wordsize64"); +#endif diff --git a/usr/share/swig/4.2.1/swigcompat.swg b/usr/share/swig/4.2.1/swigcompat.swg new file mode 100644 index 00000000000..7d29b75391e --- /dev/null +++ b/usr/share/swig/4.2.1/swigcompat.swg @@ -0,0 +1,23 @@ +/* ----------------------------------------------------------------------------- + * swigcompat.swg + * + * Macros to provide support compatibility with older C and C++ standards. + * ----------------------------------------------------------------------------- */ + +/* C99 and C++11 should provide snprintf, but define SWIG_NO_SNPRINTF + * if you're missing it. + */ +#if ((defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) || \ + (defined __cplusplus && __cplusplus >= 201103L) || \ + defined SWIG_HAVE_SNPRINTF) && \ + !defined SWIG_NO_SNPRINTF +# define SWIG_snprintf(O,S,F,A) snprintf(O,S,F,A) +# define SWIG_snprintf2(O,S,F,A,B) snprintf(O,S,F,A,B) +#else +/* Fallback versions ignore the buffer size, but most of our uses either have a + * fixed maximum possible size or dynamically allocate a buffer that's large + * enough. + */ +# define SWIG_snprintf(O,S,F,A) sprintf(O,F,A) +# define SWIG_snprintf2(O,S,F,A,B) sprintf(O,F,A,B) +#endif diff --git a/usr/share/swig/4.1.1/swigerrors.swg b/usr/share/swig/4.2.1/swigerrors.swg similarity index 100% rename from usr/share/swig/4.1.1/swigerrors.swg rename to usr/share/swig/4.2.1/swigerrors.swg diff --git a/usr/share/swig/4.1.1/swigfragments.swg b/usr/share/swig/4.2.1/swigfragments.swg similarity index 63% rename from usr/share/swig/4.1.1/swigfragments.swg rename to usr/share/swig/4.2.1/swigfragments.swg index 28aa1180f92..75f05bc711f 100644 --- a/usr/share/swig/4.1.1/swigfragments.swg +++ b/usr/share/swig/4.2.1/swigfragments.swg @@ -77,6 +77,10 @@ #include %} +%fragment("", "header") %{ +#include +%} + %fragment("", "header") %{ #include %} @@ -85,6 +89,41 @@ #include %} -%fragment("", "header") %{ -#include +%fragment("", "header") %{ +#include +%} + +%fragment("", "header") %{ +#include +%} + +%fragment("", "header") %{ +#include +%} + +/* ----------------------------------------------------------------------------- + * Other common fragments + * ----------------------------------------------------------------------------- */ + +%fragment("long_check_wordsize32", "header", fragment="") %{ +#if !defined(SWIG_NO_WORDSIZE32_CHECK) +#if (__WORDSIZE == 64) || (LONG_MAX != INT_MAX) +# error "SWIG generated code is invalid on this 64-bit architecture, please regenerate without defining SWIGWORDSIZE32 or define SWIGWORDSIZE64" +#endif +#endif +%} + +%fragment("long_check_wordsize64", "header", fragment="") %{ +#if !defined(SWIG_NO_WORDSIZE64_CHECK) +#if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX) +# error "SWIG generated code is invalid on this 32-bit architecture, please regenerate without defining SWIGWORDSIZE64 or define SWIGWORDSIZE32" +#endif +#endif %} + +#ifdef SWIGWORDSIZE64 +%fragment("long_check_wordsize", "header", fragment="long_check_wordsize64") {} +#else +%fragment("long_check_wordsize", "header", fragment="long_check_wordsize32") {} +#endif + diff --git a/usr/share/swig/4.1.1/swiginit.swg b/usr/share/swig/4.2.1/swiginit.swg similarity index 100% rename from usr/share/swig/4.1.1/swiginit.swg rename to usr/share/swig/4.2.1/swiginit.swg diff --git a/usr/share/swig/4.1.1/swiglabels.swg b/usr/share/swig/4.2.1/swiglabels.swg similarity index 96% rename from usr/share/swig/4.1.1/swiglabels.swg rename to usr/share/swig/4.2.1/swiglabels.swg index 5e0aaad7c49..b898c383d4c 100644 --- a/usr/share/swig/4.1.1/swiglabels.swg +++ b/usr/share/swig/4.2.1/swiglabels.swg @@ -121,3 +121,9 @@ #ifdef __INTEL_COMPILER # pragma warning disable 592 #endif + +#if defined(__cplusplus) && __cplusplus >=201103L +# define SWIG_NULLPTR nullptr +#else +# define SWIG_NULLPTR NULL +#endif diff --git a/usr/share/swig/4.1.1/swigrun.i b/usr/share/swig/4.2.1/swigrun.i similarity index 100% rename from usr/share/swig/4.1.1/swigrun.i rename to usr/share/swig/4.2.1/swigrun.i diff --git a/usr/share/swig/4.1.1/swigrun.swg b/usr/share/swig/4.2.1/swigrun.swg similarity index 99% rename from usr/share/swig/4.1.1/swigrun.swg rename to usr/share/swig/4.2.1/swigrun.swg index f632c4cb6d8..824185c0202 100644 --- a/usr/share/swig/4.1.1/swigrun.swg +++ b/usr/share/swig/4.2.1/swigrun.swg @@ -145,7 +145,7 @@ #define SWIG_CASTRANKLIMIT (1 << 8) /* The NewMask denotes the object was created (using new/malloc) */ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) -/* The TmpMask is for in/out typemaps that use temporal objects */ +/* The TmpMask is for in/out typemaps that use temporary objects */ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) /* Simple returning values */ #define SWIG_BADOBJ (SWIG_ERROR) diff --git a/usr/share/swig/4.1.1/swigwarn.swg b/usr/share/swig/4.2.1/swigwarn.swg similarity index 81% rename from usr/share/swig/4.1.1/swigwarn.swg rename to usr/share/swig/4.2.1/swigwarn.swg index 6a069220ef7..09b4be6ff4a 100644 --- a/usr/share/swig/4.1.1/swigwarn.swg +++ b/usr/share/swig/4.2.1/swigwarn.swg @@ -5,31 +5,31 @@ /* -- Deprecated features -- */ -%define SWIGWARN_DEPRECATED_EXTERN 101 %enddef -%define SWIGWARN_DEPRECATED_VAL 102 %enddef -%define SWIGWARN_DEPRECATED_OUT 103 %enddef -%define SWIGWARN_DEPRECATED_DISABLEDOC 104 %enddef -%define SWIGWARN_DEPRECATED_ENABLEDOC 105 %enddef -%define SWIGWARN_DEPRECATED_DOCONLY 106 %enddef -%define SWIGWARN_DEPRECATED_STYLE 107 %enddef -%define SWIGWARN_DEPRECATED_LOCALSTYLE 108 %enddef -%define SWIGWARN_DEPRECATED_TITLE 109 %enddef -%define SWIGWARN_DEPRECATED_SECTION 110 %enddef -%define SWIGWARN_DEPRECATED_SUBSECTION 111 %enddef -%define SWIGWARN_DEPRECATED_SUBSUBSECTION 112 %enddef -%define SWIGWARN_DEPRECATED_ADDMETHODS 113 %enddef -%define SWIGWARN_DEPRECATED_READONLY 114 %enddef -%define SWIGWARN_DEPRECATED_READWRITE 115 %enddef -%define SWIGWARN_DEPRECATED_EXCEPT 116 %enddef -%define SWIGWARN_DEPRECATED_NEW 117 %enddef -%define SWIGWARN_DEPRECATED_EXCEPT_TM 118 %enddef -%define SWIGWARN_DEPRECATED_IGNORE_TM 119 %enddef -%define SWIGWARN_DEPRECATED_OPTC 120 %enddef -%define SWIGWARN_DEPRECATED_NAME 121 %enddef -%define SWIGWARN_DEPRECATED_NOEXTERN 122 %enddef -%define SWIGWARN_DEPRECATED_NODEFAULT 123 %enddef +/* Unused since 4.2.0: #define WARN_DEPRECATED_EXTERN 101 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_VAL 102 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_OUT 103 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_DISABLEDOC 104 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_ENABLEDOC 105 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_DOCONLY 106 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_STYLE 107 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_LOCALSTYLE 108 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_TITLE 109 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_SECTION 110 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_SUBSECTION 111 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_SUBSUBSECTION 112 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_ADDMETHODS 113 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_READONLY 114 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_READWRITE 115 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_EXCEPT 116 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_NEW 117 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_EXCEPT_TM 118 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_IGNORE_TM 119 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_OPTC 120 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_NAME 121 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_NOEXTERN 122 */ +/* Unused since 4.2.0: #define WARN_DEPRECATED_NODEFAULT 123 */ /* Unused since 4.1.0: #define WARN_DEPRECATED_TYPEMAP_LANG 124 */ -%define SWIGWARN_DEPRECATED_INPUT_FILE 125 %enddef +/* Unused since 4.2.0: #define WARN_DEPRECATED_INPUT_FILE 125 */ %define SWIGWARN_DEPRECATED_NESTED_WORKAROUND 126 %enddef /* -- Preprocessor -- */ @@ -48,17 +48,17 @@ %define SWIGWARN_PARSE_EXTEND_UNDEF 303 %enddef %define SWIGWARN_PARSE_UNSUPPORTED_VALUE 304 %enddef %define SWIGWARN_PARSE_BAD_VALUE 305 %enddef -%define SWIGWARN_PARSE_PRIVATE 306 %enddef -%define SWIGWARN_PARSE_BAD_DEFAULT 307 %enddef +/* Unused since 1.3.32: #define WARN_PARSE_PRIVATE 306 */ +/* Unused since 4.2.0: #define WARN_PARSE_BAD_DEFAULT 307 */ %define SWIGWARN_PARSE_NAMESPACE_ALIAS 308 %enddef %define SWIGWARN_PARSE_PRIVATE_INHERIT 309 %enddef -%define SWIGWARN_PARSE_TEMPLATE_REPEAT 310 %enddef -%define SWIGWARN_PARSE_TEMPLATE_PARTIAL 311 %enddef +/* Unused since 1.3.18: #define WARN_PARSE_TEMPLATE_REPEAT 310 */ +/* Unused since 1.3.18: #define WARN_PARSE_TEMPLATE_PARTIAL 311 */ %define SWIGWARN_PARSE_UNNAMED_NESTED_CLASS 312 %enddef %define SWIGWARN_PARSE_UNDEFINED_EXTERN 313 %enddef %define SWIGWARN_PARSE_KEYWORD 314 %enddef %define SWIGWARN_PARSE_USING_UNDEF 315 %enddef -%define SWIGWARN_PARSE_MODULE_REPEAT 316 %enddef +/* Unused since 1.3.18: #define WARN_PARSE_MODULE_REPEAT 316 */ %define SWIGWARN_PARSE_TEMPLATE_SP_UNDEF 317 %enddef %define SWIGWARN_PARSE_TEMPLATE_AMBIG 318 %enddef %define SWIGWARN_PARSE_NO_ACCESS 319 %enddef @@ -70,11 +70,16 @@ %define SWIGWARN_PARSE_NAMED_NESTED_CLASS 325 %enddef %define SWIGWARN_PARSE_EXTEND_NAME 326 %enddef %define SWIGWARN_PARSE_EXTERN_TEMPLATE 327 %enddef +%define SWIGWARN_PARSE_ASSIGNED_VALUE 328 %enddef +%define SWIGWARN_PARSE_USING_CONSTRUCTOR 329 %enddef %define SWIGWARN_CPP11_LAMBDA 340 %enddef -%define SWIGWARN_CPP11_ALIAS_DECLARATION 341 %enddef /* redundant now */ -%define SWIGWARN_CPP11_ALIAS_TEMPLATE 342 %enddef /* redundant now */ -%define SWIGWARN_CPP11_VARIADIC_TEMPLATE 343 %enddef +/* Unused since 3.0.11: #define WARN_CPP11_ALIAS_DECLARATION 341 */ +/* Unused since 3.0.11: #define WARN_CPP11_ALIAS_TEMPLATE 342 */ +/* Unused since 4.2.0: #define WARN_CPP11_VARIADIC_TEMPLATE 343 */ +%define SWIGWARN_CPP11_DECLTYPE 344 %enddef +%define SWIGWARN_CPP14_AUTO 345 %enddef +%define SWIGWARN_CPP11_AUTO 346 %enddef %define SWIGWARN_IGNORE_OPERATOR_NEW 350 %enddef /* new */ %define SWIGWARN_IGNORE_OPERATOR_DELETE 351 %enddef /* delete */ @@ -135,9 +140,9 @@ %define SWIGWARN_TYPE_REDEFINED 404 %enddef %define SWIGWARN_TYPE_RVALUE_REF_QUALIFIER_IGNORED 405 %enddef -%define SWIGWARN_TYPEMAP_SOURCETARGET 450 %enddef /* No longer issued */ +/* Unused since 4.1.0: #define WARN_TYPEMAP_SOURCETARGET 450 */ %define SWIGWARN_TYPEMAP_CHARLEAK 451 %enddef -%define SWIGWARN_TYPEMAP_SWIGTYPE 452 %enddef /* No longer issued */ +/* Unused since 1.3.32: #define WARN_TYPEMAP_SWIGTYPE 452 */ %define SWIGWARN_TYPEMAP_APPLY_UNDEF 453 %enddef %define SWIGWARN_TYPEMAP_SWIGTYPELEAK 454 %enddef %define SWIGWARN_TYPEMAP_WCHARLEAK 455 %enddef @@ -175,7 +180,7 @@ %define SWIGWARN_LANG_NATIVE_UNIMPL 507 %enddef %define SWIGWARN_LANG_DEREF_SHADOW 508 %enddef %define SWIGWARN_LANG_OVERLOAD_SHADOW 509 %enddef -%define SWIGWARN_LANG_FRIEND_IGNORE 510 %enddef +%define SWIGWARN_LANG_FRIEND_IGNORE 510 %enddef /* No longer issued */ %define SWIGWARN_LANG_OVERLOAD_KEYWORD 511 %enddef %define SWIGWARN_LANG_OVERLOAD_CONST 512 %enddef %define SWIGWARN_LANG_CLASS_UNNAMED 513 %enddef @@ -233,7 +238,8 @@ /* please leave 740-749 free for Python */ -%define SWIGWARN_R_MISSING_RTYPECHECK_TYPEMAP 750 %enddef +/* Unused since 4.2.0: #define WARN_R_MISSING_RTYPECHECK_TYPEMAP 750 */ +%define SWIGWARN_R_TYPEMAP_RTYPECHECK_UNDEF 751 %enddef /* please leave 750-759 free for R */ @@ -288,7 +294,7 @@ %define SWIGWARN_PHP_MULTIPLE_INHERITANCE 870 %enddef %define SWIGWARN_PHP_UNKNOWN_PRAGMA 871 %enddef -%define SWIGWARN_PHP_PUBLIC_BASE 872 %enddef +/* Unused since 4.1.0: define WARN_PHP_PUBLIC_BASE 872 */ /* please leave 870-889 free for PHP */ diff --git a/usr/share/swig/4.1.1/swigwarnings.swg b/usr/share/swig/4.2.1/swigwarnings.swg similarity index 97% rename from usr/share/swig/4.1.1/swigwarnings.swg rename to usr/share/swig/4.2.1/swigwarnings.swg index 63ae4c65a92..2dfea660e98 100644 --- a/usr/share/swig/4.1.1/swigwarnings.swg +++ b/usr/share/swig/4.2.1/swigwarnings.swg @@ -54,7 +54,7 @@ %define SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG "454:Setting a pointer/reference variable may leak memory." %enddef %define SWIGWARN_TYPEMAP_WCHARLEAK_MSG "455:Setting a const wchar_t * variable may leak memory." %enddef %define SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG "470:Thread/reentrant unsafe wrapping, consider returning by value instead." %enddef -%define SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG "473:Returning a pointer or reference in a director method is not recommended." %enddef +%define SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG "473:Returning a reference, pointer or pointer wrapper in a director method is not recommended." %enddef %define SWIGWARN_TYPEMAP_INITIALIZER_LIST_MSG "476:Initialization using std::initializer_list." %enddef /* ----------------------------------------------------------------------------- diff --git a/usr/share/swig/4.1.1/tcl/argcargv.i b/usr/share/swig/4.2.1/tcl/argcargv.i similarity index 71% rename from usr/share/swig/4.1.1/tcl/argcargv.i rename to usr/share/swig/4.2.1/tcl/argcargv.i index bbe149ef0c1..e93f6914622 100644 --- a/usr/share/swig/4.1.1/tcl/argcargv.i +++ b/usr/share/swig/4.2.1/tcl/argcargv.i @@ -1,9 +1,9 @@ -/* ------------------------------------------------------------ +/* ------------------------------------------------------------- * SWIG library containing argc and argv multi-argument typemaps - * ------------------------------------------------------------ */ + * ------------------------------------------------------------- */ %typemap(in) (int ARGC, char **ARGV) { - int i, nitems; + Tcl_Size i, nitems; Tcl_Obj **listobjv; if (Tcl_ListObjGetElements(interp, $input, &nitems, &listobjv) == TCL_ERROR) { SWIG_exception_fail(SWIG_ValueError, "in method '$symname', Expecting list of argv"); @@ -12,18 +12,16 @@ $1 = ($1_ltype) nitems; $2 = (char **) malloc((nitems+1)*sizeof(char *)); for (i = 0; i < nitems; i++) { - $2[i] = Tcl_GetStringFromObj(listobjv[i], NULL); + $2[i] = Tcl_GetString(listobjv[i]); } $2[i] = NULL; } %typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) { - int len; + Tcl_Size len; $1 = Tcl_ListObjLength(interp, $input, &len) == TCL_OK; } %typemap(freearg) (int ARGC, char **ARGV) { - if ($2 != NULL) { - free((void *)$2); - } + free((void *)$2); } diff --git a/usr/share/swig/4.1.1/tcl/attribute.i b/usr/share/swig/4.2.1/tcl/attribute.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/attribute.i rename to usr/share/swig/4.2.1/tcl/attribute.i diff --git a/usr/share/swig/4.1.1/tcl/carrays.i b/usr/share/swig/4.2.1/tcl/carrays.i similarity index 91% rename from usr/share/swig/4.1.1/tcl/carrays.i rename to usr/share/swig/4.2.1/tcl/carrays.i index 0236672d3f0..c1e6db3f0b4 100644 --- a/usr/share/swig/4.1.1/tcl/carrays.i +++ b/usr/share/swig/4.2.1/tcl/carrays.i @@ -1,4 +1 @@ %include - - - diff --git a/usr/share/swig/4.2.1/tcl/cdata.i b/usr/share/swig/4.2.1/tcl/cdata.i new file mode 100644 index 00000000000..367965990df --- /dev/null +++ b/usr/share/swig/4.2.1/tcl/cdata.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.2.1/tcl/cmalloc.i b/usr/share/swig/4.2.1/tcl/cmalloc.i new file mode 100644 index 00000000000..248f06b961b --- /dev/null +++ b/usr/share/swig/4.2.1/tcl/cmalloc.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.1.1/tcl/cpointer.i b/usr/share/swig/4.2.1/tcl/cpointer.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/cpointer.i rename to usr/share/swig/4.2.1/tcl/cpointer.i diff --git a/usr/share/swig/4.1.1/tcl/cstring.i b/usr/share/swig/4.2.1/tcl/cstring.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/cstring.i rename to usr/share/swig/4.2.1/tcl/cstring.i diff --git a/usr/share/swig/4.1.1/tcl/cwstring.i b/usr/share/swig/4.2.1/tcl/cwstring.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/cwstring.i rename to usr/share/swig/4.2.1/tcl/cwstring.i diff --git a/usr/share/swig/4.1.1/tcl/exception.i b/usr/share/swig/4.2.1/tcl/exception.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/exception.i rename to usr/share/swig/4.2.1/tcl/exception.i diff --git a/usr/share/swig/4.2.1/tcl/factory.i b/usr/share/swig/4.2.1/tcl/factory.i new file mode 100644 index 00000000000..46a0a8733e7 --- /dev/null +++ b/usr/share/swig/4.2.1/tcl/factory.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.1.1/tcl/std_auto_ptr.i b/usr/share/swig/4.2.1/tcl/std_auto_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/std_auto_ptr.i rename to usr/share/swig/4.2.1/tcl/std_auto_ptr.i diff --git a/usr/share/swig/4.1.1/tcl/std_common.i b/usr/share/swig/4.2.1/tcl/std_common.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/std_common.i rename to usr/share/swig/4.2.1/tcl/std_common.i diff --git a/usr/share/swig/4.2.1/tcl/std_deque.i b/usr/share/swig/4.2.1/tcl/std_deque.i new file mode 100644 index 00000000000..cb98f6c2fb3 --- /dev/null +++ b/usr/share/swig/4.2.1/tcl/std_deque.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.2.1/tcl/std_except.i b/usr/share/swig/4.2.1/tcl/std_except.i new file mode 100644 index 00000000000..af98428f65d --- /dev/null +++ b/usr/share/swig/4.2.1/tcl/std_except.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.1.1/tcl/std_map.i b/usr/share/swig/4.2.1/tcl/std_map.i similarity index 76% rename from usr/share/swig/4.1.1/tcl/std_map.i rename to usr/share/swig/4.2.1/tcl/std_map.i index 2c7f40ac7dd..5c8bc75fc2e 100644 --- a/usr/share/swig/4.1.1/tcl/std_map.i +++ b/usr/share/swig/4.2.1/tcl/std_map.i @@ -47,7 +47,11 @@ namespace std { throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { +%#ifdef __cpp_lib_map_try_emplace + (*self).insert_or_assign(key, x); +%#else (*self)[key] = x; +%#endif } void del(const K& key) throw (std::out_of_range) { std::map< K, T, C >::iterator i = self->find(key); @@ -63,17 +67,4 @@ namespace std { } }; -// Legacy macros (deprecated) -%define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) -#warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" -%enddef - -%define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) -#warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" -%enddef - } diff --git a/usr/share/swig/4.1.1/tcl/std_pair.i b/usr/share/swig/4.2.1/tcl/std_pair.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/std_pair.i rename to usr/share/swig/4.2.1/tcl/std_pair.i diff --git a/usr/share/swig/4.1.1/tcl/std_string.i b/usr/share/swig/4.2.1/tcl/std_string.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/std_string.i rename to usr/share/swig/4.2.1/tcl/std_string.i diff --git a/usr/share/swig/4.2.1/tcl/std_string_view.i b/usr/share/swig/4.2.1/tcl/std_string_view.i new file mode 100644 index 00000000000..9d922bccdc0 --- /dev/null +++ b/usr/share/swig/4.2.1/tcl/std_string_view.i @@ -0,0 +1,2 @@ +%include + diff --git a/usr/share/swig/4.1.1/tcl/std_unique_ptr.i b/usr/share/swig/4.2.1/tcl/std_unique_ptr.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/std_unique_ptr.i rename to usr/share/swig/4.2.1/tcl/std_unique_ptr.i diff --git a/usr/share/swig/4.1.1/tcl/std_vector.i b/usr/share/swig/4.2.1/tcl/std_vector.i similarity index 96% rename from usr/share/swig/4.1.1/tcl/std_vector.i rename to usr/share/swig/4.2.1/tcl/std_vector.i index a74bf3a1b60..f950ee3fd5c 100644 --- a/usr/share/swig/4.1.1/tcl/std_vector.i +++ b/usr/share/swig/4.2.1/tcl/std_vector.i @@ -35,10 +35,10 @@ #include SWIGINTERN Tcl_Obj* SwigString_FromString(const std::string &s) { - return Tcl_NewStringObj(s.data(), (int)s.length()); + return Tcl_NewStringObj(s.data(), (Tcl_Size)s.length()); } -SWIGINTERN int Tcl_GetBoolFromObj(Tcl_Interp *interp, Tcl_Obj *o, bool *val) { +SWIGINTERN int SWIG_Tcl_GetBoolFromObj(Tcl_Interp *interp, Tcl_Obj *o, bool *val) { int v; int res = Tcl_GetBooleanFromObj(interp, o, &v); if (res == TCL_OK) { @@ -48,7 +48,7 @@ SWIGINTERN int Tcl_GetBoolFromObj(Tcl_Interp *interp, Tcl_Obj *o, bool *val) { } SWIGINTERN int SwigString_AsString(Tcl_Interp *interp, Tcl_Obj *o, std::string *val) { - int len; + Tcl_Size len; const char* temp = Tcl_GetStringFromObj(o, &len); (void)interp; if (temp == NULL) @@ -85,8 +85,8 @@ namespace std { template class vector { %typemap(in) vector< T > (std::vector< T > *v) { Tcl_Obj **listobjv; - int nitems; - int i; + Tcl_Size nitems; + Tcl_Size i; T* temp; if (SWIG_ConvertPtr($input, (void **) &v, @@ -114,8 +114,8 @@ namespace std { %typemap(in) const vector< T >* (std::vector< T > *v, std::vector< T > w), const vector< T >& (std::vector< T > *v, std::vector< T > w) { Tcl_Obj **listobjv; - int nitems; - int i; + Tcl_Size nitems; + Tcl_Size i; T* temp; if(SWIG_ConvertPtr($input, (void **) &v, @@ -153,7 +153,7 @@ namespace std { %typecheck(SWIG_TYPECHECK_VECTOR) vector< T > { Tcl_Obj **listobjv; - int nitems; + Tcl_Size nitems; T* temp; std::vector< T > *v; @@ -182,7 +182,7 @@ namespace std { %typecheck(SWIG_TYPECHECK_VECTOR) const vector< T >&, const vector< T >* { Tcl_Obj **listobjv; - int nitems; + Tcl_Size nitems; T* temp; std::vector< T > *v; @@ -261,8 +261,8 @@ namespace std { %typemap(in) vector< T > (std::vector< T > *v){ Tcl_Obj **listobjv; - int nitems; - int i; + Tcl_Size nitems; + Tcl_Size i; T temp; if(SWIG_ConvertPtr($input, (void **) &v, @@ -285,8 +285,8 @@ namespace std { %typemap(in) const vector< T >& (std::vector< T > *v,std::vector< T > w), const vector< T >* (std::vector< T > *v,std::vector< T > w) { Tcl_Obj **listobjv; - int nitems; - int i; + Tcl_Size nitems; + Tcl_Size i; T temp; if(SWIG_ConvertPtr($input, (void **) &v, @@ -316,7 +316,7 @@ namespace std { %typecheck(SWIG_TYPECHECK_VECTOR) vector< T > { Tcl_Obj **listobjv; - int nitems; + Tcl_Size nitems; T temp; std::vector< T > *v; @@ -343,7 +343,7 @@ namespace std { %typecheck(SWIG_TYPECHECK_VECTOR) const vector< T >&, const vector< T >*{ Tcl_Obj **listobjv; - int nitems; + Tcl_Size nitems; T temp; std::vector< T > *v; @@ -413,7 +413,7 @@ namespace std { }; %enddef - specialize_std_vector(bool, Tcl_GetBoolFromObj, Tcl_NewBooleanObj); + specialize_std_vector(bool, SWIG_Tcl_GetBoolFromObj, Tcl_NewBooleanObj); specialize_std_vector(char, SwigInt_As,Tcl_NewIntObj); specialize_std_vector(int, Tcl_GetIntFromObj,Tcl_NewIntObj); specialize_std_vector(short, SwigInt_As, Tcl_NewIntObj); diff --git a/usr/share/swig/4.1.1/tcl/std_wstring.i b/usr/share/swig/4.2.1/tcl/std_wstring.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/std_wstring.i rename to usr/share/swig/4.2.1/tcl/std_wstring.i diff --git a/usr/share/swig/4.1.1/pointer.i b/usr/share/swig/4.2.1/tcl/stl.i similarity index 56% rename from usr/share/swig/4.1.1/pointer.i rename to usr/share/swig/4.2.1/tcl/stl.i index 9ac04ebfc03..04f86014f2c 100644 --- a/usr/share/swig/4.1.1/pointer.i +++ b/usr/share/swig/4.2.1/tcl/stl.i @@ -1,11 +1,10 @@ /* ----------------------------------------------------------------------------- - * pointer.i + * stl.i * ----------------------------------------------------------------------------- */ - -%echo "pointer.i is deprecated. Use cpointer.i instead." -%echo "See https://www.swig.org/Doc3.0/Library.html" - - - +%include +%include +%include +%include +%include diff --git a/usr/share/swig/4.2.1/tcl/swigmove.i b/usr/share/swig/4.2.1/tcl/swigmove.i new file mode 100644 index 00000000000..62ecca76823 --- /dev/null +++ b/usr/share/swig/4.2.1/tcl/swigmove.i @@ -0,0 +1 @@ +%include diff --git a/usr/share/swig/4.1.1/tcl/tcl8.swg b/usr/share/swig/4.2.1/tcl/tcl8.swg similarity index 100% rename from usr/share/swig/4.1.1/tcl/tcl8.swg rename to usr/share/swig/4.2.1/tcl/tcl8.swg diff --git a/usr/share/swig/4.1.1/tcl/tclapi.swg b/usr/share/swig/4.2.1/tcl/tclapi.swg similarity index 96% rename from usr/share/swig/4.1.1/tcl/tclapi.swg rename to usr/share/swig/4.2.1/tcl/tclapi.swg index 2187de52e65..03c3967ad87 100644 --- a/usr/share/swig/4.1.1/tcl/tclapi.swg +++ b/usr/share/swig/4.2.1/tcl/tclapi.swg @@ -23,8 +23,8 @@ typedef struct swig_const_info { swig_type_info **ptype; } swig_const_info; -typedef int (*swig_wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); -typedef int (*swig_wrapper_func)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); +typedef int (*swig_wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *const []); +typedef int (*swig_wrapper_func)(ClientData, Tcl_Interp *, int, Tcl_Obj *const []); typedef char *(*swig_variable_func)(ClientData, Tcl_Interp *, char *, char *, int); typedef void (*swig_delete_func)(ClientData); @@ -63,7 +63,7 @@ typedef struct swig_instance { /* Structure for command table */ typedef struct { const char *name; - int (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); + int (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *const []); ClientData clientdata; } swig_command_info; diff --git a/usr/share/swig/4.1.1/tcl/tclerrors.swg b/usr/share/swig/4.2.1/tcl/tclerrors.swg similarity index 89% rename from usr/share/swig/4.1.1/tcl/tclerrors.swg rename to usr/share/swig/4.2.1/tcl/tclerrors.swg index 889d3ad50e6..73d73f8cf81 100644 --- a/usr/share/swig/4.1.1/tcl/tclerrors.swg +++ b/usr/share/swig/4.2.1/tcl/tclerrors.swg @@ -51,15 +51,15 @@ SWIG_Tcl_SetErrorObj(Tcl_Interp *interp, const char *ctype, Tcl_Obj *obj) { Tcl_ResetResult(interp); Tcl_SetObjResult(interp, obj); - Tcl_SetErrorCode(interp, "SWIG", ctype, NULL); + Tcl_SetErrorCode(interp, "SWIG", ctype, (char *)NULL); } SWIGINTERN void SWIG_Tcl_SetErrorMsg(Tcl_Interp *interp, const char *ctype, const char *mesg) { Tcl_ResetResult(interp); - Tcl_SetErrorCode(interp, "SWIG", ctype, NULL); - Tcl_AppendResult(interp, ctype, " ", mesg, NULL); + Tcl_SetErrorCode(interp, "SWIG", ctype, (char *)NULL); + Tcl_AppendResult(interp, ctype, " ", mesg, (char *)NULL); /* Tcl_AddErrorInfo(interp, ctype); Tcl_AddErrorInfo(interp, " "); diff --git a/usr/share/swig/4.1.1/tcl/tclfragments.swg b/usr/share/swig/4.2.1/tcl/tclfragments.swg similarity index 100% rename from usr/share/swig/4.1.1/tcl/tclfragments.swg rename to usr/share/swig/4.2.1/tcl/tclfragments.swg diff --git a/usr/share/swig/4.1.1/tcl/tclinit.swg b/usr/share/swig/4.2.1/tcl/tclinit.swg similarity index 99% rename from usr/share/swig/4.1.1/tcl/tclinit.swg rename to usr/share/swig/4.2.1/tcl/tclinit.swg index cf14de88144..eb9e3ecaa05 100644 --- a/usr/share/swig/4.1.1/tcl/tclinit.swg +++ b/usr/share/swig/4.2.1/tcl/tclinit.swg @@ -24,7 +24,7 @@ SWIGEXPORT int SWIG_init(Tcl_Interp *); /* Compatibility version for TCL stubs */ #ifndef SWIG_TCL_STUBS_VERSION -#define SWIG_TCL_STUBS_VERSION "8.4" +#define SWIG_TCL_STUBS_VERSION "8.4-" #endif %} diff --git a/usr/share/swig/4.1.1/tcl/tclinterp.i b/usr/share/swig/4.2.1/tcl/tclinterp.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/tclinterp.i rename to usr/share/swig/4.2.1/tcl/tclinterp.i diff --git a/usr/share/swig/4.1.1/tcl/tclkw.swg b/usr/share/swig/4.2.1/tcl/tclkw.swg similarity index 100% rename from usr/share/swig/4.1.1/tcl/tclkw.swg rename to usr/share/swig/4.2.1/tcl/tclkw.swg diff --git a/usr/share/swig/4.1.1/tcl/tclmacros.swg b/usr/share/swig/4.2.1/tcl/tclmacros.swg similarity index 100% rename from usr/share/swig/4.1.1/tcl/tclmacros.swg rename to usr/share/swig/4.2.1/tcl/tclmacros.swg diff --git a/usr/share/swig/4.1.1/tcl/tclopers.swg b/usr/share/swig/4.2.1/tcl/tclopers.swg similarity index 100% rename from usr/share/swig/4.1.1/tcl/tclopers.swg rename to usr/share/swig/4.2.1/tcl/tclopers.swg diff --git a/usr/share/swig/4.1.1/tcl/tclprimtypes.swg b/usr/share/swig/4.2.1/tcl/tclprimtypes.swg similarity index 96% rename from usr/share/swig/4.1.1/tcl/tclprimtypes.swg rename to usr/share/swig/4.2.1/tcl/tclprimtypes.swg index febbffb734b..ddefa7db511 100644 --- a/usr/share/swig/4.1.1/tcl/tclprimtypes.swg +++ b/usr/share/swig/4.2.1/tcl/tclprimtypes.swg @@ -61,7 +61,7 @@ SWIG_From_dec(unsigned long)(unsigned long value) return SWIG_From(long)(%numeric_cast(value, long)); } else { char temp[256]; - sprintf(temp, "%lu", value); + SWIG_snprintf(temp, sizeof(temp), "%lu", value); return Tcl_NewStringObj(temp,-1); } } @@ -82,7 +82,7 @@ SWIG_AsVal_dec(unsigned long)(Tcl_Obj *obj, unsigned long *val) { get it as a string so we can distinguish these cases. */ } { - int len = 0; + Tcl_Size len = 0; const char *nptr = Tcl_GetStringFromObj(obj, &len); if (nptr && len > 0) { char *endptr; @@ -122,7 +122,7 @@ SWIG_From_dec(long long)(long long value) return SWIG_From(long)(%numeric_cast(value,long)); } else { char temp[256]; - sprintf(temp, "%lld", value); + SWIG_snprintf(temp, sizeof(temp), "%lld", value); return Tcl_NewStringObj(temp,-1); } } @@ -163,7 +163,7 @@ SWIG_From_dec(unsigned long long)(unsigned long long value) return SWIG_From(long long)(%numeric_cast(value, long long)); } else { char temp[256]; - sprintf(temp, "%llu", value); + SWIG_snprintf(temp, sizeof(temp), "%llu", value); return Tcl_NewStringObj(temp,-1); } } @@ -183,7 +183,7 @@ SWIG_AsVal_dec(unsigned long long)(Tcl_Obj *obj, unsigned long long *val) if (val) *val = (unsigned long) v; return SWIG_OK; } else { - int len = 0; + Tcl_Size len = 0; const char *nptr = Tcl_GetStringFromObj(obj, &len); if (nptr && len > 0) { char *endptr; diff --git a/usr/share/swig/4.1.1/tcl/tclresult.i b/usr/share/swig/4.2.1/tcl/tclresult.i similarity index 100% rename from usr/share/swig/4.1.1/tcl/tclresult.i rename to usr/share/swig/4.2.1/tcl/tclresult.i diff --git a/usr/share/swig/4.1.1/tcl/tclrun.swg b/usr/share/swig/4.2.1/tcl/tclrun.swg similarity index 91% rename from usr/share/swig/4.1.1/tcl/tclrun.swg rename to usr/share/swig/4.2.1/tcl/tclrun.swg index e8136051f11..debbd091e8d 100644 --- a/usr/share/swig/4.1.1/tcl/tclrun.swg +++ b/usr/share/swig/4.2.1/tcl/tclrun.swg @@ -68,7 +68,7 @@ #define SWIG_Tcl_GetConstant SWIG_Tcl_GetConstantObj #if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 5) -#define SWIG_TCL_HASHTABLE_INIT {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define SWIG_TCL_HASHTABLE_INIT {0, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0} #else #define SWIG_TCL_HASHTABLE_INIT {0} #endif @@ -118,6 +118,8 @@ SWIG_Tcl_Disown(void *ptr) { return 0; } +SWIGRUNTIME void SWIG_Tcl_ObjectDelete(ClientData clientData); + /* Convert a pointer value */ SWIGRUNTIME int SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swig_type_info *ty, int flags) { @@ -138,7 +140,7 @@ SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swi /* from being called when c is not a command, firing the unknown proc */ if (Tcl_VarEval(interp,"info commands ", c, (char *) NULL) == TCL_OK) { Tcl_Obj *result = Tcl_GetObjResult(interp); - if (*(Tcl_GetStringFromObj(result, NULL)) == 0) { + if (*(Tcl_GetString(result)) == 0) { /* It's not a command, so it can't be a pointer */ Tcl_ResetResult(interp); return SWIG_ERROR; @@ -156,7 +158,7 @@ SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swi return SWIG_ERROR; } - c = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), NULL); + c = Tcl_GetString(Tcl_GetObjResult(interp)); } cmd_name = c; @@ -164,10 +166,16 @@ SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swi c = SWIG_UnpackData(c,ptr,sizeof(void *)); if (ty) { + Tcl_CmdInfo info; tc = c ? SWIG_TypeCheck(c,ty) : 0; - if (tc) { - Tcl_CmdInfo info; - if (Tcl_GetCommandInfo(interp, cmd_name, &info)) { + if (!tc) { + return SWIG_ERROR; + } + if (Tcl_GetCommandInfo(interp, cmd_name, &info)) { + /* When creating a pointer string, SWIG_Tcl_NewInstanceObj calls Tcl_CreateObjCommand and sets + * info.objClientData to an instance of swig_instance. Detecting when we can cast any info.objClientData + * to swig_instance is not simple as it may be an unrelated command; we use deleteProc to determine this. */ + if (info.deleteProc == SWIG_Tcl_ObjectDelete) { swig_instance *inst = (swig_instance *)info.objClientData; if (!inst->thisvalue) { *ptr = 0; @@ -184,13 +192,11 @@ SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swi } { int newmemory = 0; - *ptr = SWIG_TypeCast(tc,(void *) *ptr,&newmemory); + *ptr = SWIG_TypeCast(tc,(void *) *ptr, &newmemory); assert(!newmemory); /* newmemory handling not yet implemented */ } } } - } else { - return SWIG_ERROR; } } @@ -200,7 +206,7 @@ SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swi /* Convert a pointer value */ SWIGRUNTIMEINLINE int SWIG_Tcl_ConvertPtr(Tcl_Interp *interp, Tcl_Obj *oc, void **ptr, swig_type_info *ty, int flags) { - return SWIG_Tcl_ConvertPtrFromString(interp, Tcl_GetStringFromObj(oc,NULL), ptr, ty, flags); + return SWIG_Tcl_ConvertPtrFromString(interp, Tcl_GetString(oc), ptr, ty, flags); } /* Convert a pointer value */ @@ -227,7 +233,7 @@ SWIG_Tcl_ConvertPacked(Tcl_Interp *SWIGUNUSEDPARM(interp) , Tcl_Obj *obj, void * const char *c; if (!obj) goto type_error; - c = Tcl_GetStringFromObj(obj,NULL); + c = Tcl_GetString(obj); /* Pointer values must start with leading underscore */ if (*c != '_') goto type_error; c++; @@ -326,7 +332,7 @@ SWIG_Tcl_ObjectDelete(ClientData clientData) { /* Function to invoke object methods given an instance */ SWIGRUNTIME int -SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST _objv[]) { +SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const _objv[]) { char *method, *attrname; swig_instance *inst = (swig_instance *) clientData; swig_method *meth; @@ -346,7 +352,7 @@ SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_ Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); return TCL_ERROR; } - method = Tcl_GetStringFromObj(objv[1],NULL); + method = Tcl_GetString(objv[1]); if (strcmp(method,"-acquire") == 0) { inst->destroy = 1; SWIG_Acquire(inst->thisvalue); @@ -409,7 +415,7 @@ SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_ Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); return TCL_ERROR; } - attrname = Tcl_GetStringFromObj(objv[2],NULL); + attrname = Tcl_GetString(objv[2]); attr = cls->attributes; while (attr && attr->name) { if ((strcmp(attr->name, attrname) == 0) && (attr->getmethod)) { @@ -443,7 +449,7 @@ SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_ } i = 2; while (i < objc) { - attrname = Tcl_GetStringFromObj(objv[i],NULL); + attrname = Tcl_GetString(objv[i]); attr = cls->attributes; while (attr && attr->name) { if ((strcmp(attr->name, attrname) == 0) && (attr->setmethod)) { @@ -512,7 +518,7 @@ SWIG_Tcl_NewInstanceObj(Tcl_Interp *interp, void *thisvalue, swig_type_info *typ Tcl_CmdInfo ci; int has_command; char *name; - name = Tcl_GetStringFromObj(robj,NULL); + name = Tcl_GetString(robj); has_command = Tcl_GetCommandInfo(interp, name, &ci); if (!has_command || flags) { swig_instance *newinst = (swig_instance *) malloc(sizeof(swig_instance)); @@ -521,7 +527,7 @@ SWIG_Tcl_NewInstanceObj(Tcl_Interp *interp, void *thisvalue, swig_type_info *typ newinst->thisvalue = thisvalue; newinst->classptr = (swig_class *) type->clientdata; newinst->destroy = flags; - newinst->cmdtok = Tcl_CreateObjCommand(interp, Tcl_GetStringFromObj(robj,NULL), (swig_wrapper_func) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete); + newinst->cmdtok = Tcl_CreateObjCommand(interp, Tcl_GetString(robj), (swig_wrapper_func) SWIG_Tcl_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_Tcl_ObjectDelete); if (flags) { SWIG_Acquire(thisvalue); } @@ -541,7 +547,7 @@ SWIG_Tcl_NewInstanceObj(Tcl_Interp *interp, void *thisvalue, swig_type_info *typ /* Function to create objects */ SWIGRUNTIME int -SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *newObj = 0; void *thisvalue = 0; swig_instance *newinst = 0; @@ -558,7 +564,7 @@ SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, } cons = classptr->constructor; if (objc > 1) { - char *s = Tcl_GetStringFromObj(objv[1],NULL); + char *s = Tcl_GetString(objv[1]); if (strcmp(s,"-this") == 0) { thisarg = 2; cons = 0; @@ -570,7 +576,7 @@ SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, } else if (objc >= 3) { char *s1; name = s; - s1 = Tcl_GetStringFromObj(objv[2],NULL); + s1 = Tcl_GetString(objv[2]); if (strcmp(s1,"-this") == 0) { thisarg = 3; cons = 0; @@ -586,12 +592,12 @@ SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, return result; } newObj = Tcl_DuplicateObj(Tcl_GetObjResult(interp)); - if (!name) name = Tcl_GetStringFromObj(newObj,NULL); + if (!name) name = Tcl_GetString(newObj); } else if (thisarg > 0) { if (thisarg < objc) { destroy = 0; newObj = Tcl_DuplicateObj(objv[thisarg]); - if (!name) name = Tcl_GetStringFromObj(newObj,NULL); + if (!name) name = Tcl_GetString(newObj); } else { Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); return TCL_ERROR; @@ -613,7 +619,7 @@ SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, if (destroy) { SWIG_Acquire(thisvalue); } - newinst->cmdtok = Tcl_CreateObjCommand(interp,name, (swig_wrapper) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete); + newinst->cmdtok = Tcl_CreateObjCommand(interp,name, (swig_wrapper) SWIG_Tcl_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_Tcl_ObjectDelete); return TCL_OK; } @@ -621,7 +627,7 @@ SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, * Get arguments * -----------------------------------------------------------------------------*/ SWIGRUNTIME int -SWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], const char *fmt, ...) { +SWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], const char *fmt, ...) { int argno = 0, opt = 0; long tempi; double tempd; @@ -650,7 +656,7 @@ SWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], const char vptr = va_arg(ap,void *); if (vptr) { if (isupper(*c)) { - obj = SWIG_Tcl_GetConstantObj(Tcl_GetStringFromObj(objv[argno+1],0)); + obj = SWIG_Tcl_GetConstantObj(Tcl_GetString(objv[argno+1])); if (!obj) obj = objv[argno+1]; } else { obj = objv[argno+1]; @@ -674,15 +680,15 @@ SWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], const char break; case 's': case 'S': if (*(c+1) == '#') { - int *vlptr = (int *) va_arg(ap, void *); + Tcl_Size *vlptr = (Tcl_Size *) va_arg(ap, void *); *((char **) vptr) = Tcl_GetStringFromObj(obj, vlptr); c++; } else { - *((char **)vptr) = Tcl_GetStringFromObj(obj,NULL); + *((char **)vptr) = Tcl_GetString(obj); } break; case 'c': case 'C': - *((char *)vptr) = *(Tcl_GetStringFromObj(obj,NULL)); + *((char *)vptr) = *(Tcl_GetString(obj)); break; case 'p': case 'P': ty = (swig_type_info *) va_arg(ap, void *); @@ -707,11 +713,11 @@ SWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], const char argerror: { char temp[32]; - sprintf(temp,"%d", argno+1); + SWIG_snprintf(temp, sizeof(temp), "%d", argno+1); c = strchr(fmt,':'); if (!c) c = strchr(fmt,';'); if (!c) c = (char *)""; - Tcl_AppendResult(interp,c," argument ", temp, NULL); + Tcl_AppendResult(interp,c," argument ", temp, (char *)NULL); va_end(ap); return TCL_ERROR; } diff --git a/usr/share/swig/4.1.1/tcl/tclruntime.swg b/usr/share/swig/4.2.1/tcl/tclruntime.swg similarity index 56% rename from usr/share/swig/4.1.1/tcl/tclruntime.swg rename to usr/share/swig/4.2.1/tcl/tclruntime.swg index bb4edd74545..3b34a76c000 100644 --- a/usr/share/swig/4.1.1/tcl/tclruntime.swg +++ b/usr/share/swig/4.2.1/tcl/tclruntime.swg @@ -6,6 +6,22 @@ #include #include #include + +/* Check, if Tcl version supports Tcl_Size, + which was introduced in Tcl 8.7 and 9. +*/ +#ifndef TCL_SIZE_MAX + #include + #define TCL_SIZE_MAX INT_MAX + + #ifndef Tcl_Size + typedef int Tcl_Size; + #endif + + #define TCL_SIZE_MODIFIER "" + #define Tcl_GetSizeIntFromObj Tcl_GetIntFromObj + #define Tcl_NewSizeIntObj Tcl_NewIntObj +#endif %} %insert(runtime) "swigrun.swg"; /* Common C API type-checking code */ diff --git a/usr/share/swig/4.1.1/tcl/tclsh.i b/usr/share/swig/4.2.1/tcl/tclsh.i similarity index 68% rename from usr/share/swig/4.1.1/tcl/tclsh.i rename to usr/share/swig/4.2.1/tcl/tclsh.i index 21dc35af315..e908756c194 100644 --- a/usr/share/swig/4.1.1/tcl/tclsh.i +++ b/usr/share/swig/4.2.1/tcl/tclsh.i @@ -4,20 +4,15 @@ * SWIG File for building new tclsh program * ----------------------------------------------------------------------------- */ -#ifdef AUTODOC -%subsection "tclsh.i" -%text %{ -This module provides the Tcl_AppInit() function needed to build a -new version of the tclsh executable. This file should not be used -when using dynamic loading. To make an interface file work with -both static and dynamic loading, put something like this in your -interface file : - - #ifdef STATIC - %include - #endif -%} -#endif +// This module provides the Tcl_AppInit() function needed to build a +// new version of the tclsh executable. This file should not be used +// when using dynamic loading. To make an interface file work with +// both static and dynamic loading, put something like this in your +// interface file : +// +// #ifdef STATIC +// %include +// #endif %{ diff --git a/usr/share/swig/4.1.1/tcl/tclstrings.swg b/usr/share/swig/4.2.1/tcl/tclstrings.swg similarity index 85% rename from usr/share/swig/4.1.1/tcl/tclstrings.swg rename to usr/share/swig/4.2.1/tcl/tclstrings.swg index 540d6270eb2..738c8136296 100644 --- a/usr/share/swig/4.1.1/tcl/tclstrings.swg +++ b/usr/share/swig/4.2.1/tcl/tclstrings.swg @@ -6,7 +6,7 @@ SWIGINTERN int SWIG_AsCharPtrAndSize(Tcl_Obj *obj, char** cptr, size_t* psize, int *alloc) { - int len = 0; + Tcl_Size len = 0; char *cstr = Tcl_GetStringFromObj(obj, &len); if (cstr) { if (cptr) *cptr = cstr; @@ -24,7 +24,7 @@ SWIG_AsCharPtrAndSize(Tcl_Obj *obj, char** cptr, size_t* psize, int *alloc) SWIGINTERNINLINE Tcl_Obj * SWIG_FromCharPtrAndSize(const char* carray, size_t size) { - return (size < INT_MAX) ? Tcl_NewStringObj(carray, %numeric_cast(size,int)) : NULL; + return (size < TCL_SIZE_MAX) ? Tcl_NewStringObj(carray, %numeric_cast(size,Tcl_Size)) : NULL; } } diff --git a/usr/share/swig/4.1.1/tcl/tcltypemaps.swg b/usr/share/swig/4.2.1/tcl/tcltypemaps.swg similarity index 100% rename from usr/share/swig/4.1.1/tcl/tcltypemaps.swg rename to usr/share/swig/4.2.1/tcl/tcltypemaps.swg diff --git a/usr/share/swig/4.1.1/tcl/tcluserdir.swg b/usr/share/swig/4.2.1/tcl/tcluserdir.swg similarity index 100% rename from usr/share/swig/4.1.1/tcl/tcluserdir.swg rename to usr/share/swig/4.2.1/tcl/tcluserdir.swg diff --git a/usr/share/swig/4.1.1/tcl/tclwstrings.swg b/usr/share/swig/4.2.1/tcl/tclwstrings.swg similarity index 82% rename from usr/share/swig/4.1.1/tcl/tclwstrings.swg rename to usr/share/swig/4.2.1/tcl/tclwstrings.swg index 09374c54fac..76da2ab0887 100644 --- a/usr/share/swig/4.1.1/tcl/tclwstrings.swg +++ b/usr/share/swig/4.2.1/tcl/tclwstrings.swg @@ -12,14 +12,14 @@ SWIGINTERN int SWIG_AsWCharPtrAndSize(Tcl_Obj *obj, wchar_t** cptr, size_t* psize, int *alloc) { - int len = 0; + Tcl_Size len = 0; Tcl_UniChar *ustr = Tcl_GetUnicodeFromObj(obj, &len); if (ustr) { if (cptr) { Tcl_Encoding encoding = NULL; char *src = (char *) ustr; - int srcLen = (len)*sizeof(Tcl_UniChar); - int dstLen = sizeof(wchar_t)*(len + 1); + Tcl_Size srcLen = (len)*sizeof(Tcl_UniChar); + Tcl_Size dstLen = sizeof(wchar_t)*(len + 1); char *dst = %new_array(dstLen, char); int flags = 0; Tcl_EncodingState *statePtr = 0; @@ -44,11 +44,11 @@ SWIGINTERNINLINE Tcl_Obj * SWIG_FromWCharPtrAndSize(const wchar_t* carray, size_t size) { Tcl_Obj *res = NULL; - if (size < INT_MAX) { + if (size < TCL_SIZE_MAX) { Tcl_Encoding encoding = NULL; char *src = (char *) carray; - int srcLen = (int)(size*sizeof(wchar_t)); - int dstLen = (int)(size*sizeof(Tcl_UniChar)); + Tcl_Size srcLen = (Tcl_Size)(size*sizeof(wchar_t)); + Tcl_Size dstLen = (Tcl_Size)(size*sizeof(Tcl_UniChar)); char *dst = %new_array(dstLen, char); int flags = 0; Tcl_EncodingState *statePtr = 0; @@ -59,7 +59,7 @@ SWIG_FromWCharPtrAndSize(const wchar_t* carray, size_t size) Tcl_ExternalToUtf(0, encoding, src, srcLen, flags, statePtr, dst, dstLen, &srcRead, &dstWrote, &dstChars); - res = Tcl_NewUnicodeObj((Tcl_UniChar*)dst, (int)size); + res = Tcl_NewUnicodeObj((Tcl_UniChar*)dst, (Tcl_Size)size); %delete_array(dst); } return res; diff --git a/usr/share/swig/4.1.1/tcl/typemaps.i b/usr/share/swig/4.2.1/tcl/typemaps.i similarity index 98% rename from usr/share/swig/4.1.1/tcl/typemaps.i rename to usr/share/swig/4.2.1/tcl/typemaps.i index 04a5c78f395..4f42cfc2a6f 100644 --- a/usr/share/swig/4.1.1/tcl/typemaps.i +++ b/usr/share/swig/4.2.1/tcl/typemaps.i @@ -164,14 +164,14 @@ or you can use the %apply directive : %typemap(in) long long *INPUT($*1_ltype temp), long long &INPUT($*1_ltype temp) { - temp = ($*1_ltype) strtoll(Tcl_GetStringFromObj($input,NULL),0,0); + temp = ($*1_ltype) strtoll(Tcl_GetString($input),0,0); $1 = &temp; } %typemap(in) unsigned long long *INPUT($*1_ltype temp), unsigned long long &INPUT($*1_ltype temp) { - temp = ($*1_ltype) strtoull(Tcl_GetStringFromObj($input,NULL),0,0); + temp = ($*1_ltype) strtoull(Tcl_GetString($input),0,0); $1 = &temp; } @@ -275,7 +275,7 @@ output values. { char temp[256]; Tcl_Obj *o; - sprintf(temp,"%lld",(long long)*($1)); + SWIG_snprintf(temp,sizeof(temp),"%lld",(long long)*($1)); o = Tcl_NewStringObj(temp,-1); Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); } @@ -284,7 +284,7 @@ output values. { char temp[256]; Tcl_Obj *o; - sprintf(temp,"%llu",(unsigned long long)*($1)); + SWIG_snprintf(temp,sizeof(temp),"%llu",(unsigned long long)*($1)); o = Tcl_NewStringObj(temp,-1); Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),o); } diff --git a/usr/share/swig/4.1.1/tcl/wish.i b/usr/share/swig/4.2.1/tcl/wish.i similarity index 79% rename from usr/share/swig/4.1.1/tcl/wish.i rename to usr/share/swig/4.2.1/tcl/wish.i index 42902850d01..6969b2ac5db 100644 --- a/usr/share/swig/4.1.1/tcl/wish.i +++ b/usr/share/swig/4.2.1/tcl/wish.i @@ -4,25 +4,20 @@ * SWIG File for making wish * ----------------------------------------------------------------------------- */ -#ifdef AUTODOC -%subsection "wish.i" -%text %{ -This module provides the Tk_AppInit() function needed to build a -new version of the wish executable. Like tclsh.i, this file should -not be used with dynamic loading. To make an interface file work with -both static and dynamic loading, put something like this in your -interface file : - - #ifdef STATIC - %include - #endif - -A startup file may be specified by defining the symbol SWIG_RcFileName -as follows (this should be included in a code-block) : - - #define SWIG_RcFileName "~/.mywishrc" -%} -#endif +// This module provides the Tk_AppInit() function needed to build a +// new version of the wish executable. Like tclsh.i, this file should +// not be used with dynamic loading. To make an interface file work with +// both static and dynamic loading, put something like this in your +// interface file : +// +// #ifdef STATIC +// %include +// #endif +// +// A startup file may be specified by defining the symbol SWIG_RcFileName +// as follows (this should be included in a code-block) : +// +// #define SWIG_RcFileName "~/.mywishrc" %{ diff --git a/usr/share/swig/4.1.1/typemaps/attribute.swg b/usr/share/swig/4.2.1/typemaps/attribute.swg similarity index 90% rename from usr/share/swig/4.1.1/typemaps/attribute.swg rename to usr/share/swig/4.2.1/typemaps/attribute.swg index 7d4767f52b7..abdf44dfdc7 100644 --- a/usr/share/swig/4.1.1/typemaps/attribute.swg +++ b/usr/share/swig/4.2.1/typemaps/attribute.swg @@ -102,16 +102,6 @@ #endif %enddef -// deprecated (same as %attributeref, but there is an argument order inconsistency) -%define %attribute_ref(Class, AttributeType, AccessorMethod, AttributeName...) - #if #AttributeName != "" - %attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, AccessorMethod, AccessorMethod, self_->AccessorMethod(), self_->AccessorMethod() = val_) - #else - %attribute_custom(%arg(Class), %arg(AttributeType), AccessorMethod, AccessorMethod, AccessorMethod, self_->AccessorMethod(), self_->AccessorMethod() = val_) - #endif -%enddef - - %define %attributeval(Class, AttributeType, AttributeName, GetMethod, SetMethod...) %{ #define %mangle(Class) ##_## AttributeName ## _get(self_) new AttributeType(self_->GetMethod()) diff --git a/usr/share/swig/4.1.1/typemaps/carrays.swg b/usr/share/swig/4.2.1/typemaps/carrays.swg similarity index 89% rename from usr/share/swig/4.1.1/typemaps/carrays.swg rename to usr/share/swig/4.2.1/typemaps/carrays.swg index 462d60bc2c5..d02e70fab30 100644 --- a/usr/share/swig/4.1.1/typemaps/carrays.swg +++ b/usr/share/swig/4.2.1/typemaps/carrays.swg @@ -11,10 +11,10 @@ * Generates functions for creating and accessing elements of a C array * (as pointers). Creates the following functions: * - * TYPE *new_NAME(int nelements) + * TYPE *new_NAME(size_t nelements) * void delete_NAME(TYPE *); - * TYPE NAME_getitem(TYPE *, int index); - * void NAME_setitem(TYPE *, int index, TYPE value); + * TYPE NAME_getitem(TYPE *, size_t index); + * void NAME_setitem(TYPE *, size_t index, TYPE value); * * ----------------------------------------------------------------------------- */ @@ -51,10 +51,10 @@ void NAME##_setitem(TYPE *ary, size_t index, TYPE value); * interface: * * struct NAME { - * NAME(int nelements); + * NAME(size_t nelements); * ~NAME(); - * TYPE getitem(int index); - * void setitem(int index, TYPE value); + * TYPE getitem(size_t index); + * void setitem(size_t index, TYPE value); * TYPE * cast(); * static NAME *frompointer(TYPE *t); * } diff --git a/usr/share/swig/4.1.1/typemaps/cdata.swg b/usr/share/swig/4.2.1/typemaps/cdata.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/cdata.swg rename to usr/share/swig/4.2.1/typemaps/cdata.swg diff --git a/usr/share/swig/4.1.1/typemaps/cmalloc.swg b/usr/share/swig/4.2.1/typemaps/cmalloc.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/cmalloc.swg rename to usr/share/swig/4.2.1/typemaps/cmalloc.swg diff --git a/usr/share/swig/4.1.1/typemaps/cpointer.swg b/usr/share/swig/4.2.1/typemaps/cpointer.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/cpointer.swg rename to usr/share/swig/4.2.1/typemaps/cpointer.swg diff --git a/usr/share/swig/4.1.1/typemaps/cstring.swg b/usr/share/swig/4.2.1/typemaps/cstring.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/cstring.swg rename to usr/share/swig/4.2.1/typemaps/cstring.swg diff --git a/usr/share/swig/4.1.1/typemaps/cstrings.swg b/usr/share/swig/4.2.1/typemaps/cstrings.swg similarity index 97% rename from usr/share/swig/4.1.1/typemaps/cstrings.swg rename to usr/share/swig/4.2.1/typemaps/cstrings.swg index 42ce4d9bb7a..7a7e2c1f969 100644 --- a/usr/share/swig/4.1.1/typemaps/cstrings.swg +++ b/usr/share/swig/4.2.1/typemaps/cstrings.swg @@ -50,7 +50,7 @@ * * %cstring_bounded_output(Char *outx, 512); * void foo(Char *outx) { - * sprintf(outx,"blah blah\n"); + * strcpy(outx,"blah blah\n"); * } * */ @@ -175,7 +175,7 @@ * * %cstring_output_maxsize(Char *outx, int max) { * void foo(Char *outx, int max) { - * sprintf(outx,"blah blah\n"); + * strcpy(outx,"blah blah\n"); * } */ @@ -205,7 +205,7 @@ * * %cstring_output_withsize(Char *outx, int *max) { * void foo(Char *outx, int *max) { - * sprintf(outx,"blah blah\n"); + * strcpy(outx,"blah blah\n"); * *max = strlen(outx); * } */ @@ -239,7 +239,7 @@ * %cstring_output_allocate(Char **outx, free($1)); * void foo(Char **outx) { * *outx = (Char *) malloc(512); - * sprintf(outx,"blah blah\n"); + * strcpy(outx,"blah blah\n"); * } */ @@ -266,7 +266,7 @@ * %cstring_output_allocate_size(Char **outx, int *sz, free($1)); * void foo(Char **outx, int *sz) { * *outx = (Char *) malloc(512); - * sprintf(outx,"blah blah\n"); + * strcpy(outx,"blah blah\n"); * *sz = strlen(outx); * } */ diff --git a/usr/share/swig/4.1.1/typemaps/cwstring.swg b/usr/share/swig/4.2.1/typemaps/cwstring.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/cwstring.swg rename to usr/share/swig/4.2.1/typemaps/cwstring.swg diff --git a/usr/share/swig/4.1.1/typemaps/enumint.swg b/usr/share/swig/4.2.1/typemaps/enumint.swg similarity index 99% rename from usr/share/swig/4.1.1/typemaps/enumint.swg rename to usr/share/swig/4.2.1/typemaps/enumint.swg index d048bb6bf70..b7e2956a267 100644 --- a/usr/share/swig/4.1.1/typemaps/enumint.swg +++ b/usr/share/swig/4.2.1/typemaps/enumint.swg @@ -29,7 +29,7 @@ %typemap(varin,fragment=SWIG_AsVal_frag(int),noblock=1) enum SWIGTYPE { if (sizeof(int) != sizeof($1)) { %variable_fail(SWIG_AttributeError,"$type", "arch, read-only $name"); - } else { + } else { int ecode = SWIG_AsVal(int)($input, %reinterpret_cast(&$1,int*)); if (!SWIG_IsOK(ecode)) { %variable_fail(ecode, "$type", "$name"); diff --git a/usr/share/swig/4.1.1/typemaps/exception.swg b/usr/share/swig/4.2.1/typemaps/exception.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/exception.swg rename to usr/share/swig/4.2.1/typemaps/exception.swg diff --git a/usr/share/swig/4.1.1/typemaps/factory.swg b/usr/share/swig/4.2.1/typemaps/factory.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/factory.swg rename to usr/share/swig/4.2.1/typemaps/factory.swg diff --git a/usr/share/swig/4.1.1/typemaps/fragments.swg b/usr/share/swig/4.2.1/typemaps/fragments.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/fragments.swg rename to usr/share/swig/4.2.1/typemaps/fragments.swg diff --git a/usr/share/swig/4.1.1/typemaps/implicit.swg b/usr/share/swig/4.2.1/typemaps/implicit.swg similarity index 98% rename from usr/share/swig/4.1.1/typemaps/implicit.swg rename to usr/share/swig/4.2.1/typemaps/implicit.swg index 2fc3108e7c6..5536e0a22d0 100644 --- a/usr/share/swig/4.1.1/typemaps/implicit.swg +++ b/usr/share/swig/4.2.1/typemaps/implicit.swg @@ -27,7 +27,7 @@ get(2.0) ==> get(A(2.0)) get(B()) ==> get(A(B())) - and swig will construct an 'A' temporal variable using the + and swig will construct an 'A' temporary variable using the corresponding implicit constructor. diff --git a/usr/share/swig/4.1.1/typemaps/inoutlist.swg b/usr/share/swig/4.2.1/typemaps/inoutlist.swg similarity index 98% rename from usr/share/swig/4.1.1/typemaps/inoutlist.swg rename to usr/share/swig/4.2.1/typemaps/inoutlist.swg index 23fda85f3a8..6c7604a99ab 100644 --- a/usr/share/swig/4.1.1/typemaps/inoutlist.swg +++ b/usr/share/swig/4.2.1/typemaps/inoutlist.swg @@ -221,10 +221,6 @@ this : x = neg(x) -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - */ %define %_value_inout_typemap(Type) diff --git a/usr/share/swig/4.1.1/typemaps/misctypes.swg b/usr/share/swig/4.2.1/typemaps/misctypes.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/misctypes.swg rename to usr/share/swig/4.2.1/typemaps/misctypes.swg diff --git a/usr/share/swig/4.1.1/typemaps/primtypes.swg b/usr/share/swig/4.2.1/typemaps/primtypes.swg similarity index 98% rename from usr/share/swig/4.1.1/typemaps/primtypes.swg rename to usr/share/swig/4.2.1/typemaps/primtypes.swg index dd80eb775e3..85a0b8d9b8e 100644 --- a/usr/share/swig/4.1.1/typemaps/primtypes.swg +++ b/usr/share/swig/4.2.1/typemaps/primtypes.swg @@ -252,9 +252,11 @@ SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max) { double x = *d; if ((min <= x && x <= max)) { - double fx = floor(x); - double cx = ceil(x); - double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ + double fx, cx, rd; + errno = 0; + fx = floor(x); + cx = ceil(x); + rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ if ((errno == EDOM) || (errno == ERANGE)) { errno = 0; } else { diff --git a/usr/share/swig/4.1.1/typemaps/ptrtypes.swg b/usr/share/swig/4.2.1/typemaps/ptrtypes.swg similarity index 86% rename from usr/share/swig/4.1.1/typemaps/ptrtypes.swg rename to usr/share/swig/4.2.1/typemaps/ptrtypes.swg index ca54fcdc265..8619b31800e 100644 --- a/usr/share/swig/4.1.1/typemaps/ptrtypes.swg +++ b/usr/share/swig/4.2.1/typemaps/ptrtypes.swg @@ -183,14 +183,34 @@ %ptr_input_typemap(%arg(CheckCode),%arg(AsPtrMeth),%arg(AsPtrFrag),Type); %enddef +/*--------------------------------------------------------------------- + * typemap definition for types with from method for ptr types + * Same as typemaps_from but without varout typemap + *---------------------------------------------------------------------*/ + +%define %ptr_typemaps_from(FromMeth, FromFrag, Type...) + %value_out_typemap(%arg(FromMeth), %arg(FromFrag), Type); + /* No varout typemap */ + %value_constcode_typemap(%arg(FromMeth), %arg(FromFrag), Type); + %value_directorin_typemap(%arg(FromMeth), %arg(FromFrag), Type); + %value_throws_typemap(%arg(FromMeth), %arg(FromFrag), Type); + %value_output_typemap(%arg(FromMeth), %arg(FromFrag), Type); +%enddef + /*--------------------------------------------------------------------- * typemap definition for types with asptr/from methods *---------------------------------------------------------------------*/ %define %typemaps_asptrfrom(CheckCode, AsPtrMeth, FromMeth, AsPtrFrag, FromFrag, Type...) + %typemaps_asptr(%arg(CheckCode), %arg(AsPtrMeth), %arg(AsPtrFrag), Type) + %ptr_typemaps_from(%arg(FromMeth), %arg(FromFrag), Type); + %ptr_inout_typemap(Type); +%enddef + +// Same as typemaps_asptrfrom but defines a varout typemap to wrap with value semantics instead of the default pointer semantics +%define %_typemaps_asptrfrom(CheckCode, AsPtrMeth, FromMeth, AsPtrFrag, FromFrag, Type...) %typemaps_asptr(%arg(CheckCode), %arg(AsPtrMeth), %arg(AsPtrFrag), Type) %typemaps_from(%arg(FromMeth), %arg(FromFrag), Type); - %value_output_typemap(%arg(FromMeth), %arg(FromFrag), Type); %ptr_inout_typemap(Type); %enddef @@ -199,7 +219,7 @@ *---------------------------------------------------------------------*/ %define %typemaps_asptrfromn(CheckCode, Type...) -%typemaps_asptrfrom(%arg(CheckCode), +%_typemaps_asptrfrom(%arg(CheckCode), %arg(SWIG_AsPtr(Type)), %arg(SWIG_From(Type)), %arg(SWIG_AsPtr_frag(Type)), diff --git a/usr/share/swig/4.1.1/typemaps/std_except.swg b/usr/share/swig/4.2.1/typemaps/std_except.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/std_except.swg rename to usr/share/swig/4.2.1/typemaps/std_except.swg diff --git a/usr/share/swig/4.1.1/typemaps/std_string.swg b/usr/share/swig/4.2.1/typemaps/std_string.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/std_string.swg rename to usr/share/swig/4.2.1/typemaps/std_string.swg diff --git a/usr/share/swig/4.2.1/typemaps/std_string_view.swg b/usr/share/swig/4.2.1/typemaps/std_string_view.swg new file mode 100644 index 00000000000..24f57c6c007 --- /dev/null +++ b/usr/share/swig/4.2.1/typemaps/std_string_view.swg @@ -0,0 +1,16 @@ +// +// string_view +// + + +%include + +%fragment(""); + +namespace std +{ + %naturalvar string_view; + class string_view; +} + +%typemaps_std_string_view(std::string_view, char, SWIG_AsCharPtrAndSize, SWIG_FromCharPtrAndSize, %checkcode(STRINGVIEW)); diff --git a/usr/share/swig/4.1.1/typemaps/std_strings.swg b/usr/share/swig/4.2.1/typemaps/std_strings.swg similarity index 71% rename from usr/share/swig/4.1.1/typemaps/std_strings.swg rename to usr/share/swig/4.2.1/typemaps/std_strings.swg index e9c23ba9158..842545826e6 100644 --- a/usr/share/swig/4.1.1/typemaps/std_strings.swg +++ b/usr/share/swig/4.2.1/typemaps/std_strings.swg @@ -45,6 +45,16 @@ SWIG_From_dec(String)(const String& s) } %enddef +%define %std_string_view_from(String, SWIG_FromCharPtrAndSize, Frag) +%fragment(SWIG_From_frag(String),"header",fragment=Frag) { +SWIGINTERNINLINE SWIG_Object +SWIG_From_dec(String)(const String& s) +{ + return SWIG_FromCharPtrAndSize(s.data() ? s.data() : "", s.size()); +} +} +%enddef + %define %std_string_asval(String) %fragment(SWIG_AsVal_frag(String),"header", fragment=SWIG_AsPtr_frag(String)) { SWIGINTERN int @@ -76,3 +86,18 @@ SWIG_AsVal_dec(String)(SWIG_Object obj, String *val) %typemaps_asptrfromn(%arg(CheckCode), String); %enddef + + +/* An empty string_view returns NULL from data() but SWIG_FromCharPtrAndSize() + * implementations treat that as invalid and return None/Null/undef or similar + * in the target language so we can't just use %typemaps_std_string. + */ +%define %typemaps_std_string_view(String, Char, AsPtrMethod, FromMethod, CheckCode) + +%std_string_asptr(String, Char, AsPtrMethod, #AsPtrMethod) +%std_string_asval(String) +%std_string_view_from(String, FromMethod, #FromMethod) + +%typemaps_asptrfromn(%arg(CheckCode), String); + +%enddef diff --git a/usr/share/swig/4.1.1/typemaps/std_wstring.swg b/usr/share/swig/4.2.1/typemaps/std_wstring.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/std_wstring.swg rename to usr/share/swig/4.2.1/typemaps/std_wstring.swg diff --git a/usr/share/swig/4.1.1/typemaps/string.swg b/usr/share/swig/4.2.1/typemaps/string.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/string.swg rename to usr/share/swig/4.2.1/typemaps/string.swg diff --git a/usr/share/swig/4.1.1/typemaps/strings.swg b/usr/share/swig/4.2.1/typemaps/strings.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/strings.swg rename to usr/share/swig/4.2.1/typemaps/strings.swg diff --git a/usr/share/swig/4.1.1/typemaps/swigmacros.swg b/usr/share/swig/4.2.1/typemaps/swigmacros.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/swigmacros.swg rename to usr/share/swig/4.2.1/typemaps/swigmacros.swg diff --git a/usr/share/swig/4.1.1/typemaps/swigmove.swg b/usr/share/swig/4.2.1/typemaps/swigmove.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/swigmove.swg rename to usr/share/swig/4.2.1/typemaps/swigmove.swg diff --git a/usr/share/swig/4.1.1/typemaps/swigobject.swg b/usr/share/swig/4.2.1/typemaps/swigobject.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/swigobject.swg rename to usr/share/swig/4.2.1/typemaps/swigobject.swg diff --git a/usr/share/swig/4.1.1/typemaps/swigtype.swg b/usr/share/swig/4.2.1/typemaps/swigtype.swg similarity index 97% rename from usr/share/swig/4.1.1/typemaps/swigtype.swg rename to usr/share/swig/4.2.1/typemaps/swigtype.swg index 69f83794d23..ba8ce3c1f8f 100644 --- a/usr/share/swig/4.1.1/typemaps/swigtype.swg +++ b/usr/share/swig/4.2.1/typemaps/swigtype.swg @@ -172,12 +172,8 @@ if ($input) { size_t ii = 0; for (; ii < (size_t)$1_dim0; ++ii) { - if ($input[ii]) { - size_t jj = 0; - for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = $input[ii][jj]; - } else { - %variable_nullref("$type","$name"); - } + size_t jj = 0; + for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = $input[ii][jj]; } } else { %variable_nullref("$type","$name"); @@ -188,12 +184,8 @@ if ($input) { size_t ii = 0; for (; ii < (size_t)$1_dim0; ++ii) { - if ($input[ii]) { - size_t jj = 0; - for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = $input[ii][jj]; - } else { - %variable_nullref("$type","$name"); - } + size_t jj = 0; + for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = $input[ii][jj]; } } else { %variable_nullref("$type","$name"); @@ -208,12 +200,8 @@ } else if (inp) { size_t ii = 0; for (; ii < (size_t)$1_dim0; ++ii) { - if (inp[ii]) { - size_t jj = 0; - for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = inp[ii][jj]; - } else { - %variable_nullref("$type", "$name"); - } + size_t jj = 0; + for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = inp[ii][jj]; } } else { %variable_nullref("$type", "$name"); diff --git a/usr/share/swig/4.1.1/typemaps/swigtypemaps.swg b/usr/share/swig/4.2.1/typemaps/swigtypemaps.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/swigtypemaps.swg rename to usr/share/swig/4.2.1/typemaps/swigtypemaps.swg diff --git a/usr/share/swig/4.1.1/typemaps/typemaps.swg b/usr/share/swig/4.2.1/typemaps/typemaps.swg similarity index 96% rename from usr/share/swig/4.1.1/typemaps/typemaps.swg rename to usr/share/swig/4.2.1/typemaps/typemaps.swg index 4629e8dfa0f..7d013b045d9 100644 --- a/usr/share/swig/4.1.1/typemaps/typemaps.swg +++ b/usr/share/swig/4.2.1/typemaps/typemaps.swg @@ -140,10 +140,6 @@ to a Tcl variable you might do this : x = neg(x) -Note : previous versions of SWIG used the symbol 'BOTH' to mark -input/output arguments. This is still supported, but will be slowly -phased out in future releases. - */ diff --git a/usr/share/swig/4.1.1/typemaps/valtypes.swg b/usr/share/swig/4.2.1/typemaps/valtypes.swg similarity index 99% rename from usr/share/swig/4.1.1/typemaps/valtypes.swg rename to usr/share/swig/4.2.1/typemaps/valtypes.swg index f2f34acfca4..7623ff049b0 100644 --- a/usr/share/swig/4.1.1/typemaps/valtypes.swg +++ b/usr/share/swig/4.2.1/typemaps/valtypes.swg @@ -180,6 +180,7 @@ /*--------------------------------------------------------------------- * typemap definition for types with from method *---------------------------------------------------------------------*/ + %define %typemaps_from(FromMeth, FromFrag, Type...) %value_out_typemap(%arg(FromMeth), %arg(FromFrag), Type); %value_varout_typemap(%arg(FromMeth), %arg(FromFrag), Type); @@ -191,7 +192,7 @@ /*--------------------------------------------------------------------- - * typemap definition for types with alval/from method + * typemap definition for types with asval/from method *---------------------------------------------------------------------*/ %define %typemaps_asvalfrom(CheckCode, AsValMeth, FromMeth, diff --git a/usr/share/swig/4.1.1/typemaps/void.swg b/usr/share/swig/4.2.1/typemaps/void.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/void.swg rename to usr/share/swig/4.2.1/typemaps/void.swg diff --git a/usr/share/swig/4.1.1/typemaps/wstring.swg b/usr/share/swig/4.2.1/typemaps/wstring.swg similarity index 100% rename from usr/share/swig/4.1.1/typemaps/wstring.swg rename to usr/share/swig/4.2.1/typemaps/wstring.swg diff --git a/usr/share/swig/4.1.1/wchar.i b/usr/share/swig/4.2.1/wchar.i similarity index 100% rename from usr/share/swig/4.1.1/wchar.i rename to usr/share/swig/4.2.1/wchar.i diff --git a/usr/share/swig/4.1.1/windows.i b/usr/share/swig/4.2.1/windows.i similarity index 100% rename from usr/share/swig/4.1.1/windows.i rename to usr/share/swig/4.2.1/windows.i diff --git a/usr/share/swig/4.1.1/xml/typemaps.i b/usr/share/swig/4.2.1/xml/typemaps.i similarity index 100% rename from usr/share/swig/4.1.1/xml/typemaps.i rename to usr/share/swig/4.2.1/xml/typemaps.i diff --git a/usr/share/swig/4.1.1/xml/xml.swg b/usr/share/swig/4.2.1/xml/xml.swg similarity index 100% rename from usr/share/swig/4.1.1/xml/xml.swg rename to usr/share/swig/4.2.1/xml/xml.swg diff --git a/var/lib/pacman/local/libsasl-2.1.28-3/mtree b/var/lib/pacman/local/libsasl-2.1.28-3/mtree deleted file mode 100644 index d15c37dcff6..00000000000 Binary files a/var/lib/pacman/local/libsasl-2.1.28-3/mtree and /dev/null differ diff --git a/var/lib/pacman/local/libsasl-2.1.28-3/desc b/var/lib/pacman/local/libsasl-2.1.28-4/desc similarity index 79% rename from var/lib/pacman/local/libsasl-2.1.28-3/desc rename to var/lib/pacman/local/libsasl-2.1.28-4/desc index a313d3e5605..4fdf2b82e62 100644 --- a/var/lib/pacman/local/libsasl-2.1.28-3/desc +++ b/var/lib/pacman/local/libsasl-2.1.28-4/desc @@ -2,7 +2,7 @@ libsasl %VERSION% -2.1.28-3 +2.1.28-4 %BASE% cyrus-sasl @@ -17,16 +17,16 @@ https://www.cyrusimap.org/sasl/ x86_64 %BUILDDATE% -1689274558 +1712696631 %INSTALLDATE% -1689391431 +1712804384 %PACKAGER% -CI (msys2/msys2-autobuild/95ab14df/5546485341) +CI (msys2/msys2-autobuild/8d08599c/8622221778) %SIZE% -453138 +448530 %REASON% 1 diff --git a/var/lib/pacman/local/libsasl-2.1.28-3/files b/var/lib/pacman/local/libsasl-2.1.28-4/files similarity index 100% rename from var/lib/pacman/local/libsasl-2.1.28-3/files rename to var/lib/pacman/local/libsasl-2.1.28-4/files diff --git a/var/lib/pacman/local/libsasl-2.1.28-4/mtree b/var/lib/pacman/local/libsasl-2.1.28-4/mtree new file mode 100644 index 00000000000..3d0f029c980 Binary files /dev/null and b/var/lib/pacman/local/libsasl-2.1.28-4/mtree differ diff --git a/var/lib/pacman/local/libsqlite-3.45.1-1/mtree b/var/lib/pacman/local/libsqlite-3.45.1-1/mtree deleted file mode 100644 index 434d17a7d35..00000000000 Binary files a/var/lib/pacman/local/libsqlite-3.45.1-1/mtree and /dev/null differ diff --git a/var/lib/pacman/local/libsqlite-3.45.1-1/desc b/var/lib/pacman/local/libsqlite-3.45.2-1/desc similarity index 76% rename from var/lib/pacman/local/libsqlite-3.45.1-1/desc rename to var/lib/pacman/local/libsqlite-3.45.2-1/desc index 50e7d1f97bc..cbc879d6bb0 100644 --- a/var/lib/pacman/local/libsqlite-3.45.1-1/desc +++ b/var/lib/pacman/local/libsqlite-3.45.2-1/desc @@ -2,7 +2,7 @@ libsqlite %VERSION% -3.45.1-1 +3.45.2-1 %BASE% sqlite @@ -17,16 +17,16 @@ https://www.sqlite.org/ x86_64 %BUILDDATE% -1706818792 +1712511236 %INSTALLDATE% -1706929170 +1712804384 %PACKAGER% -CI (msys2/msys2-autobuild/b78070c6/7747131153) +CI (msys2/msys2-autobuild/8d08599c/8590405538) %SIZE% -1426347 +1427371 %REASON% 1 @@ -47,5 +47,5 @@ sqlite-rbu<3.33.0 sqlite-vfslog<3.33.0 %PROVIDES% -libsqlite=3.45.1 +libsqlite=3.45.2 diff --git a/var/lib/pacman/local/libsqlite-3.45.1-1/files b/var/lib/pacman/local/libsqlite-3.45.2-1/files similarity index 100% rename from var/lib/pacman/local/libsqlite-3.45.1-1/files rename to var/lib/pacman/local/libsqlite-3.45.2-1/files diff --git a/var/lib/pacman/local/libsqlite-3.45.2-1/mtree b/var/lib/pacman/local/libsqlite-3.45.2-1/mtree new file mode 100644 index 00000000000..7538792b03e Binary files /dev/null and b/var/lib/pacman/local/libsqlite-3.45.2-1/mtree differ diff --git a/var/lib/pacman/local/lndir-1.0.4-2/mtree b/var/lib/pacman/local/lndir-1.0.4-2/mtree deleted file mode 100644 index 2df4bcf5d34..00000000000 Binary files a/var/lib/pacman/local/lndir-1.0.4-2/mtree and /dev/null differ diff --git a/var/lib/pacman/local/lndir-1.0.4-2/desc b/var/lib/pacman/local/lndir-1.0.5-1/desc similarity index 77% rename from var/lib/pacman/local/lndir-1.0.4-2/desc rename to var/lib/pacman/local/lndir-1.0.5-1/desc index 5455abd16ea..f03ef4ab3b8 100644 --- a/var/lib/pacman/local/lndir-1.0.4-2/desc +++ b/var/lib/pacman/local/lndir-1.0.5-1/desc @@ -2,7 +2,7 @@ lndir %VERSION% -1.0.4-2 +1.0.5-1 %BASE% lndir @@ -17,13 +17,13 @@ https://xorg.freedesktop.org/ x86_64 %BUILDDATE% -1684512838 +1712512296 %INSTALLDATE% -1684551627 +1712804384 %PACKAGER% -CI (msys2/msys2-autobuild/dfc132af/5026133359) +CI (msys2/msys2-autobuild/8d08599c/8590405538) %SIZE% 17574 diff --git a/var/lib/pacman/local/lndir-1.0.4-2/files b/var/lib/pacman/local/lndir-1.0.5-1/files similarity index 100% rename from var/lib/pacman/local/lndir-1.0.4-2/files rename to var/lib/pacman/local/lndir-1.0.5-1/files diff --git a/var/lib/pacman/local/lndir-1.0.5-1/mtree b/var/lib/pacman/local/lndir-1.0.5-1/mtree new file mode 100644 index 00000000000..eefe47947c9 Binary files /dev/null and b/var/lib/pacman/local/lndir-1.0.5-1/mtree differ diff --git a/var/lib/pacman/local/mingw-w64-x86_64-git-extra-1.1.636.2db97b993-1/desc b/var/lib/pacman/local/mingw-w64-x86_64-git-extra-1.1.636.2db97b993-1/desc index 78602f368f7..dcb533576c2 100644 --- a/var/lib/pacman/local/mingw-w64-x86_64-git-extra-1.1.636.2db97b993-1/desc +++ b/var/lib/pacman/local/mingw-w64-x86_64-git-extra-1.1.636.2db97b993-1/desc @@ -20,7 +20,7 @@ any 1682971619 %INSTALLDATE% -1712545197 +1712804392 %PACKAGER% Johannes Schindelin diff --git a/var/lib/pacman/local/pacman-6.0.2-13/mtree b/var/lib/pacman/local/pacman-6.0.2-13/mtree deleted file mode 100644 index 1e6ecabc0f6..00000000000 Binary files a/var/lib/pacman/local/pacman-6.0.2-13/mtree and /dev/null differ diff --git a/var/lib/pacman/local/pacman-6.0.2-13/desc b/var/lib/pacman/local/pacman-6.0.2-14/desc similarity index 80% rename from var/lib/pacman/local/pacman-6.0.2-13/desc rename to var/lib/pacman/local/pacman-6.0.2-14/desc index 7dbeddb749f..9e29a55e251 100644 --- a/var/lib/pacman/local/pacman-6.0.2-13/desc +++ b/var/lib/pacman/local/pacman-6.0.2-14/desc @@ -2,7 +2,7 @@ pacman %VERSION% -6.0.2-13 +6.0.2-14 %BASE% pacman @@ -17,16 +17,16 @@ https://www.archlinux.org/pacman/ x86_64 %BUILDDATE% -1705860466 +1712514311 %INSTALLDATE% -1705978756 +1712804379 %PACKAGER% -CI (msys2/msys2-autobuild/1c45f2ab/7602918660) +CI (msys2/msys2-autobuild/8d08599c/8590755033) %SIZE% -41930763 +41939288 %LICENSE% spdx:GPL-2.0-or-later diff --git a/var/lib/pacman/local/pacman-6.0.2-13/files b/var/lib/pacman/local/pacman-6.0.2-14/files similarity index 99% rename from var/lib/pacman/local/pacman-6.0.2-13/files rename to var/lib/pacman/local/pacman-6.0.2-14/files index b23ea88648c..14600a9f84b 100644 --- a/var/lib/pacman/local/pacman-6.0.2-13/files +++ b/var/lib/pacman/local/pacman-6.0.2-14/files @@ -400,6 +400,6 @@ var/lib/pacman/ %BACKUP% etc/pacman.conf e37d160042192fbf55e19de408d175d6 -etc/makepkg.conf 329b46a18cc1a407481a364a8a8e0b81 -etc/makepkg_mingw.conf c705d35b09494f3ee2fabfa732a4fbb8 +etc/makepkg.conf 9d8499144b7bf54683a2374bda11bb24 +etc/makepkg_mingw.conf 0b14bee90495114ff9daca7c6bcf1903 diff --git a/var/lib/pacman/local/pacman-6.0.2-14/mtree b/var/lib/pacman/local/pacman-6.0.2-14/mtree new file mode 100644 index 00000000000..220e7292ddd Binary files /dev/null and b/var/lib/pacman/local/pacman-6.0.2-14/mtree differ diff --git a/var/lib/pacman/local/swig-4.1.1-2/files b/var/lib/pacman/local/swig-4.1.1-2/files deleted file mode 100644 index 13eb347a1d1..00000000000 --- a/var/lib/pacman/local/swig-4.1.1-2/files +++ /dev/null @@ -1,799 +0,0 @@ -%FILES% -usr/ -usr/bin/ -usr/bin/ccache-swig.exe -usr/bin/swig.exe -usr/share/ -usr/share/licenses/ -usr/share/licenses/swig/ -usr/share/licenses/swig/LICENSE -usr/share/licenses/swig/LICENSE-UNIVERSITIES -usr/share/swig/ -usr/share/swig/4.1.1/ -usr/share/swig/4.1.1/allkw.swg -usr/share/swig/4.1.1/attribute.i -usr/share/swig/4.1.1/carrays.i -usr/share/swig/4.1.1/cdata.i -usr/share/swig/4.1.1/cmalloc.i -usr/share/swig/4.1.1/constraints.i -usr/share/swig/4.1.1/cpointer.i -usr/share/swig/4.1.1/csharp/ -usr/share/swig/4.1.1/csharp/arrays_csharp.i -usr/share/swig/4.1.1/csharp/boost_intrusive_ptr.i -usr/share/swig/4.1.1/csharp/boost_shared_ptr.i -usr/share/swig/4.1.1/csharp/complex.i -usr/share/swig/4.1.1/csharp/csharp.swg -usr/share/swig/4.1.1/csharp/csharphead.swg -usr/share/swig/4.1.1/csharp/csharpkw.swg -usr/share/swig/4.1.1/csharp/director.swg -usr/share/swig/4.1.1/csharp/enums.swg -usr/share/swig/4.1.1/csharp/enumsimple.swg -usr/share/swig/4.1.1/csharp/enumtypesafe.swg -usr/share/swig/4.1.1/csharp/std_array.i -usr/share/swig/4.1.1/csharp/std_auto_ptr.i -usr/share/swig/4.1.1/csharp/std_common.i -usr/share/swig/4.1.1/csharp/std_complex.i -usr/share/swig/4.1.1/csharp/std_deque.i -usr/share/swig/4.1.1/csharp/std_except.i -usr/share/swig/4.1.1/csharp/std_list.i -usr/share/swig/4.1.1/csharp/std_map.i -usr/share/swig/4.1.1/csharp/std_pair.i -usr/share/swig/4.1.1/csharp/std_set.i -usr/share/swig/4.1.1/csharp/std_shared_ptr.i -usr/share/swig/4.1.1/csharp/std_string.i -usr/share/swig/4.1.1/csharp/std_unique_ptr.i -usr/share/swig/4.1.1/csharp/std_vector.i -usr/share/swig/4.1.1/csharp/std_wstring.i -usr/share/swig/4.1.1/csharp/stl.i -usr/share/swig/4.1.1/csharp/swiginterface.i -usr/share/swig/4.1.1/csharp/swigmove.i -usr/share/swig/4.1.1/csharp/swigtype_inout.i -usr/share/swig/4.1.1/csharp/typemaps.i -usr/share/swig/4.1.1/csharp/wchar.i -usr/share/swig/4.1.1/cstring.i -usr/share/swig/4.1.1/cwstring.i -usr/share/swig/4.1.1/d/ -usr/share/swig/4.1.1/d/boost_shared_ptr.i -usr/share/swig/4.1.1/d/carrays.i -usr/share/swig/4.1.1/d/cpointer.i -usr/share/swig/4.1.1/d/d.swg -usr/share/swig/4.1.1/d/dclassgen.swg -usr/share/swig/4.1.1/d/ddirectives.swg -usr/share/swig/4.1.1/d/denums.swg -usr/share/swig/4.1.1/d/dexception.swg -usr/share/swig/4.1.1/d/dhead.swg -usr/share/swig/4.1.1/d/director.swg -usr/share/swig/4.1.1/d/dkw.swg -usr/share/swig/4.1.1/d/dmemberfunctionpointers.swg -usr/share/swig/4.1.1/d/doperators.swg -usr/share/swig/4.1.1/d/dprimitives.swg -usr/share/swig/4.1.1/d/dstrings.swg -usr/share/swig/4.1.1/d/dswigtype.swg -usr/share/swig/4.1.1/d/dvoid.swg -usr/share/swig/4.1.1/d/std_auto_ptr.i -usr/share/swig/4.1.1/d/std_common.i -usr/share/swig/4.1.1/d/std_deque.i -usr/share/swig/4.1.1/d/std_except.i -usr/share/swig/4.1.1/d/std_map.i -usr/share/swig/4.1.1/d/std_pair.i -usr/share/swig/4.1.1/d/std_shared_ptr.i -usr/share/swig/4.1.1/d/std_string.i -usr/share/swig/4.1.1/d/std_unique_ptr.i -usr/share/swig/4.1.1/d/std_vector.i -usr/share/swig/4.1.1/d/stl.i -usr/share/swig/4.1.1/d/swigmove.i -usr/share/swig/4.1.1/d/typemaps.i -usr/share/swig/4.1.1/d/wrapperloader.swg -usr/share/swig/4.1.1/director_common.swg -usr/share/swig/4.1.1/exception.i -usr/share/swig/4.1.1/go/ -usr/share/swig/4.1.1/go/cdata.i -usr/share/swig/4.1.1/go/director.swg -usr/share/swig/4.1.1/go/exception.i -usr/share/swig/4.1.1/go/go.swg -usr/share/swig/4.1.1/go/gokw.swg -usr/share/swig/4.1.1/go/goruntime.swg -usr/share/swig/4.1.1/go/gostring.swg -usr/share/swig/4.1.1/go/std_array.i -usr/share/swig/4.1.1/go/std_common.i -usr/share/swig/4.1.1/go/std_deque.i -usr/share/swig/4.1.1/go/std_except.i -usr/share/swig/4.1.1/go/std_list.i -usr/share/swig/4.1.1/go/std_map.i -usr/share/swig/4.1.1/go/std_pair.i -usr/share/swig/4.1.1/go/std_string.i -usr/share/swig/4.1.1/go/std_vector.i -usr/share/swig/4.1.1/go/stl.i -usr/share/swig/4.1.1/go/swigmove.i -usr/share/swig/4.1.1/go/typemaps.i -usr/share/swig/4.1.1/guile/ -usr/share/swig/4.1.1/guile/common.scm -usr/share/swig/4.1.1/guile/cplusplus.i -usr/share/swig/4.1.1/guile/guile.i -usr/share/swig/4.1.1/guile/guile_scm.swg -usr/share/swig/4.1.1/guile/guile_scm_run.swg -usr/share/swig/4.1.1/guile/guilemain.i -usr/share/swig/4.1.1/guile/interpreter.i -usr/share/swig/4.1.1/guile/list-vector.i -usr/share/swig/4.1.1/guile/pointer-in-out.i -usr/share/swig/4.1.1/guile/ports.i -usr/share/swig/4.1.1/guile/std_auto_ptr.i -usr/share/swig/4.1.1/guile/std_common.i -usr/share/swig/4.1.1/guile/std_deque.i -usr/share/swig/4.1.1/guile/std_except.i -usr/share/swig/4.1.1/guile/std_map.i -usr/share/swig/4.1.1/guile/std_pair.i -usr/share/swig/4.1.1/guile/std_string.i -usr/share/swig/4.1.1/guile/std_unique_ptr.i -usr/share/swig/4.1.1/guile/std_vector.i -usr/share/swig/4.1.1/guile/stl.i -usr/share/swig/4.1.1/guile/swigmove.i -usr/share/swig/4.1.1/guile/swigrun.i -usr/share/swig/4.1.1/guile/typemaps.i -usr/share/swig/4.1.1/intrusive_ptr.i -usr/share/swig/4.1.1/inttypes.i -usr/share/swig/4.1.1/java/ -usr/share/swig/4.1.1/java/arrays_java.i -usr/share/swig/4.1.1/java/boost_intrusive_ptr.i -usr/share/swig/4.1.1/java/boost_shared_ptr.i -usr/share/swig/4.1.1/java/director.swg -usr/share/swig/4.1.1/java/enums.swg -usr/share/swig/4.1.1/java/enumsimple.swg -usr/share/swig/4.1.1/java/enumtypesafe.swg -usr/share/swig/4.1.1/java/enumtypeunsafe.swg -usr/share/swig/4.1.1/java/java.swg -usr/share/swig/4.1.1/java/javahead.swg -usr/share/swig/4.1.1/java/javakw.swg -usr/share/swig/4.1.1/java/std_array.i -usr/share/swig/4.1.1/java/std_auto_ptr.i -usr/share/swig/4.1.1/java/std_common.i -usr/share/swig/4.1.1/java/std_deque.i -usr/share/swig/4.1.1/java/std_except.i -usr/share/swig/4.1.1/java/std_list.i -usr/share/swig/4.1.1/java/std_map.i -usr/share/swig/4.1.1/java/std_pair.i -usr/share/swig/4.1.1/java/std_set.i -usr/share/swig/4.1.1/java/std_shared_ptr.i -usr/share/swig/4.1.1/java/std_string.i -usr/share/swig/4.1.1/java/std_unique_ptr.i -usr/share/swig/4.1.1/java/std_unordered_map.i -usr/share/swig/4.1.1/java/std_unordered_set.i -usr/share/swig/4.1.1/java/std_vector.i -usr/share/swig/4.1.1/java/std_wstring.i -usr/share/swig/4.1.1/java/stl.i -usr/share/swig/4.1.1/java/swiginterface.i -usr/share/swig/4.1.1/java/swigmove.i -usr/share/swig/4.1.1/java/typemaps.i -usr/share/swig/4.1.1/java/various.i -usr/share/swig/4.1.1/javascript/ -usr/share/swig/4.1.1/javascript/jsc/ -usr/share/swig/4.1.1/javascript/jsc/arrays_javascript.i -usr/share/swig/4.1.1/javascript/jsc/ccomplex.i -usr/share/swig/4.1.1/javascript/jsc/cdata.i -usr/share/swig/4.1.1/javascript/jsc/complex.i -usr/share/swig/4.1.1/javascript/jsc/exception.i -usr/share/swig/4.1.1/javascript/jsc/javascript.swg -usr/share/swig/4.1.1/javascript/jsc/javascriptcode.swg -usr/share/swig/4.1.1/javascript/jsc/javascriptcomplex.swg -usr/share/swig/4.1.1/javascript/jsc/javascriptfragments.swg -usr/share/swig/4.1.1/javascript/jsc/javascripthelpers.swg -usr/share/swig/4.1.1/javascript/jsc/javascriptinit.swg -usr/share/swig/4.1.1/javascript/jsc/javascriptkw.swg -usr/share/swig/4.1.1/javascript/jsc/javascriptprimtypes.swg -usr/share/swig/4.1.1/javascript/jsc/javascriptrun.swg -usr/share/swig/4.1.1/javascript/jsc/javascriptruntime.swg -usr/share/swig/4.1.1/javascript/jsc/javascriptstrings.swg -usr/share/swig/4.1.1/javascript/jsc/javascripttypemaps.swg -usr/share/swig/4.1.1/javascript/jsc/std_auto_ptr.i -usr/share/swig/4.1.1/javascript/jsc/std_common.i -usr/share/swig/4.1.1/javascript/jsc/std_complex.i -usr/share/swig/4.1.1/javascript/jsc/std_deque.i -usr/share/swig/4.1.1/javascript/jsc/std_except.i -usr/share/swig/4.1.1/javascript/jsc/std_map.i -usr/share/swig/4.1.1/javascript/jsc/std_pair.i -usr/share/swig/4.1.1/javascript/jsc/std_string.i -usr/share/swig/4.1.1/javascript/jsc/std_unique_ptr.i -usr/share/swig/4.1.1/javascript/jsc/std_vector.i -usr/share/swig/4.1.1/javascript/jsc/stl.i -usr/share/swig/4.1.1/javascript/jsc/swigmove.i -usr/share/swig/4.1.1/javascript/jsc/typemaps.i -usr/share/swig/4.1.1/javascript/v8/ -usr/share/swig/4.1.1/javascript/v8/arrays_javascript.i -usr/share/swig/4.1.1/javascript/v8/ccomplex.i -usr/share/swig/4.1.1/javascript/v8/cdata.i -usr/share/swig/4.1.1/javascript/v8/complex.i -usr/share/swig/4.1.1/javascript/v8/exception.i -usr/share/swig/4.1.1/javascript/v8/javascript.swg -usr/share/swig/4.1.1/javascript/v8/javascriptcode.swg -usr/share/swig/4.1.1/javascript/v8/javascriptcomplex.swg -usr/share/swig/4.1.1/javascript/v8/javascriptfragments.swg -usr/share/swig/4.1.1/javascript/v8/javascripthelpers.swg -usr/share/swig/4.1.1/javascript/v8/javascriptinit.swg -usr/share/swig/4.1.1/javascript/v8/javascriptkw.swg -usr/share/swig/4.1.1/javascript/v8/javascriptprimtypes.swg -usr/share/swig/4.1.1/javascript/v8/javascriptrun.swg -usr/share/swig/4.1.1/javascript/v8/javascriptruntime.swg -usr/share/swig/4.1.1/javascript/v8/javascriptstrings.swg -usr/share/swig/4.1.1/javascript/v8/javascripttypemaps.swg -usr/share/swig/4.1.1/javascript/v8/std_auto_ptr.i -usr/share/swig/4.1.1/javascript/v8/std_common.i -usr/share/swig/4.1.1/javascript/v8/std_complex.i -usr/share/swig/4.1.1/javascript/v8/std_deque.i -usr/share/swig/4.1.1/javascript/v8/std_except.i -usr/share/swig/4.1.1/javascript/v8/std_map.i -usr/share/swig/4.1.1/javascript/v8/std_pair.i -usr/share/swig/4.1.1/javascript/v8/std_string.i -usr/share/swig/4.1.1/javascript/v8/std_unique_ptr.i -usr/share/swig/4.1.1/javascript/v8/std_vector.i -usr/share/swig/4.1.1/javascript/v8/stl.i -usr/share/swig/4.1.1/javascript/v8/swigmove.i -usr/share/swig/4.1.1/javascript/v8/typemaps.i -usr/share/swig/4.1.1/lua/ -usr/share/swig/4.1.1/lua/_std_common.i -usr/share/swig/4.1.1/lua/argcargv.i -usr/share/swig/4.1.1/lua/carrays.i -usr/share/swig/4.1.1/lua/factory.i -usr/share/swig/4.1.1/lua/lua.swg -usr/share/swig/4.1.1/lua/lua_fnptr.i -usr/share/swig/4.1.1/lua/luakw.swg -usr/share/swig/4.1.1/lua/luarun.swg -usr/share/swig/4.1.1/lua/luaruntime.swg -usr/share/swig/4.1.1/lua/luatypemaps.swg -usr/share/swig/4.1.1/lua/std_auto_ptr.i -usr/share/swig/4.1.1/lua/std_common.i -usr/share/swig/4.1.1/lua/std_deque.i -usr/share/swig/4.1.1/lua/std_except.i -usr/share/swig/4.1.1/lua/std_map.i -usr/share/swig/4.1.1/lua/std_pair.i -usr/share/swig/4.1.1/lua/std_string.i -usr/share/swig/4.1.1/lua/std_unique_ptr.i -usr/share/swig/4.1.1/lua/std_vector.i -usr/share/swig/4.1.1/lua/stl.i -usr/share/swig/4.1.1/lua/swigmove.i -usr/share/swig/4.1.1/lua/typemaps.i -usr/share/swig/4.1.1/lua/wchar.i -usr/share/swig/4.1.1/math.i -usr/share/swig/4.1.1/mzscheme/ -usr/share/swig/4.1.1/mzscheme/mzrun.swg -usr/share/swig/4.1.1/mzscheme/mzscheme.swg -usr/share/swig/4.1.1/mzscheme/std_auto_ptr.i -usr/share/swig/4.1.1/mzscheme/std_common.i -usr/share/swig/4.1.1/mzscheme/std_deque.i -usr/share/swig/4.1.1/mzscheme/std_map.i -usr/share/swig/4.1.1/mzscheme/std_pair.i -usr/share/swig/4.1.1/mzscheme/std_string.i -usr/share/swig/4.1.1/mzscheme/std_unique_ptr.i -usr/share/swig/4.1.1/mzscheme/std_vector.i -usr/share/swig/4.1.1/mzscheme/stl.i -usr/share/swig/4.1.1/mzscheme/swigmove.i -usr/share/swig/4.1.1/mzscheme/typemaps.i -usr/share/swig/4.1.1/ocaml/ -usr/share/swig/4.1.1/ocaml/carray.i -usr/share/swig/4.1.1/ocaml/class.swg -usr/share/swig/4.1.1/ocaml/cstring.i -usr/share/swig/4.1.1/ocaml/director.swg -usr/share/swig/4.1.1/ocaml/ocaml.i -usr/share/swig/4.1.1/ocaml/ocaml.swg -usr/share/swig/4.1.1/ocaml/ocamlkw.swg -usr/share/swig/4.1.1/ocaml/ocamlrun.swg -usr/share/swig/4.1.1/ocaml/ocamlrundec.swg -usr/share/swig/4.1.1/ocaml/preamble.swg -usr/share/swig/4.1.1/ocaml/std_common.i -usr/share/swig/4.1.1/ocaml/std_complex.i -usr/share/swig/4.1.1/ocaml/std_deque.i -usr/share/swig/4.1.1/ocaml/std_except.i -usr/share/swig/4.1.1/ocaml/std_list.i -usr/share/swig/4.1.1/ocaml/std_map.i -usr/share/swig/4.1.1/ocaml/std_pair.i -usr/share/swig/4.1.1/ocaml/std_string.i -usr/share/swig/4.1.1/ocaml/std_vector.i -usr/share/swig/4.1.1/ocaml/stl.i -usr/share/swig/4.1.1/ocaml/swig.ml -usr/share/swig/4.1.1/ocaml/swig.mli -usr/share/swig/4.1.1/ocaml/swigmove.i -usr/share/swig/4.1.1/ocaml/swigp4.ml -usr/share/swig/4.1.1/ocaml/typecheck.i -usr/share/swig/4.1.1/ocaml/typemaps.i -usr/share/swig/4.1.1/ocaml/typeregister.swg -usr/share/swig/4.1.1/octave/ -usr/share/swig/4.1.1/octave/argcargv.i -usr/share/swig/4.1.1/octave/attribute.i -usr/share/swig/4.1.1/octave/boost_shared_ptr.i -usr/share/swig/4.1.1/octave/carrays.i -usr/share/swig/4.1.1/octave/cdata.i -usr/share/swig/4.1.1/octave/cmalloc.i -usr/share/swig/4.1.1/octave/director.swg -usr/share/swig/4.1.1/octave/exception.i -usr/share/swig/4.1.1/octave/factory.i -usr/share/swig/4.1.1/octave/implicit.i -usr/share/swig/4.1.1/octave/octave.swg -usr/share/swig/4.1.1/octave/octcomplex.swg -usr/share/swig/4.1.1/octave/octcontainer.swg -usr/share/swig/4.1.1/octave/octfragments.swg -usr/share/swig/4.1.1/octave/octheaders.hpp -usr/share/swig/4.1.1/octave/octiterators.swg -usr/share/swig/4.1.1/octave/octopers.swg -usr/share/swig/4.1.1/octave/octprimtypes.swg -usr/share/swig/4.1.1/octave/octrun.swg -usr/share/swig/4.1.1/octave/octruntime.swg -usr/share/swig/4.1.1/octave/octstdcommon.swg -usr/share/swig/4.1.1/octave/octtypemaps.swg -usr/share/swig/4.1.1/octave/octuserdir.swg -usr/share/swig/4.1.1/octave/std_alloc.i -usr/share/swig/4.1.1/octave/std_auto_ptr.i -usr/share/swig/4.1.1/octave/std_basic_string.i -usr/share/swig/4.1.1/octave/std_carray.i -usr/share/swig/4.1.1/octave/std_char_traits.i -usr/share/swig/4.1.1/octave/std_common.i -usr/share/swig/4.1.1/octave/std_complex.i -usr/share/swig/4.1.1/octave/std_container.i -usr/share/swig/4.1.1/octave/std_deque.i -usr/share/swig/4.1.1/octave/std_except.i -usr/share/swig/4.1.1/octave/std_list.i -usr/share/swig/4.1.1/octave/std_map.i -usr/share/swig/4.1.1/octave/std_pair.i -usr/share/swig/4.1.1/octave/std_shared_ptr.i -usr/share/swig/4.1.1/octave/std_string.i -usr/share/swig/4.1.1/octave/std_unique_ptr.i -usr/share/swig/4.1.1/octave/std_vector.i -usr/share/swig/4.1.1/octave/std_wstring.i -usr/share/swig/4.1.1/octave/stl.i -usr/share/swig/4.1.1/octave/swigmove.i -usr/share/swig/4.1.1/octave/typemaps.i -usr/share/swig/4.1.1/perl5/ -usr/share/swig/4.1.1/perl5/argcargv.i -usr/share/swig/4.1.1/perl5/attribute.i -usr/share/swig/4.1.1/perl5/carrays.i -usr/share/swig/4.1.1/perl5/cdata.i -usr/share/swig/4.1.1/perl5/cmalloc.i -usr/share/swig/4.1.1/perl5/cpointer.i -usr/share/swig/4.1.1/perl5/cstring.i -usr/share/swig/4.1.1/perl5/director.swg -usr/share/swig/4.1.1/perl5/exception.i -usr/share/swig/4.1.1/perl5/factory.i -usr/share/swig/4.1.1/perl5/Makefile.pl -usr/share/swig/4.1.1/perl5/noembed.h -usr/share/swig/4.1.1/perl5/perl5.swg -usr/share/swig/4.1.1/perl5/perlerrors.swg -usr/share/swig/4.1.1/perl5/perlfragments.swg -usr/share/swig/4.1.1/perl5/perlhead.swg -usr/share/swig/4.1.1/perl5/perlinit.swg -usr/share/swig/4.1.1/perl5/perlkw.swg -usr/share/swig/4.1.1/perl5/perlmacros.swg -usr/share/swig/4.1.1/perl5/perlmain.i -usr/share/swig/4.1.1/perl5/perlopers.swg -usr/share/swig/4.1.1/perl5/perlprimtypes.swg -usr/share/swig/4.1.1/perl5/perlrun.swg -usr/share/swig/4.1.1/perl5/perlruntime.swg -usr/share/swig/4.1.1/perl5/perlstrings.swg -usr/share/swig/4.1.1/perl5/perltypemaps.swg -usr/share/swig/4.1.1/perl5/perluserdir.swg -usr/share/swig/4.1.1/perl5/reference.i -usr/share/swig/4.1.1/perl5/std_auto_ptr.i -usr/share/swig/4.1.1/perl5/std_common.i -usr/share/swig/4.1.1/perl5/std_deque.i -usr/share/swig/4.1.1/perl5/std_except.i -usr/share/swig/4.1.1/perl5/std_list.i -usr/share/swig/4.1.1/perl5/std_map.i -usr/share/swig/4.1.1/perl5/std_pair.i -usr/share/swig/4.1.1/perl5/std_string.i -usr/share/swig/4.1.1/perl5/std_unique_ptr.i -usr/share/swig/4.1.1/perl5/std_vector.i -usr/share/swig/4.1.1/perl5/stl.i -usr/share/swig/4.1.1/perl5/swigmove.i -usr/share/swig/4.1.1/perl5/typemaps.i -usr/share/swig/4.1.1/php/ -usr/share/swig/4.1.1/php/argcargv.i -usr/share/swig/4.1.1/php/const.i -usr/share/swig/4.1.1/php/director.swg -usr/share/swig/4.1.1/php/factory.i -usr/share/swig/4.1.1/php/php.swg -usr/share/swig/4.1.1/php/phpinit.swg -usr/share/swig/4.1.1/php/phpinterfaces.i -usr/share/swig/4.1.1/php/phpkw.swg -usr/share/swig/4.1.1/php/phppointers.i -usr/share/swig/4.1.1/php/phprun.swg -usr/share/swig/4.1.1/php/std_auto_ptr.i -usr/share/swig/4.1.1/php/std_common.i -usr/share/swig/4.1.1/php/std_deque.i -usr/share/swig/4.1.1/php/std_map.i -usr/share/swig/4.1.1/php/std_pair.i -usr/share/swig/4.1.1/php/std_string.i -usr/share/swig/4.1.1/php/std_unique_ptr.i -usr/share/swig/4.1.1/php/std_vector.i -usr/share/swig/4.1.1/php/stl.i -usr/share/swig/4.1.1/php/swigmove.i -usr/share/swig/4.1.1/php/typemaps.i -usr/share/swig/4.1.1/php/utils.i -usr/share/swig/4.1.1/pointer.i -usr/share/swig/4.1.1/python/ -usr/share/swig/4.1.1/python/argcargv.i -usr/share/swig/4.1.1/python/attribute.i -usr/share/swig/4.1.1/python/boost_shared_ptr.i -usr/share/swig/4.1.1/python/builtin.swg -usr/share/swig/4.1.1/python/carrays.i -usr/share/swig/4.1.1/python/ccomplex.i -usr/share/swig/4.1.1/python/cdata.i -usr/share/swig/4.1.1/python/cmalloc.i -usr/share/swig/4.1.1/python/complex.i -usr/share/swig/4.1.1/python/cpointer.i -usr/share/swig/4.1.1/python/cstring.i -usr/share/swig/4.1.1/python/cwstring.i -usr/share/swig/4.1.1/python/director.swg -usr/share/swig/4.1.1/python/embed.i -usr/share/swig/4.1.1/python/exception.i -usr/share/swig/4.1.1/python/factory.i -usr/share/swig/4.1.1/python/file.i -usr/share/swig/4.1.1/python/implicit.i -usr/share/swig/4.1.1/python/pyabc.i -usr/share/swig/4.1.1/python/pyapi.swg -usr/share/swig/4.1.1/python/pybackward.swg -usr/share/swig/4.1.1/python/pybuffer.i -usr/share/swig/4.1.1/python/pyclasses.swg -usr/share/swig/4.1.1/python/pycomplex.swg -usr/share/swig/4.1.1/python/pycontainer.swg -usr/share/swig/4.1.1/python/pydocs.swg -usr/share/swig/4.1.1/python/pyerrors.swg -usr/share/swig/4.1.1/python/pyfragments.swg -usr/share/swig/4.1.1/python/pyhead.swg -usr/share/swig/4.1.1/python/pyinit.swg -usr/share/swig/4.1.1/python/pyiterators.swg -usr/share/swig/4.1.1/python/pymacros.swg -usr/share/swig/4.1.1/python/pyname_compat.i -usr/share/swig/4.1.1/python/pyopers.swg -usr/share/swig/4.1.1/python/pyprimtypes.swg -usr/share/swig/4.1.1/python/pyrun.swg -usr/share/swig/4.1.1/python/pyruntime.swg -usr/share/swig/4.1.1/python/pystdcommon.swg -usr/share/swig/4.1.1/python/pystrings.swg -usr/share/swig/4.1.1/python/python.swg -usr/share/swig/4.1.1/python/pythonkw.swg -usr/share/swig/4.1.1/python/pythreads.swg -usr/share/swig/4.1.1/python/pytuplehlp.swg -usr/share/swig/4.1.1/python/pytypemaps.swg -usr/share/swig/4.1.1/python/pyuserdir.swg -usr/share/swig/4.1.1/python/pywstrings.swg -usr/share/swig/4.1.1/python/std_alloc.i -usr/share/swig/4.1.1/python/std_array.i -usr/share/swig/4.1.1/python/std_auto_ptr.i -usr/share/swig/4.1.1/python/std_basic_string.i -usr/share/swig/4.1.1/python/std_carray.i -usr/share/swig/4.1.1/python/std_char_traits.i -usr/share/swig/4.1.1/python/std_common.i -usr/share/swig/4.1.1/python/std_complex.i -usr/share/swig/4.1.1/python/std_container.i -usr/share/swig/4.1.1/python/std_deque.i -usr/share/swig/4.1.1/python/std_except.i -usr/share/swig/4.1.1/python/std_ios.i -usr/share/swig/4.1.1/python/std_iostream.i -usr/share/swig/4.1.1/python/std_list.i -usr/share/swig/4.1.1/python/std_map.i -usr/share/swig/4.1.1/python/std_multimap.i -usr/share/swig/4.1.1/python/std_multiset.i -usr/share/swig/4.1.1/python/std_pair.i -usr/share/swig/4.1.1/python/std_set.i -usr/share/swig/4.1.1/python/std_shared_ptr.i -usr/share/swig/4.1.1/python/std_sstream.i -usr/share/swig/4.1.1/python/std_streambuf.i -usr/share/swig/4.1.1/python/std_string.i -usr/share/swig/4.1.1/python/std_unique_ptr.i -usr/share/swig/4.1.1/python/std_unordered_map.i -usr/share/swig/4.1.1/python/std_unordered_multimap.i -usr/share/swig/4.1.1/python/std_unordered_multiset.i -usr/share/swig/4.1.1/python/std_unordered_set.i -usr/share/swig/4.1.1/python/std_vector.i -usr/share/swig/4.1.1/python/std_vectora.i -usr/share/swig/4.1.1/python/std_wios.i -usr/share/swig/4.1.1/python/std_wiostream.i -usr/share/swig/4.1.1/python/std_wsstream.i -usr/share/swig/4.1.1/python/std_wstreambuf.i -usr/share/swig/4.1.1/python/std_wstring.i -usr/share/swig/4.1.1/python/stl.i -usr/share/swig/4.1.1/python/swigmove.i -usr/share/swig/4.1.1/python/typemaps.i -usr/share/swig/4.1.1/python/wchar.i -usr/share/swig/4.1.1/r/ -usr/share/swig/4.1.1/r/boost_shared_ptr.i -usr/share/swig/4.1.1/r/cdata.i -usr/share/swig/4.1.1/r/exception.i -usr/share/swig/4.1.1/r/r.swg -usr/share/swig/4.1.1/r/rcontainer.swg -usr/share/swig/4.1.1/r/rfragments.swg -usr/share/swig/4.1.1/r/rkw.swg -usr/share/swig/4.1.1/r/ropers.swg -usr/share/swig/4.1.1/r/rrun.swg -usr/share/swig/4.1.1/r/rstdcommon.swg -usr/share/swig/4.1.1/r/rtype.swg -usr/share/swig/4.1.1/r/srun.swg -usr/share/swig/4.1.1/r/std_alloc.i -usr/share/swig/4.1.1/r/std_common.i -usr/share/swig/4.1.1/r/std_container.i -usr/share/swig/4.1.1/r/std_deque.i -usr/share/swig/4.1.1/r/std_except.i -usr/share/swig/4.1.1/r/std_list.i -usr/share/swig/4.1.1/r/std_map.i -usr/share/swig/4.1.1/r/std_pair.i -usr/share/swig/4.1.1/r/std_shared_ptr.i -usr/share/swig/4.1.1/r/std_string.i -usr/share/swig/4.1.1/r/std_vector.i -usr/share/swig/4.1.1/r/stl.i -usr/share/swig/4.1.1/r/swigmove.i -usr/share/swig/4.1.1/r/typemaps.i -usr/share/swig/4.1.1/ruby/ -usr/share/swig/4.1.1/ruby/argcargv.i -usr/share/swig/4.1.1/ruby/attribute.i -usr/share/swig/4.1.1/ruby/boost_shared_ptr.i -usr/share/swig/4.1.1/ruby/carrays.i -usr/share/swig/4.1.1/ruby/cdata.i -usr/share/swig/4.1.1/ruby/cmalloc.i -usr/share/swig/4.1.1/ruby/cpointer.i -usr/share/swig/4.1.1/ruby/cstring.i -usr/share/swig/4.1.1/ruby/director.swg -usr/share/swig/4.1.1/ruby/embed.i -usr/share/swig/4.1.1/ruby/exception.i -usr/share/swig/4.1.1/ruby/extconf.rb -usr/share/swig/4.1.1/ruby/factory.i -usr/share/swig/4.1.1/ruby/file.i -usr/share/swig/4.1.1/ruby/Makefile.swig -usr/share/swig/4.1.1/ruby/progargcargv.i -usr/share/swig/4.1.1/ruby/ruby.swg -usr/share/swig/4.1.1/ruby/rubyapi.swg -usr/share/swig/4.1.1/ruby/rubyautodoc.swg -usr/share/swig/4.1.1/ruby/rubyclasses.swg -usr/share/swig/4.1.1/ruby/rubycomplex.swg -usr/share/swig/4.1.1/ruby/rubycontainer.swg -usr/share/swig/4.1.1/ruby/rubycontainer_extended.swg -usr/share/swig/4.1.1/ruby/rubydef.swg -usr/share/swig/4.1.1/ruby/rubyerrors.swg -usr/share/swig/4.1.1/ruby/rubyfragments.swg -usr/share/swig/4.1.1/ruby/rubyhead.swg -usr/share/swig/4.1.1/ruby/rubyinit.swg -usr/share/swig/4.1.1/ruby/rubyiterators.swg -usr/share/swig/4.1.1/ruby/rubykw.swg -usr/share/swig/4.1.1/ruby/rubymacros.swg -usr/share/swig/4.1.1/ruby/rubyopers.swg -usr/share/swig/4.1.1/ruby/rubyprimtypes.swg -usr/share/swig/4.1.1/ruby/rubyrun.swg -usr/share/swig/4.1.1/ruby/rubyruntime.swg -usr/share/swig/4.1.1/ruby/rubystdautodoc.swg -usr/share/swig/4.1.1/ruby/rubystdcommon.swg -usr/share/swig/4.1.1/ruby/rubystdcommon_forward.swg -usr/share/swig/4.1.1/ruby/rubystdfunctors.swg -usr/share/swig/4.1.1/ruby/rubystrings.swg -usr/share/swig/4.1.1/ruby/rubytracking.swg -usr/share/swig/4.1.1/ruby/rubytypemaps.swg -usr/share/swig/4.1.1/ruby/rubyuserdir.swg -usr/share/swig/4.1.1/ruby/rubywstrings.swg -usr/share/swig/4.1.1/ruby/std_alloc.i -usr/share/swig/4.1.1/ruby/std_array.i -usr/share/swig/4.1.1/ruby/std_auto_ptr.i -usr/share/swig/4.1.1/ruby/std_basic_string.i -usr/share/swig/4.1.1/ruby/std_char_traits.i -usr/share/swig/4.1.1/ruby/std_common.i -usr/share/swig/4.1.1/ruby/std_complex.i -usr/share/swig/4.1.1/ruby/std_container.i -usr/share/swig/4.1.1/ruby/std_deque.i -usr/share/swig/4.1.1/ruby/std_except.i -usr/share/swig/4.1.1/ruby/std_functors.i -usr/share/swig/4.1.1/ruby/std_ios.i -usr/share/swig/4.1.1/ruby/std_iostream.i -usr/share/swig/4.1.1/ruby/std_list.i -usr/share/swig/4.1.1/ruby/std_map.i -usr/share/swig/4.1.1/ruby/std_multimap.i -usr/share/swig/4.1.1/ruby/std_multiset.i -usr/share/swig/4.1.1/ruby/std_pair.i -usr/share/swig/4.1.1/ruby/std_queue.i -usr/share/swig/4.1.1/ruby/std_set.i -usr/share/swig/4.1.1/ruby/std_shared_ptr.i -usr/share/swig/4.1.1/ruby/std_sstream.i -usr/share/swig/4.1.1/ruby/std_stack.i -usr/share/swig/4.1.1/ruby/std_streambuf.i -usr/share/swig/4.1.1/ruby/std_string.i -usr/share/swig/4.1.1/ruby/std_unique_ptr.i -usr/share/swig/4.1.1/ruby/std_unordered_map.i -usr/share/swig/4.1.1/ruby/std_unordered_multimap.i -usr/share/swig/4.1.1/ruby/std_unordered_multiset.i -usr/share/swig/4.1.1/ruby/std_unordered_set.i -usr/share/swig/4.1.1/ruby/std_vector.i -usr/share/swig/4.1.1/ruby/std_vectora.i -usr/share/swig/4.1.1/ruby/std_wstring.i -usr/share/swig/4.1.1/ruby/stl.i -usr/share/swig/4.1.1/ruby/swigmove.i -usr/share/swig/4.1.1/ruby/timeval.i -usr/share/swig/4.1.1/ruby/typemaps.i -usr/share/swig/4.1.1/runtime.swg -usr/share/swig/4.1.1/scilab/ -usr/share/swig/4.1.1/scilab/boost_shared_ptr.i -usr/share/swig/4.1.1/scilab/carrays.i -usr/share/swig/4.1.1/scilab/cmalloc.i -usr/share/swig/4.1.1/scilab/cpointer.i -usr/share/swig/4.1.1/scilab/exception.i -usr/share/swig/4.1.1/scilab/matrix.i -usr/share/swig/4.1.1/scilab/sciarray.swg -usr/share/swig/4.1.1/scilab/scibool.swg -usr/share/swig/4.1.1/scilab/scichar.swg -usr/share/swig/4.1.1/scilab/scicontainer.swg -usr/share/swig/4.1.1/scilab/scidouble.swg -usr/share/swig/4.1.1/scilab/scienum.swg -usr/share/swig/4.1.1/scilab/sciexception.swg -usr/share/swig/4.1.1/scilab/scifloat.swg -usr/share/swig/4.1.1/scilab/sciint.swg -usr/share/swig/4.1.1/scilab/sciiterators.swg -usr/share/swig/4.1.1/scilab/scilab.swg -usr/share/swig/4.1.1/scilab/scilist.swg -usr/share/swig/4.1.1/scilab/scilong.swg -usr/share/swig/4.1.1/scilab/scilonglong.swg -usr/share/swig/4.1.1/scilab/scimacros.swg -usr/share/swig/4.1.1/scilab/scimatrixbool.swg -usr/share/swig/4.1.1/scilab/scimatrixchar.swg -usr/share/swig/4.1.1/scilab/scimatrixdouble.swg -usr/share/swig/4.1.1/scilab/scimatrixint.swg -usr/share/swig/4.1.1/scilab/scimisctypes.swg -usr/share/swig/4.1.1/scilab/scipointer.swg -usr/share/swig/4.1.1/scilab/sciprimtypes.swg -usr/share/swig/4.1.1/scilab/scirun.swg -usr/share/swig/4.1.1/scilab/sciruntime.swg -usr/share/swig/4.1.1/scilab/scisequence.swg -usr/share/swig/4.1.1/scilab/scisequencebool.swg -usr/share/swig/4.1.1/scilab/scisequencedouble.swg -usr/share/swig/4.1.1/scilab/scisequencefloat.swg -usr/share/swig/4.1.1/scilab/scisequenceint.swg -usr/share/swig/4.1.1/scilab/scisequencepointer.swg -usr/share/swig/4.1.1/scilab/scisequencestring.swg -usr/share/swig/4.1.1/scilab/scishort.swg -usr/share/swig/4.1.1/scilab/scisignedchar.swg -usr/share/swig/4.1.1/scilab/scistdcommon.swg -usr/share/swig/4.1.1/scilab/scitypemaps.swg -usr/share/swig/4.1.1/scilab/sciunsignedchar.swg -usr/share/swig/4.1.1/scilab/sciunsignedint.swg -usr/share/swig/4.1.1/scilab/sciunsignedlong.swg -usr/share/swig/4.1.1/scilab/sciunsignedshort.swg -usr/share/swig/4.1.1/scilab/std_alloc.i -usr/share/swig/4.1.1/scilab/std_basic_string.i -usr/share/swig/4.1.1/scilab/std_char_traits.i -usr/share/swig/4.1.1/scilab/std_common.i -usr/share/swig/4.1.1/scilab/std_container.i -usr/share/swig/4.1.1/scilab/std_deque.i -usr/share/swig/4.1.1/scilab/std_except.i -usr/share/swig/4.1.1/scilab/std_list.i -usr/share/swig/4.1.1/scilab/std_map.i -usr/share/swig/4.1.1/scilab/std_multiset.i -usr/share/swig/4.1.1/scilab/std_pair.i -usr/share/swig/4.1.1/scilab/std_set.i -usr/share/swig/4.1.1/scilab/std_shared_ptr.i -usr/share/swig/4.1.1/scilab/std_string.i -usr/share/swig/4.1.1/scilab/std_vector.i -usr/share/swig/4.1.1/scilab/stl.i -usr/share/swig/4.1.1/scilab/swigmove.i -usr/share/swig/4.1.1/scilab/typemaps.i -usr/share/swig/4.1.1/shared_ptr.i -usr/share/swig/4.1.1/std/ -usr/share/swig/4.1.1/std/_std_deque.i -usr/share/swig/4.1.1/std/std_alloc.i -usr/share/swig/4.1.1/std/std_array.i -usr/share/swig/4.1.1/std/std_basic_string.i -usr/share/swig/4.1.1/std/std_carray.swg -usr/share/swig/4.1.1/std/std_char_traits.i -usr/share/swig/4.1.1/std/std_common.i -usr/share/swig/4.1.1/std/std_container.i -usr/share/swig/4.1.1/std/std_deque.i -usr/share/swig/4.1.1/std/std_except.i -usr/share/swig/4.1.1/std/std_ios.i -usr/share/swig/4.1.1/std/std_iostream.i -usr/share/swig/4.1.1/std/std_list.i -usr/share/swig/4.1.1/std/std_map.i -usr/share/swig/4.1.1/std/std_multimap.i -usr/share/swig/4.1.1/std/std_multiset.i -usr/share/swig/4.1.1/std/std_pair.i -usr/share/swig/4.1.1/std/std_queue.i -usr/share/swig/4.1.1/std/std_set.i -usr/share/swig/4.1.1/std/std_sstream.i -usr/share/swig/4.1.1/std/std_stack.i -usr/share/swig/4.1.1/std/std_streambuf.i -usr/share/swig/4.1.1/std/std_string.i -usr/share/swig/4.1.1/std/std_unordered_map.i -usr/share/swig/4.1.1/std/std_unordered_multimap.i -usr/share/swig/4.1.1/std/std_unordered_multiset.i -usr/share/swig/4.1.1/std/std_unordered_set.i -usr/share/swig/4.1.1/std/std_vector.i -usr/share/swig/4.1.1/std/std_vectora.i -usr/share/swig/4.1.1/std/std_wios.i -usr/share/swig/4.1.1/std/std_wiostream.i -usr/share/swig/4.1.1/std/std_wsstream.i -usr/share/swig/4.1.1/std/std_wstreambuf.i -usr/share/swig/4.1.1/std/std_wstring.i -usr/share/swig/4.1.1/std_except.i -usr/share/swig/4.1.1/stdint.i -usr/share/swig/4.1.1/stl.i -usr/share/swig/4.1.1/swig.swg -usr/share/swig/4.1.1/swigarch.i -usr/share/swig/4.1.1/swigerrors.swg -usr/share/swig/4.1.1/swigfragments.swg -usr/share/swig/4.1.1/swiginit.swg -usr/share/swig/4.1.1/swiglabels.swg -usr/share/swig/4.1.1/swigrun.i -usr/share/swig/4.1.1/swigrun.swg -usr/share/swig/4.1.1/swigwarn.swg -usr/share/swig/4.1.1/swigwarnings.swg -usr/share/swig/4.1.1/tcl/ -usr/share/swig/4.1.1/tcl/argcargv.i -usr/share/swig/4.1.1/tcl/attribute.i -usr/share/swig/4.1.1/tcl/carrays.i -usr/share/swig/4.1.1/tcl/cdata.i -usr/share/swig/4.1.1/tcl/cmalloc.i -usr/share/swig/4.1.1/tcl/cpointer.i -usr/share/swig/4.1.1/tcl/cstring.i -usr/share/swig/4.1.1/tcl/cwstring.i -usr/share/swig/4.1.1/tcl/exception.i -usr/share/swig/4.1.1/tcl/factory.i -usr/share/swig/4.1.1/tcl/std_auto_ptr.i -usr/share/swig/4.1.1/tcl/std_common.i -usr/share/swig/4.1.1/tcl/std_deque.i -usr/share/swig/4.1.1/tcl/std_except.i -usr/share/swig/4.1.1/tcl/std_map.i -usr/share/swig/4.1.1/tcl/std_pair.i -usr/share/swig/4.1.1/tcl/std_string.i -usr/share/swig/4.1.1/tcl/std_unique_ptr.i -usr/share/swig/4.1.1/tcl/std_vector.i -usr/share/swig/4.1.1/tcl/std_wstring.i -usr/share/swig/4.1.1/tcl/stl.i -usr/share/swig/4.1.1/tcl/swigmove.i -usr/share/swig/4.1.1/tcl/tcl8.swg -usr/share/swig/4.1.1/tcl/tclapi.swg -usr/share/swig/4.1.1/tcl/tclerrors.swg -usr/share/swig/4.1.1/tcl/tclfragments.swg -usr/share/swig/4.1.1/tcl/tclinit.swg -usr/share/swig/4.1.1/tcl/tclinterp.i -usr/share/swig/4.1.1/tcl/tclkw.swg -usr/share/swig/4.1.1/tcl/tclmacros.swg -usr/share/swig/4.1.1/tcl/tclopers.swg -usr/share/swig/4.1.1/tcl/tclprimtypes.swg -usr/share/swig/4.1.1/tcl/tclresult.i -usr/share/swig/4.1.1/tcl/tclrun.swg -usr/share/swig/4.1.1/tcl/tclruntime.swg -usr/share/swig/4.1.1/tcl/tclsh.i -usr/share/swig/4.1.1/tcl/tclstrings.swg -usr/share/swig/4.1.1/tcl/tcltypemaps.swg -usr/share/swig/4.1.1/tcl/tcluserdir.swg -usr/share/swig/4.1.1/tcl/tclwstrings.swg -usr/share/swig/4.1.1/tcl/typemaps.i -usr/share/swig/4.1.1/tcl/wish.i -usr/share/swig/4.1.1/typemaps/ -usr/share/swig/4.1.1/typemaps/attribute.swg -usr/share/swig/4.1.1/typemaps/carrays.swg -usr/share/swig/4.1.1/typemaps/cdata.swg -usr/share/swig/4.1.1/typemaps/cmalloc.swg -usr/share/swig/4.1.1/typemaps/cpointer.swg -usr/share/swig/4.1.1/typemaps/cstring.swg -usr/share/swig/4.1.1/typemaps/cstrings.swg -usr/share/swig/4.1.1/typemaps/cwstring.swg -usr/share/swig/4.1.1/typemaps/enumint.swg -usr/share/swig/4.1.1/typemaps/exception.swg -usr/share/swig/4.1.1/typemaps/factory.swg -usr/share/swig/4.1.1/typemaps/fragments.swg -usr/share/swig/4.1.1/typemaps/implicit.swg -usr/share/swig/4.1.1/typemaps/inoutlist.swg -usr/share/swig/4.1.1/typemaps/misctypes.swg -usr/share/swig/4.1.1/typemaps/primtypes.swg -usr/share/swig/4.1.1/typemaps/ptrtypes.swg -usr/share/swig/4.1.1/typemaps/std_except.swg -usr/share/swig/4.1.1/typemaps/std_string.swg -usr/share/swig/4.1.1/typemaps/std_strings.swg -usr/share/swig/4.1.1/typemaps/std_wstring.swg -usr/share/swig/4.1.1/typemaps/string.swg -usr/share/swig/4.1.1/typemaps/strings.swg -usr/share/swig/4.1.1/typemaps/swigmacros.swg -usr/share/swig/4.1.1/typemaps/swigmove.swg -usr/share/swig/4.1.1/typemaps/swigobject.swg -usr/share/swig/4.1.1/typemaps/swigtype.swg -usr/share/swig/4.1.1/typemaps/swigtypemaps.swg -usr/share/swig/4.1.1/typemaps/typemaps.swg -usr/share/swig/4.1.1/typemaps/valtypes.swg -usr/share/swig/4.1.1/typemaps/void.swg -usr/share/swig/4.1.1/typemaps/wstring.swg -usr/share/swig/4.1.1/wchar.i -usr/share/swig/4.1.1/windows.i -usr/share/swig/4.1.1/xml/ -usr/share/swig/4.1.1/xml/typemaps.i -usr/share/swig/4.1.1/xml/xml.swg - diff --git a/var/lib/pacman/local/swig-4.1.1-2/mtree b/var/lib/pacman/local/swig-4.1.1-2/mtree deleted file mode 100644 index 98c70761eae..00000000000 Binary files a/var/lib/pacman/local/swig-4.1.1-2/mtree and /dev/null differ diff --git a/var/lib/pacman/local/swig-4.1.1-2/desc b/var/lib/pacman/local/swig-4.2.1-1/desc similarity index 74% rename from var/lib/pacman/local/swig-4.1.1-2/desc rename to var/lib/pacman/local/swig-4.2.1-1/desc index b66149954a8..713cec9e5d7 100644 --- a/var/lib/pacman/local/swig-4.1.1-2/desc +++ b/var/lib/pacman/local/swig-4.2.1-1/desc @@ -2,7 +2,7 @@ swig %VERSION% -4.1.1-2 +4.2.1-1 %BASE% swig @@ -17,16 +17,16 @@ https://www.swig.org/ x86_64 %BUILDDATE% -1694795027 +1712513063 %INSTALLDATE% -1695006026 +1712804385 %PACKAGER% -CI (msys2/msys2-autobuild/0852421d/6200370894) +CI (msys2/msys2-autobuild/8d08599c/8590405538) %SIZE% -4778734 +4834833 %LICENSE% custom diff --git a/var/lib/pacman/local/swig-4.2.1-1/files b/var/lib/pacman/local/swig-4.2.1-1/files new file mode 100644 index 00000000000..312590b9601 --- /dev/null +++ b/var/lib/pacman/local/swig-4.2.1-1/files @@ -0,0 +1,854 @@ +%FILES% +usr/ +usr/bin/ +usr/bin/ccache-swig.exe +usr/bin/swig.exe +usr/share/ +usr/share/licenses/ +usr/share/licenses/swig/ +usr/share/licenses/swig/LICENSE +usr/share/licenses/swig/LICENSE-UNIVERSITIES +usr/share/swig/ +usr/share/swig/4.2.1/ +usr/share/swig/4.2.1/allkw.swg +usr/share/swig/4.2.1/attribute.i +usr/share/swig/4.2.1/carrays.i +usr/share/swig/4.2.1/cdata.i +usr/share/swig/4.2.1/cmalloc.i +usr/share/swig/4.2.1/constraints.i +usr/share/swig/4.2.1/cpointer.i +usr/share/swig/4.2.1/csharp/ +usr/share/swig/4.2.1/csharp/argcargv.i +usr/share/swig/4.2.1/csharp/arrays_csharp.i +usr/share/swig/4.2.1/csharp/boost_intrusive_ptr.i +usr/share/swig/4.2.1/csharp/boost_shared_ptr.i +usr/share/swig/4.2.1/csharp/complex.i +usr/share/swig/4.2.1/csharp/csharp.swg +usr/share/swig/4.2.1/csharp/csharphead.swg +usr/share/swig/4.2.1/csharp/csharpkw.swg +usr/share/swig/4.2.1/csharp/director.swg +usr/share/swig/4.2.1/csharp/enums.swg +usr/share/swig/4.2.1/csharp/enumsimple.swg +usr/share/swig/4.2.1/csharp/enumtypesafe.swg +usr/share/swig/4.2.1/csharp/std_array.i +usr/share/swig/4.2.1/csharp/std_auto_ptr.i +usr/share/swig/4.2.1/csharp/std_common.i +usr/share/swig/4.2.1/csharp/std_complex.i +usr/share/swig/4.2.1/csharp/std_deque.i +usr/share/swig/4.2.1/csharp/std_except.i +usr/share/swig/4.2.1/csharp/std_list.i +usr/share/swig/4.2.1/csharp/std_map.i +usr/share/swig/4.2.1/csharp/std_pair.i +usr/share/swig/4.2.1/csharp/std_set.i +usr/share/swig/4.2.1/csharp/std_shared_ptr.i +usr/share/swig/4.2.1/csharp/std_string.i +usr/share/swig/4.2.1/csharp/std_string_view.i +usr/share/swig/4.2.1/csharp/std_unique_ptr.i +usr/share/swig/4.2.1/csharp/std_unordered_map.i +usr/share/swig/4.2.1/csharp/std_unordered_set.i +usr/share/swig/4.2.1/csharp/std_vector.i +usr/share/swig/4.2.1/csharp/std_wstring.i +usr/share/swig/4.2.1/csharp/stl.i +usr/share/swig/4.2.1/csharp/swiginterface.i +usr/share/swig/4.2.1/csharp/swigmove.i +usr/share/swig/4.2.1/csharp/swigtype_inout.i +usr/share/swig/4.2.1/csharp/typemaps.i +usr/share/swig/4.2.1/csharp/wchar.i +usr/share/swig/4.2.1/cstring.i +usr/share/swig/4.2.1/cwstring.i +usr/share/swig/4.2.1/d/ +usr/share/swig/4.2.1/d/argcargv.i +usr/share/swig/4.2.1/d/boost_shared_ptr.i +usr/share/swig/4.2.1/d/carrays.i +usr/share/swig/4.2.1/d/cpointer.i +usr/share/swig/4.2.1/d/d.swg +usr/share/swig/4.2.1/d/dclassgen.swg +usr/share/swig/4.2.1/d/ddirectives.swg +usr/share/swig/4.2.1/d/denums.swg +usr/share/swig/4.2.1/d/dexception.swg +usr/share/swig/4.2.1/d/dhead.swg +usr/share/swig/4.2.1/d/director.swg +usr/share/swig/4.2.1/d/dkw.swg +usr/share/swig/4.2.1/d/dmemberfunctionpointers.swg +usr/share/swig/4.2.1/d/doperators.swg +usr/share/swig/4.2.1/d/dprimitives.swg +usr/share/swig/4.2.1/d/dstrings.swg +usr/share/swig/4.2.1/d/dswigtype.swg +usr/share/swig/4.2.1/d/dvoid.swg +usr/share/swig/4.2.1/d/std_auto_ptr.i +usr/share/swig/4.2.1/d/std_common.i +usr/share/swig/4.2.1/d/std_deque.i +usr/share/swig/4.2.1/d/std_except.i +usr/share/swig/4.2.1/d/std_map.i +usr/share/swig/4.2.1/d/std_pair.i +usr/share/swig/4.2.1/d/std_shared_ptr.i +usr/share/swig/4.2.1/d/std_string.i +usr/share/swig/4.2.1/d/std_unique_ptr.i +usr/share/swig/4.2.1/d/std_vector.i +usr/share/swig/4.2.1/d/stl.i +usr/share/swig/4.2.1/d/swigmove.i +usr/share/swig/4.2.1/d/typemaps.i +usr/share/swig/4.2.1/d/wrapperloader.swg +usr/share/swig/4.2.1/director_common.swg +usr/share/swig/4.2.1/exception.i +usr/share/swig/4.2.1/go/ +usr/share/swig/4.2.1/go/argcargv.i +usr/share/swig/4.2.1/go/cdata.i +usr/share/swig/4.2.1/go/director.swg +usr/share/swig/4.2.1/go/exception.i +usr/share/swig/4.2.1/go/go.swg +usr/share/swig/4.2.1/go/gokw.swg +usr/share/swig/4.2.1/go/goruntime.swg +usr/share/swig/4.2.1/go/gostring.swg +usr/share/swig/4.2.1/go/std_array.i +usr/share/swig/4.2.1/go/std_common.i +usr/share/swig/4.2.1/go/std_deque.i +usr/share/swig/4.2.1/go/std_except.i +usr/share/swig/4.2.1/go/std_list.i +usr/share/swig/4.2.1/go/std_map.i +usr/share/swig/4.2.1/go/std_pair.i +usr/share/swig/4.2.1/go/std_string.i +usr/share/swig/4.2.1/go/std_vector.i +usr/share/swig/4.2.1/go/stl.i +usr/share/swig/4.2.1/go/swigmove.i +usr/share/swig/4.2.1/go/typemaps.i +usr/share/swig/4.2.1/guile/ +usr/share/swig/4.2.1/guile/argcargv.i +usr/share/swig/4.2.1/guile/common.scm +usr/share/swig/4.2.1/guile/cplusplus.i +usr/share/swig/4.2.1/guile/guile.i +usr/share/swig/4.2.1/guile/guile_scm.swg +usr/share/swig/4.2.1/guile/guile_scm_run.swg +usr/share/swig/4.2.1/guile/guilemain.i +usr/share/swig/4.2.1/guile/interpreter.i +usr/share/swig/4.2.1/guile/list-vector.i +usr/share/swig/4.2.1/guile/pointer-in-out.i +usr/share/swig/4.2.1/guile/ports.i +usr/share/swig/4.2.1/guile/std_auto_ptr.i +usr/share/swig/4.2.1/guile/std_common.i +usr/share/swig/4.2.1/guile/std_deque.i +usr/share/swig/4.2.1/guile/std_except.i +usr/share/swig/4.2.1/guile/std_map.i +usr/share/swig/4.2.1/guile/std_pair.i +usr/share/swig/4.2.1/guile/std_string.i +usr/share/swig/4.2.1/guile/std_unique_ptr.i +usr/share/swig/4.2.1/guile/std_vector.i +usr/share/swig/4.2.1/guile/stl.i +usr/share/swig/4.2.1/guile/swigmove.i +usr/share/swig/4.2.1/guile/swigrun.i +usr/share/swig/4.2.1/guile/typemaps.i +usr/share/swig/4.2.1/intrusive_ptr.i +usr/share/swig/4.2.1/inttypes.i +usr/share/swig/4.2.1/java/ +usr/share/swig/4.2.1/java/argcargv.i +usr/share/swig/4.2.1/java/arrays_java.i +usr/share/swig/4.2.1/java/boost_intrusive_ptr.i +usr/share/swig/4.2.1/java/boost_shared_ptr.i +usr/share/swig/4.2.1/java/director.swg +usr/share/swig/4.2.1/java/enums.swg +usr/share/swig/4.2.1/java/enumsimple.swg +usr/share/swig/4.2.1/java/enumtypesafe.swg +usr/share/swig/4.2.1/java/enumtypeunsafe.swg +usr/share/swig/4.2.1/java/java.swg +usr/share/swig/4.2.1/java/javahead.swg +usr/share/swig/4.2.1/java/javakw.swg +usr/share/swig/4.2.1/java/std_array.i +usr/share/swig/4.2.1/java/std_auto_ptr.i +usr/share/swig/4.2.1/java/std_common.i +usr/share/swig/4.2.1/java/std_deque.i +usr/share/swig/4.2.1/java/std_except.i +usr/share/swig/4.2.1/java/std_list.i +usr/share/swig/4.2.1/java/std_map.i +usr/share/swig/4.2.1/java/std_pair.i +usr/share/swig/4.2.1/java/std_set.i +usr/share/swig/4.2.1/java/std_shared_ptr.i +usr/share/swig/4.2.1/java/std_string.i +usr/share/swig/4.2.1/java/std_string_view.i +usr/share/swig/4.2.1/java/std_unique_ptr.i +usr/share/swig/4.2.1/java/std_unordered_map.i +usr/share/swig/4.2.1/java/std_unordered_set.i +usr/share/swig/4.2.1/java/std_vector.i +usr/share/swig/4.2.1/java/std_wstring.i +usr/share/swig/4.2.1/java/stl.i +usr/share/swig/4.2.1/java/swiginterface.i +usr/share/swig/4.2.1/java/swigmove.i +usr/share/swig/4.2.1/java/typemaps.i +usr/share/swig/4.2.1/java/various.i +usr/share/swig/4.2.1/javascript/ +usr/share/swig/4.2.1/javascript/jsc/ +usr/share/swig/4.2.1/javascript/jsc/argcargv.i +usr/share/swig/4.2.1/javascript/jsc/arrays_javascript.i +usr/share/swig/4.2.1/javascript/jsc/ccomplex.i +usr/share/swig/4.2.1/javascript/jsc/cdata.i +usr/share/swig/4.2.1/javascript/jsc/cmalloc.i +usr/share/swig/4.2.1/javascript/jsc/complex.i +usr/share/swig/4.2.1/javascript/jsc/exception.i +usr/share/swig/4.2.1/javascript/jsc/factory.i +usr/share/swig/4.2.1/javascript/jsc/javascript.swg +usr/share/swig/4.2.1/javascript/jsc/javascriptcode.swg +usr/share/swig/4.2.1/javascript/jsc/javascriptcomplex.swg +usr/share/swig/4.2.1/javascript/jsc/javascriptfragments.swg +usr/share/swig/4.2.1/javascript/jsc/javascripthelpers.swg +usr/share/swig/4.2.1/javascript/jsc/javascriptinit.swg +usr/share/swig/4.2.1/javascript/jsc/javascriptprimtypes.swg +usr/share/swig/4.2.1/javascript/jsc/javascriptrun.swg +usr/share/swig/4.2.1/javascript/jsc/javascriptruntime.swg +usr/share/swig/4.2.1/javascript/jsc/javascriptstrings.swg +usr/share/swig/4.2.1/javascript/jsc/javascripttypemaps.swg +usr/share/swig/4.2.1/javascript/jsc/std_auto_ptr.i +usr/share/swig/4.2.1/javascript/jsc/std_common.i +usr/share/swig/4.2.1/javascript/jsc/std_complex.i +usr/share/swig/4.2.1/javascript/jsc/std_deque.i +usr/share/swig/4.2.1/javascript/jsc/std_except.i +usr/share/swig/4.2.1/javascript/jsc/std_map.i +usr/share/swig/4.2.1/javascript/jsc/std_pair.i +usr/share/swig/4.2.1/javascript/jsc/std_string.i +usr/share/swig/4.2.1/javascript/jsc/std_unique_ptr.i +usr/share/swig/4.2.1/javascript/jsc/std_vector.i +usr/share/swig/4.2.1/javascript/jsc/stl.i +usr/share/swig/4.2.1/javascript/jsc/swigmove.i +usr/share/swig/4.2.1/javascript/jsc/typemaps.i +usr/share/swig/4.2.1/javascript/napi/ +usr/share/swig/4.2.1/javascript/napi/argcargv.i +usr/share/swig/4.2.1/javascript/napi/arrays_javascript.i +usr/share/swig/4.2.1/javascript/napi/ccomplex.i +usr/share/swig/4.2.1/javascript/napi/cdata.i +usr/share/swig/4.2.1/javascript/napi/cmalloc.i +usr/share/swig/4.2.1/javascript/napi/complex.i +usr/share/swig/4.2.1/javascript/napi/exception.i +usr/share/swig/4.2.1/javascript/napi/factory.i +usr/share/swig/4.2.1/javascript/napi/javascript.swg +usr/share/swig/4.2.1/javascript/napi/javascriptcode.swg +usr/share/swig/4.2.1/javascript/napi/javascriptcomplex.swg +usr/share/swig/4.2.1/javascript/napi/javascriptfragments.swg +usr/share/swig/4.2.1/javascript/napi/javascriptinit.swg +usr/share/swig/4.2.1/javascript/napi/javascriptprimtypes.swg +usr/share/swig/4.2.1/javascript/napi/javascriptrun.swg +usr/share/swig/4.2.1/javascript/napi/javascriptruntime.swg +usr/share/swig/4.2.1/javascript/napi/javascriptstrings.swg +usr/share/swig/4.2.1/javascript/napi/javascripttypemaps.swg +usr/share/swig/4.2.1/javascript/napi/nodejs_buffer.i +usr/share/swig/4.2.1/javascript/napi/std_auto_ptr.i +usr/share/swig/4.2.1/javascript/napi/std_common.i +usr/share/swig/4.2.1/javascript/napi/std_complex.i +usr/share/swig/4.2.1/javascript/napi/std_deque.i +usr/share/swig/4.2.1/javascript/napi/std_except.i +usr/share/swig/4.2.1/javascript/napi/std_map.i +usr/share/swig/4.2.1/javascript/napi/std_pair.i +usr/share/swig/4.2.1/javascript/napi/std_string.i +usr/share/swig/4.2.1/javascript/napi/std_unique_ptr.i +usr/share/swig/4.2.1/javascript/napi/std_vector.i +usr/share/swig/4.2.1/javascript/napi/stl.i +usr/share/swig/4.2.1/javascript/napi/swigmove.i +usr/share/swig/4.2.1/javascript/napi/typemaps.i +usr/share/swig/4.2.1/javascript/v8/ +usr/share/swig/4.2.1/javascript/v8/argcargv.i +usr/share/swig/4.2.1/javascript/v8/arrays_javascript.i +usr/share/swig/4.2.1/javascript/v8/ccomplex.i +usr/share/swig/4.2.1/javascript/v8/cdata.i +usr/share/swig/4.2.1/javascript/v8/cmalloc.i +usr/share/swig/4.2.1/javascript/v8/complex.i +usr/share/swig/4.2.1/javascript/v8/exception.i +usr/share/swig/4.2.1/javascript/v8/factory.i +usr/share/swig/4.2.1/javascript/v8/javascript.swg +usr/share/swig/4.2.1/javascript/v8/javascriptcode.swg +usr/share/swig/4.2.1/javascript/v8/javascriptcomplex.swg +usr/share/swig/4.2.1/javascript/v8/javascriptfragments.swg +usr/share/swig/4.2.1/javascript/v8/javascripthelpers.swg +usr/share/swig/4.2.1/javascript/v8/javascriptinit.swg +usr/share/swig/4.2.1/javascript/v8/javascriptprimtypes.swg +usr/share/swig/4.2.1/javascript/v8/javascriptrun.swg +usr/share/swig/4.2.1/javascript/v8/javascriptruntime.swg +usr/share/swig/4.2.1/javascript/v8/javascriptstrings.swg +usr/share/swig/4.2.1/javascript/v8/javascripttypemaps.swg +usr/share/swig/4.2.1/javascript/v8/std_auto_ptr.i +usr/share/swig/4.2.1/javascript/v8/std_common.i +usr/share/swig/4.2.1/javascript/v8/std_complex.i +usr/share/swig/4.2.1/javascript/v8/std_deque.i +usr/share/swig/4.2.1/javascript/v8/std_except.i +usr/share/swig/4.2.1/javascript/v8/std_map.i +usr/share/swig/4.2.1/javascript/v8/std_pair.i +usr/share/swig/4.2.1/javascript/v8/std_string.i +usr/share/swig/4.2.1/javascript/v8/std_unique_ptr.i +usr/share/swig/4.2.1/javascript/v8/std_vector.i +usr/share/swig/4.2.1/javascript/v8/stl.i +usr/share/swig/4.2.1/javascript/v8/swigmove.i +usr/share/swig/4.2.1/javascript/v8/typemaps.i +usr/share/swig/4.2.1/javascriptkw.swg +usr/share/swig/4.2.1/lua/ +usr/share/swig/4.2.1/lua/_std_common.i +usr/share/swig/4.2.1/lua/argcargv.i +usr/share/swig/4.2.1/lua/carrays.i +usr/share/swig/4.2.1/lua/factory.i +usr/share/swig/4.2.1/lua/lua.swg +usr/share/swig/4.2.1/lua/lua_fnptr.i +usr/share/swig/4.2.1/lua/luakw.swg +usr/share/swig/4.2.1/lua/luarun.swg +usr/share/swig/4.2.1/lua/luaruntime.swg +usr/share/swig/4.2.1/lua/luatypemaps.swg +usr/share/swig/4.2.1/lua/std_auto_ptr.i +usr/share/swig/4.2.1/lua/std_common.i +usr/share/swig/4.2.1/lua/std_deque.i +usr/share/swig/4.2.1/lua/std_except.i +usr/share/swig/4.2.1/lua/std_map.i +usr/share/swig/4.2.1/lua/std_pair.i +usr/share/swig/4.2.1/lua/std_string.i +usr/share/swig/4.2.1/lua/std_string_view.i +usr/share/swig/4.2.1/lua/std_unique_ptr.i +usr/share/swig/4.2.1/lua/std_vector.i +usr/share/swig/4.2.1/lua/stl.i +usr/share/swig/4.2.1/lua/swigmove.i +usr/share/swig/4.2.1/lua/typemaps.i +usr/share/swig/4.2.1/lua/wchar.i +usr/share/swig/4.2.1/math.i +usr/share/swig/4.2.1/mzscheme/ +usr/share/swig/4.2.1/mzscheme/argcargv.i +usr/share/swig/4.2.1/mzscheme/mzrun.swg +usr/share/swig/4.2.1/mzscheme/mzscheme.swg +usr/share/swig/4.2.1/mzscheme/std_auto_ptr.i +usr/share/swig/4.2.1/mzscheme/std_common.i +usr/share/swig/4.2.1/mzscheme/std_deque.i +usr/share/swig/4.2.1/mzscheme/std_map.i +usr/share/swig/4.2.1/mzscheme/std_pair.i +usr/share/swig/4.2.1/mzscheme/std_string.i +usr/share/swig/4.2.1/mzscheme/std_unique_ptr.i +usr/share/swig/4.2.1/mzscheme/std_vector.i +usr/share/swig/4.2.1/mzscheme/stl.i +usr/share/swig/4.2.1/mzscheme/swigmove.i +usr/share/swig/4.2.1/mzscheme/typemaps.i +usr/share/swig/4.2.1/ocaml/ +usr/share/swig/4.2.1/ocaml/carray.i +usr/share/swig/4.2.1/ocaml/class.swg +usr/share/swig/4.2.1/ocaml/cstring.i +usr/share/swig/4.2.1/ocaml/director.swg +usr/share/swig/4.2.1/ocaml/ocaml.i +usr/share/swig/4.2.1/ocaml/ocaml.swg +usr/share/swig/4.2.1/ocaml/ocamlkw.swg +usr/share/swig/4.2.1/ocaml/ocamlrun.swg +usr/share/swig/4.2.1/ocaml/ocamlrundec.swg +usr/share/swig/4.2.1/ocaml/preamble.swg +usr/share/swig/4.2.1/ocaml/std_common.i +usr/share/swig/4.2.1/ocaml/std_complex.i +usr/share/swig/4.2.1/ocaml/std_deque.i +usr/share/swig/4.2.1/ocaml/std_except.i +usr/share/swig/4.2.1/ocaml/std_list.i +usr/share/swig/4.2.1/ocaml/std_map.i +usr/share/swig/4.2.1/ocaml/std_pair.i +usr/share/swig/4.2.1/ocaml/std_string.i +usr/share/swig/4.2.1/ocaml/std_vector.i +usr/share/swig/4.2.1/ocaml/stl.i +usr/share/swig/4.2.1/ocaml/swig.ml +usr/share/swig/4.2.1/ocaml/swig.mli +usr/share/swig/4.2.1/ocaml/swigmove.i +usr/share/swig/4.2.1/ocaml/swigp4.ml +usr/share/swig/4.2.1/ocaml/typecheck.i +usr/share/swig/4.2.1/ocaml/typemaps.i +usr/share/swig/4.2.1/ocaml/typeregister.swg +usr/share/swig/4.2.1/octave/ +usr/share/swig/4.2.1/octave/argcargv.i +usr/share/swig/4.2.1/octave/attribute.i +usr/share/swig/4.2.1/octave/boost_shared_ptr.i +usr/share/swig/4.2.1/octave/carrays.i +usr/share/swig/4.2.1/octave/cdata.i +usr/share/swig/4.2.1/octave/cmalloc.i +usr/share/swig/4.2.1/octave/director.swg +usr/share/swig/4.2.1/octave/exception.i +usr/share/swig/4.2.1/octave/factory.i +usr/share/swig/4.2.1/octave/implicit.i +usr/share/swig/4.2.1/octave/octave.swg +usr/share/swig/4.2.1/octave/octcomplex.swg +usr/share/swig/4.2.1/octave/octcontainer.swg +usr/share/swig/4.2.1/octave/octfragments.swg +usr/share/swig/4.2.1/octave/octheaders.hpp +usr/share/swig/4.2.1/octave/octiterators.swg +usr/share/swig/4.2.1/octave/octopers.swg +usr/share/swig/4.2.1/octave/octprimtypes.swg +usr/share/swig/4.2.1/octave/octrun.swg +usr/share/swig/4.2.1/octave/octruntime.swg +usr/share/swig/4.2.1/octave/octstdcommon.swg +usr/share/swig/4.2.1/octave/octtypemaps.swg +usr/share/swig/4.2.1/octave/octuserdir.swg +usr/share/swig/4.2.1/octave/std_alloc.i +usr/share/swig/4.2.1/octave/std_auto_ptr.i +usr/share/swig/4.2.1/octave/std_basic_string.i +usr/share/swig/4.2.1/octave/std_char_traits.i +usr/share/swig/4.2.1/octave/std_common.i +usr/share/swig/4.2.1/octave/std_complex.i +usr/share/swig/4.2.1/octave/std_container.i +usr/share/swig/4.2.1/octave/std_deque.i +usr/share/swig/4.2.1/octave/std_except.i +usr/share/swig/4.2.1/octave/std_list.i +usr/share/swig/4.2.1/octave/std_map.i +usr/share/swig/4.2.1/octave/std_pair.i +usr/share/swig/4.2.1/octave/std_shared_ptr.i +usr/share/swig/4.2.1/octave/std_string.i +usr/share/swig/4.2.1/octave/std_unique_ptr.i +usr/share/swig/4.2.1/octave/std_vector.i +usr/share/swig/4.2.1/octave/std_wstring.i +usr/share/swig/4.2.1/octave/stl.i +usr/share/swig/4.2.1/octave/swigmove.i +usr/share/swig/4.2.1/octave/typemaps.i +usr/share/swig/4.2.1/perl5/ +usr/share/swig/4.2.1/perl5/argcargv.i +usr/share/swig/4.2.1/perl5/attribute.i +usr/share/swig/4.2.1/perl5/carrays.i +usr/share/swig/4.2.1/perl5/cdata.i +usr/share/swig/4.2.1/perl5/cmalloc.i +usr/share/swig/4.2.1/perl5/cpointer.i +usr/share/swig/4.2.1/perl5/cstring.i +usr/share/swig/4.2.1/perl5/director.swg +usr/share/swig/4.2.1/perl5/exception.i +usr/share/swig/4.2.1/perl5/factory.i +usr/share/swig/4.2.1/perl5/Makefile.pl +usr/share/swig/4.2.1/perl5/noembed.h +usr/share/swig/4.2.1/perl5/perl5.swg +usr/share/swig/4.2.1/perl5/perlerrors.swg +usr/share/swig/4.2.1/perl5/perlfragments.swg +usr/share/swig/4.2.1/perl5/perlhead.swg +usr/share/swig/4.2.1/perl5/perlinit.swg +usr/share/swig/4.2.1/perl5/perlkw.swg +usr/share/swig/4.2.1/perl5/perlmacros.swg +usr/share/swig/4.2.1/perl5/perlmain.i +usr/share/swig/4.2.1/perl5/perlopers.swg +usr/share/swig/4.2.1/perl5/perlprimtypes.swg +usr/share/swig/4.2.1/perl5/perlrun.swg +usr/share/swig/4.2.1/perl5/perlruntime.swg +usr/share/swig/4.2.1/perl5/perlstrings.swg +usr/share/swig/4.2.1/perl5/perltypemaps.swg +usr/share/swig/4.2.1/perl5/perluserdir.swg +usr/share/swig/4.2.1/perl5/reference.i +usr/share/swig/4.2.1/perl5/std_auto_ptr.i +usr/share/swig/4.2.1/perl5/std_common.i +usr/share/swig/4.2.1/perl5/std_deque.i +usr/share/swig/4.2.1/perl5/std_except.i +usr/share/swig/4.2.1/perl5/std_list.i +usr/share/swig/4.2.1/perl5/std_map.i +usr/share/swig/4.2.1/perl5/std_pair.i +usr/share/swig/4.2.1/perl5/std_string.i +usr/share/swig/4.2.1/perl5/std_string_view.i +usr/share/swig/4.2.1/perl5/std_unique_ptr.i +usr/share/swig/4.2.1/perl5/std_vector.i +usr/share/swig/4.2.1/perl5/stl.i +usr/share/swig/4.2.1/perl5/swigmove.i +usr/share/swig/4.2.1/perl5/typemaps.i +usr/share/swig/4.2.1/php/ +usr/share/swig/4.2.1/php/argcargv.i +usr/share/swig/4.2.1/php/const.i +usr/share/swig/4.2.1/php/director.swg +usr/share/swig/4.2.1/php/factory.i +usr/share/swig/4.2.1/php/php.swg +usr/share/swig/4.2.1/php/phpinit.swg +usr/share/swig/4.2.1/php/phpinterfaces.i +usr/share/swig/4.2.1/php/phpkw.swg +usr/share/swig/4.2.1/php/phppointers.i +usr/share/swig/4.2.1/php/phprun.swg +usr/share/swig/4.2.1/php/std_auto_ptr.i +usr/share/swig/4.2.1/php/std_common.i +usr/share/swig/4.2.1/php/std_deque.i +usr/share/swig/4.2.1/php/std_map.i +usr/share/swig/4.2.1/php/std_pair.i +usr/share/swig/4.2.1/php/std_string.i +usr/share/swig/4.2.1/php/std_string_view.i +usr/share/swig/4.2.1/php/std_unique_ptr.i +usr/share/swig/4.2.1/php/std_vector.i +usr/share/swig/4.2.1/php/stl.i +usr/share/swig/4.2.1/php/swigmove.i +usr/share/swig/4.2.1/php/typemaps.i +usr/share/swig/4.2.1/php/utils.i +usr/share/swig/4.2.1/python/ +usr/share/swig/4.2.1/python/argcargv.i +usr/share/swig/4.2.1/python/attribute.i +usr/share/swig/4.2.1/python/boost_shared_ptr.i +usr/share/swig/4.2.1/python/builtin.swg +usr/share/swig/4.2.1/python/carrays.i +usr/share/swig/4.2.1/python/ccomplex.i +usr/share/swig/4.2.1/python/cdata.i +usr/share/swig/4.2.1/python/cmalloc.i +usr/share/swig/4.2.1/python/complex.i +usr/share/swig/4.2.1/python/cpointer.i +usr/share/swig/4.2.1/python/cstring.i +usr/share/swig/4.2.1/python/cwstring.i +usr/share/swig/4.2.1/python/director.swg +usr/share/swig/4.2.1/python/embed.i +usr/share/swig/4.2.1/python/exception.i +usr/share/swig/4.2.1/python/factory.i +usr/share/swig/4.2.1/python/file.i +usr/share/swig/4.2.1/python/implicit.i +usr/share/swig/4.2.1/python/pyabc.i +usr/share/swig/4.2.1/python/pyapi.swg +usr/share/swig/4.2.1/python/pybackward.swg +usr/share/swig/4.2.1/python/pybuffer.i +usr/share/swig/4.2.1/python/pyclasses.swg +usr/share/swig/4.2.1/python/pycomplex.swg +usr/share/swig/4.2.1/python/pycontainer.swg +usr/share/swig/4.2.1/python/pydocs.swg +usr/share/swig/4.2.1/python/pyerrors.swg +usr/share/swig/4.2.1/python/pyfragments.swg +usr/share/swig/4.2.1/python/pyhead.swg +usr/share/swig/4.2.1/python/pyinit.swg +usr/share/swig/4.2.1/python/pyiterators.swg +usr/share/swig/4.2.1/python/pymacros.swg +usr/share/swig/4.2.1/python/pyname_compat.i +usr/share/swig/4.2.1/python/pyopers.swg +usr/share/swig/4.2.1/python/pyprimtypes.swg +usr/share/swig/4.2.1/python/pyrun.swg +usr/share/swig/4.2.1/python/pyruntime.swg +usr/share/swig/4.2.1/python/pystdcommon.swg +usr/share/swig/4.2.1/python/pystrings.swg +usr/share/swig/4.2.1/python/python.swg +usr/share/swig/4.2.1/python/pythonkw.swg +usr/share/swig/4.2.1/python/pythreads.swg +usr/share/swig/4.2.1/python/pytuplehlp.swg +usr/share/swig/4.2.1/python/pytypemaps.swg +usr/share/swig/4.2.1/python/pyuserdir.swg +usr/share/swig/4.2.1/python/pywstrings.swg +usr/share/swig/4.2.1/python/std_alloc.i +usr/share/swig/4.2.1/python/std_array.i +usr/share/swig/4.2.1/python/std_auto_ptr.i +usr/share/swig/4.2.1/python/std_basic_string.i +usr/share/swig/4.2.1/python/std_char_traits.i +usr/share/swig/4.2.1/python/std_common.i +usr/share/swig/4.2.1/python/std_complex.i +usr/share/swig/4.2.1/python/std_container.i +usr/share/swig/4.2.1/python/std_deque.i +usr/share/swig/4.2.1/python/std_except.i +usr/share/swig/4.2.1/python/std_filesystem.i +usr/share/swig/4.2.1/python/std_ios.i +usr/share/swig/4.2.1/python/std_iostream.i +usr/share/swig/4.2.1/python/std_list.i +usr/share/swig/4.2.1/python/std_map.i +usr/share/swig/4.2.1/python/std_multimap.i +usr/share/swig/4.2.1/python/std_multiset.i +usr/share/swig/4.2.1/python/std_pair.i +usr/share/swig/4.2.1/python/std_set.i +usr/share/swig/4.2.1/python/std_shared_ptr.i +usr/share/swig/4.2.1/python/std_sstream.i +usr/share/swig/4.2.1/python/std_streambuf.i +usr/share/swig/4.2.1/python/std_string.i +usr/share/swig/4.2.1/python/std_string_view.i +usr/share/swig/4.2.1/python/std_unique_ptr.i +usr/share/swig/4.2.1/python/std_unordered_map.i +usr/share/swig/4.2.1/python/std_unordered_multimap.i +usr/share/swig/4.2.1/python/std_unordered_multiset.i +usr/share/swig/4.2.1/python/std_unordered_set.i +usr/share/swig/4.2.1/python/std_vector.i +usr/share/swig/4.2.1/python/std_vectora.i +usr/share/swig/4.2.1/python/std_wios.i +usr/share/swig/4.2.1/python/std_wiostream.i +usr/share/swig/4.2.1/python/std_wsstream.i +usr/share/swig/4.2.1/python/std_wstreambuf.i +usr/share/swig/4.2.1/python/std_wstring.i +usr/share/swig/4.2.1/python/stl.i +usr/share/swig/4.2.1/python/swigmove.i +usr/share/swig/4.2.1/python/typemaps.i +usr/share/swig/4.2.1/python/wchar.i +usr/share/swig/4.2.1/r/ +usr/share/swig/4.2.1/r/argcargv.i +usr/share/swig/4.2.1/r/boost_shared_ptr.i +usr/share/swig/4.2.1/r/cdata.i +usr/share/swig/4.2.1/r/exception.i +usr/share/swig/4.2.1/r/r.swg +usr/share/swig/4.2.1/r/rcontainer.swg +usr/share/swig/4.2.1/r/rfragments.swg +usr/share/swig/4.2.1/r/rkw.swg +usr/share/swig/4.2.1/r/ropers.swg +usr/share/swig/4.2.1/r/rrun.swg +usr/share/swig/4.2.1/r/rstdcommon.swg +usr/share/swig/4.2.1/r/rtype.swg +usr/share/swig/4.2.1/r/srun.swg +usr/share/swig/4.2.1/r/std_alloc.i +usr/share/swig/4.2.1/r/std_common.i +usr/share/swig/4.2.1/r/std_container.i +usr/share/swig/4.2.1/r/std_deque.i +usr/share/swig/4.2.1/r/std_except.i +usr/share/swig/4.2.1/r/std_list.i +usr/share/swig/4.2.1/r/std_map.i +usr/share/swig/4.2.1/r/std_pair.i +usr/share/swig/4.2.1/r/std_shared_ptr.i +usr/share/swig/4.2.1/r/std_string.i +usr/share/swig/4.2.1/r/std_vector.i +usr/share/swig/4.2.1/r/stl.i +usr/share/swig/4.2.1/r/swigmove.i +usr/share/swig/4.2.1/r/typemaps.i +usr/share/swig/4.2.1/ruby/ +usr/share/swig/4.2.1/ruby/argcargv.i +usr/share/swig/4.2.1/ruby/attribute.i +usr/share/swig/4.2.1/ruby/boost_shared_ptr.i +usr/share/swig/4.2.1/ruby/carrays.i +usr/share/swig/4.2.1/ruby/cdata.i +usr/share/swig/4.2.1/ruby/cmalloc.i +usr/share/swig/4.2.1/ruby/cpointer.i +usr/share/swig/4.2.1/ruby/cstring.i +usr/share/swig/4.2.1/ruby/director.swg +usr/share/swig/4.2.1/ruby/embed.i +usr/share/swig/4.2.1/ruby/exception.i +usr/share/swig/4.2.1/ruby/extconf.rb +usr/share/swig/4.2.1/ruby/factory.i +usr/share/swig/4.2.1/ruby/file.i +usr/share/swig/4.2.1/ruby/Makefile.swig +usr/share/swig/4.2.1/ruby/progargcargv.i +usr/share/swig/4.2.1/ruby/ruby.swg +usr/share/swig/4.2.1/ruby/rubyapi.swg +usr/share/swig/4.2.1/ruby/rubyautodoc.swg +usr/share/swig/4.2.1/ruby/rubyclasses.swg +usr/share/swig/4.2.1/ruby/rubycomplex.swg +usr/share/swig/4.2.1/ruby/rubycontainer.swg +usr/share/swig/4.2.1/ruby/rubycontainer_extended.swg +usr/share/swig/4.2.1/ruby/rubydef.swg +usr/share/swig/4.2.1/ruby/rubyerrors.swg +usr/share/swig/4.2.1/ruby/rubyfragments.swg +usr/share/swig/4.2.1/ruby/rubyhead.swg +usr/share/swig/4.2.1/ruby/rubyinit.swg +usr/share/swig/4.2.1/ruby/rubyiterators.swg +usr/share/swig/4.2.1/ruby/rubykw.swg +usr/share/swig/4.2.1/ruby/rubymacros.swg +usr/share/swig/4.2.1/ruby/rubyopers.swg +usr/share/swig/4.2.1/ruby/rubyprimtypes.swg +usr/share/swig/4.2.1/ruby/rubyrun.swg +usr/share/swig/4.2.1/ruby/rubyruntime.swg +usr/share/swig/4.2.1/ruby/rubystdautodoc.swg +usr/share/swig/4.2.1/ruby/rubystdcommon.swg +usr/share/swig/4.2.1/ruby/rubystdcommon_forward.swg +usr/share/swig/4.2.1/ruby/rubystdfunctors.swg +usr/share/swig/4.2.1/ruby/rubystrings.swg +usr/share/swig/4.2.1/ruby/rubytracking.swg +usr/share/swig/4.2.1/ruby/rubytypemaps.swg +usr/share/swig/4.2.1/ruby/rubyuserdir.swg +usr/share/swig/4.2.1/ruby/rubywstrings.swg +usr/share/swig/4.2.1/ruby/std_alloc.i +usr/share/swig/4.2.1/ruby/std_array.i +usr/share/swig/4.2.1/ruby/std_auto_ptr.i +usr/share/swig/4.2.1/ruby/std_basic_string.i +usr/share/swig/4.2.1/ruby/std_char_traits.i +usr/share/swig/4.2.1/ruby/std_common.i +usr/share/swig/4.2.1/ruby/std_complex.i +usr/share/swig/4.2.1/ruby/std_container.i +usr/share/swig/4.2.1/ruby/std_deque.i +usr/share/swig/4.2.1/ruby/std_except.i +usr/share/swig/4.2.1/ruby/std_functors.i +usr/share/swig/4.2.1/ruby/std_ios.i +usr/share/swig/4.2.1/ruby/std_iostream.i +usr/share/swig/4.2.1/ruby/std_list.i +usr/share/swig/4.2.1/ruby/std_map.i +usr/share/swig/4.2.1/ruby/std_multimap.i +usr/share/swig/4.2.1/ruby/std_multiset.i +usr/share/swig/4.2.1/ruby/std_pair.i +usr/share/swig/4.2.1/ruby/std_queue.i +usr/share/swig/4.2.1/ruby/std_set.i +usr/share/swig/4.2.1/ruby/std_shared_ptr.i +usr/share/swig/4.2.1/ruby/std_sstream.i +usr/share/swig/4.2.1/ruby/std_stack.i +usr/share/swig/4.2.1/ruby/std_streambuf.i +usr/share/swig/4.2.1/ruby/std_string.i +usr/share/swig/4.2.1/ruby/std_string_view.i +usr/share/swig/4.2.1/ruby/std_unique_ptr.i +usr/share/swig/4.2.1/ruby/std_unordered_map.i +usr/share/swig/4.2.1/ruby/std_unordered_multimap.i +usr/share/swig/4.2.1/ruby/std_unordered_multiset.i +usr/share/swig/4.2.1/ruby/std_unordered_set.i +usr/share/swig/4.2.1/ruby/std_vector.i +usr/share/swig/4.2.1/ruby/std_vectora.i +usr/share/swig/4.2.1/ruby/std_wstring.i +usr/share/swig/4.2.1/ruby/stl.i +usr/share/swig/4.2.1/ruby/swigmove.i +usr/share/swig/4.2.1/ruby/timeval.i +usr/share/swig/4.2.1/ruby/typemaps.i +usr/share/swig/4.2.1/runtime.swg +usr/share/swig/4.2.1/scilab/ +usr/share/swig/4.2.1/scilab/argcargv.i +usr/share/swig/4.2.1/scilab/boost_shared_ptr.i +usr/share/swig/4.2.1/scilab/carrays.i +usr/share/swig/4.2.1/scilab/cmalloc.i +usr/share/swig/4.2.1/scilab/cpointer.i +usr/share/swig/4.2.1/scilab/exception.i +usr/share/swig/4.2.1/scilab/matrix.i +usr/share/swig/4.2.1/scilab/sciarray.swg +usr/share/swig/4.2.1/scilab/scibool.swg +usr/share/swig/4.2.1/scilab/scichar.swg +usr/share/swig/4.2.1/scilab/scicontainer.swg +usr/share/swig/4.2.1/scilab/scidouble.swg +usr/share/swig/4.2.1/scilab/scienum.swg +usr/share/swig/4.2.1/scilab/sciexception.swg +usr/share/swig/4.2.1/scilab/scifloat.swg +usr/share/swig/4.2.1/scilab/sciint.swg +usr/share/swig/4.2.1/scilab/sciiterators.swg +usr/share/swig/4.2.1/scilab/scilab.swg +usr/share/swig/4.2.1/scilab/scilist.swg +usr/share/swig/4.2.1/scilab/scilong.swg +usr/share/swig/4.2.1/scilab/scilonglong.swg +usr/share/swig/4.2.1/scilab/scimacros.swg +usr/share/swig/4.2.1/scilab/scimatrixbool.swg +usr/share/swig/4.2.1/scilab/scimatrixchar.swg +usr/share/swig/4.2.1/scilab/scimatrixdouble.swg +usr/share/swig/4.2.1/scilab/scimatrixint.swg +usr/share/swig/4.2.1/scilab/scimisctypes.swg +usr/share/swig/4.2.1/scilab/scipointer.swg +usr/share/swig/4.2.1/scilab/sciprimtypes.swg +usr/share/swig/4.2.1/scilab/scirun.swg +usr/share/swig/4.2.1/scilab/sciruntime.swg +usr/share/swig/4.2.1/scilab/scisequence.swg +usr/share/swig/4.2.1/scilab/scisequencebool.swg +usr/share/swig/4.2.1/scilab/scisequencedouble.swg +usr/share/swig/4.2.1/scilab/scisequencefloat.swg +usr/share/swig/4.2.1/scilab/scisequenceint.swg +usr/share/swig/4.2.1/scilab/scisequencepointer.swg +usr/share/swig/4.2.1/scilab/scisequencestring.swg +usr/share/swig/4.2.1/scilab/scishort.swg +usr/share/swig/4.2.1/scilab/scisignedchar.swg +usr/share/swig/4.2.1/scilab/scistdcommon.swg +usr/share/swig/4.2.1/scilab/scitypemaps.swg +usr/share/swig/4.2.1/scilab/sciunsignedchar.swg +usr/share/swig/4.2.1/scilab/sciunsignedint.swg +usr/share/swig/4.2.1/scilab/sciunsignedlong.swg +usr/share/swig/4.2.1/scilab/sciunsignedshort.swg +usr/share/swig/4.2.1/scilab/std_alloc.i +usr/share/swig/4.2.1/scilab/std_basic_string.i +usr/share/swig/4.2.1/scilab/std_char_traits.i +usr/share/swig/4.2.1/scilab/std_common.i +usr/share/swig/4.2.1/scilab/std_container.i +usr/share/swig/4.2.1/scilab/std_deque.i +usr/share/swig/4.2.1/scilab/std_except.i +usr/share/swig/4.2.1/scilab/std_list.i +usr/share/swig/4.2.1/scilab/std_map.i +usr/share/swig/4.2.1/scilab/std_multiset.i +usr/share/swig/4.2.1/scilab/std_pair.i +usr/share/swig/4.2.1/scilab/std_set.i +usr/share/swig/4.2.1/scilab/std_shared_ptr.i +usr/share/swig/4.2.1/scilab/std_string.i +usr/share/swig/4.2.1/scilab/std_vector.i +usr/share/swig/4.2.1/scilab/stl.i +usr/share/swig/4.2.1/scilab/swigmove.i +usr/share/swig/4.2.1/scilab/typemaps.i +usr/share/swig/4.2.1/shared_ptr.i +usr/share/swig/4.2.1/std/ +usr/share/swig/4.2.1/std/_std_deque.i +usr/share/swig/4.2.1/std/std_alloc.i +usr/share/swig/4.2.1/std/std_array.i +usr/share/swig/4.2.1/std/std_basic_string.i +usr/share/swig/4.2.1/std/std_char_traits.i +usr/share/swig/4.2.1/std/std_common.i +usr/share/swig/4.2.1/std/std_container.i +usr/share/swig/4.2.1/std/std_deque.i +usr/share/swig/4.2.1/std/std_except.i +usr/share/swig/4.2.1/std/std_ios.i +usr/share/swig/4.2.1/std/std_iostream.i +usr/share/swig/4.2.1/std/std_list.i +usr/share/swig/4.2.1/std/std_map.i +usr/share/swig/4.2.1/std/std_multimap.i +usr/share/swig/4.2.1/std/std_multiset.i +usr/share/swig/4.2.1/std/std_pair.i +usr/share/swig/4.2.1/std/std_queue.i +usr/share/swig/4.2.1/std/std_set.i +usr/share/swig/4.2.1/std/std_sstream.i +usr/share/swig/4.2.1/std/std_stack.i +usr/share/swig/4.2.1/std/std_streambuf.i +usr/share/swig/4.2.1/std/std_string.i +usr/share/swig/4.2.1/std/std_unordered_map.i +usr/share/swig/4.2.1/std/std_unordered_multimap.i +usr/share/swig/4.2.1/std/std_unordered_multiset.i +usr/share/swig/4.2.1/std/std_unordered_set.i +usr/share/swig/4.2.1/std/std_vector.i +usr/share/swig/4.2.1/std/std_vectora.i +usr/share/swig/4.2.1/std/std_wios.i +usr/share/swig/4.2.1/std/std_wiostream.i +usr/share/swig/4.2.1/std/std_wsstream.i +usr/share/swig/4.2.1/std/std_wstreambuf.i +usr/share/swig/4.2.1/std/std_wstring.i +usr/share/swig/4.2.1/std_except.i +usr/share/swig/4.2.1/stdint.i +usr/share/swig/4.2.1/stl.i +usr/share/swig/4.2.1/swig.swg +usr/share/swig/4.2.1/swigarch.i +usr/share/swig/4.2.1/swigcompat.swg +usr/share/swig/4.2.1/swigerrors.swg +usr/share/swig/4.2.1/swigfragments.swg +usr/share/swig/4.2.1/swiginit.swg +usr/share/swig/4.2.1/swiglabels.swg +usr/share/swig/4.2.1/swigrun.i +usr/share/swig/4.2.1/swigrun.swg +usr/share/swig/4.2.1/swigwarn.swg +usr/share/swig/4.2.1/swigwarnings.swg +usr/share/swig/4.2.1/tcl/ +usr/share/swig/4.2.1/tcl/argcargv.i +usr/share/swig/4.2.1/tcl/attribute.i +usr/share/swig/4.2.1/tcl/carrays.i +usr/share/swig/4.2.1/tcl/cdata.i +usr/share/swig/4.2.1/tcl/cmalloc.i +usr/share/swig/4.2.1/tcl/cpointer.i +usr/share/swig/4.2.1/tcl/cstring.i +usr/share/swig/4.2.1/tcl/cwstring.i +usr/share/swig/4.2.1/tcl/exception.i +usr/share/swig/4.2.1/tcl/factory.i +usr/share/swig/4.2.1/tcl/std_auto_ptr.i +usr/share/swig/4.2.1/tcl/std_common.i +usr/share/swig/4.2.1/tcl/std_deque.i +usr/share/swig/4.2.1/tcl/std_except.i +usr/share/swig/4.2.1/tcl/std_map.i +usr/share/swig/4.2.1/tcl/std_pair.i +usr/share/swig/4.2.1/tcl/std_string.i +usr/share/swig/4.2.1/tcl/std_string_view.i +usr/share/swig/4.2.1/tcl/std_unique_ptr.i +usr/share/swig/4.2.1/tcl/std_vector.i +usr/share/swig/4.2.1/tcl/std_wstring.i +usr/share/swig/4.2.1/tcl/stl.i +usr/share/swig/4.2.1/tcl/swigmove.i +usr/share/swig/4.2.1/tcl/tcl8.swg +usr/share/swig/4.2.1/tcl/tclapi.swg +usr/share/swig/4.2.1/tcl/tclerrors.swg +usr/share/swig/4.2.1/tcl/tclfragments.swg +usr/share/swig/4.2.1/tcl/tclinit.swg +usr/share/swig/4.2.1/tcl/tclinterp.i +usr/share/swig/4.2.1/tcl/tclkw.swg +usr/share/swig/4.2.1/tcl/tclmacros.swg +usr/share/swig/4.2.1/tcl/tclopers.swg +usr/share/swig/4.2.1/tcl/tclprimtypes.swg +usr/share/swig/4.2.1/tcl/tclresult.i +usr/share/swig/4.2.1/tcl/tclrun.swg +usr/share/swig/4.2.1/tcl/tclruntime.swg +usr/share/swig/4.2.1/tcl/tclsh.i +usr/share/swig/4.2.1/tcl/tclstrings.swg +usr/share/swig/4.2.1/tcl/tcltypemaps.swg +usr/share/swig/4.2.1/tcl/tcluserdir.swg +usr/share/swig/4.2.1/tcl/tclwstrings.swg +usr/share/swig/4.2.1/tcl/typemaps.i +usr/share/swig/4.2.1/tcl/wish.i +usr/share/swig/4.2.1/typemaps/ +usr/share/swig/4.2.1/typemaps/attribute.swg +usr/share/swig/4.2.1/typemaps/carrays.swg +usr/share/swig/4.2.1/typemaps/cdata.swg +usr/share/swig/4.2.1/typemaps/cmalloc.swg +usr/share/swig/4.2.1/typemaps/cpointer.swg +usr/share/swig/4.2.1/typemaps/cstring.swg +usr/share/swig/4.2.1/typemaps/cstrings.swg +usr/share/swig/4.2.1/typemaps/cwstring.swg +usr/share/swig/4.2.1/typemaps/enumint.swg +usr/share/swig/4.2.1/typemaps/exception.swg +usr/share/swig/4.2.1/typemaps/factory.swg +usr/share/swig/4.2.1/typemaps/fragments.swg +usr/share/swig/4.2.1/typemaps/implicit.swg +usr/share/swig/4.2.1/typemaps/inoutlist.swg +usr/share/swig/4.2.1/typemaps/misctypes.swg +usr/share/swig/4.2.1/typemaps/primtypes.swg +usr/share/swig/4.2.1/typemaps/ptrtypes.swg +usr/share/swig/4.2.1/typemaps/std_except.swg +usr/share/swig/4.2.1/typemaps/std_string.swg +usr/share/swig/4.2.1/typemaps/std_string_view.swg +usr/share/swig/4.2.1/typemaps/std_strings.swg +usr/share/swig/4.2.1/typemaps/std_wstring.swg +usr/share/swig/4.2.1/typemaps/string.swg +usr/share/swig/4.2.1/typemaps/strings.swg +usr/share/swig/4.2.1/typemaps/swigmacros.swg +usr/share/swig/4.2.1/typemaps/swigmove.swg +usr/share/swig/4.2.1/typemaps/swigobject.swg +usr/share/swig/4.2.1/typemaps/swigtype.swg +usr/share/swig/4.2.1/typemaps/swigtypemaps.swg +usr/share/swig/4.2.1/typemaps/typemaps.swg +usr/share/swig/4.2.1/typemaps/valtypes.swg +usr/share/swig/4.2.1/typemaps/void.swg +usr/share/swig/4.2.1/typemaps/wstring.swg +usr/share/swig/4.2.1/wchar.i +usr/share/swig/4.2.1/windows.i +usr/share/swig/4.2.1/xml/ +usr/share/swig/4.2.1/xml/typemaps.i +usr/share/swig/4.2.1/xml/xml.swg + diff --git a/var/lib/pacman/local/swig-4.2.1-1/mtree b/var/lib/pacman/local/swig-4.2.1-1/mtree new file mode 100644 index 00000000000..50af5116601 Binary files /dev/null and b/var/lib/pacman/local/swig-4.2.1-1/mtree differ diff --git a/var/lib/pacman/sync/clang32.db b/var/lib/pacman/sync/clang32.db index df5159c1bcc..7d40d7d75c3 100644 Binary files a/var/lib/pacman/sync/clang32.db and b/var/lib/pacman/sync/clang32.db differ diff --git a/var/lib/pacman/sync/clang32.db.sig b/var/lib/pacman/sync/clang32.db.sig index a5de9972e9a..f1e44575b02 100644 Binary files a/var/lib/pacman/sync/clang32.db.sig and b/var/lib/pacman/sync/clang32.db.sig differ diff --git a/var/lib/pacman/sync/clang64.db b/var/lib/pacman/sync/clang64.db index 5c791281b7e..877aa44633b 100644 Binary files a/var/lib/pacman/sync/clang64.db and b/var/lib/pacman/sync/clang64.db differ diff --git a/var/lib/pacman/sync/clang64.db.sig b/var/lib/pacman/sync/clang64.db.sig index fcd44e499f4..a82f5e104e6 100644 Binary files a/var/lib/pacman/sync/clang64.db.sig and b/var/lib/pacman/sync/clang64.db.sig differ diff --git a/var/lib/pacman/sync/clangarm64.db b/var/lib/pacman/sync/clangarm64.db index d255c5408d3..0aeff8c8bd9 100644 Binary files a/var/lib/pacman/sync/clangarm64.db and b/var/lib/pacman/sync/clangarm64.db differ diff --git a/var/lib/pacman/sync/clangarm64.db.sig b/var/lib/pacman/sync/clangarm64.db.sig index 47303ab5379..1495b90d54f 100644 Binary files a/var/lib/pacman/sync/clangarm64.db.sig and b/var/lib/pacman/sync/clangarm64.db.sig differ diff --git a/var/lib/pacman/sync/mingw32.db b/var/lib/pacman/sync/mingw32.db index 2b5a35f81a2..d0fd8d7f6df 100644 Binary files a/var/lib/pacman/sync/mingw32.db and b/var/lib/pacman/sync/mingw32.db differ diff --git a/var/lib/pacman/sync/mingw32.db.sig b/var/lib/pacman/sync/mingw32.db.sig index c215772b2bb..b41a572bf6a 100644 Binary files a/var/lib/pacman/sync/mingw32.db.sig and b/var/lib/pacman/sync/mingw32.db.sig differ diff --git a/var/lib/pacman/sync/mingw64.db b/var/lib/pacman/sync/mingw64.db index 310d5a9d221..c67b97d4f3a 100644 Binary files a/var/lib/pacman/sync/mingw64.db and b/var/lib/pacman/sync/mingw64.db differ diff --git a/var/lib/pacman/sync/mingw64.db.sig b/var/lib/pacman/sync/mingw64.db.sig index 8a4214a5f05..e2b357f1a77 100644 Binary files a/var/lib/pacman/sync/mingw64.db.sig and b/var/lib/pacman/sync/mingw64.db.sig differ diff --git a/var/lib/pacman/sync/msys.db b/var/lib/pacman/sync/msys.db index 449ff10e2bb..27de0241fb5 100644 Binary files a/var/lib/pacman/sync/msys.db and b/var/lib/pacman/sync/msys.db differ diff --git a/var/lib/pacman/sync/msys.db.sig b/var/lib/pacman/sync/msys.db.sig index 9b38ab478f7..a5014db709d 100644 Binary files a/var/lib/pacman/sync/msys.db.sig and b/var/lib/pacman/sync/msys.db.sig differ diff --git a/var/lib/pacman/sync/ucrt64.db b/var/lib/pacman/sync/ucrt64.db index d52bea602e8..f25b9db719e 100644 Binary files a/var/lib/pacman/sync/ucrt64.db and b/var/lib/pacman/sync/ucrt64.db differ diff --git a/var/lib/pacman/sync/ucrt64.db.sig b/var/lib/pacman/sync/ucrt64.db.sig index 6b389f184e3..5aeee05c045 100644 Binary files a/var/lib/pacman/sync/ucrt64.db.sig and b/var/lib/pacman/sync/ucrt64.db.sig differ