diff --git a/linx64/bin/swig/bin/ccache-swig b/linx64/bin/swig/bin/ccache-swig index 4f8ef2b1..54698b02 100755 Binary files a/linx64/bin/swig/bin/ccache-swig and b/linx64/bin/swig/bin/ccache-swig differ diff --git a/linx64/bin/swig/bin/swig b/linx64/bin/swig/bin/swig index e27c87d4..01d34376 100755 Binary files a/linx64/bin/swig/bin/swig and b/linx64/bin/swig/bin/swig differ diff --git a/linx64/bin/swig/share/swig/4.0.0/allegrocl/allegrocl.swg b/linx64/bin/swig/share/swig/4.0.0/allegrocl/allegrocl.swg deleted file mode 100644 index 524aa7c1..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/allegrocl/allegrocl.swg +++ /dev/null @@ -1,615 +0,0 @@ -/* Define a C preprocessor symbol that can be used in interface files - to distinguish between the SWIG language modules. */ - -#define SWIG_ALLEGRO_CL - -#define %ffargs(...) %feature("ffargs", "1", ##__VA_ARGS__) -%ffargs(strings_convert="t"); - -/* typemaps for argument and result type conversions. */ -%typemap(lin,numinputs=1) SWIGTYPE "(cl::let (($out $in))\n $body)"; - -%typemap(lout) bool, char, unsigned char, signed char, - short, signed short, unsigned short, - int, signed int, unsigned int, - long, signed long, unsigned long, - float, double, long double, char *, void *, - enum SWIGTYPE "(cl::setq ACL_ffresult $body)"; -%typemap(lout) void "$body"; -#ifdef __cplusplus -%typemap(lout) SWIGTYPE[ANY], SWIGTYPE *, SWIGTYPE &, SWIGTYPE && -%{ (cl:let* ((address $body) - (new-inst (cl:make-instance '$lclass :foreign-address address))) - (cl:when (cl:and $owner (cl:not (cl:zerop address))) - (excl:schedule-finalization new-inst #'$ldestructor)) - (cl:setq ACL_ffresult new-inst)) %} - -%typemap(lout) SWIGTYPE "(cl::let* ((address $body)\n (new-inst (cl::make-instance '$lclass :foreign-address address)))\n (cl::unless (cl::zerop address)\n (excl:schedule-finalization new-inst #'$ldestructor))\n (cl::setq ACL_ffresult new-inst))"; -#else -%typemap(lout) SWIGTYPE[ANY], SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE -%{ (cl:let* ((address $body) - (new-inst (cl:make-instance '$lclass :foreign-address address))) - (cl:setq ACL_ffresult new-inst)) %} -#endif - -%typemap(lisptype) bool, const bool "cl:boolean"; -%typemap(lisptype) char, const char "cl:character"; -%typemap(lisptype) unsigned char, const unsigned char "cl:integer"; -%typemap(lisptype) signed char, const signed char "cl:integer"; - -%typemap(ffitype) bool, const bool ":int"; -%typemap(ffitype) char, const char, - signed char, const signed char ":char"; -%typemap(ffitype) unsigned char, const unsigned char ":unsigned-char"; -%typemap(ffitype) short, const short, - signed short, const signed short ":short"; -%typemap(ffitype) unsigned short, const unsigned short ":unsigned-short"; -%typemap(ffitype) int, const int, signed int, const signed int ":int"; -%typemap(ffitype) unsigned int, const unsigned int ":unsigned-int"; -%typemap(ffitype) long, const long, signed long, const signed long ":long"; -%typemap(ffitype) unsigned long, const unsigned long ":unsigned-long"; -%typemap(ffitype) float, const float ":float"; -%typemap(ffitype) double, const double ":double"; -%typemap(ffitype) char *, const char *, signed char *, - const signed char *, signed char &, - const signed char & "(* :char)"; -%typemap(ffitype) unsigned char *, const unsigned char *, - unsigned char &, const unsigned char & "(* :unsigned-char)"; -%typemap(ffitype) short *, const short *, short &, - const short & "(* :short)"; -%typemap(ffitype) unsigned short *, const unsigned short *, - unsigned short &, const unsigned short & "(* :unsigned-short)"; -%typemap(ffitype) int *, const int *, int &, const int & "(* :int)"; -%typemap(ffitype) unsigned int *, const unsigned int *, - unsigned int &, const unsigned int & "(* :unsigned-int)"; -%typemap(ffitype) void * "(* :void)"; -%typemap(ffitype) void ":void"; -%typemap(ffitype) enum SWIGTYPE ":int"; -%typemap(ffitype) SWIGTYPE & "(* :void)"; -%typemap(ffitype) SWIGTYPE && "(* :void)"; - -/* const typemaps -idea: marshall all primitive c types to their respective lisp types -to maintain const corretness. For pointers/references, all bets -are off if you try to modify them. - -idea: add a constant-p slot to the base foreign-pointer class. For -constant pointer/references check this value when setting (around method?) -and error if a setf operation is performed on the address of this object. - -*/ - -/* -%exception %{ - try { - $action - } catch (...) { - return $null; - } -%} - -*/ - -// %typemap(throws) SWIGTYPE { -// (void)$1; -// SWIG_fail; -// } - -%typemap(ctype) bool, const bool "int"; -%typemap(ctype) char, unsigned char, signed char, - short, signed short, unsigned short, - int, signed int, unsigned int, - long, signed long, unsigned long, - float, double, long double, char *, void *, void, - enum SWIGTYPE, SWIGTYPE *, SWIGTYPE[], - SWIGTYPE[ANY], SWIGTYPE &, SWIGTYPE &&, const SWIGTYPE "$1_ltype"; -%typemap(ctype) SWIGTYPE "$&1_type"; - -%typemap(in) bool "$1 = (bool)$input;"; -%typemap(in) char, unsigned char, signed char, - short, signed short, unsigned short, - int, signed int, unsigned int, - long, signed long, unsigned long, - float, double, long double, char *, void *, void, - enum SWIGTYPE, SWIGTYPE *, SWIGTYPE[], - SWIGTYPE[ANY], SWIGTYPE &, SWIGTYPE && "$1 = $input;"; -%typemap(in) SWIGTYPE "$1 = *$input;"; - -/* We don't need to do any actual C-side typechecking, but need to - use the precedence values to choose which overloaded function - interfaces to generate when conflicts arise. */ - -/* predefined precedence values - -Symbolic Name Precedence Value ------------------------------- ------------------ -SWIG_TYPECHECK_POINTER 0 -SWIG_TYPECHECK_VOIDPTR 10 -SWIG_TYPECHECK_BOOL 15 -SWIG_TYPECHECK_UINT8 20 -SWIG_TYPECHECK_INT8 25 -SWIG_TYPECHECK_UINT16 30 -SWIG_TYPECHECK_INT16 35 -SWIG_TYPECHECK_UINT32 40 -SWIG_TYPECHECK_INT32 45 -SWIG_TYPECHECK_UINT64 50 -SWIG_TYPECHECK_INT64 55 -SWIG_TYPECHECK_UINT128 60 -SWIG_TYPECHECK_INT128 65 -SWIG_TYPECHECK_INTEGER 70 -SWIG_TYPECHECK_FLOAT 80 -SWIG_TYPECHECK_DOUBLE 90 -SWIG_TYPECHECK_COMPLEX 100 -SWIG_TYPECHECK_UNICHAR 110 -SWIG_TYPECHECK_UNISTRING 120 -SWIG_TYPECHECK_CHAR 130 -SWIG_TYPECHECK_STRING 140 -SWIG_TYPECHECK_BOOL_ARRAY 1015 -SWIG_TYPECHECK_INT8_ARRAY 1025 -SWIG_TYPECHECK_INT16_ARRAY 1035 -SWIG_TYPECHECK_INT32_ARRAY 1045 -SWIG_TYPECHECK_INT64_ARRAY 1055 -SWIG_TYPECHECK_INT128_ARRAY 1065 -SWIG_TYPECHECK_FLOAT_ARRAY 1080 -SWIG_TYPECHECK_DOUBLE_ARRAY 1090 -SWIG_TYPECHECK_CHAR_ARRAY 1130 -SWIG_TYPECHECK_STRING_ARRAY 1140 -*/ - -%typecheck(SWIG_TYPECHECK_BOOL) bool { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_CHAR) char { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_FLOAT) float { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_DOUBLE) double { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_STRING) char * { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_INTEGER) - unsigned char, signed char, - short, signed short, unsigned short, - int, signed int, unsigned int, - long, signed long, unsigned long, - enum SWIGTYPE { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, - SWIGTYPE[], SWIGTYPE[ANY], - SWIGTYPE { $1 = 1; }; - -/* This maps C/C++ types to Lisp classes for overload dispatch */ - -%typemap(lispclass) bool "t"; -%typemap(lispclass) char "cl:character"; -%typemap(lispclass) unsigned char, signed char, - short, signed short, unsigned short, - int, signed int, unsigned int, - long, signed long, unsigned long, - enum SWIGTYPE "cl:integer"; -%typemap(lispclass) float "cl:single-float"; -%typemap(lispclass) double "cl:double-float"; -%typemap(lispclass) char * "cl:string"; - -%typemap(out) void ""; -%typemap(out) bool "$result = (int)$1;"; -%typemap(out) char, unsigned char, signed char, - short, signed short, unsigned short, - int, signed int, unsigned int, - long, signed long, unsigned long, - float, double, long double, char *, void *, - enum SWIGTYPE, SWIGTYPE *, - SWIGTYPE[ANY], SWIGTYPE &, SWIGTYPE && "$result = $1;"; -#ifdef __cplusplus -%typemap(out) SWIGTYPE "$result = new $1_ltype($1);"; -#else -%typemap(out) SWIGTYPE { - $result = ($&1_ltype) malloc(sizeof($1_type)); - memmove($result, &$1, sizeof($1_type)); -} -#endif - -////////////////////////////////////////////////////////////// -// UCS-2 string conversion - -// should this be SWIG_TYPECHECK_CHAR? -%typecheck(SWIG_TYPECHECK_UNICHAR) wchar_t { $1 = 1; }; - -%typemap(in) wchar_t "$1 = $input;"; -%typemap(lin,numinputs=1) wchar_t "(cl::let (($out (cl:char-code $in)))\n $body)"; -%typemap(lin,numinputs=1) wchar_t * "(excl:with-native-string ($out $in -:external-format #+little-endian :fat-le #-little-endian :fat)\n -$body)" - -%typemap(out) wchar_t "$result = $1;"; -%typemap(lout) wchar_t "(cl::setq ACL_ffresult (cl::code-char $body))"; -%typemap(lout) wchar_t * "(cl::setq ACL_ffresult (excl:native-to-string $body -:external-format #+little-endian :fat-le #-little-endian :fat))"; - -%typemap(ffitype) wchar_t ":unsigned-short"; -%typemap(lisptype) wchar_t ""; -%typemap(ctype) wchar_t "wchar_t"; -%typemap(lispclass) wchar_t "cl:character"; -%typemap(lispclass) wchar_t * "cl:string"; -////////////////////////////////////////////////////////////// - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* name conversion for overloaded operators. */ -#ifdef __cplusplus -%rename(__add__) *::operator+; -%rename(__pos__) *::operator+(); -%rename(__pos__) *::operator+() const; - -%rename(__sub__) *::operator-; -%rename(__neg__) *::operator-() const; -%rename(__neg__) *::operator-(); - -%rename(__mul__) *::operator*; -%rename(__deref__) *::operator*(); -%rename(__deref__) *::operator*() const; - -%rename(__div__) *::operator/; -%rename(__mod__) *::operator%; -%rename(__logxor__) *::operator^; -%rename(__logand__) *::operator&; -%rename(__logior__) *::operator|; -%rename(__lognot__) *::operator~(); -%rename(__lognot__) *::operator~() const; - -%rename(__not__) *::operator!(); -%rename(__not__) *::operator!() const; - -%rename(__assign__) *::operator=; - -%rename(__add_assign__) *::operator+=; -%rename(__sub_assign__) *::operator-=; -%rename(__mul_assign__) *::operator*=; -%rename(__div_assign__) *::operator/=; -%rename(__mod_assign__) *::operator%=; -%rename(__logxor_assign__) *::operator^=; -%rename(__logand_assign__) *::operator&=; -%rename(__logior_assign__) *::operator|=; - -%rename(__lshift__) *::operator<<; -%rename(__lshift_assign__) *::operator<<=; -%rename(__rshift__) *::operator>>; -%rename(__rshift_assign__) *::operator>>=; - -%rename(__eq__) *::operator==; -%rename(__ne__) *::operator!=; -%rename(__lt__) *::operator<; -%rename(__gt__) *::operator>; -%rename(__lte__) *::operator<=; -%rename(__gte__) *::operator>=; - -%rename(__and__) *::operator&&; -%rename(__or__) *::operator||; - -%rename(__preincr__) *::operator++(); -%rename(__postincr__) *::operator++(int); -%rename(__predecr__) *::operator--(); -%rename(__postdecr__) *::operator--(int); - -%rename(__comma__) *::operator,(); -%rename(__comma__) *::operator,() const; - -%rename(__member_ref__) *::operator->; -%rename(__member_func_ref__) *::operator->*; - -%rename(__funcall__) *::operator(); -%rename(__aref__) *::operator[]; - -%rename(__bool__) *::operator bool(); -%rename(__bool__) *::operator bool() const; -#endif - -%insert("lisphead") %{ -(eval-when (:compile-toplevel :load-toplevel :execute) - - ;; avoid compiling ef-templates at runtime - (excl:find-external-format :fat) - (excl:find-external-format :fat-le) - -;;; You can define your own identifier converter if you want. -;;; Use the -identifier-converter command line argument to -;;; specify its name. - -(eval-when (:compile-toplevel :load-toplevel :execute) - (cl::defparameter *swig-export-list* nil)) - -(cl::defconstant *void* :..void..) - -;; parsers to aid in finding SWIG definitions in files. -(cl::defun scm-p1 (form) - (let* ((info (cl::second form)) - (id (car info)) - (id-args (if (eq (cl::car form) 'swig-dispatcher) - (cl::cdr info) - (cl::cddr info)))) - (cl::apply *swig-identifier-converter* id - (cl::progn (cl::when (cl::eq (cl::car form) 'swig-dispatcher) - (cl::remf id-args :arities)) - id-args)))) - -(cl::defmacro defswig1 (name (&rest args) &body body) - `(cl::progn (cl::defmacro ,name ,args - ,@body) - (excl::define-simple-parser ,name scm-p1)) ) - -(cl::defmacro defswig2 (name (&rest args) &body body) - `(cl::progn (cl::defmacro ,name ,args - ,@body) - (excl::define-simple-parser ,name second))) - -(defun read-symbol-from-string (string) - (cl::multiple-value-bind (result position) - (cl::read-from-string string nil "eof" :preserve-whitespace t) - (cl::if (cl::and (cl::symbolp result) - (cl::eql position (cl::length string))) - result - (cl::multiple-value-bind (sym) - (cl::intern string) - sym)))) - -(cl::defun full-name (id type arity class) - ; We need some kind of a hack here to handle template classes - ; and other synonym types right. We need the original name. - (let*( (sym (read-symbol-from-string - (if (eq *swig-identifier-converter* 'identifier-convert-lispify) - (string-lispify id) - id))) - (sym-class (find-class sym nil)) - (id (cond ( (not sym-class) - id ) - ( (and sym-class - (not (eq (class-name sym-class) - sym))) - (class-name sym-class) ) - ( t - id ))) ) - (cl::case type - (:getter (cl::format nil "~@[~A_~]~A" class id)) - (:constructor (cl::format nil "new_~A~@[~A~]" id arity)) - (:destructor (cl::format nil "delete_~A" id)) - (:type (cl::format nil "ff_~A" id)) - (:slot id) - (:ff-operator (cl::format nil "ffi_~A" id)) - (otherwise (cl::format nil "~@[~A_~]~A~@[~A~]" - class id arity))))) - -(cl::defun identifier-convert-null (id &key type class arity) - (cl::if (cl::eq type :setter) - `(cl::setf ,(identifier-convert-null - id :type :getter :class class :arity arity)) - (read-symbol-from-string (full-name id type arity class)))) - -(cl::defun string-lispify (str) - (cl::let ( (cname (excl::replace-regexp str "_" "-")) - (lastcase :other) - newcase char res ) - (cl::dotimes (n (cl::length cname)) - (cl::setf char (cl::schar cname n)) - (excl::if* (cl::alpha-char-p char) - then - (cl::setf newcase (cl::if (cl::upper-case-p char) :upper :lower)) - (cl::when (cl::and (cl::eq lastcase :lower) - (cl::eq newcase :upper)) - ;; case change... add a dash - (cl::push #\- res) - (cl::setf newcase :other)) - (cl::push (cl::char-downcase char) res) - (cl::setf lastcase newcase) - else - (cl::push char res) - (cl::setf lastcase :other))) - (cl::coerce (cl::nreverse res) 'string))) - -(cl::defun identifier-convert-lispify (cname &key type class arity) - (cl::assert (cl::stringp cname)) - (cl::when (cl::eq type :setter) - (cl::return-from identifier-convert-lispify - `(cl::setf ,(identifier-convert-lispify - cname :type :getter :class class :arity arity)))) - (cl::setq cname (full-name cname type arity class)) - (cl::if (cl::eq type :constant) - (cl::setf cname (cl::format nil "*~A*" cname))) - (read-symbol-from-string (string-lispify cname))) - -(cl::defun id-convert-and-export (name &rest kwargs) - (cl::multiple-value-bind (symbol package) - (cl::apply *swig-identifier-converter* name kwargs) - (cl::let ((args (cl::list (cl::if (cl::consp symbol) - (cl::cadr symbol) symbol) - (cl::or package cl::*package*)))) - (cl::apply #'cl::export args) - (cl::pushnew args *swig-export-list*)) - symbol)) - -(cl::defmacro swig-insert-id (name namespace &key (type :type) class) - `(cl::let ((cl::*package* (cl::find-package ,(package-name-for-namespace namespace)))) - (id-convert-and-export ,name :type ,type :class ,class))) - -(defswig2 swig-defconstant (string value) - (cl::let ((symbol (id-convert-and-export string :type :constant))) - `(cl::eval-when (:compile-toplevel :load-toplevel :execute) - (cl::defconstant ,symbol ,value)))) - -(cl::defun maybe-reorder-args (funcname arglist) - ;; in the foreign setter function the new value will be the last argument - ;; in Lisp it needs to be the first - (cl::if (cl::consp funcname) - (cl::append (cl::last arglist) (cl::butlast arglist)) - arglist)) - -(cl::defun maybe-return-value (funcname arglist) - ;; setf functions should return the new value - (cl::when (cl::consp funcname) - `(,(cl::if (cl::consp (cl::car arglist)) - (cl::caar arglist) - (cl::car arglist))))) - -(cl::defun swig-anyvarargs-p (arglist) - (cl::member :SWIG__varargs_ arglist)) - -(defswig1 swig-defun ((name &optional (mangled-name name) - &key (type :operator) class arity) - arglist kwargs - &body body) - (cl::let* ((symbol (id-convert-and-export name :type type - :arity arity :class class)) - (mangle (excl::if* (cl::string-equal name mangled-name) - then (id-convert-and-export - (cl::cond - ((cl::eq type :setter) (cl::format nil "~A-set" name)) - ((cl::eq type :getter) (cl::format nil "~A-get" name)) - (t name)) - :type :ff-operator :arity arity :class class) - else (cl::intern mangled-name))) - (defun-args (maybe-reorder-args - symbol - (cl::mapcar #'cl::car (cl::and (cl::not (cl::equal arglist '(:void))) - (cl::loop as i in arglist - when (cl::eq (cl::car i) :p+) - collect (cl::cdr i)))))) - (ffargs (cl::if (cl::equal arglist '(:void)) - arglist - (cl::mapcar #'cl::cdr arglist))) - ) - (cl::when (swig-anyvarargs-p ffargs) - (cl::setq ffargs '())) - `(cl::eval-when (:compile-toplevel :load-toplevel :execute) - (excl::compiler-let ((*record-xref-info* nil)) - (ff:def-foreign-call (,mangle ,mangled-name) ,ffargs ,@kwargs)) - (cl::macrolet ((swig-ff-call (&rest args) - (cl::cons ',mangle args))) - (cl::defun ,symbol ,defun-args - ,@body - ,@(maybe-return-value symbol defun-args)))))) - -(defswig1 swig-defmethod ((name &optional (mangled-name name) - &key (type :operator) class arity) - ffargs kwargs - &body body) - (cl::let* ((symbol (id-convert-and-export name :type type - :arity arity :class class)) - (mangle (cl::intern mangled-name)) - (defmethod-args (maybe-reorder-args - symbol - (cl::unless (cl::equal ffargs '(:void)) - (cl::loop for (lisparg name dispatch) in ffargs - when (eq lisparg :p+) - collect `(,name ,dispatch))))) - (ffargs (cl::if (cl::equal ffargs '(:void)) - ffargs - (cl::loop for (nil name nil . ffi) in ffargs - collect `(,name ,@ffi))))) - `(cl::eval-when (:compile-toplevel :load-toplevel :execute) - (excl::compiler-let ((*record-xref-info* nil)) - (ff:def-foreign-call (,mangle ,mangled-name) ,ffargs ,@kwargs)) - (cl::macrolet ((swig-ff-call (&rest args) - (cl::cons ',mangle args))) - (cl::defmethod ,symbol ,defmethod-args - ,@body - ,@(maybe-return-value symbol defmethod-args)))))) - -(defswig1 swig-dispatcher ((name &key (type :operator) class arities)) - (cl::let ((symbol (id-convert-and-export name - :type type :class class))) - `(cl::eval-when (:compile-toplevel :load-toplevel :execute) - (cl::defun ,symbol (&rest args) - (cl::case (cl::length args) - ,@(cl::loop for arity in arities - for symbol-n = (id-convert-and-export name - :type type :class class :arity arity) - collect `(,arity (cl::apply #',symbol-n args))) - (t (cl::error "No applicable wrapper-methods for foreign call ~a with args ~a of classes ~a" ',symbol args (cl::mapcar #'(cl::lambda (x) (cl::class-name (cl::class-of x))) args))) - ))))) - -(defswig2 swig-def-foreign-stub (name) - (cl::let ((lsymbol (id-convert-and-export name :type :class)) - (symbol (id-convert-and-export name :type :type))) - `(cl::eval-when (:compile-toplevel :load-toplevel :execute) - (ff:def-foreign-type ,symbol (:class )) - (cl::defclass ,lsymbol (ff:foreign-pointer) ())))) - -(defswig2 swig-def-foreign-class (name supers &rest rest) - (cl::let ((lsymbol (id-convert-and-export name :type :class)) - (symbol (id-convert-and-export name :type :type))) - `(cl::eval-when (:compile-toplevel :load-toplevel :execute) - (ff:def-foreign-type ,symbol ,@rest) - (cl::defclass ,lsymbol ,supers - ((foreign-type :initform ',symbol :initarg :foreign-type - :accessor foreign-pointer-type)))))) - -(defswig2 swig-def-foreign-type (name &rest rest) - (cl::let ((symbol (id-convert-and-export name :type :type))) - `(cl::eval-when (:compile-toplevel :load-toplevel :execute) - (ff:def-foreign-type ,symbol ,@rest)))) - -(defswig2 swig-def-synonym-type (synonym of ff-synonym) - `(cl::eval-when (:compile-toplevel :load-toplevel :execute) - (cl::setf (cl::find-class ',synonym) (cl::find-class ',of)) - (ff:def-foreign-type ,ff-synonym (:struct )))) - -(cl::defun package-name-for-namespace (namespace) - (excl::list-to-delimited-string - (cl::cons *swig-module-name* - (cl::mapcar #'(cl::lambda (name) - (cl::string - (cl::funcall *swig-identifier-converter* - name - :type :namespace))) - namespace)) - ".")) - -(cl::defmacro swig-defpackage (namespace) - (cl::let* ((parent-namespaces (cl::maplist #'cl::reverse (cl::cdr (cl::reverse namespace)))) - (parent-strings (cl::mapcar #'package-name-for-namespace - parent-namespaces)) - (string (package-name-for-namespace namespace))) - `(cl::eval-when (:compile-toplevel :load-toplevel :execute) - (cl::defpackage ,string - (:use :swig :ff #+ignore '(:common-lisp :ff :excl) - ,@parent-strings ,*swig-module-name*) - (:import-from :cl :* :nil :t))))) - -(cl::defmacro swig-in-package (namespace) - `(cl::eval-when (:compile-toplevel :load-toplevel :execute) - (cl::in-package ,(package-name-for-namespace namespace)))) - -(defswig2 swig-defvar (name mangled-name &key type (ftype :unsigned-natural)) - (cl::let ((symbol (id-convert-and-export name :type type))) - `(cl::eval-when (:compile-toplevel :load-toplevel :execute) - (ff:def-foreign-variable (,symbol ,mangled-name) :type ,ftype)))) - -) ;; eval-when - -(cl::eval-when (:compile-toplevel :execute) - (cl::flet ((starts-with-p (str prefix) - (cl::and (cl::>= (cl::length str) (cl::length prefix)) - (cl::string= str prefix :end1 (cl::length prefix))))) - (cl::export (cl::loop for sym being each present-symbol of cl::*package* - when (cl::or (starts-with-p (cl::symbol-name sym) (cl::symbol-name :swig-)) - (starts-with-p (cl::symbol-name sym) (cl::symbol-name :identifier-convert-))) - collect sym)))) - -%} - -typedef void *__SWIGACL_FwdReference; - -%{ - -#ifdef __cplusplus -# define EXTERN extern "C" -#else -# define EXTERN extern -#endif - -#define EXPORT EXTERN SWIGEXPORT - -typedef void *__SWIGACL_FwdReference; - -#include -#include -%} diff --git a/linx64/bin/swig/share/swig/4.0.0/allegrocl/inout_typemaps.i b/linx64/bin/swig/share/swig/4.0.0/allegrocl/inout_typemaps.i deleted file mode 100644 index d8d61fee..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/allegrocl/inout_typemaps.i +++ /dev/null @@ -1,111 +0,0 @@ -/* inout_typemaps.i - - Support for INPUT, OUTPUT, and INOUT typemaps. OUTPUT variables are returned - as multiple values. - -*/ - - -/* Note that this macro automatically adds a pointer to the type passed in. - As a result, INOUT typemaps for char are for 'char *'. The definition - of typemaps for 'char' takes advantage of this, believing that it's more - likely to see an INOUT argument for strings, than a single char. */ -%define INOUT_TYPEMAP(type_, OUTresult_, INbind_) -// OUTPUT map. -%typemap(lin,numinputs=0) type_ *OUTPUT, type_ &OUTPUT -%{(cl::let (($out (ff:allocate-fobject '$*in_fftype :c))) - $body - OUTresult_ - (ff:free-fobject $out)) %} - -// INPUT map. -%typemap(in) type_ *INPUT, type_ &INPUT -%{ $1 = &$input; %} - -%typemap(ctype) type_ *INPUT, type_ &INPUT "$*1_ltype"; - - -// INOUT map. -// careful here. the input string is converted to a C string -// with length equal to the input string. This should be large -// enough to contain whatever OUTPUT value will be stored in it. -%typemap(lin,numinputs=1) type_ *INOUT, type_ &INOUT -%{(cl::let (($out (ff:allocate-fobject '$*in_fftype :c))) - INbind_ - $body - OUTresult_ - (ff:free-fobject $out)) %} - -%enddef - -// $in, $out, $lclass, -// $in_fftype, $*in_fftype - -INOUT_TYPEMAP(int, - (cl::push (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) ACL_result), - (cl::setf (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) $in)); -INOUT_TYPEMAP(short, - (cl::push (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) ACL_result), - (cl::setf (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) $in)); -INOUT_TYPEMAP(long, - (cl::push (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) ACL_result), - (cl::setf (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) $in)); -INOUT_TYPEMAP(unsigned int, - (cl::push (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) ACL_result), - (cl::setf (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) $in)); -INOUT_TYPEMAP(unsigned short, - (cl::push (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) ACL_result), - (cl::setf (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) $in)); -INOUT_TYPEMAP(unsigned long, - (cl::push (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) ACL_result), - (cl::setf (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) $in)); -// char * mapping for passing strings. didn't quite work -// INOUT_TYPEMAP(char, -// (cl::push (excl:native-to-string $out) ACL_result), -// (cl::setf (ff:fslot-value-typed (cl::quote $in_fftype) :c $out) -// (excl:string-to-native $in))) -INOUT_TYPEMAP(float, - (cl::push (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) ACL_result), - (cl::setf (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) $in)); -INOUT_TYPEMAP(double, - (cl::push (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) ACL_result), - (cl::setf (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) $in)); -INOUT_TYPEMAP(bool, - (cl::push (not (zerop (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out))) - ACL_result), - (cl::setf (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) (if $in 1 0))); - -%typemap(lisptype) bool *INPUT, bool &INPUT "boolean"; - -// long long support not yet complete -// INOUT_TYPEMAP(long long); -// INOUT_TYPEMAP(unsigned long long); - -// char *OUTPUT map. -// for this to work, swig needs to know how large an array to allocate. -// you can fake this by -// %typemap(ffitype) char *myarg "(:array :char 30)"; -// %apply char *OUTPUT { char *myarg }; -%typemap(lin,numinputs=0) char *OUTPUT, char &OUTPUT -%{(cl::let (($out (ff:allocate-fobject '$*in_fftype :c))) - $body - (cl::push (excl:native-to-string $out) ACL_result) - (ff:free-fobject $out)) %} - -// char *INPUT map. -%typemap(in) char *INPUT, char &INPUT -%{ $1 = &$input; %} -%typemap(ctype) char *INPUT, char &INPUT "$*1_ltype"; - -// char *INOUT map. -%typemap(lin,numinputs=1) char *INOUT, char &INOUT -%{(cl::let (($out (excl:string-to-native $in))) - $body - (cl::push (excl:native-to-string $out) ACL_result) - (ff:free-fobject $out)) %} - -// uncomment this if you want INOUT mappings for chars instead of strings. -// INOUT_TYPEMAP(char, -// (cl::push (code-char (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out)) -// ACL_result), -// (cl::setf (ff:fslot-value-typed (cl::quote $*in_fftype) :c $out) $in)); diff --git a/linx64/bin/swig/share/swig/4.0.0/allegrocl/longlongs.i b/linx64/bin/swig/share/swig/4.0.0/allegrocl/longlongs.i deleted file mode 100644 index a15adcdd..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/allegrocl/longlongs.i +++ /dev/null @@ -1,49 +0,0 @@ -/* ----------------------------------------------------------------------------- - * longlongs.i - * - * Typemap addition for support of 'long long' type and 'unsigned long long - * Makes use of swig-def-foreign-class, so this header should be loaded - * after allegrocl.swg and after any custom user identifier-conversion - * functions have been defined. - * ----------------------------------------------------------------------------- */ - -#ifdef Acl64Bit -%typemap(ctype) long long, unsigned long long "$1_ltype"; -%typemap(out) long long, unsigned long long "$result = $1;"; - -%typemap(ffitype) long long ":nat"; -%typemap(ffitype) unsigned long long ":unsigned-nat"; - -%typemap(lout) long long, unsigned long long " #+64bit (cl::setq ACL_ffresult $body)"; - -#else -%typemap(out) long long, unsigned long long "$result = &$1;"; -%typemap(ffitype) long long "(:struct (l1 :long) (l2 :long))"; - -%typemap(ffitype) unsigned long long "(:struct (l1 :unsigned-long) (l2 :unsigned-long))"; - -%typemap(lout) long long -" (cl::setq ACL_ffresult (make-instance '#.(swig-insert-id \"longlong\" () :type :class) - :foreign-address $body))"; - -%typemap(lout) unsigned long long -" (cl:setq ACL_ffresult (make-instance '#.(swig-insert-id \"ulonglong\" () :type :class) - :foreign-address $body))"; - -#endif - -%typemap(in) long long, unsigned long long "$1 = $input;"; - - -%insert("lisphead") %{ - -#-64bit -(swig-def-foreign-class "longlong" - (ff:foreign-pointer) - (:struct (l1 :long) (l2 :long))) - -#-64bit -(swig-def-foreign-class "ulonglong" - (ff:foreign-pointer) - (:struct (l1 :unsigned-long) (l2 :unsigned-long))) -%} diff --git a/linx64/bin/swig/share/swig/4.0.0/allegrocl/std_list.i b/linx64/bin/swig/share/swig/4.0.0/allegrocl/std_list.i deleted file mode 100644 index 4e260897..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/allegrocl/std_list.i +++ /dev/null @@ -1,230 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_list.i - * - * SWIG typemaps for std::list types - * - * To use, add: - * - * %include "std_list.i" - * - * to your interface file. You will also need to include a template directive - * for each instance of the list container you want to use in your application. - * e.g. - * - * %template (intlist) std::list; - * %template (floatlist) std::list; - * ----------------------------------------------------------------------------- */ - -%module std_list -%warnfilter(468) std::list; - -%{ -#include -#include -%} - - -namespace std{ - template class list - { - public: - - typedef T &reference; - typedef const T& const_reference; - typedef T &iterator; - typedef const T& const_iterator; - - list(); - list(unsigned int size, const T& value = T()); - list(const list &); - - ~list(); - void assign(unsigned int n, const T& value); - void swap(list &x); - - const_reference front(); - const_reference back(); - const_iterator begin(); - const_iterator end(); - - void resize(unsigned int n, T c = T()); - bool empty() const; - - void push_front(const T& INPUT); - void push_back(const T& INPUT); - - - void pop_front(); - void pop_back(); - void clear(); - unsigned int size() const; - unsigned int max_size() const; - void resize(unsigned int n, const T& INPUT); - - void remove(const T& INPUT); - void unique(); - void reverse(); - void sort(); - - %extend - { - %typemap(lout) T &__getitem__ "(cl::setq ACL_ffresult (ff:fslot-value-typed '$*out_fftype :c $body))"; - %typemap(lout) T *__getitem__ "(cl::setq ACL_ffresult (make-instance '$lclass :foreign-address $body))"; - - const_reference __getitem__(int i) throw (std::out_of_range) - { - std::list::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && i::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && i::iterator first = self->begin(); - int size = int(self->size()); - if (i<0) i += size; - if (i>=0 && ierase(first); - } - else throw std::out_of_range("list index out of range"); - } - std::list __getslice__(int i,int j) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - if (i>=j) i=j; - if (i>=0 && i=0) - { - for (int k=0;k tmp(j-i); - if (j>i) std::copy(first,end,tmp.begin()); - return tmp; - } - else throw std::out_of_range("list index out of range"); - } - void __delslice__(int i,int j) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - - for (int k=0;kerase(first,end); - } - void __setslice__(int i,int j, const std::list& v) - { - std::list::iterator first = self->begin(); - std::list::iterator end = self->end(); - - int size = int(self->size()); - if (i<0) i += size; - if (j<0) j += size; - if (i<0) i = 0; - if (j>size) j = size; - - for (int k=0;kerase(first,end); - if (i+1 <= int(self->size())) - { - first = self->begin(); - for (int k=0;kinsert(first,v.begin(),v.end()); - } - else self->insert(self->end(),v.begin(),v.end()); - } - - } - unsigned int __len__() - { - return self->size(); - } - bool __nonzero__() - { - return !(self->empty()); - } - void append(const T& INPUT) - { - self->push_back(INPUT); - } - void pop() - { - self->pop_back(); - } - - }; - }; -} - - - - - - diff --git a/linx64/bin/swig/share/swig/4.0.0/allegrocl/std_string.i b/linx64/bin/swig/share/swig/4.0.0/allegrocl/std_string.i deleted file mode 100644 index cbcd250a..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/allegrocl/std_string.i +++ /dev/null @@ -1,209 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * 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 -%warnfilter(404) std::string; -%warnfilter(404) std::wstring; - -%{ -#include -%} - -// %include - -// %naturalvar std::string; -// %naturalvar std::wstring; - -namespace std { - typedef unsigned long size_t; - typedef signed long ptrdiff_t; - - template class basic_string { - public: - typedef charT *pointer; - typedef charT &reference; - typedef const charT &const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - basic_string(); - basic_string( charT *str ); - size_type size(); - charT operator []( int pos ) const; - charT *c_str() const; - basic_string &operator = ( const basic_string &ws ); - basic_string &operator = ( const charT *str ); - basic_string &append( const basic_string &other ); - basic_string &append( const charT *str ); - void push_back( charT c ); - void clear(); - void reserve( size_type t ); - void resize( size_type n, charT c = charT() ); - int compare( const basic_string &other ) const; - int compare( const charT *str ) const; - basic_string &insert( size_type pos, - const basic_string &str ); - size_type find( const basic_string &other, int pos = 0 ) const; - size_type find( charT c, int pos = 0 ) const; - %extend { - bool operator == ( const basic_string &other ) const { - return self->compare( other ) == 0; - } - bool operator != ( const basic_string &other ) const { - return self->compare( other ) != 0; - } - bool operator < ( const basic_string &other ) const { - return self->compare( other ) == -1; - } - bool operator > ( const basic_string &other ) const { - return self->compare( other ) == 1; - } - bool operator <= ( const basic_string &other ) const { - return self->compare( other ) != 1; - } - bool operator >= ( const basic_string &other ) const { - return self->compare( other ) != -1; - } - - } - }; - - %template(string) basic_string; - %template(wstring) basic_string; - - %apply char * { string }; - %apply wchar_t * { wstring }; - - typedef basic_string string; - typedef basic_string wstring; - - // automatically convert constant std::strings to cl:strings - %typemap(ctype) string "char *"; - %typemap(in) string "$1.assign($input);"; - %typemap(out) string "$result = (char *)(&$1)->c_str();"; - %typemap(lisptype) string "cl:string"; - %typemap(lout) string "(cl::setq ACL_ffresult $body)"; - - %typemap(ctype) const string *"char *"; - %typemap(in) const string * "$1.assign($input);"; - %typemap(out) const string * "$result = (char *)($1)->c_str();"; - %typemap(lisptype) const string * "cl:string"; - %typemap(lout) const string * "(cl::setq ACL_ffresult $body)"; - - %typemap(ctype) wstring "wchar_t *"; - %typemap(in) wstring "$1.assign($input);"; - %typemap(out) wstring "$result = (wchar_t *)(&$1)->c_str();"; - %typemap(lisptype) wstring "cl:string"; - %typemap(lout) wstring "(cl::setq ACL_ffresult (excl:native-to-string $body -:external-format #+little-endian :fat-le #-little-endian :fat))"; - - %typemap(ctype) const wstring *"char *"; - %typemap(in) const wstring * "$1.assign($input);"; - %typemap(out) const wstring * "$result = (char *)($1)->c_str();"; - %typemap(lisptype) const wstring * "cl:string"; - %typemap(lout) const wstring * "(cl::setq ACL_ffresult $body)"; - - /* Overloading check */ -// %typemap(in) string { -// if (caml_ptr_check($input)) -// $1.assign((char *)caml_ptr_val($input,0), -// caml_string_len($input)); -// else -// SWIG_exception(SWIG_TypeError, "string expected"); -// } - -// %typemap(in) const 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.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)); -// $1 = temp; -// } else { -// SWIG_exception(SWIG_TypeError, "string expected"); -// } -// } - -// %typemap(free) string * ($*1_ltype *temp) { -// delete temp; -// } - -// %typemap(argout) string & { -// caml_list_append(swig_result,caml_val_string_len((*$1).c_str(), -// (*$1).size())); -// } - -// %typemap(directorout) string { -// $result.assign((char *)caml_ptr_val($input,0), -// caml_string_len($input)); -// } - -// %typemap(out) string { -// $result = caml_val_string_len($1.c_str(),$1.size()); -// } - -// %typemap(out) string * { -// $result = caml_val_string_len((*$1).c_str(),(*$1).size()); -// } -} - -// #ifdef ENABLE_CHARPTR_ARRAY -// char **c_charptr_array( const std::vector &str_v ); - -// %{ -// SWIGEXT char **c_charptr_array( const std::vector &str_v ) { -// char **out = new char *[str_v.size() + 1]; -// out[str_v.size()] = 0; -// for( int i = 0; i < str_v.size(); i++ ) { -// out[i] = (char *)str_v[i].c_str(); -// } -// return out; -// } -// %} -// #endif - -// #ifdef ENABLE_STRING_VECTOR -// %template (StringVector) std::vector; - -// %insert(ml) %{ -// (* Some STL convenience items *) - -// let string_array_to_vector sa = -// let nv = _new_StringVector C_void in -// array_to_vector nv (fun x -> C_string x) sa ; nv - -// let c_string_array ar = -// _c_charptr_array (string_array_to_vector ar) -// %} - -// %insert(mli) %{ -// val c_string_array: string array -> c_obj -// %} -// #endif diff --git a/linx64/bin/swig/share/swig/4.0.0/allegrocl/typemaps.i b/linx64/bin/swig/share/swig/4.0.0/allegrocl/typemaps.i deleted file mode 100644 index 293d1cd3..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/allegrocl/typemaps.i +++ /dev/null @@ -1,4 +0,0 @@ -/* Unused for Allegro CL module */ - -%include "inout_typemaps.i" -%include "longlongs.i" diff --git a/linx64/bin/swig/share/swig/4.0.0/allkw.swg b/linx64/bin/swig/share/swig/4.0.0/allkw.swg index 563190e1..2d3cf6ea 100644 --- a/linx64/bin/swig/share/swig/4.0.0/allkw.swg +++ b/linx64/bin/swig/share/swig/4.0.0/allkw.swg @@ -16,7 +16,6 @@ */ -%include %include %include %include @@ -25,7 +24,6 @@ %include %include %include -%include %include %include %include diff --git a/linx64/bin/swig/share/swig/4.0.0/cdata.i b/linx64/bin/swig/share/swig/4.0.0/cdata.i index 23b7211e..f18ed4af 100644 --- a/linx64/bin/swig/share/swig/4.0.0/cdata.i +++ b/linx64/bin/swig/share/swig/4.0.0/cdata.i @@ -21,14 +21,6 @@ typedef struct SWIGCDATA { } %typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH); -#elif SWIGCHICKEN - -%typemap(out) SWIGCDATA { - C_word *string_space = C_alloc(C_SIZEOF_STRING($1.len)); - $result = C_string(&string_space, $1.len, $1.data); -} -%typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH); - #elif SWIGPHP7 %typemap(out) SWIGCDATA { diff --git a/linx64/bin/swig/share/swig/4.0.0/cffi/cffi.swg b/linx64/bin/swig/share/swig/4.0.0/cffi/cffi.swg deleted file mode 100644 index f7294956..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/cffi/cffi.swg +++ /dev/null @@ -1,294 +0,0 @@ -/* Define a C preprocessor symbol that can be used in interface files - to distinguish between the SWIG language modules. */ - -#define SWIG_CFFI - -/* Typespecs for basic types. */ - -%typemap(cin) void ":void"; - -%typemap(cin) char ":char"; -%typemap(cin) char * ":string"; -%typemap(cin) unsigned char ":unsigned-char"; -%typemap(cin) signed char ":char"; - -%typemap(cin) short ":short"; -%typemap(cin) signed short ":short"; -%typemap(cin) unsigned short ":unsigned-short"; - -%typemap(cin) int ":int"; -%typemap(cin) signed int ":int"; -%typemap(cin) unsigned int ":unsigned-int"; - -%typemap(cin) long ":long"; -%typemap(cin) signed long ":long"; -%typemap(cin) unsigned long ":unsigned-long"; - -%typemap(cin) long long ":long-long"; -%typemap(cin) signed long long ":long-long"; -%typemap(cin) unsigned long long ":unsigned-long-long"; - -%typemap(cin) float ":float"; -%typemap(cin) double ":double"; -%typemap(cin) SWIGTYPE ":pointer"; - -%typemap(cout) void ":void"; - -%typemap(cout) char ":char"; -%typemap(cout) char * ":string"; -%typemap(cout) unsigned char ":unsigned-char"; -%typemap(cout) signed char ":char"; - -%typemap(cout) short ":short"; -%typemap(cout) signed short ":short"; -%typemap(cout) unsigned short ":unsigned-short"; - -%typemap(cout) int ":int"; -%typemap(cout) signed int ":int"; -%typemap(cout) unsigned int ":unsigned-int"; - -%typemap(cout) long ":long"; -%typemap(cout) signed long ":long"; -%typemap(cout) unsigned long ":unsigned-long"; - -%typemap(cout) long long ":long-long"; -%typemap(cout) signed long long ":long-long"; -%typemap(cout) unsigned long long ":unsigned-long-long"; - -%typemap(cout) float ":float"; -%typemap(cout) double ":double"; -%typemap(cout) SWIGTYPE ":pointer"; - - -%typemap(ctype) bool "int"; -%typemap(ctype) char, unsigned char, signed char, - short, signed short, unsigned short, - int, signed int, unsigned int, - long, signed long, unsigned long, - float, double, long double, char *, void *, void, - enum SWIGTYPE, SWIGTYPE *, - SWIGTYPE[ANY], SWIGTYPE &, SWIGTYPE && "$1_ltype"; -%typemap(ctype) SWIGTYPE "$&1_type"; - -%typemap(in) bool "$1 = (bool)$input;"; -%typemap(in) char, unsigned char, signed char, - short, signed short, unsigned short, - int, signed int, unsigned int, - long, signed long, unsigned long, - float, double, long double, char *, void *, void, - enum SWIGTYPE, SWIGTYPE *, - SWIGTYPE[ANY], SWIGTYPE &, SWIGTYPE && "$1 = $input;"; -%typemap(in) SWIGTYPE "$1 = *$input;"; - -%typemap(out) void ""; -%typemap(out) bool "$result = (int)$1;"; -%typemap(out) char, unsigned char, signed char, - short, signed short, unsigned short, - int, signed int, unsigned int, - long, signed long, unsigned long, - float, double, long double, char *, void *, - enum SWIGTYPE, SWIGTYPE *, - SWIGTYPE[ANY], SWIGTYPE &, SWIGTYPE && "$result = $1;"; -#ifdef __cplusplus -%typemap(out) SWIGTYPE "$result = new $1_type($1);"; -#else -%typemap(out) SWIGTYPE { - $result = ($&1_ltype) malloc(sizeof($1_type)); - memmove($result, &$1, sizeof($1_type)); -} -#endif - -%typecheck(SWIG_TYPECHECK_BOOL) bool { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_CHAR) char { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_FLOAT) float { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_DOUBLE) double { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_STRING) char * { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_INTEGER) - unsigned char, signed char, - short, signed short, unsigned short, - int, signed int, unsigned int, - long, signed long, unsigned long, - enum SWIGTYPE { $1 = 1; }; -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, - SWIGTYPE[ANY], SWIGTYPE { $1 = 1; }; -/* This maps C/C++ types to Lisp classes for overload dispatch */ - -%typemap(lisptype) bool "cl:boolean"; -%typemap(lisptype) char "cl:character"; -%typemap(lisptype) unsigned char "cl:integer"; -%typemap(lisptype) signed char "cl:integer"; - -%typemap(lispclass) bool "t"; -%typemap(lispclass) char "cl:character"; -%typemap(lispclass) unsigned char, signed char, - short, signed short, unsigned short, - int, signed int, unsigned int, - long, signed long, unsigned long, - enum SWIGTYPE "cl:integer"; -/* CLOS methods can't be specialized on single-float or double-float */ -%typemap(lispclass) float "cl:number"; -%typemap(lispclass) double "cl:number"; -%typemap(lispclass) char * "cl:string"; - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -%{ - -#ifdef __cplusplus -# define EXTERN extern "C" -#else -# define EXTERN extern -#endif - -#define EXPORT EXTERN SWIGEXPORT - -#include -%} - -%insert("swiglisp") %{ -;;;SWIG wrapper code starts here - -(cl:defmacro defanonenum (cl:&body enums) - "Converts anonymous enums to defconstants." - `(cl:progn ,@(cl:loop for value in enums - for index = 0 then (cl:1+ index) - when (cl:listp value) do (cl:setf index (cl:second value) - value (cl:first value)) - collect `(cl:defconstant ,value ,index)))) - -(cl:eval-when (:compile-toplevel :load-toplevel) - (cl:unless (cl:fboundp 'swig-lispify) - (cl:defun swig-lispify (name flag cl:&optional (package cl:*package*)) - (cl:labels ((helper (lst last rest cl:&aux (c (cl:car lst))) - (cl:cond - ((cl:null lst) - rest) - ((cl:upper-case-p c) - (helper (cl:cdr lst) 'upper - (cl:case last - ((lower digit) (cl:list* c #\- rest)) - (cl:t (cl:cons c rest))))) - ((cl:lower-case-p c) - (helper (cl:cdr lst) 'lower (cl:cons (cl:char-upcase c) rest))) - ((cl:digit-char-p c) - (helper (cl:cdr lst) 'digit - (cl:case last - ((upper lower) (cl:list* c #\- rest)) - (cl:t (cl:cons c rest))))) - ((cl:char-equal c #\_) - (helper (cl:cdr lst) '_ (cl:cons #\- rest))) - (cl:t - (cl:error "Invalid character: ~A" c))))) - (cl:let ((fix (cl:case flag - ((constant enumvalue) "+") - (variable "*") - (cl:t "")))) - (cl:intern - (cl:concatenate - 'cl:string - fix - (cl:nreverse (helper (cl:concatenate 'cl:list name) cl:nil cl:nil)) - fix) - package)))))) - -;;;SWIG wrapper code ends here -%} - -#ifdef __cplusplus -%typemap(out) SWIGTYPE "$result = new $1_type($1);"; -#else -%typemap(out) SWIGTYPE { - $result = ($&1_ltype) malloc(sizeof($1_type)); - memmove($result, &$1, sizeof($1_type)); -} -#endif - -////////////////////////////////////////////////////////////// - -/* name conversion for overloaded operators. */ -#ifdef __cplusplus -%rename(__add__) *::operator+; -%rename(__pos__) *::operator+(); -%rename(__pos__) *::operator+() const; - -%rename(__sub__) *::operator-; -%rename(__neg__) *::operator-() const; -%rename(__neg__) *::operator-(); - -%rename(__mul__) *::operator*; -%rename(__deref__) *::operator*(); -%rename(__deref__) *::operator*() const; - -%rename(__div__) *::operator/; -%rename(__mod__) *::operator%; -%rename(__logxor__) *::operator^; -%rename(__logand__) *::operator&; -%rename(__logior__) *::operator|; -%rename(__lognot__) *::operator~(); -%rename(__lognot__) *::operator~() const; - -%rename(__not__) *::operator!(); -%rename(__not__) *::operator!() const; - -%rename(__assign__) *::operator=; - -%rename(__add_assign__) *::operator+=; -%rename(__sub_assign__) *::operator-=; -%rename(__mul_assign__) *::operator*=; -%rename(__div_assign__) *::operator/=; -%rename(__mod_assign__) *::operator%=; -%rename(__logxor_assign__) *::operator^=; -%rename(__logand_assign__) *::operator&=; -%rename(__logior_assign__) *::operator|=; - -%rename(__lshift__) *::operator<<; -%rename(__lshift_assign__) *::operator<<=; -%rename(__rshift__) *::operator>>; -%rename(__rshift_assign__) *::operator>>=; - -%rename(__eq__) *::operator==; -%rename(__ne__) *::operator!=; -%rename(__lt__) *::operator<; -%rename(__gt__) *::operator>; -%rename(__lte__) *::operator<=; -%rename(__gte__) *::operator>=; - -%rename(__and__) *::operator&&; -%rename(__or__) *::operator||; - -%rename(__preincr__) *::operator++(); -%rename(__postincr__) *::operator++(int); -%rename(__predecr__) *::operator--(); -%rename(__postdecr__) *::operator--(int); - -%rename(__comma__) *::operator,(); -%rename(__comma__) *::operator,() const; - -%rename(__member_ref__) *::operator->; -%rename(__member_func_ref__) *::operator->*; - -%rename(__funcall__) *::operator(); -%rename(__aref__) *::operator[]; -#endif - - -%{ - -#ifdef __cplusplus -# define EXTERN extern "C" -#else -# define EXTERN extern -#endif - -#define EXPORT EXTERN SWIGEXPORT - -#include -#include -%} diff --git a/linx64/bin/swig/share/swig/4.0.0/chicken/chicken.swg b/linx64/bin/swig/share/swig/4.0.0/chicken/chicken.swg deleted file mode 100644 index 571c392e..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/chicken/chicken.swg +++ /dev/null @@ -1,811 +0,0 @@ -/* ----------------------------------------------------------------------------- - * chicken.swg - * - * CHICKEN configuration module. - * ----------------------------------------------------------------------------- */ - -/* chicken.h has to appear first. */ - -%insert(runtime) %{ -#include -#include -%} - -%insert(runtime) "swigrun.swg"; // Common C API type-checking code -%insert(runtime) "chickenrun.swg"; // CHICKEN run-time code - -/* ----------------------------------------------------------------------------- - * standard typemaps - * ----------------------------------------------------------------------------- */ - -/* - CHICKEN: C - ---------- - - fixnum: int, short, unsigned int, unsigned short, unsigned char, - signed char - - char: char - - bool: bool - - flonum: float, double, long, long long, unsigned long, unsigned long - long - */ - -/* --- Primitive types --- */ - -%define SIMPLE_TYPEMAP(type_, from_scheme, to_scheme, checker, convtype, storage_) - -%typemap(in) type_ -%{ if (!checker ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "Argument #$argnum is not of type 'type_'"); - } - $1 = ($1_ltype) from_scheme ($input); %} - -/* Const primitive references. Passed by value */ - -%typemap(in) const type_ & ($*1_ltype temp) -%{ if (!checker ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "Argument #$argnum is not of type 'type_'"); - } - temp = ($*1_ltype) from_scheme ($input); - $1 = &temp; %} - -/* --- Variable input --- */ -%typemap(varin) type_ -%{ if (!checker ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "Cannot use '$1_ltype' for variable '$name' of type 'type_'"); - } - $1 = ($1_ltype) from_scheme ($input); %} - -#if "storage_" == "0" - -%typemap(out) type_ -%{ - $result = to_scheme (convtype ($1)); -%} - -/* References to primitive types. Return by value */ - -%typemap(out) const type_ & -%{ - $result = to_scheme (convtype (*$1)); -%} - -/* --- Variable output --- */ -%typemap(varout) type_ -%{ - $result = to_scheme (convtype ($varname)); -%} - -%typemap(throws) type_ -%{ - SWIG_Chicken_ThrowException(to_scheme ( convtype ($1))); -%} - -#else - -%typemap(out) type_ -%{ - { - C_word *space = C_alloc(storage_); - $result = to_scheme (&space, convtype ($1)); - } -%} - -/* References to primitive types. Return by value */ - -%typemap(out) const type_ & -%{ - { - C_word *space = C_alloc(storage_); - $result = to_scheme (&space, convtype (*$1)); - } -%} - -/* --- Variable output --- */ -%typemap(varout) type_ -%{ - { - C_word *space = C_alloc(storage_); - $result = to_scheme (&space, convtype ($varname)); - } -%} - -%typemap(throws) type_ -%{ - { - C_word *space = C_alloc(storage_); - SWIG_Chicken_ThrowException(to_scheme (&space, convtype ($1))); - } -%} - -#endif - -/* --- Constants --- */ - -%typemap(constcode) type_ -"static const $1_type $result = $value;" - -%enddef - -SIMPLE_TYPEMAP(int, C_num_to_int, C_fix, C_swig_is_number, (int), 0); -//SIMPLE_TYPEMAP(enum SWIGTYPE, C_unfix, C_fix, C_swig_is_fixnum, (int), 0); -SIMPLE_TYPEMAP(short, C_num_to_int, C_fix, C_swig_is_number, (int), 0); -SIMPLE_TYPEMAP(long, C_num_to_long, C_long_to_num, C_swig_is_long, (long), C_SIZEOF_FLONUM); -SIMPLE_TYPEMAP(long long, C_num_to_long, C_long_to_num, C_swig_is_long, (long), C_SIZEOF_FLONUM); -SIMPLE_TYPEMAP(unsigned int, C_num_to_unsigned_int, C_unsigned_int_to_num, C_swig_is_number, (unsigned int), C_SIZEOF_FLONUM); -SIMPLE_TYPEMAP(unsigned short, C_num_to_unsigned_int, C_fix, C_swig_is_number, (unsigned int), 0); -SIMPLE_TYPEMAP(unsigned long, C_num_to_unsigned_long, C_unsigned_long_to_num, C_swig_is_long, (unsigned long), C_SIZEOF_FLONUM); -SIMPLE_TYPEMAP(unsigned long long, C_num_to_unsigned_long, C_unsigned_long_to_num, C_swig_is_long, (unsigned long), C_SIZEOF_FLONUM); -SIMPLE_TYPEMAP(unsigned char, C_character_code, C_make_character, C_swig_is_char, (unsigned int), 0); -SIMPLE_TYPEMAP(signed char, C_character_code, C_make_character, C_swig_is_char, (int), 0); -SIMPLE_TYPEMAP(char, C_character_code, C_make_character, C_swig_is_char, (char), 0); -SIMPLE_TYPEMAP(bool, C_truep, C_mk_bool, C_swig_is_bool, (bool), 0); -SIMPLE_TYPEMAP(float, C_c_double, C_flonum, C_swig_is_number, (double), C_SIZEOF_FLONUM); -SIMPLE_TYPEMAP(double, C_c_double, C_flonum, C_swig_is_number, (double), C_SIZEOF_FLONUM); - -/* enum SWIGTYPE */ -%apply int { enum SWIGTYPE }; -%apply const int& { const enum SWIGTYPE& }; -%apply const int& { const enum SWIGTYPE&& }; - -%typemap(varin) enum SWIGTYPE -{ - if (!C_swig_is_fixnum($input) && sizeof(int) != sizeof($1)) { - swig_barf(SWIG_BARF1_BAD_ARGUMENT_TYPE, "enum variable '$name' can not be set"); - } - *((int *)(void *)&$1) = C_unfix($input); -} - - -/* --- Input arguments --- */ - -/* Strings */ - -%typemap(in) char * -{ if ($input == C_SCHEME_FALSE) { - $1 = NULL; - } - else { - if (!C_swig_is_string ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "Argument #$argnum is not of type 'char *'"); - } - $1 = ($ltype) SWIG_MakeString ($input); - } -} - -%typemap(freearg) char * "if ($1 != NULL) { free ($1); }" - -/* Pointers, references, and arrays */ -%typemap(in,closcode="(slot-ref $input 'swig-this)") SWIGTYPE *, SWIGTYPE [], SWIGTYPE &, SWIGTYPE && { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, $disown); -} - -%typemap(in,closcode="(slot-ref $input 'swig-this)") SWIGTYPE *DISOWN { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, SWIG_POINTER_DISOWN); -} - -/* Void pointer. Accepts any kind of pointer */ -%typemap(in) void * { - $1 = ($1_ltype)SWIG_MustGetPtr($input, NULL, $argnum, 0); -} - -%typemap(varin,closcode="(slot-ref $input 'swig-this)") SWIGTYPE * { - $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, SWIG_POINTER_DISOWN); -} - -%typemap(varin,closcode="(slot-ref $input 'swig-this)") SWIGTYPE & { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin,closcode="(slot-ref $input 'swig-this)") SWIGTYPE && { - $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); -} - -%typemap(varin) SWIGTYPE [] { - SWIG_Chicken_Barf(SWIG_BARF1_BAD_ARGUMENT_TYPE, "Type error"); -} - -%typemap(varin) SWIGTYPE [ANY] { - void *temp; - int ii; - $1_basetype *b = 0; - temp = SWIG_MustGetPtr($input, $1_descriptor, 1, 0); - b = ($1_basetype *) $1; - for (ii = 0; ii < $1_size; ii++) b[ii] = *(($1_basetype *) temp + ii); -} - -%typemap(varin) void * { - $1 = SWIG_MustGetPtr($input, NULL, 1, 0); -} - -%typemap(out) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - $result = SWIG_NewPointerObj($1, $descriptor, $owner); -} - -%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1); - $result = SWIG_NewPointerObj($1, ty, $owner); -} - -%typemap(varout) SWIGTYPE *, SWIGTYPE [] { - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - $result = SWIG_NewPointerObj($varname, $descriptor, 0); -} - -%typemap(varout) SWIGTYPE & { - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - $result = SWIG_NewPointerObj((void *) &$varname, $1_descriptor, 0); -} - -%typemap(varout) SWIGTYPE && { - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - $result = SWIG_NewPointerObj((void *) &$varname, $1_descriptor, 0); -} - -/* special typemaps for class pointers */ -%typemap(in) SWIGTYPE (CLASS::*) { - char err_msg[256]; - - if (C_swig_is_pair($input)) { - /* try and convert pointer object */ - void *result; - if (!SWIG_ConvertPtr(C_block_item($input,1), &result, $descriptor, 0)) { - C_word ptr = C_block_item($input,0); - if (C_swig_is_string(ptr)) { - SWIG_UnpackData(C_c_string(ptr), (void *) &$1, sizeof($type)); - } else { - snprintf(err_msg, sizeof(err_msg), "Type error in argument #%i: expected %s", $argnum, ($descriptor->str ? $descriptor->str : $descriptor->name)); - SWIG_Chicken_Barf(SWIG_BARF1_BAD_ARGUMENT_TYPE, err_msg); - } - } else { - snprintf(err_msg, sizeof(err_msg), "Type error in argument #%i: expected %s", $argnum, ($descriptor->str ? $descriptor->str : $descriptor->name)); - SWIG_Chicken_Barf(SWIG_BARF1_BAD_ARGUMENT_TYPE, err_msg); - } - } else { - snprintf(err_msg, sizeof(err_msg), "Type error in argument #%i: expected %s", $argnum, ($descriptor->str ? $descriptor->str : $descriptor->name)); - SWIG_Chicken_Barf(SWIG_BARF1_BAD_ARGUMENT_TYPE, err_msg); - } -} - -%typemap(out) SWIGTYPE (CLASS::*) { - size_t ptr_size = sizeof($type); - C_word *known_space = C_alloc(C_SIZEOF_PAIR + C_SIZEOF_STRING(2*ptr_size) + C_SIZEOF_SWIG_POINTER); - char *temp = (char *)malloc(2*ptr_size); - C_word ptr = SWIG_NewPointerObj((void *) known_space, $descriptor, 0); - - SWIG_PackData(temp, (void *) &$1, ptr_size); - $result = C_pair(&known_space, C_string(&known_space, 2*ptr_size, temp), ptr); - free(temp); -} - -%typemap(varin) SWIGTYPE (CLASS::*) { - char err_msg[256]; - - if (C_swig_is_pair($input)) { - /* try and convert pointer object */ - void *result; - if (!SWIG_ConvertPtr(C_block_item($input,1), &result, $descriptor, 0)) { - C_word ptr = C_block_item($input,0); - if (C_swig_is_string(ptr)) { - SWIG_UnpackData(C_c_string(ptr), (void *) &$1, sizeof($type)); - } else { - snprintf(err_msg, sizeof(err_msg), "Type error in argument #%i: expected %s", 1, ($descriptor->str ? $descriptor->str : $descriptor->name)); - SWIG_Chicken_Barf(SWIG_BARF1_BAD_ARGUMENT_TYPE, err_msg); - } - } else { - snprintf(err_msg, sizeof(err_msg), "Type error in argument #%i: expected %s", 1, ($descriptor->str ? $descriptor->str : $descriptor->name)); - SWIG_Chicken_Barf(SWIG_BARF1_BAD_ARGUMENT_TYPE, err_msg); - } - } else { - snprintf(err_msg, sizeof(err_msg), "Type error in argument #%i: expected %s", 1, ($descriptor->str ? $descriptor->str : $descriptor->name)); - SWIG_Chicken_Barf(SWIG_BARF1_BAD_ARGUMENT_TYPE, err_msg); - } -} - -%typemap(varout) SWIGTYPE (CLASS::*) { - size_t ptr_size = sizeof($type); - C_word *known_space = C_alloc(C_SIZEOF_PAIR + C_SIZEOF_STRING(2*ptr_size) + C_SIZEOF_SWIG_POINTER); - char *temp = (char *)malloc(2*ptr_size); - C_word ptr = SWIG_NewPointerObj((void *) known_space, $descriptor, 0); - - SWIG_PackData(temp, (void *) &$varname, ptr_size); - $result = C_pair(&known_space, C_string(&known_space, 2*ptr_size, temp), ptr); - free(temp); -} - - - -/* Pass-by-value */ - -%typemap(in,closcode="(slot-ref $input 'swig-this)") SWIGTYPE($&1_ltype argp) { - argp = ($&1_ltype)SWIG_MustGetPtr($input, $&1_descriptor, $argnum, 0); - $1 = *argp; -} - -%typemap(varin,closcode="(slot-ref $input 'swig-this)") SWIGTYPE { - $&1_ltype argp; - argp = ($&1_ltype)SWIG_MustGetPtr($input, $&1_descriptor, 1, 0); - $1 = *argp; -} - -%typemap(out) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - resultptr = new $1_ltype((const $1_ltype &) $1); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 1); -} -#else -{ - $&1_ltype resultptr; - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 1); -} -#endif - -%typemap(varout) SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - resultptr = new $1_ltype((const $1_ltype&) $1); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 0); -} -#else -{ - $&1_ltype resultptr; - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 0); -} -#endif - -/* --- Output values --- */ - -/* Strings */ - -%typemap(out) - char * -{ char *s = (char*) $1; - if ($1 == NULL) { - $result = C_SCHEME_FALSE; - } - else { - int string_len = strlen ((char *) ($1)); - C_word *string_space = C_alloc (C_SIZEOF_STRING (string_len)); - $result = C_string (&string_space, string_len, s); - } -} - -%typemap(varout) - char * -{ char *s = (char*) $varname; - if ($varname == NULL) { - $result = C_SCHEME_FALSE; - } - else { - int string_len = strlen ($varname); - C_word *string_space = C_alloc (C_SIZEOF_STRING (string_len)); - $result = C_string (&string_space, string_len, s); - } -} - -%typemap(throws) char * -{ - if ($1 == NULL) { - SWIG_Chicken_ThrowException(C_SCHEME_FALSE); - } else { - int string_len = strlen($1); - C_word *string_space = C_alloc(C_SIZEOF_STRING(string_len)); - SWIG_Chicken_ThrowException(C_string(&string_space, string_len, (char *) $1)); - } -} - -/* Void */ -%typemap(out) void -%{ -$result = C_SCHEME_UNDEFINED; -%} - -/* Special typemap for character array return values */ - -%typemap(out) - char [ANY], const char [ANY] -%{ if ($1 == NULL) { - $result = C_SCHEME_FALSE; - } - else { - const int string_len = strlen ($1); - C_word *string_space = C_alloc (C_SIZEOF_STRING (string_len)); - $result = C_string (&string_space, string_len, $1); - } %} - -/* Primitive types--return by value */ - -/* --- Variable input --- */ - -/* A string */ -#ifdef __cplusplus -%typemap(varin) char * { - if ($input == C_SCHEME_FALSE) { - $1 = NULL; - } - else if (!C_swig_is_string ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "C variable '$name ($1_ltype)'"); - } - else { - char *temp = C_c_string ($input); - int len = C_header_size ($input); - if ($1) delete [] $1; - $1 = ($type) new char[len+1]; - strncpy((char*)$1, temp, len); - ((char*)$1) [len] = 0; - } -} -%typemap(varin,warning="451:Setting const char * variable may leak memory") const char * { - if ($input == C_SCHEME_FALSE) { - $1 = NULL; - } - else if (!C_swig_is_string ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "C variable '$name ($1_ltype)'"); - } - else { - char *temp = C_c_string ($input); - int len = C_header_size ($input); - $1 = ($type) new char[len+1]; - strncpy((char*)$1,temp,len); - ((char*)$1) [len] = 0; - } -} -#else -%typemap(varin) char * { - if ($input == C_SCHEME_FALSE) { - $1 = NULL; - } - else if (!C_swig_is_string ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "C variable '$name ($1_ltype)'"); - } - else { - char *temp = C_c_string ($input); - int len = C_header_size ($input); - if ($1) free((char*) $1); - $1 = ($type) malloc(len+1); - strncpy((char*)$1,temp,len); - ((char*)$1) [len] = 0; - } -} -%typemap(varin,warning="451:Setting const char * variable may leak memory") const char * { - if ($input == C_SCHEME_FALSE) { - $1 = NULL; - } - else if (!C_swig_is_string ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "C variable '$name ($1_ltype)'"); - } - else { - char *temp = C_c_string ($input); - int len = C_header_size ($input); - $1 = ($type) malloc(len+1); - strncpy((char*)$1,temp,len); - ((char*)$1) [len] = 0; - } -} -#endif - -%typemap(varin) char [] { - swig_barf(SWIG_BARF1_BAD_ARGUMENT_TYPE, "C/C++ variable '$name' is read-only"); -} - -/* Special case for string array variables */ -%typemap(varin) char [ANY] { - if ($input == C_SCHEME_FALSE) { - memset($1,0,$1_dim0*sizeof(char)); - } - else if (!C_swig_is_string ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "C variable '$name ($1_ltype)'"); - } - else { - char *temp = C_c_string ($input); - strncpy($1,temp,$1_dim0*sizeof(char)); - } -} - -/* --- Variable output --- */ - -/* Void */ -%typemap(varout) void "$result = C_SCHEME_UNDEFINED;"; - -/* Special typemap for character array return values */ -%typemap(varout) char [ANY], const char [ANY] -%{ if ($varname == NULL) { - $result = C_SCHEME_FALSE; - } - else { - const int string_len = strlen ($varname); - C_word *string_space = C_alloc (C_SIZEOF_STRING (string_len)); - $result = C_string (&string_space, string_len, (char *) $varname); - } -%} - - -/* --- Constants --- */ - -%typemap(constcode) char * -"static const char *$result = $value;" - -%typemap(constcode) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] -"static const void *$result = (void*) $value;" - -/* ------------------------------------------------------------ - * String & length - * ------------------------------------------------------------ */ - -%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) { - if ($input == C_SCHEME_FALSE) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "Cannot use a null/#f string for a char*, int arguments"); - } - else if (C_swig_is_string ($input)) { - $1 = ($1_ltype) C_c_string ($input); - $2 = ($2_ltype) C_header_size ($input); - } - else { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "Argument #$argnum is not of type 'string'"); - } -} - -/* ------------------------------------------------------------ - * CHICKEN types - * ------------------------------------------------------------ */ - -%typemap(in) C_word "$1 = $input;"; -%typemap(out) C_word "$result = $1;"; - -/* ------------------------------------------------------------ - * Typechecking rules - * ------------------------------------------------------------ */ - -%typecheck(SWIG_TYPECHECK_INTEGER) - bool, const bool & -{ - $1 = C_swig_is_bool ($input); -} - -%typecheck(SWIG_TYPECHECK_INTEGER) - int, short, - unsigned int, unsigned short, - signed char, unsigned char, - const int &, const short &, - const unsigned int &, const unsigned short &, - enum SWIGTYPE -{ - $1 = C_swig_is_fixnum ($input); -} - -%typecheck(SWIG_TYPECHECK_INTEGER) - long, - unsigned long, - long long, unsigned long long, - const long &, - const unsigned long &, - const long long &, const unsigned long long & -{ - $1 = (C_swig_is_bool ($input) || - C_swig_is_fixnum ($input) || - C_swig_is_flonum ($input)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_DOUBLE) - float, double, - const float &, const double & -{ - $1 = C_swig_is_flonum ($input); -} - -%typecheck(SWIG_TYPECHECK_CHAR) char { - $1 = C_swig_is_string ($input); -} - -%typecheck(SWIG_TYPECHECK_STRING) char * { - $1 = C_swig_is_string ($input); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { - void *ptr; - $1 = !SWIG_ConvertPtr($input, &ptr, $1_descriptor, 0); -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - $1 = !SWIG_ConvertPtr($input, &ptr, 0, 0); -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE & -{ - void *ptr = 0; - if (SWIG_ConvertPtr($input, &ptr, $descriptor, 0)) { - /* error */ - $1 = 0; - } else { - $1 = (ptr != 0); - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE && -{ - void *ptr = 0; - if (SWIG_ConvertPtr($input, &ptr, $descriptor, 0)) { - /* error */ - $1 = 0; - } else { - $1 = (ptr != 0); - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE -{ - void *ptr = 0; - if (SWIG_ConvertPtr($input, &ptr, $&descriptor, 0)) { - /* error */ - $1 = 0; - } else { - $1 = (ptr != 0); - } -} - - -/* ------------------------------------------------------------ - * Exception handling - * ------------------------------------------------------------ */ - -/* ------------------------------------------------------------ - * --- Exception handling --- - * ------------------------------------------------------------ */ - -%typemap(throws) SWIGTYPE { - $<ype temp = new $ltype($1); - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - C_word ptr = SWIG_NewPointerObj(temp, $&descriptor,1); - SWIG_Chicken_ThrowException(ptr); -} - -%typemap(throws) SWIGTYPE * { - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - C_word ptr = SWIG_NewPointerObj((void *) $1, $descriptor, 0); - SWIG_Chicken_ThrowException(ptr); -} - -%typemap(throws) SWIGTYPE [ANY] { - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - C_word ptr = SWIG_NewPointerObj((void *) $1, $descriptor, 0); - SWIG_Chicken_ThrowException(ptr); -} - -%typemap(throws) SWIGTYPE & { - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - C_word ptr = SWIG_NewPointerObj((void *)&($1),$descriptor,0); - SWIG_Chicken_ThrowException(ptr); -} - -%typemap(throws) SWIGTYPE && { - C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER); - C_word ptr = SWIG_NewPointerObj((void *)&($1),$descriptor,0); - SWIG_Chicken_ThrowException(ptr); -} - -/* ------------------------------------------------------------ - * ANSI C typemaps - * ------------------------------------------------------------ */ - -%apply unsigned long { size_t }; - -/* ------------------------------------------------------------ - * Various - * ------------------------------------------------------------ */ - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ - -#ifdef __cplusplus -%rename(__add__) *::operator+; -%rename(__pos__) *::operator+(); -%rename(__pos__) *::operator+() const; -%rename(__sub__) *::operator-; -%rename(__neg__) *::operator-(); -%rename(__neg__) *::operator-() const; -%rename(__mul__) *::operator*; -%rename(__div__) *::operator/; -%rename(__mod__) *::operator%; -%rename(__lshift__) *::operator<<; -%rename(__rshift__) *::operator>>; -%rename(__and__) *::operator&; -%rename(__or__) *::operator|; -%rename(__xor__) *::operator^; -%rename(__invert__) *::operator~; -%rename(__iadd__) *::operator+=; -%rename(__isub__) *::operator-=; -%rename(__imul__) *::operator*=; -%rename(__idiv__) *::operator/=; -%rename(__imod__) *::operator%=; -%rename(__ilshift__) *::operator<<=; -%rename(__irshift__) *::operator>>=; -%rename(__iand__) *::operator&=; -%rename(__ior__) *::operator|=; -%rename(__ixor__) *::operator^=; -%rename(__lt__) *::operator<; -%rename(__le__) *::operator<=; -%rename(__gt__) *::operator>; -%rename(__ge__) *::operator>=; -%rename(__eq__) *::operator==; -%rename(__ne__) *::operator!=; - -/* Special cases */ -%rename(__call__) *::operator(); - -#endif -/* Warnings for certain CHICKEN keywords */ -%include - -/* TinyCLOS <--> Low-level CHICKEN */ - -%typemap("clos_in") SIMPLE_CLOS_OBJECT * "(slot-ref $input (quote this))" -%typemap("clos_out") SIMPLE_CLOS_OBJECT * "(make $class (quote this) $1)" - -%insert(header) %{ -#ifdef __cplusplus -extern "C" { -#endif -/* Chicken initialization function */ -SWIGEXPORT void SWIG_init(C_word, C_word, C_word) C_noret; -#ifdef __cplusplus -} -#endif -%} - -%insert(closprefix) "swigclosprefix.scm" - -%insert(init) "swiginit.swg" - -%insert(init) %{ -/* CHICKEN initialization function */ -#ifdef __cplusplus -extern "C" { -#endif -SWIGEXPORT void SWIG_init(C_word argc, C_word closure, C_word continuation) { - int i; - C_word sym; - C_word tmp; - C_word *a; - C_word ret; - C_word *return_vec; - - SWIG_InitializeModule(0); - SWIG_PropagateClientData(); - ret = C_SCHEME_TRUE; - -#if $veclength - return_vec = C_alloc(C_SIZEOF_VECTOR($veclength)); - ret = (C_word) return_vec; - *(return_vec++) = C_VECTOR_TYPE | $veclength; -#endif - - a = C_alloc(2*$nummethods$symsize); - -%} diff --git a/linx64/bin/swig/share/swig/4.0.0/chicken/chickenkw.swg b/linx64/bin/swig/share/swig/4.0.0/chicken/chickenkw.swg deleted file mode 100644 index d2c26c74..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/chicken/chickenkw.swg +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef CHICKEN_CHICKENKW_SWG_ -#define CHICKEN_CHICKENKW_SWG_ - -/* Warnings for certain CHICKEN keywords. From Section 7.1.1 of - Revised^5 Report on the Algorithmic Language Scheme */ -#define CHICKENKW(x) %namewarn("314: '" #x "' is a R^5RS syntatic keyword") #x - -CHICKENKW(else); -CHICKENKW(=>); -CHICKENKW(define); -CHICKENKW(unquote); -CHICKENKW(unquote-splicing); -CHICKENKW(quote); -CHICKENKW(lambda); -CHICKENKW(if); -CHICKENKW(set!); -CHICKENKW(begin); -CHICKENKW(cond); -CHICKENKW(and); -CHICKENKW(or); -CHICKENKW(case); -CHICKENKW(let); -CHICKENKW(let*); -CHICKENKW(letrec); -CHICKENKW(do); -CHICKENKW(delay); -CHICKENKW(quasiquote); - -#undef CHICKENKW - -#endif //CHICKEN_CHICKENKW_SWG_ diff --git a/linx64/bin/swig/share/swig/4.0.0/chicken/chickenrun.swg b/linx64/bin/swig/share/swig/4.0.0/chicken/chickenrun.swg deleted file mode 100644 index f1340018..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/chicken/chickenrun.swg +++ /dev/null @@ -1,374 +0,0 @@ -/* ----------------------------------------------------------------------------- - * chickenrun.swg - * ----------------------------------------------------------------------------- */ - -#include -#include -#include -#include -#include -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) -# ifndef snprintf -# define snprintf _snprintf -# endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define SWIG_malloc(size) \ - malloc(size) -#define SWIG_free(mem) \ - free(mem) -#define SWIG_MakeString(c) \ - SWIG_Chicken_MakeString(c) -#define SWIG_ConvertPtr(s, result, type, flags) \ - SWIG_Chicken_ConvertPtr(s, result, type, flags) -#define SWIG_MustGetPtr(s, type, argnum, flags) \ - SWIG_Chicken_MustGetPtr(s, type, argnum, flags) -#define SWIG_NewPointerObj(ptr, type, owner) \ - SWIG_Chicken_NewPointerObj((void*)ptr, type, owner, &known_space) -#define swig_barf SWIG_Chicken_Barf -#define SWIG_ThrowException(val) SWIG_Chicken_ThrowException(val) - -#define SWIG_contract_assert(expr, message) if (!(expr)) { \ - SWIG_Chicken_Barf(SWIG_BARF1_CONTRACT_ASSERT, C_text(message)); } else - -/* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_Chicken_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Chicken_SetModule(pointer) - -#define C_swig_is_bool(x) C_truep (C_booleanp (x)) -#define C_swig_is_char(x) C_truep (C_charp (x)) -#define C_swig_is_fixnum(x) C_truep (C_fixnump (x)) -#define C_swig_is_flonum(x) (C_truep (C_blockp (x)) && C_truep (C_flonump (x))) -#define C_swig_is_string(x) (C_truep (C_blockp (x)) && C_truep (C_stringp (x))) -#define C_swig_is_vector(x) (C_truep (C_blockp (x)) && C_truep (C_vectorp (x))) -#define C_swig_is_list(x) (C_truep (C_i_listp (x))) -#define C_swig_is_pair(x) (C_truep (C_blockp(x)) && C_truep (C_pairp(x))) -#define C_swig_is_ptr(x) (C_truep (C_blockp (x)) && C_truep (C_pointerp (x))) -#define C_swig_is_swigpointer(x) (C_truep (C_blockp(x)) && C_truep (C_swigpointerp(x))) -#define C_swig_is_closurep(x) (C_truep (C_blockp(x)) && C_truep(C_closurep(x))) -#define C_swig_is_number(x) (C_swig_is_fixnum(x) || C_swig_is_flonum(x)) -#define C_swig_is_long(x) C_swig_is_number(x) - -#define C_swig_sizeof_closure(num) (num+1) - -#define SWIG_Chicken_SetupArgout { \ - C_word *a = C_alloc(C_swig_sizeof_closure(2)); \ - C_word *closure = a; \ - *(a++)=C_CLOSURE_TYPE|2; \ - *(a++)=(C_word)SWIG_Chicken_ApplyResults; \ - *(a++)=continuation; \ - continuation=(C_word)closure; \ -} - -#define SWIG_APPEND_VALUE(obj) { \ - C_word val = (C_word)(obj); \ - if (val != C_SCHEME_UNDEFINED) { \ - C_word *a = C_alloc(C_swig_sizeof_closure(3)); \ - C_word *closure = a; \ - *(a++)=C_CLOSURE_TYPE|3; \ - *(a++)=(C_word)SWIG_Chicken_MultiResultBuild; \ - *(a++)=(C_word)continuation; \ - *(a++)=val; \ - continuation=(C_word)closure; \ - } } - -#define SWIG_Chicken_FindCreateProxy(func,obj) \ - if (C_swig_is_swigpointer(obj)) { \ - swig_type_info *t = (swig_type_info *) C_block_item(obj, 1); \ - if (t && t->clientdata && ((swig_chicken_clientdata *)t->clientdata)->gc_proxy_create) { \ - func = CHICKEN_gc_root_ref( ((swig_chicken_clientdata *)t->clientdata)->gc_proxy_create); \ - } else { \ - func = C_SCHEME_FALSE; \ - } \ - } else { \ - func = C_SCHEME_FALSE; \ - } - - -enum { - SWIG_BARF1_BAD_ARGUMENT_TYPE /* 1 arg */, - SWIG_BARF1_ARGUMENT_NULL /* 1 arg */, - SWIG_BARF1_CONTRACT_ASSERT /* 1 arg */, -}; - -typedef C_word (*swig_chicken_destructor)(C_word,C_word,C_word,C_word); -typedef struct swig_chicken_clientdata { - void *gc_proxy_create; - swig_chicken_destructor destroy; -} swig_chicken_clientdata; - -static char * -SWIG_Chicken_MakeString(C_word str) { - char *ret; - size_t l; - - l = C_header_size(str); - ret = (char *) SWIG_malloc( (l + 1) * sizeof(char)); - if (!ret) return NULL; - - memcpy(ret, C_c_string(str), l); - ret[l] = '\0'; - return ret; -} - -static C_word SWIG_Chicken_LookupSymbol(char *name, C_SYMBOL_TABLE *stable) { - C_word *a = C_alloc(C_SIZEOF_STRING (strlen (name))); - C_word n = C_string2(&a, name); - C_word sym = C_find_symbol(n, stable); - if (C_truep(sym)) { - return C_symbol_value(sym); - } else { - return C_SCHEME_FALSE; - } -} - -/* Just a helper function. Do not export it */ -static void SWIG_Chicken_Panic (C_char *) C_noret; -static void SWIG_Chicken_Panic (C_char *msg) -{ - C_word *a = C_alloc (C_SIZEOF_STRING (strlen (msg))); - C_word scmmsg = C_string2 (&a, msg); - C_halt (scmmsg); - exit (5); /* should never get here */ -} - -static void -SWIG_Chicken_Barf(int code, C_char *msg, ...) C_noret; -static void -SWIG_Chicken_Barf(int code, C_char *msg, ...) -{ - char *errorhook = C_text("\003syserror-hook"); - C_word *a = C_alloc (C_SIZEOF_STRING (strlen (errorhook))); - C_word err = C_intern2 (&a, errorhook); - int c = -1; - int i, barfval; - va_list v; - - - C_temporary_stack = C_temporary_stack_bottom; - err = C_block_item(err, 0); - - if(C_immediatep (err)) - SWIG_Chicken_Panic (C_text ("`##sys#error-hook' is not defined")); - - switch (code) { - case SWIG_BARF1_BAD_ARGUMENT_TYPE: - barfval = C_BAD_ARGUMENT_TYPE_ERROR; - c = 1; - break; - case SWIG_BARF1_ARGUMENT_NULL: - barfval = C_BAD_ARGUMENT_TYPE_ERROR; - c = 1; - break; - case SWIG_BARF1_CONTRACT_ASSERT: - barfval = C_BAD_ARGUMENT_TYPE_ERROR; - c = 1; - break; - default: - SWIG_Chicken_Panic (C_text (msg)); - }; - - if(c > 0 && !C_immediatep (err)) { - C_save (C_fix (barfval)); - - i = c; - if (i) { - C_word *b = C_alloc (C_SIZEOF_STRING (strlen (msg))); - C_word scmmsg = C_string2 (&b, msg); - C_save (scmmsg); - i--; - } - - va_start (v, msg); - - while(i--) - C_save (va_arg (v, C_word)); - - va_end (v); - C_do_apply (c + 1, err, - C_SCHEME_UNDEFINED); /* <- no continuation is passed: - '##sys#error-hook' may not - return! */ - } - else if (msg) { - SWIG_Chicken_Panic (msg); - } - else { - SWIG_Chicken_Panic (C_text ("unspecified panic")); - } -} - -static void SWIG_Chicken_ThrowException(C_word value) C_noret; -static void SWIG_Chicken_ThrowException(C_word value) -{ - char *aborthook = C_text("\003sysabort"); - C_word *a = C_alloc(C_SIZEOF_STRING(strlen(aborthook))); - C_word abort = C_intern2(&a, aborthook); - - abort = C_block_item(abort, 0); - if (C_immediatep(abort)) - SWIG_Chicken_Panic(C_text("`##sys#abort' is not defined")); - - C_save(value); - C_do_apply(1, abort, C_SCHEME_UNDEFINED); -} - -static void -SWIG_Chicken_Finalizer(C_word argc, C_word closure, C_word continuation, C_word s) -{ - swig_type_info *type; - swig_chicken_clientdata *cdata; - - if (argc == 3 && s != C_SCHEME_FALSE && C_swig_is_swigpointer(s)) { - type = (swig_type_info *) C_block_item(s, 1); - if (type) { - cdata = (swig_chicken_clientdata *) type->clientdata; - if (cdata && cdata->destroy) { - /* this will not return, but will continue correctly */ - cdata->destroy(3,closure,continuation,s); - } - } - } - C_kontinue(continuation, C_SCHEME_UNDEFINED); -} -static C_word finalizer_obj[2] = {(C_word) (C_CLOSURE_TYPE|1), (C_word) SWIG_Chicken_Finalizer}; - -static C_word -SWIG_Chicken_NewPointerObj(void *ptr, swig_type_info *type, int owner, C_word **data) -{ - swig_chicken_clientdata *cdata = (swig_chicken_clientdata *) type->clientdata; - - if (ptr == NULL) - return C_SCHEME_FALSE; - else { - C_word cptr = C_swigmpointer(data, ptr, type); - /* add finalizer to object */ - #ifndef SWIG_CHICKEN_NO_COLLECTION - if (owner) - C_do_register_finalizer(cptr, (C_word) finalizer_obj); - #endif - - return cptr; - } -} - -/* Return 0 if successful. */ -static int -SWIG_Chicken_ConvertPtr(C_word s, void **result, swig_type_info *type, int flags) -{ - swig_cast_info *cast; - swig_type_info *from; - - if (s == C_SCHEME_FALSE) { - *result = NULL; - } else if (C_swig_is_swigpointer(s)) { - /* try and convert type */ - from = (swig_type_info *) C_block_item(s, 1); - if (!from) return 1; - if (type) { - cast = SWIG_TypeCheckStruct(from, type); - if (cast) { - int newmemory = 0; - *result = SWIG_TypeCast(cast, (void *) C_block_item(s, 0), &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return 1; - } - } else { - *result = (void *) C_block_item(s, 0); - } - - /* check if we are disowning this object */ - if (flags & SWIG_POINTER_DISOWN) { - C_do_unregister_finalizer(s); - } - } else { - return 1; - } - - return 0; -} - -static SWIGINLINE void * -SWIG_Chicken_MustGetPtr (C_word s, swig_type_info *type, int argnum, int flags) -{ - void *result; - char err_msg[256]; - if (SWIG_Chicken_ConvertPtr(s, &result, type, flags)) { - /* type mismatch */ - snprintf(err_msg, sizeof(err_msg), "Type error in argument #%i: expected %s", argnum, (type->str ? type->str : type->name)); - SWIG_Chicken_Barf(SWIG_BARF1_BAD_ARGUMENT_TYPE, err_msg); - } - return result; -} - -static char *chicken_runtimevar_name = "type_pointer" SWIG_TYPE_TABLE_NAME; - -static swig_module_info * -SWIG_Chicken_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - swig_module_info *ret = 0; - C_word sym; - - /* lookup the type pointer... it is stored in its own symbol table */ - C_SYMBOL_TABLE *stable = C_find_symbol_table("swig_runtime_data" SWIG_RUNTIME_VERSION); - if (stable != NULL) { - sym = SWIG_Chicken_LookupSymbol(chicken_runtimevar_name, stable); - if (C_truep(sym) && C_swig_is_ptr(sym)) { - ret = (swig_module_info *) C_block_item(sym, 0); - } - } - - return ret; -} - -static void -SWIG_Chicken_SetModule(swig_module_info *module) { - C_word *a; - C_SYMBOL_TABLE *stable; - C_word sym; - C_word pointer; - static C_word *space = 0; - - /* type pointer is stored in its own symbol table */ - stable = C_find_symbol_table("swig_runtime_data" SWIG_RUNTIME_VERSION); - if (stable == NULL) { - stable = C_new_symbol_table("swig_runtime_data" SWIG_RUNTIME_VERSION, 16); - } - - if (!space) { - space = (C_word *) C_malloc((C_SIZEOF_POINTER + C_SIZEOF_INTERNED_SYMBOL(C_strlen(chicken_runtimevar_name))) * sizeof(C_word)); - } - a = space; - pointer = C_mpointer(&a, (void *) module); - sym = C_intern_in(&a, C_strlen(chicken_runtimevar_name), chicken_runtimevar_name, stable); - C_set_block_item(sym, 0, pointer); -} - -static C_word SWIG_Chicken_MultiResultBuild(C_word num, C_word closure, C_word lst) { - C_word cont = C_block_item(closure,1); - C_word obj = C_block_item(closure,2); - C_word func; - - SWIG_Chicken_FindCreateProxy(func,obj); - - if (C_swig_is_closurep(func)) { - ((C_proc4)(void *)C_block_item(func, 0))(4,func,cont,obj,lst); - } else { - C_word *a = C_alloc(C_SIZEOF_PAIR); - C_kontinue(cont,C_pair(&a,obj,lst)); - } - return C_SCHEME_UNDEFINED; /* never reached */ -} - -static C_word SWIG_Chicken_ApplyResults(C_word num, C_word closure, C_word result) { - C_apply_values(3,C_SCHEME_UNDEFINED,C_block_item(closure,1),result); - return C_SCHEME_UNDEFINED; /* never reached */ -} - -#ifdef __cplusplus -} -#endif diff --git a/linx64/bin/swig/share/swig/4.0.0/chicken/multi-generic.scm b/linx64/bin/swig/share/swig/4.0.0/chicken/multi-generic.scm deleted file mode 100644 index 9d2e31d3..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/chicken/multi-generic.scm +++ /dev/null @@ -1,152 +0,0 @@ -;; This file is no longer necessary with Chicken versions above 1.92 -;; -;; This file overrides two functions inside TinyCLOS to provide support -;; for multi-argument generics. There are many ways of linking this file -;; into your code... all that needs to happen is this file must be -;; executed after loading TinyCLOS but before any SWIG modules are loaded -;; -;; something like the following -;; (require 'tinyclos) -;; (load "multi-generic") -;; (declare (uses swigmod)) -;; -;; An alternative to loading this scheme code directly is to add a -;; (declare (unit multi-generic)) to the top of this file, and then -;; compile this into the final executable or something. Or compile -;; this into an extension. - -;; Lastly, to override TinyCLOS method creation, two functions are -;; overridden: see the end of this file for which two are overridden. -;; You might want to remove those two lines and then exert more control over -;; which functions are used when. - -;; Comments, bugs, suggestions: send either to chicken-users@nongnu.org or to -;; Most code copied from TinyCLOS - -(define (make - 'name "multi-generic" - 'direct-supers (list ) - 'direct-slots '())) - -(letrec ([applicable? - (lambda (c arg) - (memq c (class-cpl (class-of arg))))] - - [more-specific? - (lambda (c1 c2 arg) - (memq c2 (memq c1 (class-cpl (class-of arg)))))] - - [filter-in - (lambda (f l) - (if (null? l) - '() - (let ([h (##sys#slot l 0)] - [r (##sys#slot l 1)] ) - (if (f h) - (cons h (filter-in f r)) - (filter-in f r) ) ) ) )]) - -(add-method compute-apply-generic - (make-method (list ) - (lambda (call-next-method generic) - (lambda args - (let ([cam (let ([x (compute-apply-methods generic)] - [y ((compute-methods generic) args)] ) - (lambda (args) (x y args)) ) ] ) - (cam args) ) ) ) ) ) - - - -(add-method compute-methods - (make-method (list ) - (lambda (call-next-method generic) - (lambda (args) - (let ([applicable - (filter-in (lambda (method) - (let check-applicable ([list1 (method-specializers method)] - [list2 args]) - (cond ((null? list1) #t) - ((null? list2) #f) - (else - (and (applicable? (##sys#slot list1 0) (##sys#slot list2 0)) - (check-applicable (##sys#slot list1 1) (##sys#slot list2 1))))))) - (generic-methods generic) ) ] ) - (if (or (null? applicable) (null? (##sys#slot applicable 1))) - applicable - (let ([cmms (compute-method-more-specific? generic)]) - (sort applicable (lambda (m1 m2) (cmms m1 m2 args))) ) ) ) ) ) ) ) - -(add-method compute-method-more-specific? - (make-method (list ) - (lambda (call-next-method generic) - (lambda (m1 m2 args) - (let loop ((specls1 (method-specializers m1)) - (specls2 (method-specializers m2)) - (args args)) - (cond-expand - [unsafe - (let ((c1 (##sys#slot specls1 0)) - (c2 (##sys#slot specls2 0)) - (arg (##sys#slot args 0))) - (if (eq? c1 c2) - (loop (##sys#slot specls1 1) - (##sys#slot specls2 1) - (##sys#slot args 1)) - (more-specific? c1 c2 arg))) ] - [else - (cond ((and (null? specls1) (null? specls2)) - (##sys#error "two methods are equally specific" generic)) - ;((or (null? specls1) (null? specls2)) - ; (##sys#error "two methods have different number of specializers" generic)) - ((null? specls1) #f) - ((null? specls2) #t) - ((null? args) - (##sys#error "fewer arguments than specializers" generic)) - (else - (let ((c1 (##sys#slot specls1 0)) - (c2 (##sys#slot specls2 0)) - (arg (##sys#slot args 0))) - (if (eq? c1 c2) - (loop (##sys#slot specls1 1) - (##sys#slot specls2 1) - (##sys#slot args 1)) - (more-specific? c1 c2 arg)))) ) ] ) ) ) ) ) ) - -) ;; end of letrec - -(define multi-add-method - (lambda (generic method) - (slot-set! - generic - 'methods - (let filter-in-method ([methods (slot-ref generic 'methods)]) - (if (null? methods) - (list method) - (let ([l1 (length (method-specializers method))] - [l2 (length (method-specializers (##sys#slot methods 0)))]) - (cond ((> l1 l2) - (cons (##sys#slot methods 0) (filter-in-method (##sys#slot methods 1)))) - ((< l1 l2) - (cons method methods)) - (else - (let check-method ([ms1 (method-specializers method)] - [ms2 (method-specializers (##sys#slot methods 0))]) - (cond ((and (null? ms1) (null? ms2)) - (cons method (##sys#slot methods 1))) ;; skip the method already in the generic - ((eq? (##sys#slot ms1 0) (##sys#slot ms2 0)) - (check-method (##sys#slot ms1 1) (##sys#slot ms2 1))) - (else - (cons (##sys#slot methods 0) (filter-in-method (##sys#slot methods 1)))))))))))) - - (##sys#setslot (##sys#slot generic (- (##sys#size generic) 2)) 1 (compute-apply-generic generic)) )) - -(define (multi-add-global-method val sym specializers proc) - (let ((generic (if (procedure? val) val (make 'name (##sys#symbol->string sym))))) - (multi-add-method generic (make-method specializers proc)) - generic)) - -;; Might want to remove these, or perhaps do something like -;; (define old-add-method ##tinyclos#add-method) -;; and then you can switch between creating multi-generics and TinyCLOS generics. -(set! ##tinyclos#add-method multi-add-method) -(set! ##tinyclos#add-global-method multi-add-global-method) diff --git a/linx64/bin/swig/share/swig/4.0.0/chicken/std_string.i b/linx64/bin/swig/share/swig/4.0.0/chicken/std_string.i deleted file mode 100644 index fa77c153..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/chicken/std_string.i +++ /dev/null @@ -1,96 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - %naturalvar string; - - - %insert(closprefix) %{ (declare (hide )) %} - %nodefault string; - %rename("std-string") string; - class string { - public: - ~string() {} - }; - %extend string { - char *str; - } - %{ - #define std_string_str_get(s) ((char *)((s)->c_str())) - #define std_string_str_set(s,v) (s->assign((char *)(v))) - %} - - %typemap(typecheck) string = char *; - %typemap(typecheck) const string & = char *; - - %typemap(in) string (char * tempptr) { - if ($input == C_SCHEME_FALSE) { - $1.resize(0); - } else { - if (!C_swig_is_string ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, - "Argument #$argnum is not a string"); - } - tempptr = SWIG_MakeString($input); - $1.assign(tempptr); - if (tempptr) SWIG_free(tempptr); - } - } - - %typemap(in) const string& ($*1_ltype temp, char *tempptr) { - - if ($input == C_SCHEME_FALSE) { - temp.resize(0); - $1 = &temp; - } else { - if (!C_swig_is_string ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, - "Argument #$argnum is not a string"); - } - tempptr = SWIG_MakeString($input); - temp.assign(tempptr); - if (tempptr) SWIG_free(tempptr); - $1 = &temp; - } - } - - %typemap(out) string { - int size = $1.size(); - C_word *space = C_alloc (C_SIZEOF_STRING (size)); - $result = C_string (&space, size, (char *) $1.c_str()); - } - - %typemap(out) const string& { - int size = $1->size(); - C_word *space = C_alloc (C_SIZEOF_STRING (size)); - $result = C_string (&space, size, (char *) $1->c_str()); - } - - %typemap(varin) string { - if ($input == C_SCHEME_FALSE) { - $1.resize(0); - } else { - char *tempptr; - if (!C_swig_is_string ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, - "Argument #$argnum is not a string"); - } - tempptr = SWIG_MakeString($input); - $1.assign(tempptr); - if (tempptr) SWIG_free(tempptr); - } - } - - %typemap(varout) string { - int size = $1.size(); - C_word *space = C_alloc (C_SIZEOF_STRING (size)); - $result = C_string (&space, size, (char *) $1.c_str()); - } -} diff --git a/linx64/bin/swig/share/swig/4.0.0/chicken/swigclosprefix.scm b/linx64/bin/swig/share/swig/4.0.0/chicken/swigclosprefix.scm deleted file mode 100644 index e4bd72b7..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/chicken/swigclosprefix.scm +++ /dev/null @@ -1,31 +0,0 @@ -(declare (hide swig-initialize)) - -(define (swig-initialize obj initargs create) - (slot-set! obj 'swig-this - (if (memq 'swig-this initargs) - (cadr initargs) - (let ((ret (apply create initargs))) - (if (instance? ret) - (slot-ref ret 'swig-this) - ret))))) - -(define-class () (void)) - -(define-method (compute-getter-and-setter (class ) slot allocator) - (if (not (memq ':swig-virtual slot)) - (call-next-method) - (let ((getter (let search-get ((lst slot)) - (if (null? lst) - #f - (if (eq? (car lst) ':swig-get) - (cadr lst) - (search-get (cdr lst)))))) - (setter (let search-set ((lst slot)) - (if (null? lst) - #f - (if (eq? (car lst) ':swig-set) - (cadr lst) - (search-set (cdr lst))))))) - (values - (lambda (o) (getter (slot-ref o 'swig-this))) - (lambda (o new) (setter (slot-ref o 'swig-this) new) new))))) diff --git a/linx64/bin/swig/share/swig/4.0.0/chicken/tinyclos-multi-generic.patch b/linx64/bin/swig/share/swig/4.0.0/chicken/tinyclos-multi-generic.patch deleted file mode 100644 index 2e585960..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/chicken/tinyclos-multi-generic.patch +++ /dev/null @@ -1,150 +0,0 @@ -# This patch is against chicken 1.92, but it should work just fine -# with older versions of chicken. It adds support for mulit-argument -# generics, that is, generics now correctly handle adding methods -# with different lengths of specializer lists - -# This patch has been committed into the CHICKEN darcs repository, -# so chicken versions above 1.92 work fine. - -# Comments, bugs, suggestions send to chicken-users@nongnu.org - -# Patch written by John Lenz - ---- tinyclos.scm.old 2005-04-05 01:13:56.000000000 -0500 -+++ tinyclos.scm 2005-04-11 16:37:23.746181489 -0500 -@@ -37,8 +37,10 @@ - - (include "parameters") - -+(cond-expand [(not chicken-compile-shared) (declare (unit tinyclos))] -+ [else] ) -+ - (declare -- (unit tinyclos) - (uses extras) - (usual-integrations) - (fixnum) -@@ -234,7 +236,10 @@ - y = C_block_item(y, 1); - } - } -- return(C_block_item(v, i + 1)); -+ if (x == C_SCHEME_END_OF_LIST && y == C_SCHEME_END_OF_LIST) -+ return(C_block_item(v, i + 1)); -+ else -+ goto mismatch; - } - else if(free_index == -1) free_index = i; - mismatch: -@@ -438,7 +443,7 @@ - (define hash-arg-list - (foreign-lambda* unsigned-int ((scheme-object args) (scheme-object svector)) " - C_word tag, h, x; -- int n, i, j; -+ int n, i, j, len = 0; - for(i = 0; args != C_SCHEME_END_OF_LIST; args = C_block_item(args, 1)) { - x = C_block_item(args, 0); - if(C_immediatep(x)) { -@@ -481,8 +486,9 @@ - default: i += 255; - } - } -+ ++len; - } -- return(i & (C_METHOD_CACHE_SIZE - 1));") ) -+ return((i + len) & (C_METHOD_CACHE_SIZE - 1));") ) - - - ; -@@ -868,13 +874,27 @@ - (##tinyclos#slot-set! - generic - 'methods -- (cons method -- (filter-in -- (lambda (m) -- (let ([ms1 (method-specializers m)] -- [ms2 (method-specializers method)] ) -- (not (every2 (lambda (x y) (eq? x y)) ms1 ms2) ) ) ) -- (##tinyclos#slot-ref generic 'methods)))) -+ (let* ([ms1 (method-specializers method)] -+ [l1 (length ms1)] ) -+ (let filter-in-method ([methods (##tinyclos#slot-ref generic 'methods)]) -+ (if (null? methods) -+ (list method) -+ (let* ([mm (##sys#slot methods 0)] -+ [ms2 (method-specializers mm)] -+ [l2 (length ms2)]) -+ (cond ((> l1 l2) -+ (cons mm (filter-in-method (##sys#slot methods 1)))) -+ ((< l1 l2) -+ (cons method methods)) -+ (else -+ (let check-method ([ms1 ms1] -+ [ms2 ms2]) -+ (cond ((and (null? ms1) (null? ms2)) -+ (cons method (##sys#slot methods 1))) ;; skip the method already in the generic -+ ((eq? (##sys#slot ms1 0) (##sys#slot ms2 0)) -+ (check-method (##sys#slot ms1 1) (##sys#slot ms2 1))) -+ (else -+ (cons mm (filter-in-method (##sys#slot methods 1))))))))))))) - (if (memq generic generic-invocation-generics) - (set! method-cache-tag (vector)) - (%entity-cache-set! generic #f) ) -@@ -925,11 +945,13 @@ - (memq (car args) generic-invocation-generics)) - (let ([proc - (method-procedure -+ ; select the first method of one argument - (let lp ([lis (generic-methods generic)]) -- (let ([tail (##sys#slot lis 1)]) -- (if (null? tail) -- (##sys#slot lis 0) -- (lp tail)) ) ) ) ] ) -+ (if (null? lis) -+ (##sys#error "Unable to find original compute-apply-generic") -+ (if (= (length (method-specializers (##sys#slot lis 0))) 1) -+ (##sys#slot lis 0) -+ (lp (##sys#slot lis 1)))))) ] ) - (lambda (args) (apply proc #f args)) ) - (let ([x (compute-apply-methods generic)] - [y ((compute-methods generic) args)] ) -@@ -946,9 +968,13 @@ - (lambda (args) - (let ([applicable - (filter-in (lambda (method) -- (every2 applicable? -- (method-specializers method) -- args)) -+ (let check-applicable ([list1 (method-specializers method)] -+ [list2 args]) -+ (cond ((null? list1) #t) -+ ((null? list2) #f) -+ (else -+ (and (applicable? (##sys#slot list1 0) (##sys#slot list2 0)) -+ (check-applicable (##sys#slot list1 1) (##sys#slot list2 1))))))) - (generic-methods generic) ) ] ) - (if (or (null? applicable) (null? (##sys#slot applicable 1))) - applicable -@@ -975,8 +1001,10 @@ - [else - (cond ((and (null? specls1) (null? specls2)) - (##sys#error "two methods are equally specific" generic)) -- ((or (null? specls1) (null? specls2)) -- (##sys#error "two methods have different number of specializers" generic)) -+ ;((or (null? specls1) (null? specls2)) -+ ; (##sys#error "two methods have different number of specializers" generic)) -+ ((null? specls1) #f) -+ ((null? specls2) #t) - ((null? args) - (##sys#error "fewer arguments than specializers" generic)) - (else -@@ -1210,7 +1238,7 @@ - (define (make-primitive-class "structure")) - (define (make-primitive-class "procedure" )) - (define (make-primitive-class "end-of-file")) --(define (make-primitive-class "environment" )) ; (Benedikt insisted on this) -+(define (make-primitive-class "environment" )) - (define (make-primitive-class "hash-table" )) - (define (make-primitive-class "promise" )) - (define (make-primitive-class "queue" )) diff --git a/linx64/bin/swig/share/swig/4.0.0/chicken/typemaps.i b/linx64/bin/swig/share/swig/4.0.0/chicken/typemaps.i deleted file mode 100644 index fd587fd6..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/chicken/typemaps.i +++ /dev/null @@ -1,314 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer handling - * - * These mappings provide support for input/output arguments and - * common uses for C/C++ pointers. INOUT mappings allow for C/C++ - * pointer variables in addition to input/output arguments. - * ----------------------------------------------------------------------------- */ - -// INPUT typemaps. -// These remap a C pointer to be an "INPUT" value which is passed by value -// instead of reference. - -/* -The following methods can be applied to turn a pointer into a simple -"input" value. That is, instead of passing a pointer to an object, -you would use a real value instead. - - int *INPUT - short *INPUT - long *INPUT - long long *INPUT - unsigned int *INPUT - unsigned short *INPUT - unsigned long *INPUT - unsigned long long *INPUT - unsigned char *INPUT - char *INPUT - bool *INPUT - float *INPUT - double *INPUT - -To use these, suppose you had a C function like this : - - double fadd(double *a, double *b) { - return *a+*b; - } - -You could wrap it with SWIG as follows : - - %include - 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 Scheme list. - - 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 - 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).K: - - 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); - -*/ - -//---------------------------------------------------------------------- -// -// T_OUTPUT typemap (and helper function) to return multiple argouts as -// a tuple instead of a list. -// -//---------------------------------------------------------------------- - -// Simple types - -%define INOUT_TYPEMAP(type_, from_scheme, to_scheme, checker, convtype, storage_) - -%typemap(in) type_ *INPUT($*1_ltype temp), type_ &INPUT($*1_ltype temp) -%{ if (!checker ($input)) { - swig_barf (SWIG_BARF1_BAD_ARGUMENT_TYPE, "Argument #$argnum is not of type 'type_'"); - } - temp = ($*1_ltype) from_scheme ($input); - $1 = &temp; %} - -%typemap(typecheck) type_ *INPUT = type_; -%typemap(typecheck) type_ &INPUT = type_; - -%typemap(in, numinputs=0) type_ *OUTPUT($*1_ltype temp), type_ &OUTPUT($*1_ltype temp) -" $1 = &temp;" - -#if "storage_" == "0" - -%typemap(argout) type_ *OUTPUT, type_ &OUTPUT -%{ - if ($1 == NULL) { - swig_barf (SWIG_BARF1_ARGUMENT_NULL, "Argument #$argnum must be non-null"); - } - SWIG_APPEND_VALUE(to_scheme (convtype (*$1))); -%} - -#else - -%typemap(argout) type_ *OUTPUT, type_ &OUTPUT -%{ - { - C_word *known_space = C_alloc(storage_); - if ($1 == NULL) { - swig_barf (SWIG_BARF1_ARGUMENT_NULL, "Variable '$1' must be non-null"); - } - SWIG_APPEND_VALUE(to_scheme (&known_space, convtype (*$1))); - } -%} - -#endif - -%enddef - -INOUT_TYPEMAP(int, C_num_to_int, C_fix, C_swig_is_number, (int), 0); -INOUT_TYPEMAP(enum SWIGTYPE, C_num_to_int, C_fix, C_swig_is_number, (int), 0); -INOUT_TYPEMAP(short, C_num_to_int, C_fix, C_swig_is_number, (int), 0); -INOUT_TYPEMAP(long, C_num_to_long, C_long_to_num, C_swig_is_long, (long), C_SIZEOF_FLONUM); -INOUT_TYPEMAP(long long, C_num_to_long, C_long_to_num, C_swig_is_long, (long), C_SIZEOF_FLONUM); -INOUT_TYPEMAP(unsigned int, C_num_to_unsigned_int, C_unsigned_int_to_num, C_swig_is_number, (int), C_SIZEOF_FLONUM); -INOUT_TYPEMAP(unsigned short, C_num_to_unsigned_int, C_fix, C_swig_is_number, (unsigned int), 0); -INOUT_TYPEMAP(unsigned long, C_num_to_unsigned_long, C_unsigned_long_to_num, C_swig_is_long, (unsigned long), C_SIZEOF_FLONUM); -INOUT_TYPEMAP(unsigned long long, C_num_to_unsigned_long, C_unsigned_long_to_num, C_swig_is_long, (unsigned long), C_SIZEOF_FLONUM); -INOUT_TYPEMAP(unsigned char, C_character_code, C_make_character, C_swig_is_char, (unsigned int), 0); -INOUT_TYPEMAP(signed char, C_character_code, C_make_character, C_swig_is_char, (int), 0); -INOUT_TYPEMAP(char, C_character_code, C_make_character, C_swig_is_char, (char), 0); -INOUT_TYPEMAP(bool, C_truep, C_mk_bool, C_swig_is_bool, (bool), 0); -INOUT_TYPEMAP(float, C_c_double, C_flonum, C_swig_is_number, (double), C_SIZEOF_FLONUM); -INOUT_TYPEMAP(double, C_c_double, C_flonum, C_swig_is_number, (double), C_SIZEOF_FLONUM); - -// 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 CHICKEN 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 - 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); - -As well, you can wrap variables with : - - %include - %apply double *INOUT { double *y }; - extern double *y; - -Unlike C, this mapping does not directly modify the input value (since -this makes no sense in CHICKEN). Rather, the modified input value shows -up as the return value of the function. Thus, to apply this function -to a CHICKEN 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; -%typemap(in) enum SWIGTYPE *INOUT = enum SWIGTYPE *INPUT; -%typemap(in) short *INOUT = short *INPUT; -%typemap(in) long *INOUT = long *INPUT; -%typemap(in) long long *INOUT = long long *INPUT; -%typemap(in) unsigned *INOUT = unsigned *INPUT; -%typemap(in) unsigned short *INOUT = unsigned short *INPUT; -%typemap(in) unsigned long *INOUT = unsigned long *INPUT; -%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; -%typemap(in) unsigned char *INOUT = unsigned char *INPUT; -%typemap(in) char *INOUT = char *INPUT; -%typemap(in) bool *INOUT = bool *INPUT; -%typemap(in) float *INOUT = float *INPUT; -%typemap(in) double *INOUT = double *INPUT; - -%typemap(in) int &INOUT = int &INPUT; -%typemap(in) enum SWIGTYPE &INOUT = enum SWIGTYPE &INPUT; -%typemap(in) short &INOUT = short &INPUT; -%typemap(in) long &INOUT = long &INPUT; -%typemap(in) long long &INOUT = long long &INPUT; -%typemap(in) unsigned &INOUT = unsigned &INPUT; -%typemap(in) unsigned short &INOUT = unsigned short &INPUT; -%typemap(in) unsigned long &INOUT = unsigned long &INPUT; -%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT; -%typemap(in) unsigned char &INOUT = unsigned char &INPUT; -%typemap(in) char &INOUT = char &INPUT; -%typemap(in) bool &INOUT = bool &INPUT; -%typemap(in) float &INOUT = float &INPUT; -%typemap(in) double &INOUT = double &INPUT; - -%typemap(argout) int *INOUT = int *OUTPUT; -%typemap(argout) enum SWIGTYPE *INOUT = enum SWIGTYPE *OUTPUT; -%typemap(argout) short *INOUT = short *OUTPUT; -%typemap(argout) long *INOUT = long *OUTPUT; -%typemap(argout) long long *INOUT = long long *OUTPUT; -%typemap(argout) unsigned *INOUT = unsigned *OUTPUT; -%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT; -%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; -%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; -%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; -%typemap(argout) bool *INOUT = bool *OUTPUT; -%typemap(argout) float *INOUT = float *OUTPUT; -%typemap(argout) double *INOUT = double *OUTPUT; - -%typemap(argout) int &INOUT = int &OUTPUT; -%typemap(argout) enum SWIGTYPE &INOUT = enum SWIGTYPE &OUTPUT; -%typemap(argout) short &INOUT = short &OUTPUT; -%typemap(argout) long &INOUT = long &OUTPUT; -%typemap(argout) long long &INOUT = long long &OUTPUT; -%typemap(argout) unsigned &INOUT = unsigned &OUTPUT; -%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT; -%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT; -%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; -%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT; -%typemap(argout) char &INOUT = char &OUTPUT; -%typemap(argout) bool &INOUT = bool &OUTPUT; -%typemap(argout) float &INOUT = float &OUTPUT; -%typemap(argout) double &INOUT = double &OUTPUT; - -/* Overloading information */ - -%typemap(typecheck) double *INOUT = double; -%typemap(typecheck) bool *INOUT = bool; -%typemap(typecheck) char *INOUT = char; -%typemap(typecheck) signed char *INOUT = signed char; -%typemap(typecheck) unsigned char *INOUT = unsigned char; -%typemap(typecheck) unsigned long *INOUT = unsigned long; -%typemap(typecheck) unsigned long long *INOUT = unsigned long long; -%typemap(typecheck) unsigned short *INOUT = unsigned short; -%typemap(typecheck) unsigned int *INOUT = unsigned int; -%typemap(typecheck) long *INOUT = long; -%typemap(typecheck) long long *INOUT = long long; -%typemap(typecheck) short *INOUT = short; -%typemap(typecheck) int *INOUT = int; -%typemap(typecheck) enum SWIGTYPE *INOUT = enum SWIGTYPE; -%typemap(typecheck) float *INOUT = float; - -%typemap(typecheck) double &INOUT = double; -%typemap(typecheck) bool &INOUT = bool; -%typemap(typecheck) char &INOUT = char; -%typemap(typecheck) signed char &INOUT = signed char; -%typemap(typecheck) unsigned char &INOUT = unsigned char; -%typemap(typecheck) unsigned long &INOUT = unsigned long; -%typemap(typecheck) unsigned long long &INOUT = unsigned long long; -%typemap(typecheck) unsigned short &INOUT = unsigned short; -%typemap(typecheck) unsigned int &INOUT = unsigned int; -%typemap(typecheck) long &INOUT = long; -%typemap(typecheck) long long &INOUT = long long; -%typemap(typecheck) short &INOUT = short; -%typemap(typecheck) int &INOUT = int; -%typemap(typecheck) enum SWIGTYPE &INOUT = enum SWIGTYPE; -%typemap(typecheck) float &INOUT = float; diff --git a/linx64/bin/swig/share/swig/4.0.0/clisp/clisp.swg b/linx64/bin/swig/share/swig/4.0.0/clisp/clisp.swg deleted file mode 100644 index e1d330cb..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/clisp/clisp.swg +++ /dev/null @@ -1,32 +0,0 @@ -/* ----------------------------------------------------------------------------- - * clisp.swg - * ----------------------------------------------------------------------------- */ - -/* Define a C preprocessor symbol that can be used in interface files - to distinguish between the SWIG language modules. */ - -#define SWIG_CLISP - -/* Typespecs for basic types. */ - -%typemap(in) void "NIL"; - -%typemap(in) char "character"; -%typemap(in) char * "ffi:c-string"; -%typemap(in) unsigned char "ffi:uchar"; -%typemap(in) signed char "ffi:char"; - -%typemap(in) short "ffi:short"; -%typemap(in) signed short "ffi:short"; -%typemap(in) unsigned short "ffi:ushort"; - -%typemap(in) int "ffi:int"; -%typemap(in) signed int "ffi:int"; -%typemap(in) unsigned int "ffi:uint"; - -%typemap(in) long "ffi:long"; -%typemap(in) signed long "ffi:long"; -%typemap(in) unsigned long "ffi:ulong"; - -%typemap(in) float "SINGLE-FLOAT"; -%typemap(in) double "DOUBLE-FLOAT"; diff --git a/linx64/bin/swig/share/swig/4.0.0/csharp/boost_intrusive_ptr.i b/linx64/bin/swig/share/swig/4.0.0/csharp/boost_intrusive_ptr.i index 6b0392d3..fa3f53a2 100644 --- a/linx64/bin/swig/share/swig/4.0.0/csharp/boost_intrusive_ptr.i +++ b/linx64/bin/swig/share/swig/4.0.0/csharp/boost_intrusive_ptr.i @@ -314,7 +314,7 @@ } %} -%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") TYPE { +%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwnBase) { @@ -323,11 +323,10 @@ } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - global::System.GC.SuppressFinalize(this); } } -%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE { +%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwnDerived) { @@ -336,8 +335,7 @@ } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - global::System.GC.SuppressFinalize(this); - base.Dispose(); + base.Dispose(disposing); } } @@ -473,7 +471,7 @@ } %} -%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") TYPE { +%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwnBase) { @@ -482,11 +480,10 @@ } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - global::System.GC.SuppressFinalize(this); } } -%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE { +%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwnDerived) { @@ -495,8 +492,7 @@ } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - global::System.GC.SuppressFinalize(this); - base.Dispose(); + base.Dispose(disposing); } } diff --git a/linx64/bin/swig/share/swig/4.0.0/csharp/boost_shared_ptr.i b/linx64/bin/swig/share/swig/4.0.0/csharp/boost_shared_ptr.i index 73212ddd..508c0ec1 100644 --- a/linx64/bin/swig/share/swig/4.0.0/csharp/boost_shared_ptr.i +++ b/linx64/bin/swig/share/swig/4.0.0/csharp/boost_shared_ptr.i @@ -282,7 +282,7 @@ } %} -%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") TYPE { +%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwnBase) { @@ -291,11 +291,10 @@ } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - global::System.GC.SuppressFinalize(this); } } -%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE { +%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwnDerived) { @@ -304,8 +303,7 @@ } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - global::System.GC.SuppressFinalize(this); - base.Dispose(); + base.Dispose(disposing); } } diff --git a/linx64/bin/swig/share/swig/4.0.0/csharp/csharp.swg b/linx64/bin/swig/share/swig/4.0.0/csharp/csharp.swg index e1554dcb..83220638 100644 --- a/linx64/bin/swig/share/swig/4.0.0/csharp/csharp.swg +++ b/linx64/bin/swig/share/swig/4.0.0/csharp/csharp.swg @@ -959,17 +959,24 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { SWIG_CSBODY_PROXY(internal, internal, SWIGTYPE) SWIG_CSBODY_TYPEWRAPPER(internal, protected, internal, SWIGTYPE) -%typemap(csfinalize) SWIGTYPE %{ +%typemap(csdispose) SWIGTYPE %{ ~$csclassname() { - Dispose(); + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); } %} +%typemap(csdispose_derived) SWIGTYPE "" + %typemap(csconstruct, excode=SWIGEXCODE,directorconnect="\n SwigDirectorConnect();") SWIGTYPE %{: this($imcall, true) {$excode$directorconnect } %} -%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") SWIGTYPE { +%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") SWIGTYPE { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { @@ -978,11 +985,10 @@ SWIG_CSBODY_TYPEWRAPPER(internal, protected, internal, SWIGTYPE) } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - global::System.GC.SuppressFinalize(this); } } -%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") SWIGTYPE { +%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") SWIGTYPE { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { @@ -991,8 +997,7 @@ SWIG_CSBODY_TYPEWRAPPER(internal, protected, internal, SWIGTYPE) } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - global::System.GC.SuppressFinalize(this); - base.Dispose(); + base.Dispose(disposing); } } diff --git a/linx64/bin/swig/share/swig/4.0.0/csharp/csharphead.swg b/linx64/bin/swig/share/swig/4.0.0/csharp/csharphead.swg index 0b55635b..7db4c0e3 100644 --- a/linx64/bin/swig/share/swig/4.0.0/csharp/csharphead.swg +++ b/linx64/bin/swig/share/swig/4.0.0/csharp/csharphead.swg @@ -244,6 +244,7 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( [global::System.ThreadStatic] private static global::System.Exception pendingException = null; private static int numExceptionsPending = 0; + private static global::System.Object exceptionsLock = null; public static bool Pending { get { @@ -259,7 +260,7 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( if (pendingException != null) throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e); pendingException = e; - lock(typeof($imclassname)) { + lock(exceptionsLock) { numExceptionsPending++; } } @@ -270,13 +271,17 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( if (pendingException != null) { e = pendingException; pendingException = null; - lock(typeof($imclassname)) { + lock(exceptionsLock) { numExceptionsPending--; } } } return e; } + + static SWIGPendingException() { + exceptionsLock = new global::System.Object(); + } } %} #endif // SWIG_CSHARP_NO_EXCEPTION_HELPER diff --git a/linx64/bin/swig/share/swig/4.0.0/csharp/std_array.i b/linx64/bin/swig/share/swig/4.0.0/csharp/std_array.i index e7d392b8..a4f0f964 100644 --- a/linx64/bin/swig/share/swig/4.0.0/csharp/std_array.i +++ b/linx64/bin/swig/share/swig/4.0.0/csharp/std_array.i @@ -192,9 +192,9 @@ else throw std::out_of_range("index"); } - void setitem(int index, const_reference value) throw (std::out_of_range) { + void setitem(int index, const_reference val) throw (std::out_of_range) { if (index>=0 && index<(int)$self->size()) - (*$self)[index] = value; + (*$self)[index] = val; else throw std::out_of_range("index"); } diff --git a/linx64/bin/swig/share/swig/4.0.0/csharp/std_list.i b/linx64/bin/swig/share/swig/4.0.0/csharp/std_list.i new file mode 100644 index 00000000..674aba0a --- /dev/null +++ b/linx64/bin/swig/share/swig/4.0.0/csharp/std_list.i @@ -0,0 +1,519 @@ +/* ----------------------------------------------------------------------------- + * std_list.i + * + * SWIG typemaps for std::list + * C# implementation + * The C# wrapper is made to look and feel like a C# System.Collections.Generic.LinkedList<> collection. + * + * Note that IEnumerable<> is implemented in the proxy class which is useful for using LINQ with + * C++ std::list wrappers. The ICollection<> interface is also implemented to provide enhanced functionality + * whenever we are confident that the required C++ operator== is available. This is the case for when + * T is a primitive type or a pointer. If T does define an operator==, then use the SWIG_STD_LIST_ENHANCED + * macro to obtain this enhanced functionality, for example: + * + * SWIG_STD_LIST_ENHANCED(SomeNamespace::Klass) + * %template(ListKlass) std::list; + * ----------------------------------------------------------------------------- */ + +%include + +// MACRO for use within the std::list class body +%define SWIG_STD_LIST_MINIMUM_INTERNAL(CSINTERFACE, CTYPE...) +%typemap(csinterfaces) std::list< CTYPE > "global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n"; + +%apply void *VOID_INT_PTR { std::list< CTYPE >::iterator * }; + +%proxycode %{ + public $csclassname(global::System.Collections.IEnumerable c) : this() { + if (c == null) + throw new global::System.ArgumentNullException("c"); + foreach ($typemap(cstype, CTYPE) element in c) { + this.AddLast(element); + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public int Count { + get { + return (int)size(); + } + } + + public $csclassnameNode First { + get { + if (Count == 0) + return null; + return new $csclassnameNode(getFirstIter(), this); + } + } + + public $csclassnameNode Last { + get { + if (Count == 0) + return null; + return new $csclassnameNode(getLastIter(), this); + } + } + + public $csclassnameNode AddFirst($typemap(cstype, CTYPE) value) { + push_front(value); + return new $csclassnameNode(getFirstIter(), this); + } + + public void AddFirst($csclassnameNode newNode) { + ValidateNewNode(newNode); + if (!newNode.inlist) { + push_front(newNode.csharpvalue); + newNode.iter = getFirstIter(); + newNode.inlist = true; + } else { + throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); + } + } + + public $csclassnameNode AddLast($typemap(cstype, CTYPE) value) { + push_back(value); + return new $csclassnameNode(getLastIter(), this); + } + + public void AddLast($csclassnameNode newNode) { + ValidateNewNode(newNode); + if (!newNode.inlist) { + push_back(newNode.csharpvalue); + newNode.iter = getLastIter(); + newNode.inlist = true; + } else { + throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); + } + } + + public $csclassnameNode AddBefore($csclassnameNode node, $typemap(cstype, CTYPE) value) { + return new $csclassnameNode(insertNode(node.iter, value), this); + } + + public void AddBefore($csclassnameNode node, $csclassnameNode newNode) { + ValidateNode(node); + ValidateNewNode(newNode); + if (!newNode.inlist) { + newNode.iter = insertNode(node.iter, newNode.csharpvalue); + newNode.inlist = true; + } else { + throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); + } + } + + public $csclassnameNode AddAfter($csclassnameNode node, $typemap(cstype, CTYPE) value) { + node = node.Next; + return new $csclassnameNode(insertNode(node.iter, value), this); + } + + public void AddAfter($csclassnameNode node, $csclassnameNode newNode) { + ValidateNode(node); + ValidateNewNode(newNode); + if (!newNode.inlist) { + if (node == this.Last) + AddLast(newNode); + else + { + node = node.Next; + newNode.iter = insertNode(node.iter, newNode.csharpvalue); + newNode.inlist = true; + } + } else { + throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name); + } + } + + public void Add($typemap(cstype, CTYPE) value) { + AddLast(value); + } + + public void Remove($csclassnameNode node) { + ValidateNode(node); + eraseIter(node.iter); + } + + public void CopyTo($typemap(cstype, CTYPE)[] array, int index) { + if (array == null) + throw new global::System.ArgumentNullException("array"); + if (index < 0 || index > array.Length) + throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero"); + if (array.Rank > 1) + throw new global::System.ArgumentException("Multi dimensional array.", "array"); + $csclassnameNode node = this.First; + if (node != null) { + do { + array[index++] = node.Value; + node = node.Next; + } while (node != null); + } + } + + internal void ValidateNode($csclassnameNode node) { + if (node == null) { + throw new System.ArgumentNullException("node"); + } + if (!node.inlist || node.list != this) { + throw new System.InvalidOperationException("node"); + } + } + + internal void ValidateNewNode($csclassnameNode node) { + if (node == null) { + throw new System.ArgumentNullException("node"); + } + } + + global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.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); + } + + public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator, + global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> + { + private $csclassname collectionRef; + private $csclassnameNode currentNode; + private int currentIndex; + private object currentObject; + private int currentSize; + + public $csclassnameEnumerator($csclassname collection) { + collectionRef = collection; + currentNode = collection.First; + currentIndex = 0; + currentObject = null; + currentSize = collectionRef.Count; + } + + // Type-safe iterator Current + public $typemap(cstype, CTYPE) Current { + get { + if (currentIndex == -1) + throw new global::System.InvalidOperationException("Enumeration not started."); + if (currentIndex > currentSize) + throw new global::System.InvalidOperationException("Enumeration finished."); + if (currentObject == null) + throw new global::System.InvalidOperationException("Collection modified."); + return ($typemap(cstype, CTYPE))currentObject; + } + } + + // Type-unsafe IEnumerator.Current + object global::System.Collections.IEnumerator.Current { + get { + return Current; + } + } + + public bool MoveNext() { + if (currentNode == null) { + currentIndex = collectionRef.Count + 1; + return false; + } + ++currentIndex; + currentObject = currentNode.Value; + currentNode = currentNode.Next; + return true; + } + + 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 sealed class $csclassnameNode { + internal $csclassname list; + internal System.IntPtr iter; + internal $typemap(cstype, CTYPE) csharpvalue; + internal bool inlist; + + public $csclassnameNode($typemap(cstype, CTYPE) value) { + csharpvalue = value; + inlist = false; + } + + internal $csclassnameNode(System.IntPtr iter, $csclassname list) { + this.list = list; + this.iter = iter; + inlist = true; + } + + public $csclassname List { + get { + return this.list; + } + } + + public $csclassnameNode Next { + get { + if (list.getNextIter(iter) == System.IntPtr.Zero) + return null; + return new $csclassnameNode(list.getNextIter(iter), list); + } + } + + public $csclassnameNode Previous { + get { + if (list.getPrevIter(iter) == System.IntPtr.Zero) + return null; + return new $csclassnameNode(list.getPrevIter(iter), list); + } + } + + public $typemap(cstype, CTYPE) Value { + get { + return list.getItem(this.iter); + } + set { + list.setItem(this.iter, value); + } + } + + public static bool operator==($csclassnameNode node1, $csclassnameNode node2) { + if (object.ReferenceEquals(node1, null) && object.ReferenceEquals(node2, null)) + return true; + if (object.ReferenceEquals(node1, null) || object.ReferenceEquals(node2, null)) + return false; + return node1.Equals(node2); + } + + public static bool operator!=($csclassnameNode node1, $csclassnameNode node2) { + if (node1 == null && node2 == null) + return false; + if (node1 == null || node2 == null) + return true; + return !node1.Equals(node2); + } + + public bool Equals($csclassnameNode node) { + if (node == null) + return false; + if (!node.inlist || !this.inlist) + return object.ReferenceEquals(this, node); + return list.equals(this.iter, node.iter); + } + + public override bool Equals(object node) { + return Equals(($csclassnameNode)node); + } + + public override int GetHashCode() { + int hash = 13; + if (inlist) { + hash = (hash * 7) + this.list.GetHashCode(); + hash = (hash * 7) + this.Value.GetHashCode(); + hash = (hash * 7) + this.list.getNextIter(this.iter).GetHashCode(); + hash = (hash * 7) + this.list.getPrevIter(this.iter).GetHashCode(); + } else { + hash = (hash * 7) + this.csharpvalue.GetHashCode(); + } + return hash; + } + + public void Dispose() { + list.deleteIter(this.iter); + } + } +%} + +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 value_type& const_reference; + + class iterator; + + void push_front(CTYPE const& x); + void push_back(CTYPE const& x); + %rename(RemoveFirst) pop_front; + void pop_front(); + %rename(RemoveLast) pop_back; + void pop_back(); + size_type size() const; + %rename(Clear) clear; + void clear(); + %extend { + const_reference getItem(iterator *iter) { + return **iter; + } + + void setItem(iterator *iter, CTYPE const& val) { + *(*iter) = val; + } + + iterator *getFirstIter() { + if ($self->size() == 0) + return NULL; + return new std::list< CTYPE >::iterator($self->begin()); + } + + iterator *getLastIter() { + if ($self->size() == 0) + return NULL; + return new std::list< CTYPE >::iterator(--$self->end()); + } + + iterator *getNextIter(iterator *iter) { + std::list< CTYPE >::iterator it = *iter; + if (std::distance(it, --$self->end()) != 0) { + std::list< CTYPE >::iterator* itnext = new std::list< CTYPE >::iterator(++it); + return itnext; + } + return NULL; + } + + iterator *getPrevIter(iterator *iter) { + std::list< CTYPE >::iterator it = *iter; + if (std::distance($self->begin(), it) != 0) { + std::list< CTYPE >::iterator* itprev = new std::list< CTYPE >::iterator(--it); + return itprev; + } + return NULL; + } + + iterator *insertNode(iterator *iter, CTYPE const& value) { + std::list< CTYPE >::iterator it = $self->insert(*iter, value); + return new std::list< CTYPE >::iterator(it); + } + + void eraseIter(iterator *iter) { + std::list< CTYPE >::iterator it = *iter; + $self->erase(it); + } + + void deleteIter(iterator *iter) { + delete iter; + } + + bool equals(iterator *iter1, iterator *iter2) { + if (iter1 == NULL && iter2 == NULL) + return true; + std::list< CTYPE >::iterator it1 = *iter1; + std::list< CTYPE >::iterator it2 = *iter2; + return it1 == it2; + } + } +%enddef + +// Extra methods added to the collection class if operator== is defined for the class being wrapped +// The class will then implement ICollection<>, which adds extra functionality +%define SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(CTYPE...) + %extend { + bool Contains(CTYPE const& value) { + return std::find($self->begin(), $self->end(), value) != $self->end(); + } + + bool Remove(CTYPE const& value) { + std::list< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); + if (it != $self->end()) { + $self->erase(it); + return true; + } + return false; + } + + iterator *find(CTYPE const& value) { + if (std::find($self->begin(), $self->end(), value) != $self->end()) { + return new std::list< CTYPE >::iterator(std::find($self->begin(), $self->end(), value)); + } + return NULL; + } + } +%proxycode %{ + public $csclassnameNode Find($typemap(cstype, CTYPE) value) { + System.IntPtr tmp = find(value); + if (tmp != System.IntPtr.Zero) { + return new $csclassnameNode(tmp, this); + } + return null; + } +%} +%enddef + +// Macros for std::list class specializations/enhancements +%define SWIG_STD_LIST_ENHANCED(CTYPE...) +namespace std { + template<> class list< CTYPE > { + SWIG_STD_LIST_MINIMUM_INTERNAL(ICollection, %arg(CTYPE)); + SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(CTYPE) + }; +} +%enddef + + +%{ +#include +#include +#include +%} + +%csmethodmodifiers std::list::size "private" +%csmethodmodifiers std::list::getItem "private" +%csmethodmodifiers std::list::setItem "private" +%csmethodmodifiers std::list::push_front "private" +%csmethodmodifiers std::list::push_back "private" +%csmethodmodifiers std::list::getFirstIter "private" +%csmethodmodifiers std::list::getNextIter "private" +%csmethodmodifiers std::list::getPrevIter "private" +%csmethodmodifiers std::list::getLastIter "private" +%csmethodmodifiers std::list::find "private" +%csmethodmodifiers std::list::deleteIter "private" + +namespace std { + // primary (unspecialized) class template for std::list + // does not require operator== to be defined + template + class list { + SWIG_STD_LIST_MINIMUM_INTERNAL(IEnumerable, T) + }; + // specialization for pointers + template + class list { + SWIG_STD_LIST_MINIMUM_INTERNAL(ICollection, T *) + SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(T *) + }; +} + +// template specializations for std::list +// these provide extra collections methods as operator== is defined +SWIG_STD_LIST_ENHANCED(char) +SWIG_STD_LIST_ENHANCED(signed char) +SWIG_STD_LIST_ENHANCED(unsigned char) +SWIG_STD_LIST_ENHANCED(short) +SWIG_STD_LIST_ENHANCED(unsigned short) +SWIG_STD_LIST_ENHANCED(int) +SWIG_STD_LIST_ENHANCED(unsigned int) +SWIG_STD_LIST_ENHANCED(long) +SWIG_STD_LIST_ENHANCED(unsigned long) +SWIG_STD_LIST_ENHANCED(long long) +SWIG_STD_LIST_ENHANCED(unsigned long long) +SWIG_STD_LIST_ENHANCED(float) +SWIG_STD_LIST_ENHANCED(double) +SWIG_STD_LIST_ENHANCED(std::string) // also requires a %include +SWIG_STD_LIST_ENHANCED(std::wstring) // also requires a %include diff --git a/linx64/bin/swig/share/swig/4.0.0/csharp/std_map.i b/linx64/bin/swig/share/swig/4.0.0/csharp/std_map.i index 9d07bc83..e538a03a 100644 --- a/linx64/bin/swig/share/swig/4.0.0/csharp/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/csharp/std_map.i @@ -214,9 +214,14 @@ 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< K, T, C > &other); + map(const map& other); size_type size() const; bool empty() const; %rename(Clear) clear; diff --git a/linx64/bin/swig/share/swig/4.0.0/csharp/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/csharp/std_pair.i index 0712ad76..732347db 100644 --- a/linx64/bin/swig/share/swig/4.0.0/csharp/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/csharp/std_pair.i @@ -18,12 +18,14 @@ namespace std { template struct pair { + typedef T first_type; + typedef U second_type; pair(); - pair(T t, U u); - pair(const pair& p); + pair(T first, U second); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/csharp/std_set.i b/linx64/bin/swig/share/swig/4.0.0/csharp/std_set.i new file mode 100644 index 00000000..3b2492e0 --- /dev/null +++ b/linx64/bin/swig/share/swig/4.0.0/csharp/std_set.i @@ -0,0 +1,311 @@ +/* ----------------------------------------------------------------------------- + * std_set.i + * + * SWIG typemaps for std::set. + * + * Note that ISet<> used here requires .NET 4 or later. + * + * The C# wrapper implements ISet<> interface and shares performance + * characteristics of C# System.Collections.Generic.SortedSet<> class, but + * doesn't provide quite all of its methods. + * ----------------------------------------------------------------------------- */ + +%{ +#include +#include +#include +%} + +%csmethodmodifiers std::set::size "private" +%csmethodmodifiers std::set::getitem "private" +%csmethodmodifiers std::set::create_iterator_begin "private" +%csmethodmodifiers std::set::get_next "private" +%csmethodmodifiers std::set::destroy_iterator "private" + +namespace std { + +// TODO: Add support for comparator and allocator template parameters. +template +class set { + +%typemap(csinterfaces) std::set "global::System.IDisposable, global::System.Collections.Generic.ISet<$typemap(cstype, T)>\n"; +%proxycode %{ + void global::System.Collections.Generic.ICollection<$typemap(cstype, T)>.Add(string 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 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 $typemap(cstype, T) 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 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; + + set(); + set(const 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::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::set::iterator *create_iterator_begin } + %apply void *VOID_INT_PTR { std::set::iterator *swigiterator } + + std::set::iterator *create_iterator_begin() { + return new std::set::iterator($self->begin()); + } + + const key_type& get_next(std::set::iterator *swigiterator) { + std::set::iterator iter = *swigiterator; + (*swigiterator)++; + return *iter; + } + + void destroy_iterator(std::set::iterator *swigiterator) { + delete swigiterator; + } + } +}; + +} diff --git a/linx64/bin/swig/share/swig/4.0.0/csharp/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/csharp/std_vector.i index a69cb63e..e2811290 100644 --- a/linx64/bin/swig/share/swig/4.0.0/csharp/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/csharp/std_vector.i @@ -13,18 +13,13 @@ * * SWIG_STD_VECTOR_ENHANCED(SomeNamespace::Klass) * %template(VectKlass) std::vector; - * - * Warning: heavy macro usage in this file. Use swig -E to get a sane view on the real file contents! * ----------------------------------------------------------------------------- */ -// Warning: Use the typemaps here in the expectation that the macros they are in will change name. - - %include // MACRO for use within the std::vector class body %define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CSINTERFACE, CONST_REFERENCE, CTYPE...) -%typemap(csinterfaces) std::vector< CTYPE > "global::System.IDisposable, global::System.Collections.IEnumerable\n , global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n"; +%typemap(csinterfaces) std::vector< CTYPE > "global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n"; %proxycode %{ public $csclassname(global::System.Collections.IEnumerable c) : this() { if (c == null) @@ -201,8 +196,13 @@ 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; + %rename(Clear) clear; void clear(); %rename(Add) push_back; @@ -212,8 +212,10 @@ 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; @@ -237,9 +239,9 @@ else throw std::out_of_range("index"); } - void setitem(int index, CTYPE const& value) throw (std::out_of_range) { + void setitem(int index, CTYPE const& val) throw (std::out_of_range) { if (index>=0 && index<(int)$self->size()) - (*$self)[index] = value; + (*$self)[index] = val; else throw std::out_of_range("index"); } @@ -349,7 +351,7 @@ %define SWIG_STD_VECTOR_ENHANCED(CTYPE...) namespace std { template<> class vector< CTYPE > { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, %arg(CTYPE const&), %arg(CTYPE)) + SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, const value_type&, %arg(CTYPE)) SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE) }; } @@ -382,11 +384,11 @@ namespace std { // primary (unspecialized) class template for std::vector // does not require operator== to be defined template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IEnumerable, T const&, T) + SWIG_STD_VECTOR_MINIMUM_INTERNAL(IEnumerable, const value_type&, T) }; // specialization for pointers template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, T *const&, T *) + SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, const value_type&, T *) SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(T *) }; // bool is specialized in the C++ standard - const_reference in particular diff --git a/linx64/bin/swig/share/swig/4.0.0/csharp/stl.i b/linx64/bin/swig/share/swig/4.0.0/csharp/stl.i index 9d2e91ee..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/csharp/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/csharp/stl.i @@ -1,7 +1,5 @@ /* ----------------------------------------------------------------------------- * stl.i - * - * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ %include diff --git a/linx64/bin/swig/share/swig/4.0.0/d/dclassgen.swg b/linx64/bin/swig/share/swig/4.0.0/d/dclassgen.swg index 68910b41..84fa03a0 100644 --- a/linx64/bin/swig/share/swig/4.0.0/d/dclassgen.swg +++ b/linx64/bin/swig/share/swig/4.0.0/d/dclassgen.swg @@ -33,7 +33,7 @@ // We do not use »override« attribute for generated dispose() methods to stay // somewhat compatible to Phobos and older Tango versions where Object.dispose() // does not exist. -%typemap(ddispose, methodname="dispose", methodmodifiers="public") SWIGTYPE { +%typemap(ddispose, methodname="dispose", methodmodifiers="public", parameters="") SWIGTYPE { synchronized(this) { if (swigCPtr !is null) { if (swigCMemOwn) { @@ -45,7 +45,7 @@ } } -%typemap(ddispose_derived, methodname="dispose", methodmodifiers="public") SWIGTYPE { +%typemap(ddispose_derived, methodname="dispose", methodmodifiers="public", parameters="") SWIGTYPE { synchronized(this) { if (swigCPtr !is null) { if (swigCMemOwn) { diff --git a/linx64/bin/swig/share/swig/4.0.0/d/std_map.i b/linx64/bin/swig/share/swig/4.0.0/d/std_map.i index 968def21..c5e03d06 100644 --- a/linx64/bin/swig/share/swig/4.0.0/d/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/d/std_map.i @@ -23,8 +23,14 @@ namespace std { 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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/d/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/d/std_pair.i index 0712ad76..732347db 100644 --- a/linx64/bin/swig/share/swig/4.0.0/d/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/d/std_pair.i @@ -18,12 +18,14 @@ namespace std { template struct pair { + typedef T first_type; + typedef U second_type; pair(); - pair(T t, U u); - pair(const pair& p); + pair(T first, U second); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/d/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/d/std_vector.i index c6705718..fb8f7d2e 100644 --- a/linx64/bin/swig/share/swig/4.0.0/d/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/d/std_vector.i @@ -104,15 +104,22 @@ public void capacity(size_t 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; @@ -128,7 +135,7 @@ public void capacity(size_t value) { return $self->capacity() - $self->size(); } - CONST_REFERENCE remove() throw (std::out_of_range) { + const_reference remove() throw (std::out_of_range) { if ($self->empty()) { throw std::out_of_range("Tried to remove last element from empty vector."); } @@ -138,7 +145,7 @@ public void capacity(size_t value) { return value; } - CONST_REFERENCE remove(size_type index) throw (std::out_of_range) { + 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."); } @@ -153,7 +160,7 @@ public void capacity(size_t 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) { + 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."); } @@ -165,11 +172,11 @@ public void capacity(size_t value) { // generation issue when using const pointers as vector elements (like // std::vector< const int* >). %extend { - void setElement(size_type index, CTYPE const& value) throw (std::out_of_range) { + 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] = value; + (*$self)[index] = val; } } @@ -442,8 +449,13 @@ int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) 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; + bool empty() const; void clear(); void push_back(CTYPE const& x); @@ -451,8 +463,10 @@ int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) 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; @@ -464,7 +478,7 @@ int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) return pv; } - CONST_REFERENCE remove() throw (std::out_of_range) { + const_reference remove() throw (std::out_of_range) { if ($self->empty()) { throw std::out_of_range("Tried to remove last element from empty vector."); } @@ -474,7 +488,7 @@ int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) return value; } - CONST_REFERENCE remove(size_type index) throw (std::out_of_range) { + 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."); } @@ -506,7 +520,7 @@ int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) // 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) { + 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."); } @@ -517,11 +531,11 @@ int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) // generation issue when using const pointers as vector elements (like // std::vector< const int* >). %extend { - void setElement(size_type index, CTYPE const& value) throw (std::out_of_range) { + 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] = value; + (*$self)[index] = val; } } @@ -544,7 +558,7 @@ int opApply(int delegate(ref size_t index, ref $typemap(dtype, CTYPE) value) dg) %define SWIG_STD_VECTOR_ENHANCED(CTYPE...) namespace std { template<> class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(%arg(CTYPE const&), %arg(CTYPE)) + SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, %arg(CTYPE)) SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE) }; } @@ -559,11 +573,11 @@ namespace std { // primary (unspecialized) class template for std::vector // does not require operator== to be defined template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(T const&, T) + SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, T) }; // specializations for pointers template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(T *const&, T *) + SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, T *) SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(T *) }; // bool is a bit different in the C++ standard - const_reference in particular diff --git a/linx64/bin/swig/share/swig/4.0.0/d/stl.i b/linx64/bin/swig/share/swig/4.0.0/d/stl.i index 9d2e91ee..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/d/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/d/stl.i @@ -1,7 +1,5 @@ /* ----------------------------------------------------------------------------- * stl.i - * - * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ %include diff --git a/linx64/bin/swig/share/swig/4.0.0/exception.i b/linx64/bin/swig/share/swig/4.0.0/exception.i index 3e7c7fd8..ee9ce9bc 100644 --- a/linx64/bin/swig/share/swig/4.0.0/exception.i +++ b/linx64/bin/swig/share/swig/4.0.0/exception.i @@ -127,33 +127,48 @@ SWIGINTERN void SWIG_JavaException(JNIEnv *jenv, int code, const char *msg) { #ifdef SWIGOCAML %{ -#define OCAML_MSG_BUF_LEN 1024 -SWIGINTERN void SWIG_exception_(int code, const char *msg) { - char msg_buf[OCAML_MSG_BUF_LEN]; - sprintf( msg_buf, "Exception(%d): %s\n", code, msg ); - failwith( msg_buf ); +SWIGINTERN void SWIG_OCamlException(int code, const char *msg) { + CAMLparam0(); + + SWIG_OCamlExceptionCodes exception_code = SWIG_OCamlUnknownError; + switch (code) { + case SWIG_DivisionByZero: + exception_code = SWIG_OCamlArithmeticException; + break; + case SWIG_IndexError: + exception_code = SWIG_OCamlIndexOutOfBoundsException; + break; + case SWIG_IOError: + case SWIG_SystemError: + exception_code = SWIG_OCamlSystemException; + break; + case SWIG_MemoryError: + exception_code = SWIG_OCamlOutOfMemoryError; + break; + case SWIG_OverflowError: + exception_code = SWIG_OCamlOverflowException; + break; + case SWIG_RuntimeError: + exception_code = SWIG_OCamlRuntimeException; + break; + case SWIG_SyntaxError: + case SWIG_TypeError: + case SWIG_ValueError: + exception_code = SWIG_OCamlIllegalArgumentException; + break; + case SWIG_UnknownError: + default: + exception_code = SWIG_OCamlUnknownError; + break; + } + SWIG_OCamlThrowException(exception_code, msg); + CAMLreturn0; } -#define SWIG_exception(a,b) SWIG_exception_((a),(b)) +#define SWIG_exception(code, msg) SWIG_OCamlException(code, msg) %} #endif -#ifdef SWIGCHICKEN -%{ -SWIGINTERN void SWIG_exception_(int code, const char *msg) { - C_word *a; - C_word scmmsg; - C_word list; - - a = C_alloc (C_SIZEOF_STRING (strlen (msg)) + C_SIZEOF_LIST(2)); - scmmsg = C_string2 (&a, (char *) msg); - list = C_list(&a, 2, C_fix(code), scmmsg); - SWIG_ThrowException(list); -} -#define SWIG_exception(a,b) SWIG_exception_((a),(b)) -%} -#endif - #ifdef SWIGCSHARP %{ SWIGINTERN void SWIG_CSharpException(int code, const char *msg) { diff --git a/linx64/bin/swig/share/swig/4.0.0/go/std_list.i b/linx64/bin/swig/share/swig/4.0.0/go/std_list.i index e0262331..ff6f7001 100644 --- a/linx64/bin/swig/share/swig/4.0.0/go/std_list.i +++ b/linx64/bin/swig/share/swig/4.0.0/go/std_list.i @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * std_vector.i + * std_list.i * ----------------------------------------------------------------------------- */ %{ @@ -9,7 +9,7 @@ namespace std { - template > + template class list { public: typedef size_t size_type; @@ -19,9 +19,10 @@ namespace std { typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; - typedef Alloc allocator_type; list(); + list(const list& other); + size_type size() const; bool empty() const; %rename(isEmpty) empty; diff --git a/linx64/bin/swig/share/swig/4.0.0/go/std_map.i b/linx64/bin/swig/share/swig/4.0.0/go/std_map.i index f514cf74..773b6d0c 100644 --- a/linx64/bin/swig/share/swig/4.0.0/go/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/go/std_map.i @@ -27,8 +27,14 @@ namespace std { 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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/go/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/go/std_pair.i index fe45ee67..732347db 100644 --- a/linx64/bin/swig/share/swig/4.0.0/go/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/go/std_pair.i @@ -18,12 +18,14 @@ namespace std { template struct pair { + typedef T first_type; + typedef U second_type; pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/go/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/go/std_vector.i index 29bcd139..679c7075 100644 --- a/linx64/bin/swig/share/swig/4.0.0/go/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/go/std_vector.i @@ -12,10 +12,17 @@ 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); @@ -46,10 +53,17 @@ namespace std { template<> 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); diff --git a/linx64/bin/swig/share/swig/4.0.0/go/stl.i b/linx64/bin/swig/share/swig/4.0.0/go/stl.i index 38aba67b..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/go/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/go/stl.i @@ -7,3 +7,4 @@ %include %include %include + diff --git a/linx64/bin/swig/share/swig/4.0.0/guile/guile_scm.swg b/linx64/bin/swig/share/swig/4.0.0/guile/guile_scm.swg index 37eef6f3..16dc8aa9 100644 --- a/linx64/bin/swig/share/swig/4.0.0/guile/guile_scm.swg +++ b/linx64/bin/swig/share/swig/4.0.0/guile/guile_scm.swg @@ -8,6 +8,7 @@ #define SWIGGUILE_SCM %runtime "swigrun.swg" // Common C API type-checking code +%runtime "swigerrors.swg" // SWIG errors %runtime "guile_scm_run.swg" %include diff --git a/linx64/bin/swig/share/swig/4.0.0/guile/guile_scm_run.swg b/linx64/bin/swig/share/swig/4.0.0/guile/guile_scm_run.swg index 0d04cb7c..86e5c3be 100644 --- a/linx64/bin/swig/share/swig/4.0.0/guile/guile_scm_run.swg +++ b/linx64/bin/swig/share/swig/4.0.0/guile/guile_scm_run.swg @@ -186,7 +186,7 @@ SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags) if (SCM_NULLP(smob)) { *result = NULL; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; #if SCM_MAJOR_VERSION >= 2 } else if (SCM_POINTER_P(s)) { *result = SCM_POINTER_VALUE(s); diff --git a/linx64/bin/swig/share/swig/4.0.0/guile/std_map.i b/linx64/bin/swig/share/swig/4.0.0/guile/std_map.i index ca988368..f84e78bc 100644 --- a/linx64/bin/swig/share/swig/4.0.0/guile/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/guile/std_map.i @@ -218,8 +218,14 @@ namespace std { 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< K, T, C> &); + map(const map& other); unsigned int size() const; bool empty() const; @@ -434,8 +440,18 @@ namespace std { %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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; @@ -640,8 +656,18 @@ namespace std { %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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; @@ -848,8 +874,18 @@ namespace std { %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< K, T, C> &); + map(const map& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/guile/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/guile/std_pair.i index 92dec5fa..050d4880 100644 --- a/linx64/bin/swig/share/swig/4.0.0/guile/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/guile/std_pair.i @@ -113,11 +113,15 @@ namespace std { $1 = 0; } } + + typedef T first_type; + typedef U second_type; + pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; @@ -217,9 +221,9 @@ namespace std { } pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; @@ -317,9 +321,9 @@ namespace std { } pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; @@ -408,9 +412,9 @@ namespace std { } pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/guile/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/guile/std_vector.i index d7a7140c..42bad849 100644 --- a/linx64/bin/swig/share/swig/4.0.0/guile/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/guile/std_vector.i @@ -187,9 +187,18 @@ namespace std { } } 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(unsigned int size = 0); vector(unsigned int size, const T& value); - vector(const vector&); + vector(const vector& other); + %rename(length) size; unsigned int size() const; %rename("empty?") empty; @@ -351,9 +360,18 @@ namespace std { } } 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(unsigned int size = 0); vector(unsigned int size, const T& value); - vector(const vector&); + vector(const vector& other); + %rename(length) size; unsigned int size() const; %rename("empty?") empty; diff --git a/linx64/bin/swig/share/swig/4.0.0/guile/stl.i b/linx64/bin/swig/share/swig/4.0.0/guile/stl.i index 9d2e91ee..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/guile/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/guile/stl.i @@ -1,7 +1,5 @@ /* ----------------------------------------------------------------------------- * stl.i - * - * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ %include diff --git a/linx64/bin/swig/share/swig/4.0.0/guile/typemaps.i b/linx64/bin/swig/share/swig/4.0.0/guile/typemaps.i index f2926c16..cfccced8 100644 --- a/linx64/bin/swig/share/swig/4.0.0/guile/typemaps.i +++ b/linx64/bin/swig/share/swig/4.0.0/guile/typemaps.i @@ -444,15 +444,21 @@ typedef unsigned long SCM; $1 = scm_is_string($input) ? 1 : 0; } -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { +%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { void *ptr; int res = SWIG_ConvertPtr($input, &ptr, $1_descriptor, 0); $1 = SWIG_CheckState(res); } +%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE &, SWIGTYPE && { + void *ptr; + int res = SWIG_ConvertPtr($input, &ptr, $1_descriptor, SWIG_POINTER_NO_NULL); + $1 = SWIG_CheckState(res); +} + %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { void *ptr; - int res = SWIG_ConvertPtr($input, &ptr, $&descriptor, 0); + int res = SWIG_ConvertPtr($input, &ptr, $&descriptor, SWIG_POINTER_NO_NULL); $1 = SWIG_CheckState(res); } diff --git a/linx64/bin/swig/share/swig/4.0.0/java/director.swg b/linx64/bin/swig/share/swig/4.0.0/java/director.swg index 2275976b..d3bd162e 100644 --- a/linx64/bin/swig/share/swig/4.0.0/java/director.swg +++ b/linx64/bin/swig/share/swig/4.0.0/java/director.swg @@ -5,12 +5,52 @@ * methods can be called from C++. * ----------------------------------------------------------------------------- */ -#if defined(DEBUG_DIRECTOR_OWNED) || defined(DEBUG_DIRECTOR_EXCEPTION) +#if defined(DEBUG_DIRECTOR_OWNED) || defined(DEBUG_DIRECTOR_EXCEPTION) || defined(DEBUG_DIRECTOR_THREAD_NAME) #include #endif #include +#if defined(SWIG_JAVA_USE_THREAD_NAME) + +#if !defined(SWIG_JAVA_GET_THREAD_NAME) +namespace Swig { + SWIGINTERN int GetThreadName(char *name, size_t len); +} + +#if defined(__linux__) + +#include +SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { + (void)len; +#if defined(PR_GET_NAME) + return prctl(PR_GET_NAME, (unsigned long)name, 0, 0, 0); +#else + (void)name; + return 1; +#endif +} + +#elif defined(__unix__) || defined(__APPLE__) + +#include +SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { + return pthread_getname_np(pthread_self(), name, len); +} + +#else + +SWIGINTERN int Swig::GetThreadName(char *name, size_t len) { + (void)len; + (void)name; + return 1; +} +#endif + +#endif + +#endif + namespace Swig { /* Java object wrapper */ @@ -139,12 +179,27 @@ namespace Swig { void **jenv = (void **)&jenv_; #endif 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; +#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) { + args.name = thread_name; +#if defined(DEBUG_DIRECTOR_THREAD_NAME) + std::cout << "JNIEnvWrapper: thread name: " << thread_name << std::endl; + } else { + std::cout << "JNIEnvWrapper: Couldn't set Java thread name" << std::endl; +#endif + } +#endif #if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON) // Attach a daemon thread to the JVM. Useful when the JVM should not wait for // the thread to exit upon shutdown. Only for jdk-1.4 and later. - director_->swig_jvm_->AttachCurrentThreadAsDaemon(jenv, NULL); + director_->swig_jvm_->AttachCurrentThreadAsDaemon(jenv, &args); #else - director_->swig_jvm_->AttachCurrentThread(jenv, NULL); + director_->swig_jvm_->AttachCurrentThread(jenv, &args); #endif } ~JNIEnvWrapper() { diff --git a/linx64/bin/swig/share/swig/4.0.0/java/java.swg b/linx64/bin/swig/share/swig/4.0.0/java/java.swg index 19e597bd..e9309331 100644 --- a/linx64/bin/swig/share/swig/4.0.0/java/java.swg +++ b/linx64/bin/swig/share/swig/4.0.0/java/java.swg @@ -160,7 +160,7 @@ SWIGINTERN jint SWIG_JavaIntFromSize_t(size_t size) { %typemap(jtype) jfloat "float" %typemap(jtype) jdouble "double" %typemap(jtype) jstring "String" -%typemap(jtype) jobject "Object" +%typemap(jtype) jobject "java.lang.Object" %typemap(jtype) jbooleanArray "boolean[]" %typemap(jtype) jcharArray "char[]" %typemap(jtype) jbyteArray "byte[]" @@ -169,7 +169,7 @@ SWIGINTERN jint SWIG_JavaIntFromSize_t(size_t size) { %typemap(jtype) jlongArray "long[]" %typemap(jtype) jfloatArray "float[]" %typemap(jtype) jdoubleArray "double[]" -%typemap(jtype) jobjectArray "Object[]" +%typemap(jtype) jobjectArray "java.lang.Object[]" %typemap(jstype) jboolean "boolean" %typemap(jstype) jchar "char" @@ -180,7 +180,7 @@ SWIGINTERN jint SWIG_JavaIntFromSize_t(size_t size) { %typemap(jstype) jfloat "float" %typemap(jstype) jdouble "double" %typemap(jstype) jstring "String" -%typemap(jstype) jobject "Object" +%typemap(jstype) jobject "java.lang.Object" %typemap(jstype) jbooleanArray "boolean[]" %typemap(jstype) jcharArray "char[]" %typemap(jstype) jbyteArray "byte[]" @@ -189,7 +189,7 @@ SWIGINTERN jint SWIG_JavaIntFromSize_t(size_t size) { %typemap(jstype) jlongArray "long[]" %typemap(jstype) jfloatArray "float[]" %typemap(jstype) jdoubleArray "double[]" -%typemap(jstype) jobjectArray "Object[]" +%typemap(jstype) jobjectArray "java.lang.Object[]" /* Non primitive types */ %typemap(jni) SWIGTYPE "jlong" @@ -1273,6 +1273,7 @@ SWIG_JAVABODY_PROXY(protected, protected, SWIGTYPE) SWIG_JAVABODY_TYPEWRAPPER(protected, protected, protected, SWIGTYPE) %typemap(javafinalize) SWIGTYPE %{ + @SuppressWarnings("deprecation") protected void finalize() { delete(); } @@ -1312,7 +1313,7 @@ SWIG_PROXY_CONSTRUCTOR(true, false, TYPENAME) // Set the default for SWIGTYPE: Java owns the C/C++ object. SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) -%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE { +%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized", parameters="") SWIGTYPE { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; @@ -1322,7 +1323,7 @@ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) } } -%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE { +%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized", parameters="") SWIGTYPE { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; @@ -1382,12 +1383,12 @@ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) %apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } /* String & length */ -%typemap(jni) (char *STRING, size_t LENGTH) "jbyteArray" -%typemap(jtype) (char *STRING, size_t LENGTH) "byte[]" -%typemap(jstype) (char *STRING, size_t LENGTH) "byte[]" -%typemap(javain) (char *STRING, size_t LENGTH) "$javainput" -%typemap(freearg) (char *STRING, size_t LENGTH) "" -%typemap(in) (char *STRING, size_t LENGTH) { +%typemap(jni) (const char *STRING, size_t LENGTH) "jbyteArray" +%typemap(jtype) (const char *STRING, size_t LENGTH) "byte[]" +%typemap(jstype) (const char *STRING, size_t LENGTH) "byte[]" +%typemap(javain) (const char *STRING, size_t LENGTH) "$javainput" +%typemap(freearg) (const char *STRING, size_t LENGTH) "" +%typemap(in) (const char *STRING, size_t LENGTH) { if ($input) { $1 = ($1_ltype) JCALL2(GetByteArrayElements, jenv, $input, 0); $2 = ($2_type) JCALL1(GetArrayLength, jenv, $input); @@ -1396,10 +1397,10 @@ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) $2 = 0; } } -%typemap(argout) (char *STRING, size_t LENGTH) { - if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0); +%typemap(argout) (const char *STRING, size_t LENGTH) { + if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, JNI_ABORT); } -%typemap(directorin, descriptor="[B", noblock=1) (char *STRING, size_t LENGTH) { +%typemap(directorin, descriptor="[B", noblock=1) (const char *STRING, size_t LENGTH) { $input = 0; if ($1) { $input = JCALL1(NewByteArray, jenv, (jsize)$2); @@ -1408,9 +1409,14 @@ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) } Swig::LocalRefGuard $1_refguard(jenv, $input); } +%typemap(javadirectorin, descriptor="[B") (const char *STRING, size_t LENGTH) "$jniinput" +%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) { + if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0); +} %typemap(directorargout, noblock=1) (char *STRING, size_t LENGTH) { if ($input && $1) JCALL4(GetByteArrayRegion, jenv, $input, 0, (jsize)$2, (jbyte *)$1); } -%typemap(javadirectorin, descriptor="[B") (char *STRING, size_t LENGTH) "$jniinput" %apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) } /* java keywords */ diff --git a/linx64/bin/swig/share/swig/4.0.0/java/std_array.i b/linx64/bin/swig/share/swig/4.0.0/java/std_array.i index 0944d932..d3436cc6 100644 --- a/linx64/bin/swig/share/swig/4.0.0/java/std_array.i +++ b/linx64/bin/swig/share/swig/4.0.0/java/std_array.i @@ -11,12 +11,14 @@ namespace std { typedef size_t size_type; typedef ptrdiff_t difference_type; typedef T value_type; - typedef T &reference; - typedef const T &const_reference; - typedef T *pointer; - typedef const T *const_pointer; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + array(); array(const array& other); + size_type size() const; %rename(isEmpty) empty; bool empty() const; @@ -29,10 +31,10 @@ namespace std { else throw std::out_of_range("array index out of range"); } - void set(int i, const value_type& value) throw (std::out_of_range) { + void set(int i, const value_type& val) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && i it = listIterator(0); // Special case the "copy constructor" here to avoid lots of cross-language calls - for (Object o : c) { + for (java.lang.Object o : c) { it.add(($typemap(jboxtype, T))o); } } @@ -130,8 +130,12 @@ namespace std { public: typedef size_t size_type; + typedef ptrdiff_t difference_type; typedef T value_type; - typedef T &reference; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; /* * We'd actually be better off having the nested class *not* be static in the wrapper @@ -173,7 +177,8 @@ namespace std { }; list(); - list(const list &other); + list(const list& other); + %rename(isEmpty) empty; bool empty() const; void clear(); @@ -193,11 +198,6 @@ namespace std { %extend { %fragment("SWIG_ListSize"); - list(jint count) throw (std::out_of_range) { - if (count < 0) - throw std::out_of_range("list count must be positive"); - return new std::list(static_cast::size_type>(count)); - } list(jint count, const T &value) throw (std::out_of_range) { if (count < 0) diff --git a/linx64/bin/swig/share/swig/4.0.0/java/std_map.i b/linx64/bin/swig/share/swig/4.0.0/java/std_map.i index 75d523ce..6d5ca1aa 100644 --- a/linx64/bin/swig/share/swig/4.0.0/java/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/java/std_map.i @@ -2,6 +2,8 @@ * std_map.i * * SWIG typemaps for std::map + * The Java proxy class extends java.util.AbstractMap. The std::map + * container looks and feels much like a java.util.HashMap from Java. * ----------------------------------------------------------------------------- */ %include @@ -12,48 +14,199 @@ %{ #include -#include #include %} +%fragment("SWIG_MapSize", "header", fragment="SWIG_JavaIntFromSize_t") { + SWIGINTERN jint SWIG_MapSize(size_t size) { + jint sz = SWIG_JavaIntFromSize_t(size); + if (sz == -1) { + throw std::out_of_range("map size is too large to fit into a Java int"); + } + + return sz; + } +} + +%javamethodmodifiers std::map::sizeImpl "private"; +%javamethodmodifiers std::map::containsImpl "private"; +%javamethodmodifiers std::map::putUnchecked "private"; +%javamethodmodifiers std::map::removeUnchecked "private"; +%javamethodmodifiers std::map::find "private"; +%javamethodmodifiers std::map::begin "private"; +%javamethodmodifiers std::map::end "private"; + +%rename(Iterator) std::map::iterator; +%nodefaultctor std::map::iterator; +%javamethodmodifiers std::map::iterator::getNextUnchecked "private"; +%javamethodmodifiers std::map::iterator::isNot "private"; +%javamethodmodifiers std::map::iterator::getKey "private"; +%javamethodmodifiers std::map::iterator::getValue "private"; +%javamethodmodifiers std::map::iterator::setValue "private"; + namespace std { - template > class map { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef K key_type; - typedef T mapped_type; - map(); - map(const map< K, T, C > &); +template > class map { - unsigned int size() const; - bool empty() const; - void clear(); +%typemap(javabase) std::map< K, T, C > + "java.util.AbstractMap<$typemap(jboxtype, K), $typemap(jboxtype, T)>" + +%proxycode %{ + + public int size() { + return sizeImpl(); + } + + public boolean containsKey(java.lang.Object key) { + if (!(key instanceof $typemap(jboxtype, K))) { + return false; + } + + return containsImpl(($typemap(jboxtype, K))key); + } + + public $typemap(jboxtype, T) get(java.lang.Object key) { + if (!(key instanceof $typemap(jboxtype, K))) { + return null; + } + + Iterator itr = find(($typemap(jboxtype, K)) key); + if (itr.isNot(end())) { + return itr.getValue(); + } + + return null; + } + + public $typemap(jboxtype, T) put($typemap(jboxtype, K) key, $typemap(jboxtype, T) value) { + Iterator itr = find(($typemap(jboxtype, K)) key); + if (itr.isNot(end())) { + $typemap(jboxtype, T) oldValue = itr.getValue(); + itr.setValue(value); + return oldValue; + } else { + putUnchecked(key, value); + return null; + } + } + + public $typemap(jboxtype, T) remove(java.lang.Object key) { + if (!(key instanceof $typemap(jboxtype, K))) { + return null; + } + + Iterator itr = find(($typemap(jboxtype, K)) key); + if (itr.isNot(end())) { + $typemap(jboxtype, T) oldValue = itr.getValue(); + removeUnchecked(itr); + return oldValue; + } else { + return null; + } + } + + public java.util.Set> entrySet() { + java.util.Set> setToReturn = + new java.util.HashSet>(); + + Iterator itr = begin(); + final Iterator end = end(); + while (itr.isNot(end)) { + setToReturn.add(new Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)>() { + private Iterator iterator; + + private Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)> init(Iterator iterator) { + this.iterator = iterator; + return this; + } + + public $typemap(jboxtype, K) getKey() { + return iterator.getKey(); + } + + public $typemap(jboxtype, T) getValue() { + return iterator.getValue(); + } + + public $typemap(jboxtype, T) setValue($typemap(jboxtype, T) newValue) { + $typemap(jboxtype, T) oldValue = iterator.getValue(); + iterator.setValue(newValue); + return oldValue; + } + }.init(itr)); + itr = itr.getNextUnchecked(); + } + + return setToReturn; + } +%} + + 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); + + struct iterator { + %typemap(javaclassmodifiers) iterator "protected class" %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"); + std::map< K, T, C >::iterator getNextUnchecked() { + std::map< K, T, C >::iterator copy = (*$self); + return ++copy; } - void set(const K& key, const T& x) { - (*self)[key] = x; + + bool isNot(iterator other) const { + return (*$self != other); } - 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"); + + K getKey() const { + return (*$self)->first; } - bool has_key(const K& key) { - std::map< K, T, C >::iterator i = self->find(key); - return i != self->end(); + + T getValue() const { + return (*$self)->second; + } + + void setValue(const T& newValue) { + (*$self)->second = newValue; } } - }; + }; + + %rename(isEmpty) empty; + bool empty() const; + void clear(); + iterator find(const K& key); + iterator begin(); + iterator end(); + %extend { + %fragment("SWIG_MapSize"); + + jint sizeImpl() const throw (std::out_of_range) { + return SWIG_MapSize(self->size()); + } + + bool containsImpl(const K& key) { + return (self->count(key) > 0); + } + + void putUnchecked(const K& key, const T& value) { + (*self)[key] = value; + } + + void removeUnchecked(const std::map< K, T, C >::iterator itr) { + self->erase(itr); + } + } +}; // Legacy macros (deprecated) %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) diff --git a/linx64/bin/swig/share/swig/4.0.0/java/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/java/std_pair.i index fe45ee67..75ad3031 100644 --- a/linx64/bin/swig/share/swig/4.0.0/java/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/java/std_pair.i @@ -18,12 +18,15 @@ namespace std { template struct pair { + typedef T first_type; + typedef U second_type; + pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/java/std_set.i b/linx64/bin/swig/share/swig/4.0.0/java/std_set.i new file mode 100644 index 00000000..04658f76 --- /dev/null +++ b/linx64/bin/swig/share/swig/4.0.0/java/std_set.i @@ -0,0 +1,199 @@ +/* ----------------------------------------------------------------------------- + * std_set.i + * + * SWIG typemaps for std::set + * The Java proxy class extends java.util.AbstractSet. The std::set + * container looks and feels much like a java.util.HashSet from Java. + * ----------------------------------------------------------------------------- */ + +%include + +// ------------------------------------------------------------------------ +// std::set +// ------------------------------------------------------------------------ + +%{ +#include +#include +%} + +%fragment("SWIG_SetSize", "header", fragment="SWIG_JavaIntFromSize_t") { + SWIGINTERN jint SWIG_SetSize(size_t size) { + jint sz = SWIG_JavaIntFromSize_t(size); + if (sz == -1) { + throw std::out_of_range("set size is too large to fit into a Java int"); + } + + return sz; + } +} + +%javamethodmodifiers std::set::sizeImpl "private"; +%javamethodmodifiers std::set::containsImpl "private"; +%javamethodmodifiers std::set::removeImpl "private"; +%javamethodmodifiers std::set::hasNextImpl "private"; +%javamethodmodifiers std::set::begin "private"; +%javamethodmodifiers std::set::end "private"; + +%rename(Iterator) std::set::iterator; +%nodefaultctor std::set::iterator; +%javamethodmodifiers std::set::iterator::incrementUnchecked "private"; +%javamethodmodifiers std::set::iterator::derefUnchecked "private"; +%javamethodmodifiers std::set::iterator::isNot "private"; + +namespace std { + +template +class set { + +%typemap(javabase) std::set "java.util.AbstractSet<$typemap(jboxtype, T)>" +%proxycode %{ + public $javaclassname(java.util.Collection collection) { + this(); + addAll(collection); + } + + public int size() { + return sizeImpl(); + } + + public boolean addAll(java.util.Collection collection) { + boolean didAddElement = false; + for (java.lang.Object object : collection) { + didAddElement |= add(($typemap(jboxtype, T))object); + } + + return didAddElement; + } + + public java.util.Iterator<$typemap(jboxtype, T)> iterator() { + return new java.util.Iterator<$typemap(jboxtype, T)>() { + private Iterator curr; + private Iterator end; + + private java.util.Iterator<$typemap(jboxtype, T)> init() { + curr = $javaclassname.this.begin(); + end = $javaclassname.this.end(); + return this; + } + + public $typemap(jboxtype, T) next() { + if (!hasNext()) { + throw new java.util.NoSuchElementException(); + } + + // Save the current position, increment it, + // then return the value at the position before the increment. + final $typemap(jboxtype, T) currValue = curr.derefUnchecked(); + curr.incrementUnchecked(); + return currValue; + } + + public boolean hasNext() { + return curr.isNot(end); + } + }.init(); + } + + public boolean containsAll(java.util.Collection collection) { + for (java.lang.Object object : collection) { + if (!contains(object)) { + return false; + } + } + + return true; + } + + public boolean contains(java.lang.Object object) { + if (!(object instanceof $typemap(jboxtype, T))) { + return false; + } + + return containsImpl(($typemap(jboxtype, T))object); + } + + public boolean removeAll(java.util.Collection collection) { + boolean didRemoveElement = false; + for (java.lang.Object object : collection) { + didRemoveElement |= remove(object); + } + + return didRemoveElement; + } + + public boolean remove(java.lang.Object object) { + if (!(object instanceof $typemap(jboxtype, T))) { + return false; + } + + return removeImpl(($typemap(jboxtype, T))object); + } +%} + + public: + + struct iterator { + %typemap(javaclassmodifiers) iterator "protected class" + %extend { + void incrementUnchecked() { + ++(*$self); + } + + T derefUnchecked() const { + return **$self; + } + + bool isNot(iterator other) const { + return (*$self != other); + } + } + }; + + 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; + + set(); + set(const set& other); + + %rename(isEmpty) empty; + bool empty() const; + void clear(); + iterator begin(); + iterator end(); + + %extend { + %fragment("SWIG_SetSize"); + + // Returns whether item was inserted. + bool add(const T& key) { + return self->insert(key).second; + } + + // Returns whether set contains key. + bool containsImpl(const T& key) { + return (self->count(key) > 0); + } + + // Returns whether the item was erased. + bool removeImpl(const T& key) { + return (self->erase(key) > 0); + } + + jint sizeImpl() const throw (std::out_of_range) { + return SWIG_SetSize(self->size()); + } + + bool hasNextImpl(const iterator& itr) const { + return (itr != $self->end()); + } + } +}; + +} diff --git a/linx64/bin/swig/share/swig/4.0.0/java/std_unordered_map.i b/linx64/bin/swig/share/swig/4.0.0/java/std_unordered_map.i new file mode 100644 index 00000000..283a9b46 --- /dev/null +++ b/linx64/bin/swig/share/swig/4.0.0/java/std_unordered_map.i @@ -0,0 +1,211 @@ +/* ----------------------------------------------------------------------------- + * std_unordered_map.i + * + * SWIG typemaps for std::unordered_map + * The Java proxy class extends java.util.AbstractMap. The std::unordered_map + * container looks and feels much like a java.util.HashMap from Java. + * ----------------------------------------------------------------------------- */ + +%include + +// ------------------------------------------------------------------------ +// std::unordered_map +// ------------------------------------------------------------------------ + +%{ +#include +#include +%} + +%fragment("SWIG_MapSize", "header", fragment="SWIG_JavaIntFromSize_t") { + SWIGINTERN jint SWIG_MapSize(size_t size) { + jint sz = SWIG_JavaIntFromSize_t(size); + if (sz == -1) { + throw std::out_of_range("map size is too large to fit into a Java int"); + } + + return sz; + } +} + +%javamethodmodifiers std::unordered_map::sizeImpl "private"; +%javamethodmodifiers std::unordered_map::containsImpl "private"; +%javamethodmodifiers std::unordered_map::putUnchecked "private"; +%javamethodmodifiers std::unordered_map::removeUnchecked "private"; +%javamethodmodifiers std::unordered_map::find "private"; +%javamethodmodifiers std::unordered_map::begin "private"; +%javamethodmodifiers std::unordered_map::end "private"; + +%rename(Iterator) std::unordered_map::iterator; +%nodefaultctor std::unordered_map::iterator; +%javamethodmodifiers std::unordered_map::iterator::getNextUnchecked "private"; +%javamethodmodifiers std::unordered_map::iterator::isNot "private"; +%javamethodmodifiers std::unordered_map::iterator::getKey "private"; +%javamethodmodifiers std::unordered_map::iterator::getValue "private"; +%javamethodmodifiers std::unordered_map::iterator::setValue "private"; + +namespace std { + +template class unordered_map { + +%typemap(javabase) std::unordered_map + "java.util.AbstractMap<$typemap(jboxtype, K), $typemap(jboxtype, T)>" + +%proxycode %{ + + public int size() { + return sizeImpl(); + } + + public boolean containsKey(java.lang.Object key) { + if (!(key instanceof $typemap(jboxtype, K))) { + return false; + } + + return containsImpl(($typemap(jboxtype, K))key); + } + + public $typemap(jboxtype, T) get(java.lang.Object key) { + if (!(key instanceof $typemap(jboxtype, K))) { + return null; + } + + Iterator itr = find(($typemap(jboxtype, K)) key); + if (itr.isNot(end())) { + return itr.getValue(); + } + + return null; + } + + public $typemap(jboxtype, T) put($typemap(jboxtype, K) key, $typemap(jboxtype, T) value) { + Iterator itr = find(($typemap(jboxtype, K)) key); + if (itr.isNot(end())) { + $typemap(jboxtype, T) oldValue = itr.getValue(); + itr.setValue(value); + return oldValue; + } else { + putUnchecked(key, value); + return null; + } + } + + public $typemap(jboxtype, T) remove(java.lang.Object key) { + if (!(key instanceof $typemap(jboxtype, K))) { + return null; + } + + Iterator itr = find(($typemap(jboxtype, K)) key); + if (itr.isNot(end())) { + $typemap(jboxtype, T) oldValue = itr.getValue(); + removeUnchecked(itr); + return oldValue; + } else { + return null; + } + } + + public java.util.Set> entrySet() { + java.util.Set> setToReturn = + new java.util.HashSet>(); + + Iterator itr = begin(); + final Iterator end = end(); + while (itr.isNot(end)) { + setToReturn.add(new Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)>() { + private Iterator iterator; + + private Entry<$typemap(jboxtype, K), $typemap(jboxtype, T)> init(Iterator iterator) { + this.iterator = iterator; + return this; + } + + public $typemap(jboxtype, K) getKey() { + return iterator.getKey(); + } + + public $typemap(jboxtype, T) getValue() { + return iterator.getValue(); + } + + public $typemap(jboxtype, T) setValue($typemap(jboxtype, T) newValue) { + $typemap(jboxtype, T) oldValue = iterator.getValue(); + iterator.setValue(newValue); + return oldValue; + } + }.init(itr)); + itr = itr.getNextUnchecked(); + } + + return setToReturn; + } +%} + + 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); + + struct iterator { + %typemap(javaclassmodifiers) iterator "protected class" + %extend { + std::unordered_map< K, T >::iterator getNextUnchecked() { + std::unordered_map< K, T >::iterator copy = (*$self); + return ++copy; + } + + bool isNot(iterator other) const { + return (*$self != other); + } + + K getKey() const { + return (*$self)->first; + } + + T getValue() const { + return (*$self)->second; + } + + void setValue(const T& newValue) { + (*$self)->second = newValue; + } + } + }; + + %rename(isEmpty) empty; + bool empty() const; + void clear(); + iterator find(const K& key); + iterator begin(); + iterator end(); + %extend { + %fragment("SWIG_MapSize"); + + jint sizeImpl() const throw (std::out_of_range) { + return SWIG_MapSize(self->size()); + } + + bool containsImpl(const K& key) { + return (self->count(key) > 0); + } + + void putUnchecked(const K& key, const T& value) { + (*self)[key] = value; + } + + void removeUnchecked(const std::unordered_map< K, T >::iterator itr) { + self->erase(itr); + } + } +}; + +} diff --git a/linx64/bin/swig/share/swig/4.0.0/java/std_unordered_set.i b/linx64/bin/swig/share/swig/4.0.0/java/std_unordered_set.i new file mode 100644 index 00000000..59726e94 --- /dev/null +++ b/linx64/bin/swig/share/swig/4.0.0/java/std_unordered_set.i @@ -0,0 +1,199 @@ +/* ----------------------------------------------------------------------------- + * std_unordered_set.i + * + * SWIG typemaps for std::unordered_set + * The Java proxy class extends java.util.AbstractSet. The std::unordered_set + * container looks and feels much like a java.util.HashSet from Java. + * ----------------------------------------------------------------------------- */ + +%include + +// ------------------------------------------------------------------------ +// std::unordered_set +// ------------------------------------------------------------------------ + +%{ +#include +#include +%} + +%fragment("SWIG_UnorderedSetSize", "header", fragment="SWIG_JavaIntFromSize_t") { + SWIGINTERN jint SWIG_UnorderedSetSize(size_t size) { + jint sz = SWIG_JavaIntFromSize_t(size); + if (sz == -1) { + throw std::out_of_range("unordered_set size is too large to fit into a Java int"); + } + + return sz; + } +} + +%javamethodmodifiers std::unordered_set::sizeImpl "private"; +%javamethodmodifiers std::unordered_set::containsImpl "private"; +%javamethodmodifiers std::unordered_set::removeImpl "private"; +%javamethodmodifiers std::unordered_set::hasNextImpl "private"; +%javamethodmodifiers std::unordered_set::begin "private"; +%javamethodmodifiers std::unordered_set::end "private"; + +%rename(Iterator) std::unordered_set::iterator; +%nodefaultctor std::unordered_set::iterator; +%javamethodmodifiers std::unordered_set::iterator::incrementUnchecked "private"; +%javamethodmodifiers std::unordered_set::iterator::derefUnchecked "private"; +%javamethodmodifiers std::unordered_set::iterator::isNot "private"; + +namespace std { + +template +class unordered_set { + +%typemap(javabase) std::unordered_set "java.util.AbstractSet<$typemap(jboxtype, Key)>" +%proxycode %{ + public $javaclassname(java.util.Collection collection) { + this(); + addAll(collection); + } + + public int size() { + return sizeImpl(); + } + + public boolean addAll(java.util.Collection collection) { + boolean didAddElement = false; + for (java.lang.Object object : collection) { + didAddElement |= add(($typemap(jboxtype, Key))object); + } + + return didAddElement; + } + + public java.util.Iterator<$typemap(jboxtype, Key)> iterator() { + return new java.util.Iterator<$typemap(jboxtype, Key)>() { + private Iterator curr; + private Iterator end; + + private java.util.Iterator<$typemap(jboxtype, Key)> init() { + curr = $javaclassname.this.begin(); + end = $javaclassname.this.end(); + return this; + } + + public $typemap(jboxtype, Key) next() { + if (!hasNext()) { + throw new java.util.NoSuchElementException(); + } + + // Save the current position, increment it, + // then return the value at the position before the increment. + final $typemap(jboxtype, Key) currValue = curr.derefUnchecked(); + curr.incrementUnchecked(); + return currValue; + } + + public boolean hasNext() { + return curr.isNot(end); + } + }.init(); + } + + public boolean containsAll(java.util.Collection collection) { + for (java.lang.Object object : collection) { + if (!contains(object)) { + return false; + } + } + + return true; + } + + public boolean contains(java.lang.Object object) { + if (!(object instanceof $typemap(jboxtype, Key))) { + return false; + } + + return containsImpl(($typemap(jboxtype, Key))object); + } + + public boolean removeAll(java.util.Collection collection) { + boolean didRemoveElement = false; + for (java.lang.Object object : collection) { + didRemoveElement |= remove(object); + } + + return didRemoveElement; + } + + public boolean remove(java.lang.Object object) { + if (!(object instanceof $typemap(jboxtype, Key))) { + return false; + } + + return removeImpl(($typemap(jboxtype, Key))object); + } +%} + + public: + + struct iterator { + %typemap(javaclassmodifiers) iterator "protected class" + %extend { + void incrementUnchecked() { + ++(*$self); + } + + Key derefUnchecked() const { + return **$self; + } + + bool isNot(iterator other) const { + return (*$self != other); + } + } + }; + + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef Key value_type; + typedef Key key_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); + + %rename(isEmpty) empty; + bool empty() const; + void clear(); + iterator begin(); + iterator end(); + + %extend { + %fragment("SWIG_UnorderedSetSize"); + + // Returns whether item was inserted. + bool add(const Key& key) { + return self->insert(key).second; + } + + // Returns whether set contains key. + bool containsImpl(const Key& key) { + return (self->count(key) > 0); + } + + // Returns whether the item was erased. + bool removeImpl(const Key& key) { + return (self->erase(key) > 0); + } + + jint sizeImpl() const throw (std::out_of_range) { + return SWIG_UnorderedSetSize(self->size()); + } + + bool hasNextImpl(const iterator& itr) const { + return (itr != $self->end()); + } + } +}; + +} diff --git a/linx64/bin/swig/share/swig/4.0.0/java/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/java/std_vector.i index cb1752c6..955e20ca 100644 --- a/linx64/bin/swig/share/swig/4.0.0/java/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/java/std_vector.i @@ -23,7 +23,7 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { } } -%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CTYPE, CREF_TYPE) +%define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CTYPE, CONST_REFERENCE) %typemap(javabase) std::vector< CTYPE > "java.util.AbstractList<$typemap(jboxtype, CTYPE)>" %typemap(javainterfaces) std::vector< CTYPE > "java.util.RandomAccess" %proxycode %{ @@ -79,13 +79,14 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { typedef size_t size_type; typedef ptrdiff_t difference_type; typedef CTYPE value_type; - typedef CTYPE &reference; - typedef CREF_TYPE const_reference; typedef CTYPE *pointer; typedef CTYPE const *const_pointer; + typedef CTYPE &reference; + typedef CONST_REFERENCE const_reference; vector(); vector(const vector &other); + size_type capacity() const; void reserve(size_type n) throw (std::length_error); %rename(isEmpty) empty; @@ -93,11 +94,6 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { void clear(); %extend { %fragment("SWIG_VectorSize"); - vector(jint count) throw (std::out_of_range) { - if (count < 0) - throw std::out_of_range("vector count must be positive"); - return new std::vector< CTYPE >(static_cast::size_type>(count)); - } vector(jint count, const CTYPE &value) throw (std::out_of_range) { if (count < 0) @@ -109,14 +105,14 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { return SWIG_VectorSize(self->size()); } - void doAdd(const value_type& value) { - self->push_back(value); + void doAdd(const value_type& x) { + self->push_back(x); } - void doAdd(jint index, const value_type& value) throw (std::out_of_range) { + void doAdd(jint index, const value_type& x) throw (std::out_of_range) { jint size = static_cast(self->size()); if (0 <= index && index <= size) { - self->insert(self->begin() + index, value); + self->insert(self->begin() + index, x); } else { throw std::out_of_range("vector index out of range"); } @@ -133,7 +129,7 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { } } - CREF_TYPE doGet(jint index) throw (std::out_of_range) { + CONST_REFERENCE doGet(jint index) throw (std::out_of_range) { jint size = static_cast(self->size()); if (index >= 0 && index < size) return (*self)[index]; @@ -141,11 +137,11 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { throw std::out_of_range("vector index out of range"); } - value_type doSet(jint index, const value_type& value) throw (std::out_of_range) { + value_type doSet(jint index, const value_type& val) throw (std::out_of_range) { jint size = static_cast(self->size()); if (index >= 0 && index < size) { CTYPE const old_value = (*self)[index]; - (*self)[index] = value; + (*self)[index] = val; return old_value; } else @@ -173,7 +169,7 @@ SWIGINTERN jint SWIG_VectorSize(size_t size) { namespace std { template class vector { - SWIG_STD_VECTOR_MINIMUM_INTERNAL(T, const T&) + SWIG_STD_VECTOR_MINIMUM_INTERNAL(T, const value_type&) }; // bool specialization diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/javascriptrun.swg b/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/javascriptrun.swg index 30ee032e..4a8fc5be 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/javascriptrun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/javascriptrun.swg @@ -150,7 +150,7 @@ SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, voi /* special case: JavaScript null => C NULL pointer */ if(JSValueIsNull(context, valRef)) { *ptr=0; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } if(!JSValueIsObject(context, valRef)) { diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_map.i b/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_map.i index 903f77aa..9fa10880 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_map.i @@ -27,8 +27,15 @@ namespace std { 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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_pair.i index fe45ee67..732347db 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_pair.i @@ -18,12 +18,14 @@ namespace std { template struct pair { + typedef T first_type; + typedef U second_type; pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_vector.i index 971b426a..586ac5c6 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/jsc/std_vector.i @@ -14,10 +14,17 @@ 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); @@ -48,10 +55,17 @@ namespace std { template<> 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); diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascripthelpers.swg b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascripthelpers.swg index 7b8a5ec2..80fbd7aa 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascripthelpers.swg +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascripthelpers.swg @@ -93,7 +93,7 @@ SWIGRUNTIME void JS_veto_set_variable(v8::Local property, v8::Local sproperty; if (property->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocal(&sproperty)) { - sproperty->WriteUtf8(buffer, 256); + SWIGV8_WRITE_UTF8(sproperty, buffer, 256); res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); } else { diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptprimtypes.swg b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptprimtypes.swg index c0055c48..f76be983 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptprimtypes.swg +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptprimtypes.swg @@ -22,7 +22,7 @@ int SWIG_AsVal_dec(bool)(v8::Handle obj, bool *val) return SWIG_ERROR; } - if (val) *val = obj->BooleanValue(); + if (val) *val = SWIGV8_BOOLEAN_VALUE(obj); return SWIG_OK; } } @@ -44,7 +44,7 @@ int SWIG_AsVal_dec(int)(v8::Handle valRef, int* val) if (!valRef->IsNumber()) { return SWIG_TypeError; } - if(val) *val = valRef->IntegerValue(); + if(val) *val = SWIGV8_INTEGER_VALUE(valRef); return SWIG_OK; } @@ -68,7 +68,7 @@ int SWIG_AsVal_dec(long)(v8::Handle obj, long* val) if (!obj->IsNumber()) { return SWIG_TypeError; } - if(val) *val = (long) obj->IntegerValue(); + if(val) *val = (long) SWIGV8_INTEGER_VALUE(obj); return SWIG_OK; } @@ -95,7 +95,7 @@ int SWIG_AsVal_dec(unsigned long)(v8::Handle obj, unsigned long *val) return SWIG_TypeError; } - long longVal = (long) obj->NumberValue(); + long longVal = (long) SWIGV8_NUMBER_VALUE(obj); if(longVal < 0) { return SWIG_OverflowError; @@ -133,7 +133,7 @@ int SWIG_AsVal_dec(long long)(v8::Handle obj, long long* val) if (!obj->IsNumber()) { return SWIG_TypeError; } - if(val) *val = (long long) obj->IntegerValue(); + if(val) *val = (long long) SWIGV8_INTEGER_VALUE(obj); return SWIG_OK; } @@ -168,7 +168,7 @@ int SWIG_AsVal_dec(unsigned long long)(v8::Handle obj, unsigned long return SWIG_TypeError; } - long long longVal = (long long) obj->NumberValue(); + long long longVal = (long long) SWIGV8_NUMBER_VALUE(obj); if(longVal < 0) { return SWIG_OverflowError; @@ -198,7 +198,7 @@ int SWIG_AsVal_dec(double)(v8::Handle obj, double *val) if(!obj->IsNumber()) { return SWIG_TypeError; } - if(val) *val = obj->NumberValue(); + if(val) *val = SWIGV8_NUMBER_VALUE(obj); return SWIG_OK; } diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptrun.swg b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptrun.swg index 39b0362a..2452f404 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptrun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptrun.swg @@ -91,6 +91,32 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; #define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ.Reset(v8::Isolate::GetCurrent(), class); #endif +#ifdef NODE_VERSION +#if NODE_VERSION_AT_LEAST(10, 12, 0) +#define SWIG_NODE_AT_LEAST_1012 +#endif +#endif + +//Necessary to check Node.js version because V8 API changes are backported in Node.js +#if (defined(NODE_VERSION) && !defined(SWIG_NODE_AT_LEAST_1012)) || \ + (!defined(NODE_VERSION) && (V8_MAJOR_VERSION-0) < 7) +#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject() +#define SWIGV8_TO_STRING(handle) (handle)->ToString() +#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue() +#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue() +#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() +#else +#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() +#define SWIGV8_TO_STRING(handle) (handle)->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() +#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() +#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() +#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue(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()) +#endif + /* --------------------------------------------------------------------------- * Error handling * @@ -258,7 +284,7 @@ SWIGRUNTIME int SWIG_V8_GetInstancePtr(v8::Handle valRef, void **ptr) if(!valRef->IsObject()) { return SWIG_TypeError; } - v8::Handle objRef = valRef->ToObject(); + v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; @@ -347,12 +373,12 @@ SWIGRUNTIME int SWIG_V8_ConvertPtr(v8::Handle valRef, void **ptr, swi /* special case: JavaScript null => C NULL pointer */ if(valRef->IsNull()) { *ptr=0; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } if(!valRef->IsObject()) { return SWIG_TypeError; } - v8::Handle objRef = valRef->ToObject(); + v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags); } @@ -479,7 +505,7 @@ SWIGRUNTIMEINLINE int SwigV8Packed_Check(v8::Handle valRef) { SWIGV8_HANDLESCOPE(); - v8::Handle objRef = valRef->ToObject(); + v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); if(objRef->InternalFieldCount() < 1) return false; #if (V8_MAJOR_VERSION-0) < 5 v8::Handle flag = objRef->GetHiddenValue(SWIGV8_STRING_NEW("__swig__packed_data__")); @@ -489,7 +515,7 @@ int SwigV8Packed_Check(v8::Handle valRef) { if (!objRef->GetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey).ToLocal(&flag)) return false; #endif - return (flag->IsBoolean() && flag->BooleanValue()); + return (flag->IsBoolean() && SWIGV8_BOOLEAN_VALUE(flag)); } SWIGRUNTIME @@ -499,7 +525,7 @@ swig_type_info *SwigV8Packed_UnpackData(v8::Handle valRef, void *ptr, SwigV8PackedData *sobj; - v8::Handle objRef = valRef->ToObject(); + v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); #if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031511) v8::Handle cdataRef = objRef->GetInternalField(0); diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptruntime.swg b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptruntime.swg index 0e405932..c78e04ef 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptruntime.swg +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptruntime.swg @@ -44,6 +44,8 @@ #ifdef BUILDING_NODE_EXTENSION %insert("runtime") %{ #include +//Older version of node.h does not include this +#include %} #endif diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptstrings.swg b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptstrings.swg index 65ba20e5..e767a6d6 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptstrings.swg +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/javascriptstrings.swg @@ -7,11 +7,11 @@ SWIGINTERN int SWIG_AsCharPtrAndSize(v8::Handle valRef, char** cptr, size_t* psize, int *alloc) { if(valRef->IsString()) { - v8::Handle js_str = valRef->ToString(); + v8::Handle js_str = SWIGV8_TO_STRING(valRef); - size_t len = js_str->Utf8Length() + 1; + size_t len = SWIGV8_UTF8_LENGTH(js_str) + 1; char* cstr = new char[len]; - js_str->WriteUtf8(cstr, len); + SWIGV8_WRITE_UTF8(js_str, cstr, len); if(alloc) *alloc = SWIG_NEWOBJ; if(psize) *psize = len; @@ -20,7 +20,7 @@ SWIG_AsCharPtrAndSize(v8::Handle valRef, char** cptr, size_t* psize, return SWIG_OK; } else { if(valRef->IsObject()) { - v8::Handle obj = valRef->ToObject(); + v8::Handle obj = SWIGV8_TO_OBJECT(valRef); // try if the object is a wrapped char[] swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); if (pchar_descriptor) { diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_map.i b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_map.i index 903f77aa..3b8b0936 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_map.i @@ -27,8 +27,14 @@ namespace std { 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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_pair.i index 8d605722..b72c50b9 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_pair.i @@ -17,12 +17,14 @@ namespace std { template struct pair { + typedef T first_type; + typedef U second_type; pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_vector.i index 971b426a..586ac5c6 100644 --- a/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/javascript/v8/std_vector.i @@ -14,10 +14,17 @@ 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); @@ -48,10 +55,17 @@ namespace std { template<> 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); diff --git a/linx64/bin/swig/share/swig/4.0.0/lua/luarun.swg b/linx64/bin/swig/share/swig/4.0.0/lua/luarun.swg index 58ada4d6..9636cdc9 100644 --- a/linx64/bin/swig/share/swig/4.0.0/lua/luarun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/lua/luarun.swg @@ -1765,7 +1765,12 @@ SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type { swig_lua_userdata *usr; swig_cast_info *cast; - if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */ + /* special case: lua nil => NULL pointer */ + if (lua_isnil(L,index)) + { + *ptr=0; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; + } usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ if (usr) { diff --git a/linx64/bin/swig/share/swig/4.0.0/lua/luaruntime.swg b/linx64/bin/swig/share/swig/4.0.0/lua/luaruntime.swg index 8df46e8c..399bb640 100644 --- a/linx64/bin/swig/share/swig/4.0.0/lua/luaruntime.swg +++ b/linx64/bin/swig/share/swig/4.0.0/lua/luaruntime.swg @@ -4,8 +4,9 @@ * all the runtime code for . * ----------------------------------------------------------------------------- */ -%runtime "swigrun.swg"; /* Common C API type-checking code */ -%runtime "luarun.swg"; /* Lua runtime stuff */ +%runtime "swigrun.swg" /* Common C API type-checking code */ +%runtime "swigerrors.swg" /* SWIG errors */ +%runtime "luarun.swg" /* Lua runtime stuff */ %insert(initbeforefunc) "swiginit.swg" diff --git a/linx64/bin/swig/share/swig/4.0.0/lua/luatypemaps.swg b/linx64/bin/swig/share/swig/4.0.0/lua/luatypemaps.swg index 4c68d1d1..8959f201 100644 --- a/linx64/bin/swig/share/swig/4.0.0/lua/luatypemaps.swg +++ b/linx64/bin/swig/share/swig/4.0.0/lua/luatypemaps.swg @@ -189,7 +189,7 @@ SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) { // Also needed for object ptrs by const ref // eg A* const& ref_pointer(A* const& a); // found in mixed_types.i -%typemap(in,checkfn="lua_isuserdata") SWIGTYPE *const&($*ltype temp) +%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE *const&($*ltype temp) %{temp=($*ltype)SWIG_MustGetPtr(L,$input,$*descriptor,0,$argnum,"$symname"); $1=($1_ltype)&temp;%} @@ -327,7 +327,7 @@ parameters match which function %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE & { void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, 0)) { + if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { $1 = 0; } else { $1 = 1; @@ -336,7 +336,7 @@ parameters match which function %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE && { void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, 0)) { + if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { $1 = 0; } else { $1 = 1; @@ -345,7 +345,7 @@ parameters match which function %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $&1_descriptor, 0)) { + if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $&1_descriptor, SWIG_POINTER_NO_NULL)) { $1 = 0; } else { $1 = 1; @@ -367,7 +367,7 @@ parameters match which function %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const& { void *ptr; - if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $*descriptor, 0)) { + if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $*descriptor, 0)) { $1 = 0; } else { $1 = 1; diff --git a/linx64/bin/swig/share/swig/4.0.0/lua/std_map.i b/linx64/bin/swig/share/swig/4.0.0/lua/std_map.i index 8a203e13..773b6d0c 100644 --- a/linx64/bin/swig/share/swig/4.0.0/lua/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/lua/std_map.i @@ -27,8 +27,14 @@ namespace std { 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< K, T, C> &); + map(const map& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/lua/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/lua/std_pair.i index 06728533..410da922 100644 --- a/linx64/bin/swig/share/swig/4.0.0/lua/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/lua/std_pair.i @@ -7,21 +7,6 @@ %{ #include %} -/* -A really cut down version of the pair class. - -this is not useful on its own - it needs a %template definition with it - -eg. -namespace std { - %template(IntPair) pair; - %template(make_IntPair) make_pair; -} - - -*/ - - namespace std { template struct pair { @@ -30,13 +15,12 @@ namespace std { pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); T first; U second; }; template - pair make_pair(const T&,const U&); - + pair make_pair(const T& first, const U& second); } diff --git a/linx64/bin/swig/share/swig/4.0.0/lua/std_string.i b/linx64/bin/swig/share/swig/4.0.0/lua/std_string.i index e9f326b5..b95a8a4a 100644 --- a/linx64/bin/swig/share/swig/4.0.0/lua/std_string.i +++ b/linx64/bin/swig/share/swig/4.0.0/lua/std_string.i @@ -109,7 +109,6 @@ as this is overloaded by the const char* version public: string(); string(const char*); - //string(const string&); unsigned int size() const; unsigned int length() const; bool empty() const; @@ -119,7 +118,6 @@ as this is overloaded by the const char* version // assign does not return a copy of this object // (no point in a scripting language) void assign(const char*); - //void assign(const string&); // no support for all the other features // it's probably better to do it in lua }; diff --git a/linx64/bin/swig/share/swig/4.0.0/lua/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/lua/std_vector.i index a4ea978d..9eb85e9e 100644 --- a/linx64/bin/swig/share/swig/4.0.0/lua/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/lua/std_vector.i @@ -25,10 +25,19 @@ 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(unsigned int); - vector(const vector&); + vector(const vector& other); vector(unsigned int,T); + unsigned int size() const; unsigned int max_size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/modula3/modula3.swg b/linx64/bin/swig/share/swig/4.0.0/modula3/modula3.swg deleted file mode 100644 index 13d06e9c..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/modula3/modula3.swg +++ /dev/null @@ -1,787 +0,0 @@ -/* ----------------------------------------------------------------------------- - * modula3.swg - * - * Modula3 typemaps - * ----------------------------------------------------------------------------- */ - -%include - -/* The ctype, m3rawtype and m3wraptype typemaps work together and so there should be one of each. - * The ctype typemap contains the C type used in the signature of C wrappers for C++ functions. - * The m3rawtype typemap contains the M3 type used in the raw interface. - * The m3rawintype typemap contains the M3 type used as function argument. - * The m3rawrettype typemap contains the M3 type used as return value. - * The m3wraptype typemap contains the M3 type used in the M3 type wrapper classes and module class. */ - -/* Primitive types */ -%typemap(ctype) bool, const bool & "bool" -%typemap(ctype) char, const char & "char" -%typemap(ctype) signed char, const signed char & "signed char" -%typemap(ctype) unsigned char, const unsigned char & "unsigned short" -%typemap(ctype) short, const short & "short" -%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 long, const long long & "long long" -%typemap(ctype) unsigned long long, const unsigned long long & "unsigned long long" -%typemap(ctype) float, const float & "float" -%typemap(ctype) double, const double & "double" -%typemap(ctype) char * "char *" -%typemap(ctype) void "void" - -%typemap(m3rawtype) bool, const bool & "BOOLEAN" -%typemap(m3rawtype) char, const char & "C.char" -%typemap(m3rawtype) signed char, const signed char & "C.signed_char" -%typemap(m3rawtype) unsigned char, const unsigned char & "C.unsigned_char" -%typemap(m3rawtype) short, const short & "C.short" -%typemap(m3rawtype) unsigned short, const unsigned short & "C.unsigned_short" -%typemap(m3rawtype) int, const int & "C.int" -%typemap(m3rawtype) unsigned int, const unsigned int & "C.unsigned_int" -%typemap(m3rawtype) long, const long & "C.long" -%typemap(m3rawtype) unsigned long, const unsigned long & "C.unsigned_long" -%typemap(m3rawtype) long long, const long long & "C.long_long" -%typemap(m3rawtype) unsigned long long, const unsigned long long & "C.unsigned_long_long" -%typemap(m3rawtype) float, const float & "C.float" -%typemap(m3rawtype) double, const double & "C.double" -%typemap(m3rawtype) long double, const long double & "C.long_double" -%typemap(m3rawtype) char * "C.char_star" -%typemap(m3rawtype) void "" -%typemap(m3rawtype) FILE "Cstdio.FILE"; -%typemap(m3rawtype) FILE * "Cstdio.FILE_star"; - - -%typemap(m3rawintype) bool *, bool &, bool "BOOLEAN" -%typemap(m3rawintype) char *, char &, char "C.char" -%typemap(m3rawintype) signed char *, signed char &, signed char "C.signed_char" -%typemap(m3rawintype) unsigned char *, unsigned char &, unsigned char "C.unsigned_char" -%typemap(m3rawintype) short *, short &, short "C.short" -%typemap(m3rawintype) unsigned short *, unsigned short &, unsigned short "C.unsigned_short" -%typemap(m3rawintype) int *, int &, int "C.int" -%typemap(m3rawintype) unsigned int *, unsigned int &, unsigned int "C.unsigned_int" -%typemap(m3rawintype) long *, long &, long "C.long" -%typemap(m3rawintype) unsigned long *, unsigned long &, unsigned long "C.unsigned_long" -%typemap(m3rawintype) long long *, long long &, long long "C.long_long" -%typemap(m3rawintype) unsigned long long *, unsigned long long &, unsigned long long "C.unsigned_long_long" -%typemap(m3rawintype) float *, float &, float "C.float" -%typemap(m3rawintype) double *, double &, double "C.double" -%typemap(m3rawintype) long double *, long double &, long double "C.long_double" -%typemap(m3rawintype) char * "C.char_star" -%typemap(m3rawintype) void "" -%typemap(m3rawintype) void * "ADDRESS" -%typemap(m3rawintype) FILE "Cstdio.FILE"; -%typemap(m3rawintype) FILE * "Cstdio.FILE_star"; - -%typemap(m3rawinmode) char *, void *, FILE * "" - - -%typemap(m3rawrettype) bool, const bool & "BOOLEAN" -%typemap(m3rawrettype) char, const char & "C.char" -%typemap(m3rawrettype) signed char, const signed char & "C.signed_char" -%typemap(m3rawrettype) unsigned char, const unsigned char & "C.unsigned_char" -%typemap(m3rawrettype) short, const short & "C.short" -%typemap(m3rawrettype) unsigned short, const unsigned short & "C.unsigned_short" -%typemap(m3rawrettype) int, const int & "C.int" -%typemap(m3rawrettype) unsigned int, const unsigned int & "C.unsigned_int" -%typemap(m3rawrettype) long, const long & "C.long" -%typemap(m3rawrettype) unsigned long, const unsigned long & "C.unsigned_long" -%typemap(m3rawrettype) long long, const long long & "C.long_long" -%typemap(m3rawrettype) unsigned long long, const unsigned long long & "C.unsigned_long_long" -%typemap(m3rawrettype) float, const float & "C.float" -%typemap(m3rawrettype) double, const double & "C.double" -%typemap(m3rawrettype) long double, const long double & "C.long_double" -%typemap(m3rawrettype) char * "C.char_star" -%typemap(m3rawrettype) void "" -%typemap(m3rawrettype) void * "ADDRESS" -%typemap(m3rawrettype) FILE "Cstdio.FILE"; -%typemap(m3rawrettype) FILE * "Cstdio.FILE_star"; - - -%typemap("m3rawtype:import") - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double &, - long double, const long double &, - char * - "Ctypes AS C" - -%typemap("m3rawintype:import") - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double &, - long double, const long double &, - char * - "Ctypes AS C" - -%typemap("m3rawrettype:import") - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double &, - long double, const long double &, - char * - "Ctypes AS C" - -%typemap("m3rawtype:import") - FILE, FILE * - "Cstdio"; - -%typemap("m3rawintype:import") - FILE, FILE * - "Cstdio"; - -%typemap("m3rawrettype:import") - FILE, FILE * - "Cstdio"; - -%typemap(m3wraptype) bool, const bool & "BOOLEAN" -%typemap(m3wraptype) char, const char & "CHAR" -%typemap(m3wraptype) signed char, const signed char & "CHAR" -%typemap(m3wraptype) unsigned char, const unsigned char & "CHAR" -%typemap(m3wraptype) short, const short & "Integer16.T" -%typemap(m3wraptype) unsigned short, const unsigned short & "Cardinal16.T" -%typemap(m3wraptype) int, const int & "INTEGER" -%typemap(m3wraptype) unsigned int, const unsigned int & "CARDINAL" -%typemap(m3wraptype) long, const long & "Integer32.T" -%typemap(m3wraptype) unsigned long, const unsigned long & "Cardinal32.T" -%typemap(m3wraptype) long long, const long long & "Integer64.T" -%typemap(m3wraptype) unsigned long long, const unsigned long long & "Cardinal64.T" -%typemap(m3wraptype) float, const float & "REAL" -%typemap(m3wraptype) double, const double & "LONGREAL" -%typemap(m3wraptype) long double, const long double & "EXTENDED" -%typemap(m3wraptype) char * "TEXT" -%typemap(m3wraptype) void "" -%typemap(m3wraptype) FILE "Cstdio.FILE"; -%typemap(m3wraptype) FILE * "Cstdio.FILE_star"; - -%typemap(m3wrapintype) bool, const bool *, const bool & "BOOLEAN" -%typemap(m3wrapintype) char, const char *, const char & "CHAR" -%typemap(m3wrapintype) signed char, const signed char *, const signed char & "CHAR" -%typemap(m3wrapintype) unsigned char, const unsigned char *, const unsigned char & "CHAR" -%typemap(m3wrapintype) short, const short *, const short & "INTEGER" -%typemap(m3wrapintype) unsigned short, const unsigned short *, const unsigned short & "CARDINAL" -%typemap(m3wrapintype) int, const int *, const int & "INTEGER" -%typemap(m3wrapintype) unsigned int, const unsigned int *, const unsigned int & "CARDINAL" -%typemap(m3wrapintype) long, const long *, const long & "INTEGER" -%typemap(m3wrapintype) unsigned long, const unsigned long *, const unsigned long & "CARDINAL" -%typemap(m3wrapintype) long long, const long long *, const long long & "INTEGER" -%typemap(m3wrapintype) unsigned long long, const unsigned long long *, const unsigned long long & "CARDINAL" -%typemap(m3wrapintype) float, const float *, const float & "REAL" -%typemap(m3wrapintype) double, const double *, const double & "LONGREAL" -%typemap(m3wrapintype) long double, const long double *, const long double & "EXTENDED" -%typemap(m3wrapintype) const char *, const char [] "TEXT" -%typemap(m3wrapintype,numinputs=0) void "" -%typemap(m3wrapintype) FILE "Cstdio.FILE"; -%typemap(m3wrapintype) FILE * "Cstdio.FILE_star"; - - -%typemap(m3wrapouttype) bool, bool *, bool & "BOOLEAN" -%typemap(m3wrapouttype) char, char *, char & "CHAR" -%typemap(m3wrapouttype) signed char, signed char *, signed char & "CHAR" -%typemap(m3wrapouttype) unsigned char, unsigned char *, unsigned char & "CHAR" -%typemap(m3wrapouttype) short, short *, short & "INTEGER" -%typemap(m3wrapouttype) unsigned short, unsigned short *, unsigned short & "CARDINAL" -%typemap(m3wrapouttype) int, int *, int & "INTEGER" -%typemap(m3wrapouttype) unsigned int, unsigned int *, unsigned int & "CARDINAL" -%typemap(m3wrapouttype) long, long *, long & "INTEGER" -%typemap(m3wrapouttype) unsigned long, unsigned long *, unsigned long & "CARDINAL" -%typemap(m3wrapouttype) long long, long long *, long long & "INTEGER" -%typemap(m3wrapouttype) unsigned long long, unsigned long long *, unsigned long long & "CARDINAL" -%typemap(m3wrapouttype) float, float *, float & "REAL" -%typemap(m3wrapouttype) double, double *, double & "LONGREAL" -%typemap(m3wrapouttype) long double, long double *, long double & "EXTENDED" -%typemap(m3wrapouttype) char *, char [] "TEXT" -%typemap(m3wrapouttype,numinputs=0) void "" - -%typemap(m3wraprettype) bool, const bool & "BOOLEAN" -%typemap(m3wraprettype) char, const char & "CHAR" -%typemap(m3wraprettype) signed char, const signed char & "CHAR" -%typemap(m3wraprettype) unsigned char, const unsigned char & "CHAR" -%typemap(m3wraprettype) short, const short & "INTEGER" -%typemap(m3wraprettype) unsigned short, const unsigned short & "CARDINAL" -%typemap(m3wraprettype) int, const int & "INTEGER" -%typemap(m3wraprettype) unsigned int, const unsigned int & "CARDINAL" -%typemap(m3wraprettype) long, const long & "INTEGER" -%typemap(m3wraprettype) unsigned long, const unsigned long & "CARDINAL" -%typemap(m3wraprettype) long long, const long long & "INTEGER" -%typemap(m3wraprettype) unsigned long long, const unsigned long long & "CARDINAL" -%typemap(m3wraprettype) float, const float & "REAL" -%typemap(m3wraprettype) double, const double & "LONGREAL" -%typemap(m3wraprettype) long double, const long double & "EXTENDED" -%typemap(m3wraprettype) char * "TEXT" -%typemap(m3wraprettype) void "" -%typemap(m3wraprettype) FILE "Cstdio.FILE"; -%typemap(m3wraprettype) FILE * "Cstdio.FILE_star"; - - -%typemap(ctype) char[ANY] "char *" -%typemap(m3rawtype) char[ANY] "C.char_star" -%typemap(m3rawintype) char[ANY] "C.char_star" -%typemap(m3rawrettype) char[ANY] "C.char_star" -%typemap(m3wraptype) char[ANY] "TEXT" -%typemap(m3wrapintype) char[ANY] "TEXT" -%typemap(m3wrapouttype) char[ANY] "TEXT" -%typemap(m3wraprettype) char[ANY] "TEXT" - -%typemap(m3wrapinmode) const char * %{%} -%typemap(m3wrapargvar) const char * %{$1 : C.char_star;%} -%typemap(m3wrapinconv) const char * %{$1 := M3toC.SharedTtoS($1_name);%} -%typemap(m3wrapfreearg) const char * %{M3toC.FreeSharedS($1_name,$1);%} -%typemap(m3wrapargraw) const char * %{$1%} -%typemap("m3wrapargvar:import") const char * "Ctypes AS C" -%typemap("m3wrapinconv:import") const char * "M3toC" -%typemap("m3wrapfreearg:import") const char * "M3toC" - -%typemap(m3wrapretvar) char * %{result : C.char_star;%} -%typemap(m3wrapretraw) char * %{result%} -%typemap(m3wrapretconv) char * %{M3toC.CopyStoT(result)%} -%typemap("m3wrapretvar:import") char * "Ctypes AS C" -%typemap("m3wrapretconv:import") char * "M3toC" - -%typemap(m3wrapinmode) FILE * %{%} - - -%typemap("m3wraptype:import") - FILE, FILE * - "Cstdio"; - -%typemap("m3wrapintype:import") - FILE, FILE * - "Cstdio"; - -%typemap("m3wraprettype:import") - FILE, FILE * - "Cstdio"; - - -/* Composed types */ -%typemap(ctype) SWIGTYPE "$1_type" -%typemap(m3rawtype) SWIGTYPE "$1_basetype" -%typemap(m3rawrettype) SWIGTYPE "UNTRACED REF $1_basetype" -%typemap(m3wraptype) SWIGTYPE "$1_basetype" -%typemap(m3wrapintype) SWIGTYPE "$1_basetype" -%typemap(m3wrapouttype) SWIGTYPE "$1_basetype" -%typemap(m3wraprettype) SWIGTYPE "$1_basetype" - -%typemap(ctype) SWIGTYPE [] "$1_type" -%typemap(m3rawtype) const SWIGTYPE [] "UNTRACED REF ARRAY INTEGER OF $1_basetype" -%typemap(m3rawtype) SWIGTYPE [] "UNTRACED REF ARRAY INTEGER OF $1_basetype" -%typemap(m3rawintype) const SWIGTYPE [] "(*ARRAY OF*) $1_basetype" -%typemap(m3rawinmode) const SWIGTYPE [] "READONLY" -%typemap(m3rawintype) SWIGTYPE [] "(*ARRAY OF*) $1_basetype" -%typemap(m3rawinmode) SWIGTYPE [] "VAR" -%typemap(m3rawrettype) const SWIGTYPE [] "UNTRACED REF ARRAY INTEGER OF $1_basetype" -%typemap(m3rawrettype) SWIGTYPE [] "UNTRACED REF ARRAY INTEGER OF $1_basetype" -%typemap(m3wraptype) SWIGTYPE [] "$1_basetype" -%typemap(m3wrapintype) const SWIGTYPE [] "ARRAY OF $1_basetype" -%typemap(m3wrapinmode) const SWIGTYPE [] "READONLY" -%typemap(m3wrapintype) SWIGTYPE [] "ARRAY OF $1_basetype" -%typemap(m3wrapinmode) SWIGTYPE [] "VAR" -%typemap(m3wrapouttype) SWIGTYPE [] "ARRAY OF $1_basetype" -%typemap(m3wraprettype) SWIGTYPE [] "REF ARRAY OF $1_basetype" - -%typemap(ctype) SWIGTYPE * "$1_type" -%typemap(m3rawtype) const SWIGTYPE * "UNTRACED REF $1_basetype" -%typemap(m3rawtype) SWIGTYPE * "UNTRACED REF $1_basetype" -%typemap(m3rawintype) const SWIGTYPE * "$1_basetype" -%typemap(m3rawinmode) const SWIGTYPE * "READONLY" -%typemap(m3rawintype) SWIGTYPE * "$1_basetype" -%typemap(m3rawinmode) SWIGTYPE * "VAR" -%typemap(m3rawrettype) const SWIGTYPE * "UNTRACED REF $1_basetype" -%typemap(m3rawrettype) SWIGTYPE * "UNTRACED REF $1_basetype" -%typemap(m3wraptype) SWIGTYPE * "$1_basetype" -%typemap(m3wrapintype) const SWIGTYPE * "$1_basetype" -%typemap(m3wrapinmode) const SWIGTYPE * "READONLY" -%typemap(m3wrapintype) SWIGTYPE * "$1_basetype" -%typemap(m3wrapinmode) SWIGTYPE * "VAR" -%typemap(m3wrapouttype) SWIGTYPE * "$1_basetype" -%typemap(m3wraprettype) SWIGTYPE * "UNTRACED REF $1_basetype" - -%typemap(ctype) SWIGTYPE & "$1_type" -%typemap(m3rawtype) const SWIGTYPE & "UNTRACED REF $1_basetype" -%typemap(m3rawtype) SWIGTYPE & "UNTRACED REF $1_basetype" -%typemap(m3rawintype) const SWIGTYPE & "$1_basetype" -%typemap(m3rawinmode) const SWIGTYPE & "READONLY" -%typemap(m3rawintype) SWIGTYPE & "$1_basetype" -%typemap(m3rawinmode) SWIGTYPE & "VAR" -%typemap(m3rawrettype) const SWIGTYPE & "UNTRACED REF $1_basetype" -%typemap(m3rawrettype) SWIGTYPE & "UNTRACED REF $1_basetype" -%typemap(m3wraptype) SWIGTYPE & "$1_basetype" -%typemap(m3wrapintype) const SWIGTYPE & "$1_basetype" -%typemap(m3wrapinmode) const SWIGTYPE & "READONLY" -%typemap(m3wrapintype) SWIGTYPE & "$1_basetype" -%typemap(m3wrapinmode) SWIGTYPE & "VAR" -%typemap(m3wrapouttype) SWIGTYPE & "$1_basetype" -%typemap(m3wraprettype) SWIGTYPE & "UNTRACED REF $1_basetype" - -%typemap(ctype) SWIGTYPE && "$1_type" -%typemap(m3rawtype) const SWIGTYPE && "UNTRACED REF $1_basetype" -%typemap(m3rawtype) SWIGTYPE && "UNTRACED REF $1_basetype" -%typemap(m3rawintype) const SWIGTYPE && "$1_basetype" -%typemap(m3rawinmode) const SWIGTYPE && "READONLY" -%typemap(m3rawintype) SWIGTYPE && "$1_basetype" -%typemap(m3rawinmode) SWIGTYPE && "VAR" -%typemap(m3rawrettype) const SWIGTYPE && "UNTRACED REF $1_basetype" -%typemap(m3rawrettype) SWIGTYPE && "UNTRACED REF $1_basetype" -%typemap(m3wraptype) SWIGTYPE && "$1_basetype" -%typemap(m3wrapintype) const SWIGTYPE && "$1_basetype" -%typemap(m3wrapinmode) const SWIGTYPE && "READONLY" -%typemap(m3wrapintype) SWIGTYPE && "$1_basetype" -%typemap(m3wrapinmode) SWIGTYPE && "VAR" -%typemap(m3wrapouttype) SWIGTYPE && "$1_basetype" -%typemap(m3wraprettype) SWIGTYPE && "UNTRACED REF $1_basetype" - -%typemap(ctype) enum SWIGTYPE "$1_type" -%typemap(m3rawtype) enum SWIGTYPE "C.int" -%typemap(m3rawintype) enum SWIGTYPE "C.int (* $1_type *)" -%typemap(m3rawrettype) enum SWIGTYPE "C.int" -%typemap(m3wraptype) enum SWIGTYPE "$*1_type" -%typemap(m3wrapintype) enum SWIGTYPE "$1_type" -%typemap(m3wrapouttype) enum SWIGTYPE "$1_type" -%typemap(m3wraprettype) enum SWIGTYPE "$*1_type" - -/* pointer to a class member */ -%typemap(ctype) SWIGTYPE (CLASS::*) "$1_type" -%typemap(m3rawtype) SWIGTYPE (CLASS::*) "REFANY" -%typemap(m3wraptype) SWIGTYPE (CLASS::*) "$1_basetype" - -/* The following are the in, out, freearg, argout typemaps. - These are the PInvoke code generating typemaps for converting from C# to C and visa versa. */ - -/* primitive types */ -%typemap(in) bool -%{ $1 = $input ? true : false; %} - -%typemap(in) char, - signed char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - long long, - unsigned long long, - float, - double, - enum SWIGTYPE -%{ $1 = ($1_ltype)$input; %} - -%typemap(out) bool %{ $result = $1; %} -%typemap(out) char %{ $result = $1; %} -%typemap(out) signed char %{ $result = $1; %} -%typemap(out) unsigned char %{ $result = $1; %} -%typemap(out) short %{ $result = $1; %} -%typemap(out) unsigned short %{ $result = $1; %} -%typemap(out) int %{ $result = $1; %} -%typemap(out) unsigned int %{ $result = $1; %} -%typemap(out) long %{ $result = $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; %} -%typemap(out) double %{ $result = $1; %} -%typemap(out) enum SWIGTYPE %{ $result = $1; %} - -/* char * - treat as String */ -%typemap(in) char * { - $1 = $input; -} -//%typemap(freearg) char * { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, $1); } -//%typemap(out) char * { if($1) $result = JCALL1(NewStringUTF, jenv, $1); } - -%typemap(out) void "" - -/* primitive types by const reference */ -%typemap(in) const bool & (bool temp) -%{ temp = $input ? true : false; - $1 = &temp; %} - -%typemap(in) const char & (char temp), - const signed char & (signed char temp), - const unsigned char & (unsigned char temp), - const short & (short temp), - const unsigned short & (unsigned short temp), - const int & (int temp), - const unsigned int & (unsigned int temp), - const long & (long temp), - const unsigned long & (unsigned long temp), - const long long & ($*1_ltype temp), - const unsigned long long & ($*1_ltype temp), - const float & (float temp), - const double & (double temp) -%{ temp = ($*1_ltype)$input; -$1 = &temp; %} - -%typemap(out) const bool & %{ $result = *$1; %} -%typemap(out) const char & %{ $result = *$1; %} -%typemap(out) const signed char & %{ $result = *$1; %} -%typemap(out) const unsigned char & %{ $result = *$1; %} -%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 long & %{ $result = *$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; %} -%typemap(out) const double & %{ $result = *$1; %} - -/* Default handling. Object passed by value. Convert to a pointer */ -%typemap(in) SWIGTYPE ($&1_type argp) -%{ argp = *($&1_ltype*)&$input; - if (!argp) { -// SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); - RETURN $null; - } - $1 = *argp; %} -%typemap(out) SWIGTYPE -#ifdef __cplusplus -%{*($&1_ltype*)&$result = new $1_ltype((const $1_ltype &)$1); %} -#else -{ - $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); - memmove($1ptr, &$1, sizeof($1_type)); - *($&1_ltype*)&$result = $1ptr; -} -#endif - -/* Generic pointers and references */ -%typemap(in) SWIGTYPE *, SWIGTYPE (CLASS::*) %{ $1 = *($&1_ltype)&$input; %} -%typemap(in) SWIGTYPE & %{ $1 = *($&1_ltype)&$input; - if(!$1) { - //SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); - RETURN $null; - } %} -%typemap(in) SWIGTYPE && %{ $1 = *($&1_ltype)&$input; - if(!$1) { - //SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); - RETURN $null; - } %} -%typemap(out) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE (CLASS::*) %{ *($&1_ltype)&$result = $1; %} - - -/* Default array handling */ -%typemap(in) SWIGTYPE [] %{ $1 = *($&1_ltype)&$input; %} -%typemap(out) SWIGTYPE [] %{ *($&1_ltype)&$result = $1; %} - -/* char[ANY] - treat as String */ -%typemap(in) char[ANY] { - $1 = $input; -} - -%typemap(argout) char[ANY] "" -%typemap(freearg) char[ANY] ""//{ if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, $1); } -%typemap(out) char[ANY] { if($1) $result = $1; } - - -/* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions - * that cannot be overloaded in C# as more than one C++ type maps to a single C# type */ - -%typecheck(SWIG_TYPECHECK_BOOL) /* Java boolean */ - bool, - const bool & - "" - -%typecheck(SWIG_TYPECHECK_CHAR) /* Java char */ - char, - const char & - "" - -%typecheck(SWIG_TYPECHECK_INT8) /* Java byte */ - signed char, - const signed char & - "" - -%typecheck(SWIG_TYPECHECK_INT16) /* Java short */ - unsigned char, - short, - const unsigned char &, - const short & - "" - -%typecheck(SWIG_TYPECHECK_INT32) /* Java int */ - unsigned short, - int, - long, - const unsigned short &, - const int &, - const long &, - enum SWIGTYPE - "" - -%typecheck(SWIG_TYPECHECK_INT64) /* Java long */ - unsigned int, - unsigned long, - long long, - const unsigned int &, - const unsigned long &, - const long long & - "" - -%typecheck(SWIG_TYPECHECK_INT128) /* Java BigInteger */ - unsigned long long - "" - -%typecheck(SWIG_TYPECHECK_FLOAT) /* Java float */ - float, - const float & - "" - -%typecheck(SWIG_TYPECHECK_DOUBLE) /* Java double */ - double, - const double & - "" - -%typecheck(SWIG_TYPECHECK_STRING) /* Java String */ - char *, - char[ANY] - "" - -%typecheck(SWIG_TYPECHECK_POINTER) /* Default */ - SWIGTYPE, - SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE [], - SWIGTYPE (CLASS::*) - "" - -/* Exception handling */ - -%typemap(throws) int, - long, - short, - unsigned int, - unsigned long, - unsigned short { - char error_msg[256]; - sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, error_msg); - RETURN $null; -} - -%typemap(throws) SWIGTYPE { - (void)$1; - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); - RETURN $null; -} - -%typemap(throws) char * { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1); - RETURN $null; -} - - -/* Typemaps for code generation in proxy classes and C# type wrapper classes */ - -/* The in typemap is used for converting function parameter types from the type - * used in the proxy, module or type wrapper class to the type used in the PInvoke class. */ -%typemap(m3in) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double &, - char *, - char[ANY], - enum SWIGTYPE - "$input" -%typemap(m3in) SWIGTYPE "$&*1_type.getCPtr($input)" -%typemap(m3in) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "$1_basetype.getCPtr($input)" - -/* The m3out typemap is used for converting function return types from the return type - * used in the PInvoke class to the type returned by the proxy, module or type wrapper class. */ -%typemap(m3out) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double &, - char *, - char[ANY], - enum SWIGTYPE -%{$imcall%} - -%typemap(m3out) void %{$imcall%} - -%typemap(m3out) SWIGTYPE %{ - RETURN NEW(REF $1_basetype, $imcall); -%} -%typemap(m3out) SWIGTYPE & %{ - RETURN NEW($1_basetype, $imcall, $owner); -%} -%typemap(m3out) SWIGTYPE && %{ - RETURN NEW($1_basetype, $imcall, $owner); -%} -%typemap(m3out) SWIGTYPE *, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ - cPtr := $imcall; - RETURN (cPtr = IntPtr.Zero) ? null : NEW($1_basetype, cPtr, $owner); -%} - -/* Properties */ -%typemap(m3varin) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ -PROCEDURE Set$var (value: $vartype) = - BEGIN - $imcall; - END Set$var; -%} - -%typemap(m3varout) bool, const bool &, - char, const char &, - signed char, const signed char &, - unsigned char, const unsigned char &, - short, const short &, - unsigned short, const unsigned short &, - int, const int &, - unsigned int, const unsigned int &, - long, const long &, - unsigned long, const unsigned long &, - long long, const long long &, - unsigned long long, const unsigned long long &, - float, const float &, - double, const double &, - char *, - char[ANY], - enum SWIGTYPE %{ -PROCEDURE Get$var (): $vartype = - BEGIN - RETURN $imcall; - END Get$var; -%} - -%typemap(m3varout) void %{ - get { - $imcall; - } %} -%typemap(m3varout) SWIGTYPE %{ - get { - RETURN new $&*1_mangle($imcall, true); - } %} -%typemap(m3varout) SWIGTYPE & %{ - get { - RETURN new $1_basetype($imcall, $owner); - } %} -%typemap(m3varout) SWIGTYPE && %{ - get { - RETURN new $1_basetype($imcall, $owner); - } %} -%typemap(m3varout) SWIGTYPE *, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ - get { - IntPtr cPtr = $imcall; - RETURN (cPtr == IntPtr.Zero) ? null : new $1_basetype(cPtr, $owner); - } %} - -/* Typemaps used for the generation of proxy and type wrapper class code */ -%typemap(m3base) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(m3classmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public" -%typemap(m3code) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(m3imports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "using System;" -%typemap(m3interfaces) SWIGTYPE "IDisposable" -%typemap(m3interfaces_derived) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(m3ptrconstructormodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "internal" - -%typemap(m3finalize) SWIGTYPE %{ - ~$1_basetype() { - Dispose(); - } -%} - -%typemap(m3destruct, methodname="Dispose") SWIGTYPE { - if(swigCPtr != IntPtr.Zero && swigCMemOwn) { - $imcall; - swigCMemOwn = false; - } - swigCPtr = IntPtr.Zero; - GC.SuppressFinalize(this); - } - -%typemap(m3destruct_derived, methodname="Dispose") SWIGTYPE { - if(swigCPtr != IntPtr.Zero && swigCMemOwn) { - $imcall; - swigCMemOwn = false; - } - swigCPtr = IntPtr.Zero; - GC.SuppressFinalize(this); - base.Dispose(); - } - -%typemap(m3getcptr) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ - internal static IntPtr getCPtr($1_basetype obj) { - RETURN (obj == null) ? IntPtr.Zero : obj.swigCPtr; - } -%} - -/* M3 specific directives */ -#define %m3multiretval %feature("modula3:multiretval") -#define %constnumeric(num) %feature("constnumeric","num") - -%pragma(modula3) moduleimports=%{ -IMPORT BlaBla; -%} - -%pragma(modula3) imclassimports=%{ -FROM BlaBla IMPORT Bla; -%} - -/* Some ANSI C typemaps */ - -%apply unsigned long { size_t }; - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - diff --git a/linx64/bin/swig/share/swig/4.0.0/modula3/modula3head.swg b/linx64/bin/swig/share/swig/4.0.0/modula3/modula3head.swg deleted file mode 100644 index af96a78d..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/modula3/modula3head.swg +++ /dev/null @@ -1,64 +0,0 @@ -/* ----------------------------------------------------------------------------- - * modula3head.swg - * - * Modula3 support code - * ----------------------------------------------------------------------------- */ - -%insert(runtime) %{ - -#include -#include -#include -%} - -#if 0 -%insert(runtime) %{ -/* Support for throwing Modula3 exceptions */ -typedef enum { - SWIG_JavaOutOfMemoryError = 1, - SWIG_JavaIOException, - SWIG_JavaRuntimeException, - SWIG_JavaIndexOutOfBoundsException, - SWIG_JavaArithmeticException, - SWIG_JavaIllegalArgumentException, - SWIG_JavaNullPointerException, - SWIG_JavaUnknownError -} SWIG_JavaExceptionCodes; - -typedef struct { - SWIG_JavaExceptionCodes code; - const char *java_exception; -} SWIG_JavaExceptions_t; - -#if defined(SWIG_NOINCLUDE) -void SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg); -#else -%} -%insert(runtime) { -void SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) { - jclass excep; - static const SWIG_JavaExceptions_t java_exceptions[] = { - { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" }, - { SWIG_JavaIOException, "java/io/IOException" }, - { SWIG_JavaRuntimeException, "java/lang/RuntimeException" }, - { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" }, - { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" }, - { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" }, - { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, - { SWIG_JavaUnknownError, "java/lang/UnknownError" }, - { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } }; - const SWIG_JavaExceptions_t *except_ptr = java_exceptions; - - while (except_ptr->code != code && except_ptr->code) - except_ptr++; - - JCALL0(ExceptionClear, jenv); - excep = JCALL1(FindClass, jenv, except_ptr->java_exception); - if (excep) - JCALL2(ThrowNew, jenv, excep, msg); -} -} -%insert(runtime) %{ -#endif -%} -#endif diff --git a/linx64/bin/swig/share/swig/4.0.0/modula3/typemaps.i b/linx64/bin/swig/share/swig/4.0.0/modula3/typemaps.i deleted file mode 100644 index 1d76ab5e..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/modula3/typemaps.i +++ /dev/null @@ -1,74 +0,0 @@ -/* ----------------------------------------------------------------------------- - * typemaps.i - * - * Pointer and reference handling typemap library - * - * These mappings provide support for input/output arguments and common - * uses for C/C++ pointers and C++ references. - * ----------------------------------------------------------------------------- */ - -/* These typemaps will eventually probably maybe make their way into named typemaps - * OUTPUT * and OUTPUT & as they currently break functions that return a pointer or - * reference. */ - -%typemap(ctype) bool *, bool & "bool *" -%typemap(ctype) char & "char *" -%typemap(ctype) signed char *, signed char & "signed char *" -%typemap(ctype) unsigned char *, unsigned char & "unsigned short *" -%typemap(ctype) short *, short & "short *" -%typemap(ctype) unsigned short *, unsigned short & "unsigned short *" -%typemap(ctype) int *, int & "int *" -%typemap(ctype) unsigned int *, unsigned int & "unsigned int *" -%typemap(ctype) long *, long & "long *" -%typemap(ctype) unsigned long *, unsigned long & "unsigned long *" -%typemap(ctype) long long *, long long & "long long *" -%typemap(ctype) unsigned long long *, unsigned long long & "unsigned long long *" -%typemap(ctype) float *, float & "float *" -%typemap(ctype) double *, double & "double *" - -%typemap(imtype) bool *, bool & "ref bool" -%typemap(imtype) char & "ref char" -%typemap(imtype) signed char *, signed char & "ref sbyte" -%typemap(imtype) unsigned char *, unsigned char & "ref byte" -%typemap(imtype) short *, short & "ref short" -%typemap(imtype) unsigned short *, unsigned short & "ref ushort" -%typemap(imtype) int *, int & "ref int" -%typemap(imtype) unsigned int *, unsigned int & "ref uint" -%typemap(imtype) long *, long & "ref int" -%typemap(imtype) unsigned long *, unsigned long & "ref uint" -%typemap(imtype) long long *, long long & "ref long" -%typemap(imtype) unsigned long long *, unsigned long long & "ref ulong" -%typemap(imtype) float *, float & "ref float" -%typemap(imtype) double *, double & "ref double" - -%typemap(cstype) bool *, bool & "ref bool" -%typemap(cstype) char & "ref char" -%typemap(cstype) signed char *, signed char & "ref sbyte" -%typemap(cstype) unsigned char *, unsigned char & "ref byte" -%typemap(cstype) short *, short & "ref short" -%typemap(cstype) unsigned short *, unsigned short & "ref ushort" -%typemap(cstype) int *, int & "ref int" -%typemap(cstype) unsigned int *, unsigned int & "ref uint" -%typemap(cstype) long *, long & "ref int" -%typemap(cstype) unsigned long *, unsigned long & "ref uint" -%typemap(cstype) long long *, long long & "ref long" -%typemap(cstype) unsigned long long *, unsigned long long & "ref ulong" -%typemap(cstype) float *, float & "ref float" -%typemap(cstype) double *, double & "ref double" - -%typemap(csin) bool *, bool &, - char &, - signed char *, signed char &, - unsigned char *, unsigned char &, - short *, short &, - unsigned short *, unsigned short &, - int *, int &, - unsigned int *, unsigned int &, - long *, long &, - unsigned long *, unsigned long &, - long long *, long long &, - unsigned long long *, unsigned long long &, - float *, float &, - double *, double & - "ref $csinput" - diff --git a/linx64/bin/swig/share/swig/4.0.0/mzscheme/mzrun.swg b/linx64/bin/swig/share/swig/4.0.0/mzscheme/mzrun.swg index 06447d78..c438c9ce 100644 --- a/linx64/bin/swig/share/swig/4.0.0/mzscheme/mzrun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/mzscheme/mzrun.swg @@ -158,7 +158,7 @@ SWIG_MzScheme_ConvertPtr(Scheme_Object *s, void **result, swig_type_info *type, if (SCHEME_NULLP(s)) { *result = NULL; - return 0; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } else if (SCHEME_TYPE(s) == swig_type) { struct swig_mz_proxy *proxy = (struct swig_mz_proxy *) s; if (type) { diff --git a/linx64/bin/swig/share/swig/4.0.0/mzscheme/mzscheme.swg b/linx64/bin/swig/share/swig/4.0.0/mzscheme/mzscheme.swg index 9ae24284..f45c8725 100644 --- a/linx64/bin/swig/share/swig/4.0.0/mzscheme/mzscheme.swg +++ b/linx64/bin/swig/share/swig/4.0.0/mzscheme/mzscheme.swg @@ -7,6 +7,7 @@ /* Include headers */ %runtime "swigrun.swg" // Common C API type-checking code +%runtime "swigerrors.swg" // SWIG errors %runtime "mzrun.swg" %define SWIG_APPEND_VALUE(value) diff --git a/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_map.i b/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_map.i index 6a0cb2d3..1d3eec24 100644 --- a/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_map.i @@ -221,8 +221,14 @@ namespace std { 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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; @@ -441,8 +447,18 @@ namespace std { %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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; @@ -653,8 +669,18 @@ namespace std { %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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; @@ -865,8 +891,18 @@ namespace std { %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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_pair.i index d5a65470..75f6751c 100644 --- a/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_pair.i @@ -115,11 +115,15 @@ namespace std { $1 = 0; } } + + typedef T first_type; + typedef U second_type; + pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; @@ -219,9 +223,9 @@ namespace std { } pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; @@ -320,9 +324,9 @@ namespace std { } pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; @@ -415,9 +419,9 @@ namespace std { } pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_vector.i index 22e1fa96..0ef5edb1 100644 --- a/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/mzscheme/std_vector.i @@ -189,9 +189,18 @@ namespace std { } } 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(unsigned int size = 0); vector(unsigned int size, const T& value); - vector(const vector&); + vector(const vector& other); + %rename(length) size; unsigned int size() const; %rename("empty?") empty; @@ -365,9 +374,18 @@ namespace std { } } 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(unsigned int size = 0); vector(unsigned int size, const T& value); - vector(const vector&); + vector(const vector& other); + %rename(length) size; unsigned int size() const; %rename("empty?") empty; diff --git a/linx64/bin/swig/share/swig/4.0.0/mzscheme/stl.i b/linx64/bin/swig/share/swig/4.0.0/mzscheme/stl.i index b19eae58..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/mzscheme/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/mzscheme/stl.i @@ -1,8 +1,7 @@ /* ----------------------------------------------------------------------------- * stl.i - * - * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ + %include %include %include diff --git a/linx64/bin/swig/share/swig/4.0.0/mzscheme/typemaps.i b/linx64/bin/swig/share/swig/4.0.0/mzscheme/typemaps.i index 9346349b..09bda2cc 100644 --- a/linx64/bin/swig/share/swig/4.0.0/mzscheme/typemaps.i +++ b/linx64/bin/swig/share/swig/4.0.0/mzscheme/typemaps.i @@ -329,7 +329,7 @@ REF_MAP(double, SCHEME_REALP, scheme_real_to_double, $1 = (SCHEME_STRINGP($input)) ? 1 : 0; } -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { +%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { void *ptr; if (SWIG_ConvertPtr($input, (void **) &ptr, $1_descriptor, 0)) { $1 = 0; @@ -338,9 +338,18 @@ REF_MAP(double, SCHEME_REALP, scheme_real_to_double, } } +%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE &, SWIGTYPE && { + void *ptr; + if (SWIG_ConvertPtr($input, (void **) &ptr, $1_descriptor, SWIG_POINTER_NO_NULL)) { + $1 = 0; + } else { + $1 = 1; + } +} + %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { void *ptr; - if (SWIG_ConvertPtr($input, (void **) &ptr, $&1_descriptor, 0)) { + if (SWIG_ConvertPtr($input, (void **) &ptr, $&1_descriptor, SWIG_POINTER_NO_NULL)) { $1 = 0; } else { $1 = 1; diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/carray.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/carray.i index bbf1ddd5..5e74c3da 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/carray.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/carray.i @@ -9,7 +9,6 @@ type _value = c_obj %define %array_tmap_out(type,what,out_f) %typemap(type) what [ANY] { int i; - /* $*1_type */ $result = caml_array_new($1_dim0); for( i = 0; i < $1_dim0; i++ ) { caml_array_set($result,i,out_f($1[i])); @@ -20,7 +19,6 @@ type _value = c_obj %define %array_tmap_in(type,what,in_f) %typemap(type) what [ANY] { int i; - /* $*1_type */ $1 = ($*1_type *)malloc( $1_size ); for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { $1[i] = in_f(caml_array_nth($input,i)); @@ -57,7 +55,6 @@ type _value = c_obj %typemap(in) SWIGTYPE [] { int i; - /* $*1_type */ $1 = new $*1_type [$1_dim0]; for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { $1[i] = *(($*1_ltype *) @@ -69,7 +66,6 @@ type _value = c_obj %typemap(in) SWIGTYPE [] { int i; - /* $*1_type */ $1 = ($*1_type *)malloc( $1_size ); for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { $1[i] = *(($*1_ltype) @@ -89,7 +85,7 @@ type _value = c_obj caml_array_set ($result, i, - callback(*fromval,caml_val_ptr((void *)&$1[i],$*1_descriptor))); + caml_callback(*fromval,caml_val_ptr((void *)&$1[i],$*1_descriptor))); } else { caml_array_set ($result, @@ -102,7 +98,6 @@ type _value = c_obj %typemap(in) enum SWIGTYPE [] { int i; - /* $*1_type */ $1 = ($*1_type *)malloc( $1_size ); for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { $1[i] = ($type) @@ -119,7 +114,7 @@ type _value = c_obj caml_array_set ($result, i, - callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"), + caml_callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"), *caml_named_value("$type_marker"), Val_int($1[i]))); } diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/class.swg b/linx64/bin/swig/share/swig/4.0.0/ocaml/class.swg index 0ee304ca..eb369cd7 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/class.swg +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/class.swg @@ -56,6 +56,7 @@ begin (fun mth arg -> invoke_inner raw_ptr mth arg) end +let _ = register_class_byname "$realname" create_$classname_from_ptr let _ = Callback.register "create_$normalized_from_ptr" create_$classname_from_ptr diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/cstring.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/cstring.i index 0d6aa4b6..f1190ad5 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/cstring.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/cstring.i @@ -108,7 +108,7 @@ %define %cstring_mutable(TYPEMAP,...) %typemap(in) TYPEMAP { char *t = String_val($input); - int n = string_length($input); + int n = caml_string_length($input); $1 = ($1_ltype) t; #if #__VA_ARGS__ == "" #ifdef __cplusplus diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/director.swg b/linx64/bin/swig/share/swig/4.0.0/ocaml/director.swg index 158cbfee..eb91aaf4 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/director.swg +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/director.swg @@ -74,12 +74,12 @@ namespace Swig { public: /* wrap a ocaml object. */ Director(CAML_VALUE self) : swig_self(self), swig_disown_flag(false) { - register_global_root(&swig_self); + caml_register_global_root(&swig_self); } /* discard our reference at destruction */ virtual ~Director() { - remove_global_root(&swig_self); + caml_remove_global_root(&swig_self); swig_disown(); // Disown is safe here because we're just divorcing a reference that points to us. } @@ -93,7 +93,7 @@ namespace Swig { void swig_disown() const { if (!swig_disown_flag) { swig_disown_flag=true; - callback(*caml_named_value("caml_obj_disown"),swig_self); + caml_callback(*caml_named_value("caml_obj_disown"),swig_self); } } }; diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/ocaml.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/ocaml.i index e099f7c1..96a36c8b 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/ocaml.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/ocaml.i @@ -4,10 +4,6 @@ * SWIG Configuration File for Ocaml * ----------------------------------------------------------------------------- */ -%runtime %{ -#define SWIGSTATIC static -%} - /* Insert common stuff */ %insert(runtime) "swigrun.swg" diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/ocaml.swg b/linx64/bin/swig/share/swig/4.0.0/ocaml/ocaml.swg index a00252b2..3d552cc5 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/ocaml.swg +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/ocaml.swg @@ -31,12 +31,12 @@ extern "C" { /* Cast a pointer if possible; returns 1 if successful */ - SWIGSTATIC int + SWIGINTERN int SWIG_Cast (void *source, swig_type_info *source_type, void **ptr, swig_type_info *dest_type) { - if( !source ) { // Special case for NULL. This is a popular question - // for other modules on the list, so I want an easy way out... + if( !source ) { /* Special case for NULL. This is a popular question + for other modules on the list, so I want an easy way out... */ *ptr = 0; return 0; } @@ -62,7 +62,7 @@ extern "C" { SWIG_TypeCheckStruct(source_type, dest_type ); #ifdef TYPE_CAST_VERBOSE fprintf( stderr, "Typecheck -> %s\n", - tc ? tc->str : "" ); + tc ? tc->type->str : "" ); #endif if( tc ) { int newmemory = 0; @@ -79,7 +79,7 @@ extern "C" { } /* Return 0 if successful. */ - SWIGSTATIC int + SWIGINTERN int SWIG_GetPtr(void *inptr, void **outptr, swig_type_info *intype, swig_type_info *outtype) { if (intype) { @@ -91,9 +91,9 @@ extern "C" { } } - SWIGSTATIC void caml_print_list( CAML_VALUE v ); + SWIGINTERN void caml_print_list( CAML_VALUE v ); - SWIGSTATIC void caml_print_val( CAML_VALUE v ) { + SWIGINTERN void caml_print_val( CAML_VALUE v ) { switch( SWIG_Tag_val(v) ) { case C_bool: if( Bool_val(SWIG_Field(v,0)) ) fprintf( stderr, "true " ); @@ -157,7 +157,7 @@ extern "C" { } } - SWIGSTATIC void caml_print_list( CAML_VALUE v ) { + SWIGINTERN void caml_print_list( CAML_VALUE v ) { CAMLparam1(v); while( v && Is_block(v) ) { fprintf( stderr, "[ " ); @@ -168,7 +168,7 @@ extern "C" { CAMLreturn0; } - SWIGSTATIC CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ) { + SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ) { CAMLparam1(lst); int i = 0; while( i < n && lst && Is_block(lst) ) { @@ -178,7 +178,7 @@ extern "C" { else CAMLreturn(SWIG_Field(lst,0)); } - SWIGSTATIC CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ) { + SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ) { CAMLparam2(lst,elt); SWIG_CAMLlocal3(v,vt,lh); lh = Val_unit; @@ -189,22 +189,22 @@ extern "C" { while( lst && Is_block(lst) ) { if( v && v != Val_unit ) { - vt = alloc_tuple(2); + vt = caml_alloc_tuple(2); SWIG_Store_field(v,1,vt); v = vt; } else { - v = lh = alloc_tuple(2); + v = lh = caml_alloc_tuple(2); } SWIG_Store_field(v,0,SWIG_Field(lst,0)); lst = SWIG_Field(lst,1); } if( v && Is_block(v) ) { - vt = alloc_tuple(2); + vt = caml_alloc_tuple(2); SWIG_Store_field(v,1,vt); v = vt; } else { - v = lh = alloc_tuple(2); + v = lh = caml_alloc_tuple(2); } SWIG_Store_field(v,0,elt); SWIG_Store_field(v,1,Val_unit); @@ -212,52 +212,52 @@ extern "C" { CAMLreturn(lh); } - SWIGSTATIC int caml_list_length( CAML_VALUE lst ) { + SWIGINTERN int caml_list_length( CAML_VALUE lst ) { CAMLparam1(lst); int i = 0; while( lst && Is_block(lst) ) { i++; lst = SWIG_Field(lst,1); } CAMLreturn(i); } - SWIGSTATIC void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ) { + SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ) { CAMLparam2(arr,item); SWIG_Store_field(SWIG_Field(arr,0),n,item); CAMLreturn0; } - SWIGSTATIC value caml_array_nth( CAML_VALUE arr, int n ) { + SWIGINTERN value caml_array_nth( CAML_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 ) CAMLreturn(caml_list_nth(arr,0)); else - failwith("Need array or list"); + caml_failwith("Need array or list"); } - SWIGSTATIC int caml_array_len( CAML_VALUE arr ) { + SWIGINTERN int caml_array_len( CAML_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 ) CAMLreturn(caml_list_length(arr)); else - failwith("Need array or list"); + caml_failwith("Need array or list"); } - SWIGSTATIC CAML_VALUE caml_swig_alloc(int x,int y) { + SWIGINTERN CAML_VALUE caml_swig_alloc(int x,int y) { return caml_alloc(x,y); } - SWIGSTATIC value caml_array_new( int n ) { + SWIGINTERN value caml_array_new( int n ) { CAMLparam0(); SWIG_CAMLlocal1(vv); vv = caml_swig_alloc(1,C_array); - SWIG_Store_field(vv,0,alloc_tuple(n)); + SWIG_Store_field(vv,0,caml_alloc_tuple(n)); CAMLreturn(vv); } - SWIGSTATIC CAML_VALUE caml_val_bool( int b ) { + SWIGINTERN CAML_VALUE caml_val_bool( int b ) { CAMLparam0(); SWIG_CAMLlocal1(bv); bv = caml_swig_alloc(1,C_bool); @@ -265,7 +265,7 @@ extern "C" { CAMLreturn(bv); } - SWIGSTATIC CAML_VALUE caml_val_char( char c ) { + SWIGINTERN CAML_VALUE caml_val_char( char c ) { CAMLparam0(); SWIG_CAMLlocal1(cv); cv = caml_swig_alloc(1,C_char); @@ -273,7 +273,7 @@ extern "C" { CAMLreturn(cv); } - SWIGSTATIC CAML_VALUE caml_val_uchar( unsigned char uc ) { + SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char uc ) { CAMLparam0(); SWIG_CAMLlocal1(ucv); ucv = caml_swig_alloc(1,C_uchar); @@ -281,7 +281,7 @@ extern "C" { CAMLreturn(ucv); } - SWIGSTATIC CAML_VALUE caml_val_short( short s ) { + SWIGINTERN CAML_VALUE caml_val_short( short s ) { CAMLparam0(); SWIG_CAMLlocal1(sv); sv = caml_swig_alloc(1,C_short); @@ -289,7 +289,7 @@ extern "C" { CAMLreturn(sv); } - SWIGSTATIC CAML_VALUE caml_val_ushort( unsigned short us ) { + SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short us ) { CAMLparam0(); SWIG_CAMLlocal1(usv); usv = caml_swig_alloc(1,C_ushort); @@ -297,7 +297,7 @@ extern "C" { CAMLreturn(usv); } - SWIGSTATIC CAML_VALUE caml_val_int( int i ) { + SWIGINTERN CAML_VALUE caml_val_int( int i ) { CAMLparam0(); SWIG_CAMLlocal1(iv); iv = caml_swig_alloc(1,C_int); @@ -305,7 +305,7 @@ extern "C" { CAMLreturn(iv); } - SWIGSTATIC CAML_VALUE caml_val_uint( unsigned int ui ) { + SWIGINTERN CAML_VALUE caml_val_uint( unsigned int ui ) { CAMLparam0(); SWIG_CAMLlocal1(uiv); uiv = caml_swig_alloc(1,C_int); @@ -313,75 +313,75 @@ extern "C" { CAMLreturn(uiv); } - SWIGSTATIC CAML_VALUE caml_val_long( long l ) { + SWIGINTERN CAML_VALUE caml_val_long( long l ) { CAMLparam0(); SWIG_CAMLlocal1(lv); lv = caml_swig_alloc(1,C_int64); - SWIG_Store_field(lv,0,copy_int64(l)); + SWIG_Store_field(lv,0,caml_copy_int64(l)); CAMLreturn(lv); } - SWIGSTATIC CAML_VALUE caml_val_ulong( unsigned long ul ) { + SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long ul ) { CAMLparam0(); SWIG_CAMLlocal1(ulv); ulv = caml_swig_alloc(1,C_int64); - SWIG_Store_field(ulv,0,copy_int64(ul)); + SWIG_Store_field(ulv,0,caml_copy_int64(ul)); CAMLreturn(ulv); } - SWIGSTATIC CAML_VALUE caml_val_float( float f ) { + SWIGINTERN CAML_VALUE caml_val_float( float f ) { CAMLparam0(); SWIG_CAMLlocal1(fv); fv = caml_swig_alloc(1,C_float); - SWIG_Store_field(fv,0,copy_double((double)f)); + SWIG_Store_field(fv,0,caml_copy_double((double)f)); CAMLreturn(fv); } - SWIGSTATIC CAML_VALUE caml_val_double( double d ) { + SWIGINTERN CAML_VALUE caml_val_double( double d ) { CAMLparam0(); SWIG_CAMLlocal1(fv); fv = caml_swig_alloc(1,C_double); - SWIG_Store_field(fv,0,copy_double(d)); + SWIG_Store_field(fv,0,caml_copy_double(d)); CAMLreturn(fv); } - SWIGSTATIC CAML_VALUE caml_val_ptr( void *p, swig_type_info *info ) { + SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *info ) { CAMLparam0(); SWIG_CAMLlocal1(vv); vv = caml_swig_alloc(2,C_ptr); - SWIG_Store_field(vv,0,copy_int64((long)p)); - SWIG_Store_field(vv,1,copy_int64((long)info)); + SWIG_Store_field(vv,0,caml_copy_int64((long)p)); + SWIG_Store_field(vv,1,caml_copy_int64((long)info)); CAMLreturn(vv); } - SWIGSTATIC CAML_VALUE caml_val_string( const char *p ) { + SWIGINTERN CAML_VALUE caml_val_string( const char *p ) { CAMLparam0(); SWIG_CAMLlocal1(vv); if( !p ) CAMLreturn(caml_val_ptr( (void *)p, 0 )); vv = caml_swig_alloc(1,C_string); - SWIG_Store_field(vv,0,copy_string(p)); + SWIG_Store_field(vv,0,caml_copy_string(p)); CAMLreturn(vv); } - SWIGSTATIC CAML_VALUE caml_val_string_len( const char *p, int len ) { + SWIGINTERN CAML_VALUE caml_val_string_len( const char *p, int len ) { CAMLparam0(); SWIG_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,alloc_string(len)); + SWIG_Store_field(vv,0,caml_alloc_string(len)); memcpy(String_val(SWIG_Field(vv,0)),p,len); CAMLreturn(vv); } #define caml_val_obj(v, name) caml_val_obj_helper(v, SWIG_TypeQuery((name)), name) - SWIGSTATIC CAML_VALUE caml_val_obj_helper( void *v, swig_type_info *type, char *name) { + SWIGINTERN CAML_VALUE caml_val_obj_helper( void *v, swig_type_info *type, char *name) { CAMLparam0(); - CAMLreturn(callback2(*caml_named_value("caml_create_object_fn"), + CAMLreturn(caml_callback2(*caml_named_value("caml_create_object_fn"), caml_val_ptr(v,type), - copy_string(name))); + caml_copy_string(name))); } - SWIGSTATIC long caml_long_val_full( CAML_VALUE v, char *name ) { + SWIGINTERN long caml_long_val_full( CAML_VALUE v, const char *name ) { CAMLparam1(v); if( !Is_block(v) ) return 0; @@ -408,20 +408,20 @@ extern "C" { case C_enum: { SWIG_CAMLlocal1(ret); CAML_VALUE *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int"); - if( !name ) failwith( "Not an enum conversion" ); - ret = callback2(*enum_to_int,*caml_named_value(name),v); + if( !name ) caml_failwith( "Not an enum conversion" ); + ret = caml_callback2(*enum_to_int,*caml_named_value(name),v); CAMLreturn(caml_long_val(ret)); } default: - failwith("No conversion to int"); + caml_failwith("No conversion to int"); } } - SWIGSTATIC long caml_long_val( CAML_VALUE v ) { + SWIGINTERN long caml_long_val( CAML_VALUE v ) { return caml_long_val_full(v,0); } - SWIGSTATIC double caml_double_val( CAML_VALUE v ) { + SWIGINTERN double caml_double_val( CAML_VALUE v ) { CAMLparam1(v); if( !Is_block(v) ) return 0.0; switch( SWIG_Tag_val(v) ) { @@ -442,36 +442,28 @@ extern "C" { CAMLreturn_type(Double_val(SWIG_Field(v,0))); default: fprintf( stderr, "Unknown block tag %d\n", SWIG_Tag_val(v) ); - failwith("No conversion to double"); + caml_failwith("No conversion to double"); } } - SWIGSTATIC int caml_ptr_val_internal( CAML_VALUE v, void **out, + SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out, swig_type_info *descriptor ) { CAMLparam1(v); void *outptr = NULL; swig_type_info *outdescr = NULL; + static CAML_VALUE *func_val = NULL; if( v == Val_unit ) { *out = 0; - CAMLreturn(0); + CAMLreturn_type(0); } if( !Is_block(v) ) return -1; switch( SWIG_Tag_val(v) ) { - case C_int: - if( !caml_long_val( v ) ) { - *out = 0; - CAMLreturn(0); - } else { - *out = 0; - CAMLreturn(1); - } - break; case C_obj: - CAMLreturn - (caml_ptr_val_internal - (callback(*caml_named_value("caml_obj_ptr"),v), - out,descriptor)); + if (!func_val) { + func_val = caml_named_value("caml_obj_ptr"); + } + CAMLreturn_type(caml_ptr_val_internal(caml_callback(*func_val, v), out, descriptor)); case C_string: outptr = (void *)String_val(SWIG_Field(v,0)); break; @@ -481,14 +473,14 @@ extern "C" { break; default: *out = 0; - CAMLreturn(1); + CAMLreturn_type(1); break; } - - CAMLreturn(SWIG_GetPtr(outptr,out,outdescr,descriptor)); + + CAMLreturn_type(SWIG_GetPtr(outptr, out, outdescr, descriptor)); } - SWIGSTATIC void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ) { + SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ) { CAMLparam0(); #ifdef TYPE_CAST_VERBOSE caml_print_val( v ); @@ -497,23 +489,23 @@ extern "C" { if( !caml_ptr_val_internal( v, &out, descriptor ) ) CAMLreturn_type(out); else - failwith( "No appropriate conversion found." ); + caml_failwith( "No appropriate conversion found." ); } - SWIGSTATIC char *caml_string_val( CAML_VALUE v ) { + SWIGINTERN char *caml_string_val( CAML_VALUE v ) { return (char *)caml_ptr_val( v, 0 ); } - SWIGSTATIC int caml_string_len( CAML_VALUE v ) { + SWIGINTERN int caml_string_len( CAML_VALUE v ) { switch( SWIG_Tag_val(v) ) { case C_string: - return string_length(SWIG_Field(v,0)); + return caml_string_length(SWIG_Field(v,0)); default: return strlen((char *)caml_ptr_val(v,0)); } } - SWIGSTATIC int caml_bool_check( CAML_VALUE v ) { + SWIGINTERN int caml_bool_check( CAML_VALUE v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; @@ -528,7 +520,7 @@ extern "C" { } } - SWIGSTATIC int caml_int_check( CAML_VALUE v ) { + SWIGINTERN int caml_int_check( CAML_VALUE v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; @@ -549,7 +541,7 @@ extern "C" { } } - SWIGSTATIC int caml_float_check( CAML_VALUE v ) { + SWIGINTERN int caml_float_check( CAML_VALUE v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; @@ -563,7 +555,7 @@ extern "C" { } } - SWIGSTATIC int caml_ptr_check( CAML_VALUE v ) { + SWIGINTERN int caml_ptr_check( CAML_VALUE v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; @@ -578,10 +570,23 @@ extern "C" { } } + SWIGINTERN CAML_VALUE SWIG_Ocaml_ptr_to_val(const char *name, void *ptr, swig_type_info *descriptor) { + CAMLparam0(); + SWIG_CAMLlocal1(result); + + CAML_VALUE *fromval = caml_named_value(name); + if (fromval) { + result = caml_callback(*fromval, caml_val_ptr(ptr, descriptor)); + } else { + result = caml_val_ptr(ptr, descriptor); + } + CAMLreturn(result); + } + static swig_module_info *SWIG_Ocaml_GetModule(void *SWIGUNUSEDPARM(clientdata)) { CAML_VALUE pointer; - pointer = callback(*caml_named_value("swig_find_type_info"), caml_val_int(0)); + 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)); } @@ -592,7 +597,7 @@ extern "C" { CAML_VALUE mod_pointer; mod_pointer = caml_val_ptr(pointer, NULL); - callback(*caml_named_value("swig_set_type_info"), mod_pointer); + caml_callback(*caml_named_value("swig_set_type_info"), mod_pointer); } #ifdef __cplusplus diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/ocamldec.swg b/linx64/bin/swig/share/swig/4.0.0/ocaml/ocamldec.swg index 96e1cd2c..0c2faf77 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/ocamldec.swg +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/ocamldec.swg @@ -16,6 +16,7 @@ SWIGEXT { #endif #define value caml_value_t #define CAML_VALUE caml_value_t +#define CAML_NAME_SPACE #include #include #include @@ -24,9 +25,16 @@ SWIGEXT { #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 +/* Adapted from memory.h and mlvalues.h */ #define SWIG_CAMLlocal1(x) \ caml_value_t x = 0; \ @@ -56,7 +64,7 @@ SWIGEXT { #define SWIG_Store_field(block, offset, val) do{ \ mlsize_t caml__temp_offset = (offset); \ caml_value_t caml__temp_val = (val); \ - modify (&SWIG_Field ((block), caml__temp_offset), caml__temp_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)) @@ -101,9 +109,17 @@ SWIGEXT { #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 @@ -111,56 +127,85 @@ CAMLextern int64 Int64_val(caml_value_t v); #define SWIG_GetModule(clientdata) SWIG_Ocaml_GetModule(clientdata) #define SWIG_SetModule(clientdata, pointer) SWIG_Ocaml_SetModule(pointer) -#define SWIG_contract_assert(expr, msg) if(!(expr)) {failwith(msg);} else +typedef enum { + SWIG_OCamlArithmeticException, + SWIG_OCamlDirectorPureVirtual, + SWIG_OCamlOutOfMemoryError, + SWIG_OCamlOverflowException, + SWIG_OCamlIllegalArgumentException, + SWIG_OCamlIndexOutOfBoundsException, + SWIG_OCamlRuntimeException, + SWIG_OCamlSystemException, + SWIG_OCamlUnknownError +} SWIG_OCamlExceptionCodes; - SWIGSTATIC int +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) if(!(expr)) {SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, msg);} + + 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 ); - SWIGSTATIC void * - SWIG_MustGetPtr (CAML_VALUE v, swig_type_info *type); - - SWIGSTATIC CAML_VALUE _wrap_delete_void( CAML_VALUE ); - - SWIGSTATIC int enum_to_int( char *name, CAML_VALUE v ); - SWIGSTATIC CAML_VALUE int_to_enum( char *name, int v ); + SWIGINTERN CAML_VALUE caml_val_int( int x ); + SWIGINTERN CAML_VALUE caml_val_uint( unsigned int x ); - SWIGSTATIC CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ); - SWIGSTATIC CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ); - SWIGSTATIC int caml_list_length( CAML_VALUE lst ); - SWIGSTATIC CAML_VALUE caml_array_new( int n ); - SWIGSTATIC void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ); - SWIGSTATIC CAML_VALUE caml_array_nth( CAML_VALUE arr, int n ); - SWIGSTATIC int caml_array_len( CAML_VALUE arr ); + SWIGINTERN CAML_VALUE caml_val_long( long x ); + SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long x ); - SWIGSTATIC CAML_VALUE caml_val_char( char c ); - SWIGSTATIC CAML_VALUE caml_val_uchar( unsigned char c ); + SWIGINTERN CAML_VALUE caml_val_float( float f ); + SWIGINTERN CAML_VALUE caml_val_double( double d ); - SWIGSTATIC CAML_VALUE caml_val_short( short s ); - SWIGSTATIC CAML_VALUE caml_val_ushort( unsigned short s ); - - SWIGSTATIC CAML_VALUE caml_val_int( int x ); - SWIGSTATIC CAML_VALUE caml_val_uint( unsigned int x ); + SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *descriptor ); - SWIGSTATIC CAML_VALUE caml_val_long( long x ); - SWIGSTATIC CAML_VALUE caml_val_ulong( unsigned long x ); + SWIGINTERN CAML_VALUE caml_val_string( const char *str ); + SWIGINTERN CAML_VALUE caml_val_string_len( const char *str, int len ); - SWIGSTATIC CAML_VALUE caml_val_float( float f ); - SWIGSTATIC CAML_VALUE caml_val_double( double d ); + SWIGINTERN long caml_long_val( CAML_VALUE v ); + SWIGINTERN double caml_double_val( CAML_VALUE v ); - SWIGSTATIC CAML_VALUE caml_val_ptr( void *p, swig_type_info *descriptor ); - - SWIGSTATIC CAML_VALUE caml_val_string( const char *str ); - SWIGSTATIC CAML_VALUE caml_val_string_len( const char *str, int len ); - - SWIGSTATIC long caml_long_val( CAML_VALUE v ); - SWIGSTATIC double caml_double_val( CAML_VALUE v ); - - SWIGSTATIC int caml_ptr_val_internal( CAML_VALUE v, void **out, + SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out, swig_type_info *descriptor ); - SWIGSTATIC void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ); + SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ); - SWIGSTATIC char *caml_string_val( CAML_VALUE v ); - SWIGSTATIC int caml_string_len( CAML_VALUE v ); + SWIGINTERN char *caml_string_val( CAML_VALUE v ); + SWIGINTERN int caml_string_len( CAML_VALUE v ); #ifdef __cplusplus } diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/ocamlkw.swg b/linx64/bin/swig/share/swig/4.0.0/ocaml/ocamlkw.swg index 92d82221..5e66085e 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/ocamlkw.swg +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/ocamlkw.swg @@ -6,12 +6,13 @@ /* from - http://caml.inria.fr/ocaml/htmlman/manual044.html + https://caml.inria.fr/pub/docs/manual-ocaml/lex.html */ OCAMLKW(and); OCAMLKW(as); +OCAMLKW(asr); OCAMLKW(assert); OCAMLKW(begin); OCAMLKW(class); @@ -33,13 +34,20 @@ OCAMLKW(in); OCAMLKW(include); OCAMLKW(inherit); OCAMLKW(initializer); +OCAMLKW(land); OCAMLKW(lazy); OCAMLKW(let); +OCAMLKW(lor); +OCAMLKW(lsl); +OCAMLKW(lsr); +OCAMLKW(lxor); OCAMLKW(match); OCAMLKW(method); +OCAMLKW(mod); OCAMLKW(module); OCAMLKW(mutable); OCAMLKW(new); +OCAMLKW(nonrec); OCAMLKW(object); OCAMLKW(of); OCAMLKW(open); diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_common.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_common.i index 6523af0b..7e64607d 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_common.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_common.i @@ -7,6 +7,7 @@ %include %apply size_t { std::size_t }; +%apply const size_t& { const std::size_t& }; %{ #include diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_except.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_except.i new file mode 100644 index 00000000..74ddcb51 --- /dev/null +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_except.i @@ -0,0 +1,23 @@ +%{ +#include +#include +%} + +namespace std +{ + %ignore exception; + struct exception {}; +} + +%typemap(throws) std::bad_cast "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" +%typemap(throws) std::bad_exception "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" +%typemap(throws) std::domain_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" +%typemap(throws) std::exception "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" +%typemap(throws) std::invalid_argument "SWIG_OCamlThrowException(SWIG_OCamlIllegalArgumentException, $1.what());" +%typemap(throws) std::length_error "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" +%typemap(throws) std::logic_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" +%typemap(throws) std::out_of_range "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" +%typemap(throws) std::overflow_error "SWIG_OCamlThrowException(SWIG_OCamlArithmeticException, $1.what());" +%typemap(throws) std::range_error "SWIG_OCamlThrowException(SWIG_OCamlIndexOutOfBoundsException, $1.what());" +%typemap(throws) std::runtime_error "SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1.what());" +%typemap(throws) std::underflow_error "SWIG_OCamlThrowException(SWIG_OCamlArithmeticException, $1.what());" diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_list.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_list.i index 06181cca..e0524aa4 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_list.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_list.i @@ -13,21 +13,24 @@ %} -namespace std{ +namespace std { template class list { public: - - typedef T &reference; - typedef const T& const_reference; + 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; typedef T &iterator; typedef const T& const_iterator; - + list(); list(unsigned int size, const T& value = T()); - list(const list &); + list(const list& other); - ~list(); void assign(unsigned int n, const T& value); void swap(list &x); @@ -35,28 +38,25 @@ namespace std{ const_reference back(); const_iterator begin(); const_iterator end(); - + void resize(unsigned int n, T c = T()); bool empty() const; void push_front(const T& x); void push_back(const T& x); - void pop_front(); void pop_back(); void clear(); unsigned int size() const; unsigned int max_size() const; void resize(unsigned int n, const T& value); - + void remove(const T& value); void unique(); void reverse(); void sort(); - - - + %extend { const_reference __getitem__(int i) throw (std::out_of_range) @@ -206,9 +206,7 @@ namespace std{ { self->pop_back(); } - - }; - + } }; } diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_map.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_map.i index 91756bec..3f197baa 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_map.i @@ -26,8 +26,14 @@ namespace std { 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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_pair.i index fe45ee67..732347db 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_pair.i @@ -18,12 +18,14 @@ namespace std { template struct pair { + typedef T first_type; + typedef U second_type; pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_string.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_string.i index bd5be0da..712c3bb7 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_string.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_string.i @@ -29,7 +29,6 @@ class wstring; /* Overloading check */ %typemap(in) string { - /* %typemap(in) string */ if (caml_ptr_check($input)) $1.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); else @@ -37,7 +36,6 @@ class wstring; } %typemap(in) const string & ($*1_ltype temp) { - /* %typemap(in) const string & */ if (caml_ptr_check($input)) { temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); $1 = &temp; @@ -47,7 +45,6 @@ class wstring; } %typemap(in) string & ($*1_ltype temp) { - /* %typemap(in) string & */ if (caml_ptr_check($input)) { temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); $1 = &temp; @@ -57,7 +54,6 @@ class wstring; } %typemap(in) string * ($*1_ltype *temp) { - /* %typemap(in) string * */ if (caml_ptr_check($input)) { temp = new $*1_ltype((char *)caml_ptr_val($input,0), caml_string_len($input)); $1 = temp; @@ -71,24 +67,26 @@ class wstring; } %typemap(argout) string & { - /* %typemap(argout) string & */ swig_result = caml_list_append(swig_result,caml_val_string_len((*$1).c_str(), (*$1).size())); } +%typemap(directorin) string { + swig_result = caml_val_string_len($1.c_str(), $1.size()); + args = caml_list_append(args, swig_result); +} + %typemap(directorout) string { - /* %typemap(directorout) string */ $result.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); } %typemap(out) string { - /* %typemap(out) string */ $result = caml_val_string_len($1.c_str(),$1.size()); } %typemap(out) string * { - /* %typemap(out) string * */ $result = caml_val_string_len((*$1).c_str(),(*$1).size()); } +%typemap(typecheck) string, const string & = char *; } #ifdef ENABLE_CHARPTR_ARRAY @@ -114,7 +112,7 @@ char **c_charptr_array( const std::vector &str_v ); let string_array_to_vector sa = let nv = _new_StringVector C_void in - array_to_vector nv (fun x -> C_string x) sa ; nv + ignore (array_to_vector nv (fun x -> C_string x) sa) ; nv let c_string_array ar = _c_charptr_array (string_array_to_vector ar) diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_vector.i index 53d10744..891d038c 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/std_vector.i @@ -41,9 +41,18 @@ 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(unsigned int size = 0); vector(unsigned int size, const T& value); - vector(const vector&); + vector(const vector& other); + unsigned int size() const; bool empty() const; void clear(); @@ -71,7 +80,7 @@ namespace std { let array_to_vector v argcons array = for i = 0 to (Array.length array) - 1 do - (invoke v) "set" (C_list [ C_int i ; (argcons array.(i)) ]) + ignore ((invoke v) "set" (C_list [ C_int i ; (argcons array.(i)) ])) done ; v diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/stl.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/stl.i index 9d2e91ee..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/stl.i @@ -1,7 +1,5 @@ /* ----------------------------------------------------------------------------- * stl.i - * - * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ %include diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/swig.ml b/linx64/bin/swig/share/swig/4.0.0/ocaml/swig.ml index d0658e78..58a93347 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/swig.ml +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/swig.ml @@ -44,6 +44,13 @@ let _ = Callback.register "swig_runmethod" invoke let fnhelper arg = match arg with C_list l -> l | C_void -> [] | _ -> [ arg ] +let director_core_helper fnargs = + try + match List.hd fnargs with + | C_director_core (o,r) -> fnargs + | _ -> C_void :: fnargs + with Failure _ -> C_void :: fnargs + let rec get_int x = match x with C_bool b -> if b then 1 else 0 @@ -155,5 +162,5 @@ let _ = Callback.register "swig_set_type_info" set_type_info let class_master_list = Hashtbl.create 20 let register_class_byname nm co = Hashtbl.replace class_master_list nm (Obj.magic co) -let create_class nm arg = +let create_class nm = try (Obj.magic (Hashtbl.find class_master_list nm)) with _ -> raise (NoSuchClass nm) diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/swig.mli b/linx64/bin/swig/share/swig/4.0.0/ocaml/swig.mli index 3207b9e7..c5ffadb1 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/swig.mli +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/swig.mli @@ -30,6 +30,7 @@ exception NoSuchClass of string val invoke : ('a c_obj_t) -> (string -> 'a c_obj_t -> 'a c_obj_t) val fnhelper : 'a c_obj_t -> 'a c_obj_t list +val director_core_helper : 'a c_obj_t list -> 'a c_obj_t list val get_int : 'a c_obj_t -> int val get_float : 'a c_obj_t -> float diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/typecheck.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/typecheck.i index a13e1552..0c0a600a 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/typecheck.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/typecheck.i @@ -4,7 +4,7 @@ * Typechecking rules * ----------------------------------------------------------------------------- */ -%typecheck(SWIG_TYPECHECK_INTEGER) char, signed char, const char &, const signed char & { +%typecheck(SWIG_TYPECHECK_INT8) char, signed char, const char &, const signed char & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { @@ -14,7 +14,7 @@ } } -%typecheck(SWIG_TYPECHECK_INTEGER) unsigned char, const unsigned char & { +%typecheck(SWIG_TYPECHECK_UINT8) unsigned char, const unsigned char & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { @@ -24,7 +24,7 @@ } } -%typecheck(SWIG_TYPECHECK_INTEGER) short, signed short, const short &, const signed short &, wchar_t { +%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) ) { @@ -34,7 +34,7 @@ } } -%typecheck(SWIG_TYPECHECK_INTEGER) unsigned short, const unsigned short & { +%typecheck(SWIG_TYPECHECK_UINT16) unsigned short, const unsigned short & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { @@ -47,7 +47,7 @@ // XXX arty // Will move enum SWIGTYPE later when I figure out what to do with it... -%typecheck(SWIG_TYPECHECK_INTEGER) int, signed int, const int &, const signed int &, enum SWIGTYPE { +%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) ) { @@ -57,7 +57,7 @@ } } -%typecheck(SWIG_TYPECHECK_INTEGER) unsigned int, const unsigned int & { +%typecheck(SWIG_TYPECHECK_UINT32) unsigned int, const unsigned int & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { @@ -68,7 +68,13 @@ } } -%typecheck(SWIG_TYPECHECK_INTEGER) long, signed long, unsigned long, long long, signed long long, unsigned long long, const long &, const signed long &, const unsigned long &, const long long &, const signed long long &, const unsigned long long & { +%typecheck(SWIG_TYPECHECK_INT64) + long, signed long, unsigned long, + long long, signed long long, unsigned long long, + const long &, const signed long &, const unsigned long &, + const long long &, const signed long long &, const unsigned long long &, + size_t, const size_t & +{ if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { @@ -78,7 +84,7 @@ } } -%typecheck(SWIG_TYPECHECK_INTEGER) bool, oc_bool, BOOL, const bool &, const oc_bool &, const BOOL & { +%typecheck(SWIG_TYPECHECK_BOOL) bool, const bool & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { @@ -88,7 +94,7 @@ } } -%typecheck(SWIG_TYPECHECK_DOUBLE) float, const float & { +%typecheck(SWIG_TYPECHECK_FLOAT) float, const float & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { @@ -130,24 +136,42 @@ } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { - void *ptr; - $1 = !caml_ptr_val_internal($input, &ptr,$descriptor); + if (!Is_block($input) || !(SWIG_Tag_val($input) == C_obj || SWIG_Tag_val($input) == C_ptr)) { + $1 = 0; + } else { + void *ptr; + $1 = !caml_ptr_val_internal($input, &ptr, $descriptor); + } } -#if 0 - %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - void *ptr; - $1 = !caml_ptr_val_internal($input, &ptr, $&1_descriptor); + swig_type_info *typeinfo; + if (!Is_block($input)) { + $1 = 0; + } else { + switch (SWIG_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)); + $1 = SWIG_TypeCheck("$1_type", typeinfo) != NULL; + break; + } + default: $1 = 0; break; + } + } } -#endif - %typecheck(SWIG_TYPECHECK_VOIDPTR) void * { void *ptr; $1 = !caml_ptr_val_internal($input, &ptr, 0); } +%typecheck(SWIG_TYPECHECK_SWIGOBJECT) CAML_VALUE "$1 = 1;" + /* ------------------------------------------------------------ * Exception handling * ------------------------------------------------------------ */ @@ -158,19 +182,16 @@ unsigned int, unsigned long, unsigned short { - SWIG_exception($1,"Thrown exception from C++ (int)"); + char error_msg[256]; + sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); + SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, error_msg); } -%typemap(throws) SWIGTYPE CLASS { - $&1_ltype temp = new $1_ltype($1); - SWIG_exception((int)temp,"Thrown exception from C++ (object)"); -} - -%typemap(throws) SWIGTYPE { +%typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] { (void)$1; - SWIG_exception(0,"Thrown exception from C++ (unknown)"); + SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, "C++ $1_type exception thrown"); } %typemap(throws) char * { - SWIG_exception(0,$1); + SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, $1); } diff --git a/linx64/bin/swig/share/swig/4.0.0/ocaml/typemaps.i b/linx64/bin/swig/share/swig/4.0.0/ocaml/typemaps.i index b70b7892..23e2955f 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ocaml/typemaps.i +++ b/linx64/bin/swig/share/swig/4.0.0/ocaml/typemaps.i @@ -27,46 +27,37 @@ $result = caml_val_ptr($1,$descriptor); } -#ifdef __cplusplus +%typemap(in) char *& (char *temp) { + temp = (char*)caml_val_ptr($1,$descriptor); + $1 = &temp; +} + +%typemap(argout) char *& { + swig_result = caml_list_append(swig_result,caml_val_string_len(*$1, strlen(*$1))); +} %typemap(in) SWIGTYPE & { - /* %typemap(in) SWIGTYPE & */ $1 = ($ltype) caml_ptr_val($input,$1_descriptor); } %typemap(in) SWIGTYPE && { - /* %typemap(in) SWIGTYPE && */ $1 = ($ltype) caml_ptr_val($input,$1_descriptor); } %typemap(varin) SWIGTYPE & { - /* %typemap(varin) SWIGTYPE & */ $1 = *(($ltype) caml_ptr_val($input,$1_descriptor)); } %typemap(varin) SWIGTYPE && { - /* %typemap(varin) SWIGTYPE && */ $1 = *(($ltype) caml_ptr_val($input,$1_descriptor)); } -%typemap(out) SWIGTYPE & { - /* %typemap(out) SWIGTYPE & */ - CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - if( fromval ) { - $result = callback(*fromval,caml_val_ptr((void *) &$1,$1_descriptor)); - } else { - $result = caml_val_ptr ((void *) &$1,$1_descriptor); - } +%typemap(varout) SWIGTYPE &, SWIGTYPE && { + $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)&$1, $1_descriptor); } -%typemap(out) SWIGTYPE && { - /* %typemap(out) SWIGTYPE && */ - CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - if( fromval ) { - $result = callback(*fromval,caml_val_ptr((void *) &$1,$1_descriptor)); - } else { - $result = caml_val_ptr ((void *) &$1,$1_descriptor); - } +%typemap(out) SWIGTYPE &, SWIGTYPE && { + $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor); } #if 0 @@ -75,7 +66,7 @@ if( fromval ) { swig_result = caml_list_append(swig_result, - callback(*fromval,caml_val_ptr((void *) $1, + caml_callback(*fromval,caml_val_ptr((void *) $1, $1_descriptor))); } else { swig_result = @@ -88,7 +79,7 @@ if( fromval ) { swig_result = caml_list_append(swig_result, - callback(*fromval,caml_val_ptr((void *) $1, + caml_callback(*fromval,caml_val_ptr((void *) $1, $1_descriptor))); } else { swig_result = @@ -98,81 +89,61 @@ } #endif -%typemap(argout) const SWIGTYPE & { } -%typemap(argout) const SWIGTYPE && { } - %typemap(in) SWIGTYPE { $1 = *(($&1_ltype) caml_ptr_val($input,$&1_descriptor)) ; } +#ifdef __cplusplus + %typemap(out) SWIGTYPE { - /* %typemap(out) SWIGTYPE */ $&1_ltype temp = new $ltype((const $1_ltype &) $1); - CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - if( fromval ) { - $result = callback(*fromval,caml_val_ptr((void *)temp,$&1_descriptor)); - } else { - $result = caml_val_ptr ((void *)temp,$&1_descriptor); - } -} - -%typemap(in) char *& (char *temp) { - /* %typemap(in) char *& */ - temp = (char*)caml_val_ptr($1,$descriptor); - $1 = &temp; -} - -%typemap(argout) char *& { - /* %typemap(argout) char *& */ - swig_result = caml_list_append(swig_result,caml_val_string_len(*$1, strlen(*$1))); + $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)temp, $&1_descriptor); } #else -%typemap(in) SWIGTYPE { - $1 = *(($&1_ltype) caml_ptr_val($input,$&1_descriptor)) ; -} - %typemap(out) SWIGTYPE { - /* %typemap(out) SWIGTYPE */ void *temp = calloc(1,sizeof($ltype)); - CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - memmove( temp, &$1, sizeof( $1_type ) ); - if( fromval ) { - $result = callback(*fromval,caml_val_ptr((void *)temp,$&1_descriptor)); - } else { - $result = caml_val_ptr ((void *)temp,$&1_descriptor); - } + memmove(temp, &$1, sizeof($1_type)); + $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", temp, $&1_descriptor); } -%apply SWIGTYPE { const SWIGTYPE & }; -%apply SWIGTYPE { const SWIGTYPE && }; - #endif +%typemap(directorin) SWIGTYPE { + $<ype temp = new $ltype((const $ltype &)$1); + swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)temp, $&1_descriptor); + args = caml_list_append(args, swig_result); +} + +%typemap(directorin) SWIGTYPE *, SWIGTYPE [], SWIGTYPE &, SWIGTYPE && { + swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)&$1, $&1_descriptor); + args = caml_list_append(args, swig_result); +} + /* The SIMPLE_MAP macro below defines the whole set of typemaps needed for simple types. */ -%define SIMPLE_MAP(C_NAME, C_TO_MZ, MZ_TO_C) +%define SIMPLE_MAP(C_NAME, C_TO_OCAML, OCAML_TO_C) /* In */ %typemap(in) C_NAME { - $1 = MZ_TO_C($input); + $1 = OCAML_TO_C($input); } %typemap(varin) C_NAME { - $1 = MZ_TO_C($input); + $1 = OCAML_TO_C($input); } -%typemap(in) C_NAME & ($*1_ltype temp) { - temp = ($*1_ltype) MZ_TO_C($input); +%typemap(in) const C_NAME & ($*1_ltype temp) { + temp = ($*1_ltype) OCAML_TO_C($input); $1 = &temp; } -%typemap(varin) C_NAME & { - $1 = MZ_TO_C($input); +%typemap(varin) const C_NAME & { + $1 = OCAML_TO_C($input); } %typemap(directorout) C_NAME { - $1 = MZ_TO_C($input); + $1 = OCAML_TO_C($input); } %typemap(in) C_NAME *INPUT ($*1_ltype temp) { - temp = ($*1_ltype) MZ_TO_C($input); + temp = ($*1_ltype) OCAML_TO_C($input); $1 = &temp; } %typemap(in,numinputs=0) C_NAME *OUTPUT ($*1_ltype temp) { @@ -180,32 +151,26 @@ } /* Out */ %typemap(out) C_NAME { - $result = C_TO_MZ($1); + $result = C_TO_OCAML($1); } %typemap(varout) C_NAME { - $result = C_TO_MZ($1); + $result = C_TO_OCAML($1); } -%typemap(varout) C_NAME & { - /* %typemap(varout) C_NAME & (generic) */ - $result = C_TO_MZ($1); +%typemap(varout) const C_NAME & { + $result = C_TO_OCAML($1); } %typemap(argout) C_NAME *OUTPUT { - swig_result = caml_list_append(swig_result,C_TO_MZ((long)*$1)); + swig_result = caml_list_append(swig_result, C_TO_OCAML((long)*$1)); } -%typemap(out) C_NAME & { - /* %typemap(out) C_NAME & (generic) */ - $result = C_TO_MZ(*$1); -} -%typemap(argout) C_NAME & { - swig_result = caml_list_append(swig_result,C_TO_MZ((long)*$1)); +%typemap(out) const C_NAME & { + $result = C_TO_OCAML(*$1); } %typemap(directorin) C_NAME { - args = caml_list_append(args,C_TO_MZ($1)); + args = caml_list_append(args, C_TO_OCAML($1)); } %enddef SIMPLE_MAP(bool, caml_val_bool, caml_long_val); -SIMPLE_MAP(oc_bool, caml_val_bool, caml_long_val); SIMPLE_MAP(char, caml_val_char, caml_long_val); SIMPLE_MAP(signed char, caml_val_char, caml_long_val); SIMPLE_MAP(unsigned char, caml_val_uchar, caml_long_val); @@ -229,23 +194,8 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); /* Pass through value */ -%typemap (in) value,caml::value,CAML_VALUE "$1=$input;"; -%typemap (out) value,caml::value,CAML_VALUE "$result=$1;"; - -/* Arrays */ - -%typemap(in) ArrayCarrier * { - $1 = ($ltype)caml_ptr_val($input,$1_descriptor); -} - -%typemap(out) ArrayCarrier * { - CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - if( fromval ) { - $result = callback(*fromval,caml_val_ptr((void *)$1,$1_descriptor)); - } else { - $result = caml_val_ptr ((void *)$1,$1_descriptor); - } -} +%typemap (in) CAML_VALUE "$1=$input;"; +%typemap (out) CAML_VALUE "$result=$1;"; #if 0 %include @@ -255,15 +205,12 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); %define %char_ptr_in(how) %typemap(how) char *, signed char *, unsigned char * { - /* %typemap(how) char * ... */ $1 = ($ltype)caml_string_val($input); } /* Again work around the empty array bound bug */ %typemap(how) char [ANY], signed char [ANY], unsigned char [ANY] { - /* %typemap(how) char [ANY] ... */ char *temp = caml_string_val($input); strcpy((char *)$1,temp); - /* strncpy would be better but we might not have an array size */ } %enddef @@ -291,28 +238,20 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); %define %swigtype_ptr_in(how) %typemap(how) SWIGTYPE * { - /* %typemap(how) SWIGTYPE * */ $1 = ($ltype)caml_ptr_val($input,$1_descriptor); } %typemap(how) SWIGTYPE (CLASS::*) { - /* %typemap(how) SWIGTYPE (CLASS::*) */ void *v = caml_ptr_val($input,$1_descriptor); memcpy(& $1, &v, sizeof(v)); } %enddef -%define %swigtype_ptr_out(how) %typemap(out) SWIGTYPE * { - /* %typemap(how) SWIGTYPE *, SWIGTYPE (CLASS::*) */ - CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - if( fromval ) { - $result = callback(*fromval,caml_val_ptr((void *)$1,$1_descriptor)); - } else { - $result = caml_val_ptr ((void *)$1,$1_descriptor); - } + $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor); } + +%define %swigtype_ptr_out(how) %typemap(how) SWIGTYPE (CLASS::*) { - /* %typemap(how) SWIGTYPE *, SWIGTYPE (CLASS::*) */ void *v; memcpy(&v,& $1, sizeof(void *)); $result = caml_val_ptr (v,$1_descriptor); @@ -328,7 +267,7 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); %define %swigtype_array_fail(how,msg) %typemap(how) SWIGTYPE [] { - failwith(msg); + caml_failwith(msg); } %enddef @@ -350,7 +289,7 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); %define %swig_enum_out(how) %typemap(how) enum SWIGTYPE { - $result = callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"),*caml_named_value("$type_marker"),Val_int((int)$1)); + $result = caml_callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"),*caml_named_value("$type_marker"),Val_int((int)$1)); } %enddef @@ -361,6 +300,15 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); %swig_enum_out(varout) %swig_enum_out(directorin) +%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) { + $1 = ($1_ltype) caml_string_val($input); + $2 = ($2_ltype) caml_string_len($input); +} + +%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { + swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **)&$1); + $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, ty); +} /* Array reference typemaps */ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } diff --git a/linx64/bin/swig/share/swig/4.0.0/octave/octrun.swg b/linx64/bin/swig/share/swig/4.0.0/octave/octrun.swg index feed973c..ff614e68 100644 --- a/linx64/bin/swig/share/swig/4.0.0/octave/octrun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/octave/octrun.swg @@ -51,7 +51,7 @@ SWIGRUNTIME octave_value SWIG_Error(int code, const char *msg) { octave_value type(SWIG_ErrorType(code)); std::string r = msg; r += " (" + type.string_value() + ")"; - error(r.c_str()); + error("%s", r.c_str()); return octave_value(r); } @@ -840,7 +840,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); const std::string opname = std::string("__") + octave_base_value::get_umap_name(umap) + std::string("__"); octave_value ret; if (!dispatch_unary_op(opname, ret)) { - error((opname + std::string(" method not found")).c_str()); + error("%s", (opname + std::string(" method not found")).c_str()); return octave_value(); } return ret; @@ -1477,7 +1477,7 @@ SWIGRUNTIME int SWIG_Octave_ConvertPtrAndOwn(octave_value ov, void **ptr, swig_t (ov.is_matrix_type() && ov.rows() == 0 && ov.columns() == 0) ) { if (ptr) *ptr = 0; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } if (ov.type_id() != octave_swig_ref::static_type_id()) return SWIG_ERROR; diff --git a/linx64/bin/swig/share/swig/4.0.0/octave/std_deque.i b/linx64/bin/swig/share/swig/4.0.0/octave/std_deque.i index 6866a610..c40cfee1 100644 --- a/linx64/bin/swig/share/swig/4.0.0/octave/std_deque.i +++ b/linx64/bin/swig/share/swig/4.0.0/octave/std_deque.i @@ -12,7 +12,7 @@ template struct traits_from > { - static octave_value from(const std::deque & vec) { + static octave_value from(const std::deque& vec) { return traits_from_stdseq >::from(vec); } }; diff --git a/linx64/bin/swig/share/swig/4.0.0/octave/std_list.i b/linx64/bin/swig/share/swig/4.0.0/octave/std_list.i index 1421efae..35f6c132 100644 --- a/linx64/bin/swig/share/swig/4.0.0/octave/std_list.i +++ b/linx64/bin/swig/share/swig/4.0.0/octave/std_list.i @@ -12,7 +12,7 @@ template struct traits_from > { - static octave_value *from(const std::list & vec) { + static octave_value *from(const std::list& vec) { return traits_from_stdseq >::from(vec); } }; diff --git a/linx64/bin/swig/share/swig/4.0.0/octave/stl.i b/linx64/bin/swig/share/swig/4.0.0/octave/stl.i index b29f7d84..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/octave/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/octave/stl.i @@ -1,6 +1,10 @@ -/* initial STL definition. extended as needed in each language */ +/* ----------------------------------------------------------------------------- + * stl.i + * ----------------------------------------------------------------------------- */ + %include %include %include %include %include + diff --git a/linx64/bin/swig/share/swig/4.0.0/perl5/perlrun.swg b/linx64/bin/swig/share/swig/4.0.0/perl5/perlrun.swg index 02714c45..b04002f5 100644 --- a/linx64/bin/swig/share/swig/4.0.0/perl5/perlrun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/perl5/perlrun.swg @@ -277,7 +277,7 @@ SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_ voidptr = INT2PTR(void *,tmp); } else if (! SvOK(sv)) { /* Check for undef */ *(ptr) = (void *) 0; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ if (!SvROK(sv)) { /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */ diff --git a/linx64/bin/swig/share/swig/4.0.0/perl5/std_list.i b/linx64/bin/swig/share/swig/4.0.0/perl5/std_list.i index cd5a6112..36678add 100644 --- a/linx64/bin/swig/share/swig/4.0.0/perl5/std_list.i +++ b/linx64/bin/swig/share/swig/4.0.0/perl5/std_list.i @@ -189,11 +189,15 @@ namespace std { } 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; list(); - list(const list &); + list(const list& other); unsigned int size() const; bool empty() const; @@ -346,7 +350,7 @@ namespace std { typedef const value_type& const_reference; list(); - list(const list &); + list(const list& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/perl5/std_map.i b/linx64/bin/swig/share/swig/4.0.0/perl5/std_map.i index ae7c2660..1b373183 100644 --- a/linx64/bin/swig/share/swig/4.0.0/perl5/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/perl5/std_map.i @@ -27,8 +27,14 @@ namespace std { 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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/perl5/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/perl5/std_pair.i index 0712ad76..732347db 100644 --- a/linx64/bin/swig/share/swig/4.0.0/perl5/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/perl5/std_pair.i @@ -18,12 +18,14 @@ namespace std { template struct pair { + typedef T first_type; + typedef U second_type; pair(); - pair(T t, U u); - pair(const pair& p); + pair(T first, U second); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/perl5/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/perl5/std_vector.i index ec844946..5bfd2c5a 100644 --- a/linx64/bin/swig/share/swig/4.0.0/perl5/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/perl5/std_vector.i @@ -181,11 +181,16 @@ namespace std { } 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(unsigned int size = 0); vector(unsigned int size, const T& value); - vector(const vector &); + vector(const vector& other); unsigned int size() const; bool empty() const; @@ -353,11 +358,16 @@ namespace std { } public: typedef size_t size_type; - typedef T value_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(unsigned int size = 0); vector(unsigned int size, T *value); - vector(const vector &); + vector(const vector& other); unsigned int size() const; bool empty() const; @@ -524,11 +534,16 @@ namespace std { } 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(unsigned int size = 0); vector(unsigned int size, T value); - vector(const vector &); + vector(const vector& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/perl5/stl.i b/linx64/bin/swig/share/swig/4.0.0/perl5/stl.i index b19eae58..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/perl5/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/perl5/stl.i @@ -1,8 +1,7 @@ /* ----------------------------------------------------------------------------- * stl.i - * - * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ + %include %include %include diff --git a/linx64/bin/swig/share/swig/4.0.0/php/const.i b/linx64/bin/swig/share/swig/4.0.0/php/const.i index d62f162c..32b4b9b0 100644 --- a/linx64/bin/swig/share/swig/4.0.0/php/const.i +++ b/linx64/bin/swig/share/swig/4.0.0/php/const.i @@ -39,8 +39,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); - c.flags = CONST_CS; - c.module_number = module_number; + SWIG_ZEND_CONSTANT_SET_FLAGS(&c, CONST_CS, module_number); zend_register_constant(&c); } diff --git a/linx64/bin/swig/share/swig/4.0.0/php/globalvar.i b/linx64/bin/swig/share/swig/4.0.0/php/globalvar.i index a5fd779a..6b31207a 100644 --- a/linx64/bin/swig/share/swig/4.0.0/php/globalvar.i +++ b/linx64/bin/swig/share/swig/4.0.0/php/globalvar.i @@ -136,7 +136,7 @@ %typemap(varin) SWIGTYPE [] { - if($1) { + if ($1) { zval *z_var = zend_hash_str_find(&EG(symbol_table), "$1", sizeof("$1") - 1); SWIG_SetPointerZval(z_var, (void*)$1, $1_descriptor, $owner); } @@ -144,15 +144,15 @@ %typemap(varin) char [ANY] { - zval **z_var; - char *s1; + zval **z_var; + char *s1; - zend_hash_str_find(&EG(symbol_table), "$1", sizeof("$1") - 1, (void**)&z_var); - s1 = Z_STRVAL_P(z_var); - if ((s1 == NULL) || ($1 == NULL) || strcmp(s1, $1)) { - if (s1) - strncpy($1, s1, $1_dim0); - } + zend_hash_str_find(&EG(symbol_table), "$1", sizeof("$1") - 1, (void**)&z_var); + s1 = Z_STRVAL_P(z_var); + if ((s1 == NULL) || ($1 == NULL) || strcmp(s1, $1)) { + if (s1) + strncpy($1, s1, $1_dim0); + } } %typemap(varin) SWIGTYPE @@ -166,7 +166,6 @@ } $1 = *($&1_ltype)_temp; - } %typemap(varin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE && @@ -245,7 +244,7 @@ (z_var)->value.str.val = 0; (z_var)->value.str.len = 0; } - } + } } %typemap(varout) SWIGTYPE diff --git a/linx64/bin/swig/share/swig/4.0.0/php/php.swg b/linx64/bin/swig/share/swig/4.0.0/php/php.swg index 83f76217..4eba6be2 100644 --- a/linx64/bin/swig/share/swig/4.0.0/php/php.swg +++ b/linx64/bin/swig/share/swig/4.0.0/php/php.swg @@ -5,6 +5,7 @@ * ----------------------------------------------------------------------------- */ %runtime "swigrun.swg" // Common C API type-checking code +%runtime "swigerrors.swg" // SWIG errors %runtime "phprun.swg" // PHP runtime functions %include // PHP initialization routine. @@ -148,8 +149,8 @@ if (SWIG_ConvertPtr(&$input, (void **) &$1, 0, 0) < 0) { /* Allow NULL from php for void* */ if (Z_ISNULL($input)) $1=0; - else - SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor"); + else + SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor"); } %} @@ -470,30 +471,36 @@ %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { void *tmp; - _v = (SWIG_ConvertPtr(&$input, (void **)&tmp, $&1_descriptor, 0) >= 0); + $1 = (SWIG_ConvertPtr(&$input, (void **)&tmp, $&1_descriptor, SWIG_POINTER_NO_NULL) >= 0); } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [], - SWIGTYPE &, - SWIGTYPE &&, SWIGTYPE *const& { void *tmp; - _v = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, 0) >= 0); + $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, 0) >= 0); +} + +%typecheck(SWIG_TYPECHECK_POINTER) + SWIGTYPE &, + SWIGTYPE && +{ + void *tmp; + $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, SWIG_POINTER_NO_NULL) >= 0); } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const& { void *tmp; - _v = (SWIG_ConvertPtr(&$input, (void**)&tmp, $*1_descriptor, 0) >= 0); + $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, $*1_descriptor, 0) >= 0); } %typecheck(SWIG_TYPECHECK_VOIDPTR) void * { void *tmp; - _v = (SWIG_ConvertPtr(&$input, (void**)&tmp, 0, 0) >= 0); + $1 = (SWIG_ConvertPtr(&$input, (void**)&tmp, 0, 0) >= 0); } /* Exception handling */ diff --git a/linx64/bin/swig/share/swig/4.0.0/php/phpinit.swg b/linx64/bin/swig/share/swig/4.0.0/php/phpinit.swg index 1f252d1a..1665f5dc 100644 --- a/linx64/bin/swig/share/swig/4.0.0/php/phpinit.swg +++ b/linx64/bin/swig/share/swig/4.0.0/php/phpinit.swg @@ -1,13 +1,13 @@ /* ------------------------------------------------------------ - * The start of the PHP initialization function + * The start of the PHP initialization function * ------------------------------------------------------------ */ %insert(init) "swiginit.swg" %init %{ SWIG_php_minit { - SWIG_InitializeModule(0); + SWIG_InitializeModule((void*)&module_number); %} %fragment("swig_php_init_member_ptr2", "header") %{ @@ -21,5 +21,5 @@ static int swig_member_ptr = 0; %} %fragment("swig_php_init_member_ptr", "init", fragment="swig_php_init_member_ptr2") %{ - swig_member_ptr = zend_register_list_destructors_ex(swig_member_ptr_dtor, NULL, SWIG_MEMBER_PTR, module_number); + swig_member_ptr = zend_register_list_destructors_ex(swig_member_ptr_dtor, NULL, SWIG_MEMBER_PTR, module_number); %} diff --git a/linx64/bin/swig/share/swig/4.0.0/php/phprun.swg b/linx64/bin/swig/share/swig/4.0.0/php/phprun.swg index 3aa75ca1..a07a1b9f 100644 --- a/linx64/bin/swig/share/swig/4.0.0/php/phprun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/php/phprun.swg @@ -32,6 +32,13 @@ extern "C" { REGISTER_STRINGL_CONSTANT(#N, &swig_char, 1, CONST_CS | CONST_PERSISTENT);\ } while (0) +/* ZEND_CONSTANT_SET_FLAGS is 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 + #ifdef __cplusplus } #endif @@ -50,7 +57,7 @@ static int default_error_code = E_ERROR; /* Standard SWIG API */ #define SWIG_GetModule(clientdata) SWIG_Php_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_Php_SetModule(pointer) +#define SWIG_SetModule(clientdata, pointer) SWIG_Php_SetModule(pointer, *(int*)clientdata) /* used to wrap returned objects in so we know whether they are newobject and need freeing, or not */ @@ -217,13 +224,13 @@ SWIG_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags) { return (*ptr == NULL ? -1 : 0); case IS_NULL: *ptr = 0; - return 0; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } return -1; } -static char const_name[] = "swig_runtime_data_type_pointer"; +static const char const_name[] = "swig_runtime_data_type_pointer"; static swig_module_info *SWIG_Php_GetModule() { zval *pointer = zend_get_constant_str(const_name, sizeof(const_name) - 1); if (pointer) { @@ -234,6 +241,6 @@ static swig_module_info *SWIG_Php_GetModule() { return NULL; } -static void SWIG_Php_SetModule(swig_module_info *pointer) { - REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, CONST_PERSISTENT | CONST_CS); +static void SWIG_Php_SetModule(swig_module_info *pointer, int module_number) { + REGISTER_LONG_CONSTANT(const_name, (long) pointer, CONST_CS | CONST_PERSISTENT); } diff --git a/linx64/bin/swig/share/swig/4.0.0/php/std_map.i b/linx64/bin/swig/share/swig/4.0.0/php/std_map.i index 020c2015..7c015735 100644 --- a/linx64/bin/swig/share/swig/4.0.0/php/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/php/std_map.i @@ -27,8 +27,14 @@ namespace std { 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< K, T, C > &); + map(const map& other); unsigned int size() const; void clear(); diff --git a/linx64/bin/swig/share/swig/4.0.0/php/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/php/std_pair.i index fe45ee67..732347db 100644 --- a/linx64/bin/swig/share/swig/4.0.0/php/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/php/std_pair.i @@ -18,12 +18,14 @@ namespace std { template struct pair { + typedef T first_type; + typedef U second_type; pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/php/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/php/std_vector.i index 9cc1486e..e633bc3a 100644 --- a/linx64/bin/swig/share/swig/4.0.0/php/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/php/std_vector.i @@ -14,10 +14,17 @@ 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); @@ -56,10 +63,17 @@ namespace std { template<> 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); diff --git a/linx64/bin/swig/share/swig/4.0.0/php/stl.i b/linx64/bin/swig/share/swig/4.0.0/php/stl.i index 9d2e91ee..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/php/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/php/stl.i @@ -1,7 +1,5 @@ /* ----------------------------------------------------------------------------- * stl.i - * - * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ %include diff --git a/linx64/bin/swig/share/swig/4.0.0/php/utils.i b/linx64/bin/swig/share/swig/4.0.0/php/utils.i index 8581646a..ed6e08ff 100644 --- a/linx64/bin/swig/share/swig/4.0.0/php/utils.i +++ b/linx64/bin/swig/share/swig/4.0.0/php/utils.i @@ -77,18 +77,12 @@ %{ if (!EG(exception)) { CONVERT_IN($result, $1_ltype, *$input); - } else { - typedef $1_ltype swig_result_typedef; - $result = swig_result_typedef(); } %} %typemap(directorout) const TYPE & ($*1_ltype temp) %{ if (!EG(exception)) { CONVERT_IN(temp, $*1_ltype, *$input); - } else { - typedef $*1_ltype swig_result_typedef; - temp = swig_result_typedef(); } $result = &temp; %} diff --git a/linx64/bin/swig/share/swig/4.0.0/pike/pike.swg b/linx64/bin/swig/share/swig/4.0.0/pike/pike.swg deleted file mode 100644 index a36bf3ad..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/pike/pike.swg +++ /dev/null @@ -1,326 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pike.swg - * - * Pike configuration module. - * ----------------------------------------------------------------------------- */ - -%insert(runtime) "swigrun.swg"; // Common C API type-checking code -%insert(runtime) "pikerun.swg"; // Pike run-time code - -%insert(runtime) %{ -#ifdef __cplusplus -extern "C" { -#endif -#include -#include -#include -#ifdef __cplusplus -} -#endif -%} - -/* ----------------------------------------------------------------------------- - * standard typemaps - * ----------------------------------------------------------------------------- */ - -/* --- Input arguments --- */ - -/* Primitive datatypes. */ - -%typemap(in, pikedesc="tInt") - int, unsigned int, short, unsigned short, - long, unsigned long, char, signed char, unsigned char, - bool, enum SWIGTYPE, long long, unsigned long long -{ - if ($input.type != T_INT) - Pike_error("Bad argument: Expected an integer.\n"); - $1 = ($1_ltype) $input.u.integer; -} - -%typemap(in, pikedesc="tFloat") float, double { - if ($input.type != T_FLOAT) - Pike_error("Bad argument: Expected a float.\n"); - $1 = ($1_ltype) $input.u.float_number; -} - -%typemap(in, pikedesc="tStr") char *, char [ANY] { - if ($input.type != T_STRING) - Pike_error("Bad argument: Expected a string.\n"); - $1 = ($1_ltype) STR0($input.u.string); -} - -/* Pointers, references and arrays */ - -%typemap(in) SWIGTYPE *, - SWIGTYPE &, - SWIGTYPE &&, - SWIGTYPE [] - "SWIG_ConvertPtr($input.u.object, (void **) &$1, $1_descriptor, 1);" - -/* Void pointer. Accepts any kind of pointer */ -%typemap(in) void * "/* FIXME */"; - -/* Object passed by value. Convert to a pointer */ -%typemap(in) SWIGTYPE ($&1_ltype argp) "/* FIXME */"; - -/* Pointer to a class member */ -%typemap(in) SWIGTYPE (CLASS::*) "/* FIXME */"; - -/* Const primitive references. Passed by value */ - -%typemap(in, pikedesc="tInt") const int & (int temp), - const short & (short temp), - const long & (long temp), - const unsigned int & (unsigned int temp), - const unsigned short & (unsigned short temp), - const unsigned long & (unsigned long temp), - const char & (char temp), - const signed char & (signed char temp), - const unsigned char & (unsigned char temp), - const bool & (bool temp), - const long long & ($*1_ltype temp), - const unsigned long long & ($*1_ltype temp), - const enum SWIGTYPE & ($*1_ltype temp), - const enum SWIGTYPE && ($*1_ltype temp) -{ - if ($input.type != T_INT) - Pike_error("Bad argument: Expected an integer.\n"); - temp = ($*1_ltype) $input.u.integer; - $1 = &temp; -} - -%typemap(in, pikedesc="tFloat") const float & (float temp), - const double & (double temp) -{ - if ($input.type != T_FLOAT) - Pike_error("Bad argument: Expected a float.\n"); - temp = ($*1_ltype) $input.u.float_number; - $1 = &temp; -} - -/* ----------------------------------------------------------------------------- - * Output Typemaps - * ----------------------------------------------------------------------------- */ -%typemap(out, pikedesc="tInt") - int, unsigned int, - short, unsigned short, - long, unsigned long, - char, signed char, unsigned char, - bool, enum SWIGTYPE - "push_int($1);"; - -%typemap(out, pikedesc="tInt") long long "push_int64($1);"; -%typemap(out, pikedesc="tInt") unsigned long long "push_int64($1);"; -%typemap(out, pikedesc="tFloat") float, double "push_float($1);"; -%typemap(out, pikedesc="tStr") char * "push_text($1);"; - -/* Pointers, references, and arrays */ -%typemap(out, pikedesc="tObj") SWIGTYPE*, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] "push_object(SWIG_NewPointerObj((void *) $1, $1_descriptor, $owner));"; - -/* Void return value; don't push anything */ -%typemap(out, pikedesc="tVoid") void ""; - -/* Dynamic casts */ - -%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC "/* FIXME */"; - -/* Member pointer */ -%typemap(out) SWIGTYPE (CLASS::*) "/* FIXME */"; - -/* Special typemap for character array return values */ -%typemap(out, pikedesc="tStr") char [ANY], const char [ANY] "push_text($1);"; - -/* Primitive types--return by value */ -%typemap(out, pikedesc="tObj") SWIGTYPE -#ifdef __cplusplus -{ - $&1_ltype resultptr; - resultptr = new $1_ltype((const $1_ltype &) $1); - push_object(SWIG_NewPointerObj((void *) resultptr, $&1_descriptor, 1)); -} -#else -{ - $&1_ltype resultptr; - resultptr = ($&1_ltype) malloc(sizeof($1_type)); - memmove(resultptr, &$1, sizeof($1_type)); - push_object(SWIG_NewPointerObj((void *) resultptr, $&1_descriptor, 1)); -} -#endif - -/* References to primitive types. Return by value */ - -%typemap(out, pikedesc="tInt") const int &, const unsigned int &, - const short &, const unsigned short &, - const long &, const unsigned long &, - const char &, const signed char &, const unsigned char &, - const bool &, - const long long &, const unsigned long long &, - const enum SWIGTYPE & ($*1_ltype temp), - const enum SWIGTYPE && ($*1_ltype temp) - "push_int(*($1));"; - -%typemap(out, pikedesc="tFloat") const float &, const double & "push_float(*($1));"; - -/************************ Constant Typemaps *****************************/ - -%typemap(constant) - int, unsigned int, - short, unsigned short, - long, unsigned long, - signed char, unsigned char, - bool, enum SWIGTYPE, - long long, unsigned long long - "add_integer_constant(\"$symname\", $1, 0);"; - -%typemap(constant) char - "add_integer_constant(\"$symname\", '$1', 0);"; - -%typemap(constant) long long, unsigned long long - "add_integer_constant(\"$symname\", $1, 0);"; - -%typemap(constant) float, double - "add_float_constant(\"$symname\", $1, 0);"; - -%typemap(constant) char * - "add_string_constant(\"$symname\", \"$1\", 0);"; - -/* ------------------------------------------------------------ - * String & length - * ------------------------------------------------------------ */ - -%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) { - if ($input.type != T_STRING) - Pike_error("Bad argument: Expected a string.\n"); - $1 = ($1_ltype) STR0($input.u.string); - $2 = ($2_ltype) $input.u.string->length; -} - -/* ------------------------------------------------------------ - * ANSI C typemaps - * ------------------------------------------------------------ */ - -%typemap(in, pikedesc="tInt") size_t { - if ($input.type != T_INT) - Pike_error("Bad argument: Expected an integer.\n"); - $1 = ($1_ltype) $input.u.integer; -} - -%typemap(out) size_t = long; - -/* ------------------------------------------------------------ - * Typechecking rules - * ------------------------------------------------------------ */ - -%typecheck(SWIG_TYPECHECK_INTEGER) - int, short, long, - unsigned int, unsigned short, unsigned long, - signed char, unsigned char, - long long, unsigned long long, - const int &, const short &, const long &, - const unsigned int &, const unsigned short &, const unsigned long &, - const long long &, const unsigned long long &, - enum SWIGTYPE, enum SWIGTYPE &, SWIGTYPE &&, - bool, const bool & -{ - $1 = ($input.type == T_INT) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_DOUBLE) - float, double, - const float &, const double & -{ - $1 = (($input.type == T_FLOAT) || ($input.type == T_INT)) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_CHAR) char { - $1 = ($input.type == T_INT) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_STRING) char * { - $1 = ($input.type == T_STRING) ? 1 : 0; -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] { - void *ptr; - if (SWIG_ConvertPtr($input.u.object, (void **) &ptr, $1_descriptor, 0) == -1) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { - void *ptr; - if (SWIG_ConvertPtr($input.u.object, (void **) &ptr, $&1_descriptor, 0) == -1) { - $1 = 0; - } else { - $1 = 1; - } -} - -%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { - void *ptr; - if (SWIG_ConvertPtr($input.u.object, (void **) &ptr, 0, 0) == -1) { - $1 = 0; - } else { - $1 = 1; - } -} - -/* Array reference typemaps */ -%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } -%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } - -/* const pointers */ -%apply SWIGTYPE * { SWIGTYPE *const } -%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) } -%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) } - -/* ------------------------------------------------------------ - * Overloaded operator support - * ------------------------------------------------------------ */ - -#ifdef __cplusplus -%rename("`+") *::operator+; -%rename("`-") *::operator-; -%rename("`*") *::operator*; -%rename("`/") *::operator/; -%rename("`%") *::operator%; -%rename("`<<") *::operator<<; -%rename("`>>") *::operator>>; -%rename("`&") *::operator&; -%rename("`|") *::operator|; -%rename("`^") *::operator^; -%rename("`~") *::operator~; -%rename("`<") *::operator<; -%rename("`>") *::operator>; -%rename("`==") *::operator==; - -/* Special cases */ -%rename("`()") *::operator(); - -#endif - -/* ------------------------------------------------------------ - * The start of the Pike initialization function - * ------------------------------------------------------------ */ - -%init "swiginit.swg" - -%init %{ -#ifdef __cplusplus -extern "C" -#endif -PIKE_MODULE_EXIT {} - -#ifdef __cplusplus -extern "C" -#endif -PIKE_MODULE_INIT -{ - struct program *pr; - SWIG_InitializeModule(0); -%} - -/* pike keywords */ -%include diff --git a/linx64/bin/swig/share/swig/4.0.0/pike/pikekw.swg b/linx64/bin/swig/share/swig/4.0.0/pike/pikekw.swg deleted file mode 100644 index 844b1f18..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/pike/pikekw.swg +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef PIKE_PIKEKW_SWG_ -#define PIKE_PIKEKW_SWG_ - -/* Warnings for Pike keywords */ -#define PIKEKW(x) %namewarn("314: '" #x "' is a pike keyword") #x - -/* - from - http://www.http://docs.linux.cz/pike/tutorial_C.html - -*/ - - -PIKEKW(array); -PIKEKW(break); -PIKEKW(case); -PIKEKW(catch); -PIKEKW(continue); -PIKEKW(default); -PIKEKW(do); -PIKEKW(else); -PIKEKW(float); -PIKEKW(for); -PIKEKW(foreach); -PIKEKW(function); -PIKEKW(gauge); -PIKEKW(if); -PIKEKW(inherit); -PIKEKW(inline); -PIKEKW(int); -PIKEKW(lambda); -PIKEKW(mapping); -PIKEKW(mixed); -PIKEKW(multiset); -PIKEKW(nomask); -PIKEKW(object); -PIKEKW(predef); -PIKEKW(private); -PIKEKW(program); -PIKEKW(protected); -PIKEKW(public); -PIKEKW(return); -PIKEKW(sscanf); -PIKEKW(static); -PIKEKW(string); -PIKEKW(switch); -PIKEKW(typeof); -PIKEKW(varargs); -PIKEKW(void); -PIKEKW(while); - - -#undef PIKEKW - -#endif //PIKE_PIKEKW_SWG_ diff --git a/linx64/bin/swig/share/swig/4.0.0/pike/pikerun.swg b/linx64/bin/swig/share/swig/4.0.0/pike/pikerun.swg deleted file mode 100644 index 6ec1143c..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/pike/pikerun.swg +++ /dev/null @@ -1,71 +0,0 @@ -/* ----------------------------------------------------------------------------- - * pikerun.swg - * - * This file contains the runtime support for Pike modules - * and includes code for managing global variables and pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif -#include "pike/object.h" -#include "pike/program.h" -#ifdef __cplusplus -} -#endif -#include - -/* Stores information about a wrapped object */ -typedef struct swig_object_wrapper { - void *self; - swig_type_info *type; -} swig_object_wrapper; - -#ifdef THIS -#undef THIS -#endif -#define THIS (((swig_object_wrapper *) Pike_fp->current_storage)->self) - -#define SWIG_ConvertPtr SWIG_Pike_ConvertPtr -#define SWIG_NewPointerObj SWIG_Pike_NewPointerObj -#define SWIG_GetModule(clientdata) SWIG_Pike_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Pike_SetModule(pointer) - -/* These need to be filled in before type sharing between modules will work */ -static swig_module_info *SWIG_Pike_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - return 0; -} - -static void SWIG_Pike_SetModule(swig_module_info *pointer) { - -} - -/* Convert a pointer value */ -static int -SWIG_Pike_ConvertPtr(struct object *obj, void **ptr, swig_type_info *ty, int flags) { - struct program *pr; - swig_cast_info *tc; - swig_object_wrapper *obj_wrapper; - - if (ty) { - pr = (struct program *) ty->clientdata; - obj_wrapper = (swig_object_wrapper *) get_storage(obj, pr); - if (obj_wrapper && obj_wrapper->type) { - tc = SWIG_TypeCheckStruct(obj_wrapper->type, ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, obj_wrapper->self, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - return 0; - } - } - } - return -1; -} - -/* Create a new pointer object */ -static struct object * -SWIG_Pike_NewPointerObj(void *ptr, swig_type_info *type, int own) { - return 0; -} diff --git a/linx64/bin/swig/share/swig/4.0.0/pike/std_string.i b/linx64/bin/swig/share/swig/4.0.0/pike/std_string.i deleted file mode 100644 index b32b3c11..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/pike/std_string.i +++ /dev/null @@ -1,60 +0,0 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * SWIG typemaps for std::string - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -namespace std { - - %naturalvar string; - - class string; - - /* Overloading check */ - - %typemap(typecheck) string = char *; - %typemap(typecheck) const string & = char *; - - %typemap(in, pikedesc="tStr") string { - if ($input.type != T_STRING) - Pike_error("Bad argument: Expected a string.\n"); - $1.assign(STR0($input.u.string)); - } - - %typemap(in, pikedesc="tStr") const string & ($*1_ltype temp) { - if ($input.type != T_STRING) - Pike_error("Bad argument: Expected a string.\n"); - temp.assign(STR0($input.u.string)); - $1 = &temp; - } - - %typemap(out, pikedesc="tStr") string "push_text($1.c_str());"; - - %typemap(out, pikedesc="tStr") const string & "push_text($1->c_str());"; - - %typemap(directorin) string, const string &, string & "$1.c_str()"; - - %typemap(directorin) string *, const string * "$1->c_str()"; - - %typemap(directorout) string { - if ($input.type == T_STRING) - $result.assign(STR0($input.u.string)); - else - throw Swig::DirectorTypeMismatchException("string expected"); - } - - %typemap(directorout) const string & ($*1_ltype temp) { - if ($input.type == T_STRING) { - temp.assign(STR0($input.u.string)); - $result = &temp; - } else { - throw Swig::DirectorTypeMismatchException("string expected"); - } - } - -} - diff --git a/linx64/bin/swig/share/swig/4.0.0/python/pyapi.swg b/linx64/bin/swig/share/swig/4.0.0/python/pyapi.swg index 89f57fc8..19e6979b 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/pyapi.swg +++ b/linx64/bin/swig/share/swig/4.0.0/python/pyapi.swg @@ -24,20 +24,6 @@ typedef struct swig_const_info { swig_type_info **ptype; } swig_const_info; - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyInstanceMethod_New(func); -#else - return PyMethod_New(func, NULL, NULL); -#endif -} - #ifdef __cplusplus } #endif diff --git a/linx64/bin/swig/share/swig/4.0.0/python/pycontainer.swg b/linx64/bin/swig/share/swig/4.0.0/python/pycontainer.swg index 36557d75..ef2f725a 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/pycontainer.swg +++ b/linx64/bin/swig/share/swig/4.0.0/python/pycontainer.swg @@ -36,6 +36,48 @@ %include +%fragment("container_owner_attribute_init", "init") { + // thread safe initialization + swig::container_owner_attribute(); +} + +%fragment("reference_container_owner", "header", fragment="container_owner_attribute_init") { +namespace swig { + static PyObject* container_owner_attribute() { + static PyObject* attr = SWIG_Python_str_FromChar("__swig_container"); + return attr; + } + + template + struct container_owner { + // By default, do not add the back-reference (for value types) + // Specialization below will check the reference for pointer types. + static bool back_reference(PyObject* child, PyObject* owner) { + return false; + } + }; + + template <> + struct container_owner { + /* + * Call to add a back-reference to the owning object when returning a + * reference from a container. Will only set the reference if child + * is a SWIG wrapper object that does not own the pointer. + * + * returns whether the reference was set or not + */ + static bool back_reference(PyObject* child, PyObject* owner) { + SwigPyObject* swigThis = SWIG_Python_GetSwigThis(child); + if (swigThis && (swigThis->own & SWIG_POINTER_OWN) != SWIG_POINTER_OWN) { + PyObject_SetAttr(child, container_owner_attribute(), owner); + return true; + } + return false; + } + }; +} +} + %fragment(SWIG_Traits_frag(swig::SwigPtr_PyObject),"header",fragment="StdTraits") { namespace swig { template <> struct traits { @@ -766,6 +808,12 @@ namespace swig size_type __len__() const { return self->size(); } + + // Although __getitem__, front, back actually use a const value_type& return type, the typemaps below + // use non-const so that they can be easily overridden by users if necessary. + %typemap(ret, fragment="reference_container_owner", noblock=1) value_type& __getitem__, value_type& front, value_type& back { + (void)swig::container_owner::category>::back_reference($result, $self); + } } %enddef diff --git a/linx64/bin/swig/share/swig/4.0.0/python/pyinit.swg b/linx64/bin/swig/share/swig/4.0.0/python/pyinit.swg index 3409fbb4..dfbf40b3 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/pyinit.swg +++ b/linx64/bin/swig/share/swig/4.0.0/python/pyinit.swg @@ -8,6 +8,22 @@ %fragment(""); // For offsetof #endif +%insert(runtime) %{ +#ifdef __cplusplus +extern "C" { +#endif + +/* Method creation and docstring support functions */ + +SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name); +SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); +SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); + +#ifdef __cplusplus +} +#endif +%} + %init %{ #ifdef __cplusplus @@ -298,6 +314,64 @@ SWIG_Python_FixMethods(PyMethodDef *methods, } } +/* ----------------------------------------------------------------------------- + * Method creation and docstring support functions + * ----------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------------- + * Function to find the method definition with the correct docstring for the + * proxy module as opposed to the low-level API + * ----------------------------------------------------------------------------- */ + +SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) { + /* Find the function in the modified method table */ + size_t offset = 0; + int found = 0; + while (SwigMethods_proxydocs[offset].ml_meth != NULL) { + if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) { + found = 1; + break; + } + offset++; + } + /* Use the copy with the modified docstring if available */ + return found ? &SwigMethods_proxydocs[offset] : NULL; +} + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ + +SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { + if (PyCFunction_Check(func)) { + PyCFunctionObject *funcobj = (PyCFunctionObject *)func; + PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); + if (ml) + func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); + } +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return PyMethod_New(func, NULL, NULL); +#endif +} + +/* ----------------------------------------------------------------------------- + * Wrapper of PyStaticMethod_New() + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ + +SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { + if (PyCFunction_Check(func)) { + PyCFunctionObject *funcobj = (PyCFunctionObject *)func; + PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); + if (ml) + func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); + } + return PyStaticMethod_New(func); +} + #ifdef __cplusplus } #endif diff --git a/linx64/bin/swig/share/swig/4.0.0/python/pyrun.swg b/linx64/bin/swig/share/swig/4.0.0/python/pyrun.swg index 32ce2d92..ad1b8196 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/pyrun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/python/pyrun.swg @@ -1018,7 +1018,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int if (obj == Py_None && !implicit_conv) { if (ptr) *ptr = 0; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } res = SWIG_ERROR; @@ -1098,13 +1098,13 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } } } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; + if (!SWIG_IsOK(res) && obj == Py_None) { + if (ptr) + *ptr = 0; + if (PyErr_Occurred()) + PyErr_Clear(); + res = SWIG_OK; + } } } return res; @@ -1191,12 +1191,16 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) #if PY_VERSION_HEX >= 0x03000000 PyObject *empty_args = PyTuple_New(0); if (empty_args) { - inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, Py_None); - Py_DECREF(empty_args); - if (inst) { - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + PyObject *empty_kwargs = PyDict_New(); + if (empty_kwargs) { + inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs); + Py_DECREF(empty_kwargs); + if (inst) { + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + } } + Py_DECREF(empty_args); } #else PyObject *dict = PyDict_New(); diff --git a/linx64/bin/swig/share/swig/4.0.0/python/pythonkw.swg b/linx64/bin/swig/share/swig/4.0.0/python/pythonkw.swg index 1a4329d2..0138e40e 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/pythonkw.swg +++ b/linx64/bin/swig/share/swig/4.0.0/python/pythonkw.swg @@ -14,6 +14,8 @@ PYTHONKW(and); PYTHONKW(as); PYTHONKW(assert); +PYTHONKW(async); +PYTHONKW(await); PYTHONKW(break); PYTHONKW(class); PYTHONKW(continue); diff --git a/linx64/bin/swig/share/swig/4.0.0/python/std_deque.i b/linx64/bin/swig/share/swig/4.0.0/python/std_deque.i index b1937563..d9a17470 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/std_deque.i +++ b/linx64/bin/swig/share/swig/4.0.0/python/std_deque.i @@ -14,7 +14,7 @@ template struct traits_from > { - static PyObject *from(const std::deque & vec) { + static PyObject *from(const std::deque& vec) { return traits_from_stdseq >::from(vec); } }; diff --git a/linx64/bin/swig/share/swig/4.0.0/python/std_list.i b/linx64/bin/swig/share/swig/4.0.0/python/std_list.i index baf66d91..24d274b4 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/std_list.i +++ b/linx64/bin/swig/share/swig/4.0.0/python/std_list.i @@ -14,7 +14,7 @@ template struct traits_from > { - static PyObject *from(const std::list & vec) { + static PyObject *from(const std::list& vec) { return traits_from_stdseq >::from(vec); } }; diff --git a/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_map.i b/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_map.i index 79882b29..042d5b67 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_map.i @@ -56,26 +56,26 @@ %fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits") { namespace swig { - template + template inline void - assign(const SwigPySeq& swigpyseq, std::unordered_map *unordered_map) { - typedef typename std::unordered_map::value_type value_type; + 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) { + template + struct traits_reserve > { + static void reserve(std::unordered_map &seq, typename std::unordered_map::size_type n) { seq.reserve(n); } }; - template - struct traits_asptr > { - typedef std::unordered_map unordered_map_type; + template + struct traits_asptr > { + typedef std::unordered_map unordered_map_type; static int asptr(PyObject *obj, unordered_map_type **val) { int res = SWIG_ERROR; SWIG_PYTHON_THREAD_BEGIN_BLOCK; @@ -85,7 +85,7 @@ /* In Python 3.x the ".items()" method returns a dict_items object */ items = PySequence_Fast(items, ".items() didn't return a sequence!"); %#endif - res = traits_asptr_stdseq, std::pair >::asptr(items, val); + res = traits_asptr_stdseq, std::pair >::asptr(items, val); } else { unordered_map_type *p; swig_type_info *descriptor = swig::type_info(); @@ -97,9 +97,9 @@ } }; - template - struct traits_from > { - typedef std::unordered_map unordered_map_type; + template + struct traits_from > { + typedef std::unordered_map unordered_map_type; typedef typename unordered_map_type::const_iterator const_iterator; typedef typename unordered_map_type::size_type size_type; diff --git a/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_multimap.i b/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_multimap.i index aa29a7cf..28114044 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_multimap.i +++ b/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_multimap.i @@ -6,27 +6,27 @@ %fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits") { namespace swig { - template + template inline void - assign(const SwigPySeq& swigpyseq, std::unordered_multimap *unordered_multimap) { - typedef typename std::unordered_multimap::value_type value_type; + 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) { + template + struct traits_reserve > { + static void reserve(std::unordered_multimap &seq, typename std::unordered_multimap::size_type n) { seq.reserve(n); } }; - template - struct traits_asptr > { - typedef std::unordered_multimap unordered_multimap_type; - static int asptr(PyObject *obj, std::unordered_multimap **val) { + template + struct traits_asptr > { + typedef std::unordered_multimap unordered_multimap_type; + static int asptr(PyObject *obj, std::unordered_multimap **val) { int res = SWIG_ERROR; if (PyDict_Check(obj)) { SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL); @@ -34,7 +34,7 @@ /* In Python 3.x the ".items()" method returns a dict_items object */ items = PySequence_Fast(items, ".items() didn't return a sequence!"); %#endif - res = traits_asptr_stdseq, std::pair >::asptr(items, val); + res = traits_asptr_stdseq, std::pair >::asptr(items, val); } else { unordered_multimap_type *p; swig_type_info *descriptor = swig::type_info(); @@ -45,9 +45,9 @@ } }; - template - struct traits_from > { - typedef std::unordered_multimap unordered_multimap_type; + template + struct traits_from > { + typedef std::unordered_multimap unordered_multimap_type; typedef typename unordered_multimap_type::const_iterator const_iterator; typedef typename unordered_multimap_type::size_type size_type; diff --git a/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_multiset.i b/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_multiset.i index d90a97bd..b0f3f096 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_multiset.i +++ b/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_multiset.i @@ -7,9 +7,9 @@ %fragment("StdUnorderedMultisetTraits","header",fragment="StdSequenceTraits") %{ namespace swig { - template + template inline void - assign(const SwigPySeq& swigpyseq, std::unordered_multiset* seq) { + 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(); @@ -18,24 +18,24 @@ } } - template - struct traits_reserve > { - static void reserve(std::unordered_multiset &seq, typename std::unordered_multiset::size_type n) { + template + struct traits_reserve > { + static void reserve(std::unordered_multiset &seq, typename std::unordered_multiset::size_type n) { seq.reserve(n); } }; - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::unordered_multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); + template + struct traits_asptr > { + static int asptr(PyObject *obj, std::unordered_multiset **m) { + return traits_asptr_stdseq >::asptr(obj, m); } }; - template - struct traits_from > { - static PyObject *from(const std::unordered_multiset& vec) { - return traits_from_stdseq >::from(vec); + template + struct traits_from > { + static PyObject *from(const std::unordered_multiset& vec) { + return traits_from_stdseq >::from(vec); } }; } diff --git a/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_set.i b/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_set.i index 8736cb1b..79fca6c2 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_set.i +++ b/linx64/bin/swig/share/swig/4.0.0/python/std_unordered_set.i @@ -5,9 +5,9 @@ %fragment("StdUnorderedSetTraits","header",fragment="StdSequenceTraits") %{ namespace swig { - template + template inline void - assign(const SwigPySeq& swigpyseq, std::unordered_set* seq) { + 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(); @@ -16,24 +16,24 @@ } } - template - struct traits_reserve > { - static void reserve(std::unordered_set &seq, typename std::unordered_set::size_type n) { + template + struct traits_reserve > { + static void reserve(std::unordered_set &seq, typename std::unordered_set::size_type n) { seq.reserve(n); } }; - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::unordered_set **s) { - return traits_asptr_stdseq >::asptr(obj, s); + template + struct traits_asptr > { + static int asptr(PyObject *obj, std::unordered_set **s) { + return traits_asptr_stdseq >::asptr(obj, s); } }; - template - struct traits_from > { - static PyObject *from(const std::unordered_set& vec) { - return traits_from_stdseq >::from(vec); + template + struct traits_from > { + static PyObject *from(const std::unordered_set& vec) { + return traits_from_stdseq >::from(vec); } }; } diff --git a/linx64/bin/swig/share/swig/4.0.0/python/stl.i b/linx64/bin/swig/share/swig/4.0.0/python/stl.i index a3566db5..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/python/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/python/stl.i @@ -1,4 +1,7 @@ -/* initial STL definition. extended as needed in each language */ +/* ----------------------------------------------------------------------------- + * stl.i + * ----------------------------------------------------------------------------- */ + %include %include %include diff --git a/linx64/bin/swig/share/swig/4.0.0/r/r.swg b/linx64/bin/swig/share/swig/4.0.0/r/r.swg index cf1cfc8f..8cf8cdf5 100644 --- a/linx64/bin/swig/share/swig/4.0.0/r/r.swg +++ b/linx64/bin/swig/share/swig/4.0.0/r/r.swg @@ -3,9 +3,9 @@ %insert("header") "swiglabels.swg" -%insert("header") "swigerrors.swg" %insert("init") "swiginit.swg" %insert("runtime") "swigrun.swg" +%insert("runtime") "swigerrors.swg" %insert("runtime") "rrun.swg" %init %{ @@ -192,6 +192,11 @@ unsigned char *OUTPUT free($1); } +%typemap(in) const enum SWIGTYPE & ($*1_ltype temp) +%{ temp = ($*1_ltype)INTEGER($input)[0]; + $1 = &temp; %} + +%typemap(out) const enum SWIGTYPE & %{ $result = Rf_ScalarInteger((int)*$1); %} %typemap(memberin) char[] %{ if ($input) strcpy($1, $input); diff --git a/linx64/bin/swig/share/swig/4.0.0/r/rrun.swg b/linx64/bin/swig/share/swig/4.0.0/r/rrun.swg index 8067f0a1..c341321a 100644 --- a/linx64/bin/swig/share/swig/4.0.0/r/rrun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/r/rrun.swg @@ -278,7 +278,7 @@ SWIG_R_ConvertPtr(SEXP obj, void **ptr, swig_type_info *ty, int flags) { if (!obj) return SWIG_ERROR; if (obj == R_NilValue) { if (ptr) *ptr = NULL; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } vptr = R_ExternalPtrAddr(obj); diff --git a/linx64/bin/swig/share/swig/4.0.0/r/rtype.swg b/linx64/bin/swig/share/swig/4.0.0/r/rtype.swg index c55c7037..bdc48c24 100644 --- a/linx64/bin/swig/share/swig/4.0.0/r/rtype.swg +++ b/linx64/bin/swig/share/swig/4.0.0/r/rtype.swg @@ -16,6 +16,7 @@ %typemap("rtype") enum SWIGTYPE * "character"; %typemap("rtype") enum SWIGTYPE *const "character"; %typemap("rtype") enum SWIGTYPE & "character"; +%typemap("rtype") const enum SWIGTYPE & "character"; %typemap("rtype") enum SWIGTYPE && "character"; %typemap("rtype") SWIGTYPE * "$R_class"; %typemap("rtype") SWIGTYPE *const "$R_class"; @@ -86,9 +87,7 @@ %typemap(scoercein) enum SWIGTYPE %{ $input = enumToInteger($input, "$R_class"); %} %typemap(scoercein) enum SWIGTYPE & - %{ $input = enumToInteger($input, "$R_class"); %} -%typemap(scoercein) enum SWIGTYPE && - %{ $input = enumToInteger($input, "$R_class"); %} + %{ $input = enumToInteger($input, "$*R_class"); %} %typemap(scoercein) enum SWIGTYPE * %{ $input = enumToInteger($input, "$R_class"); %} %typemap(scoercein) enum SWIGTYPE *const @@ -138,7 +137,7 @@ string &, std::string & %{ $result = enumFromInteger($result, "$R_class"); %} %typemap(scoerceout) enum SWIGTYPE & - %{ $result = enumFromInteger($result, "$R_class"); %} + %{ $result = enumFromInteger($result, "$*R_class"); %} %typemap(scoerceout) enum SWIGTYPE && %{ $result = enumFromInteger($result, "$R_class"); %} diff --git a/linx64/bin/swig/share/swig/4.0.0/r/srun.swg b/linx64/bin/swig/share/swig/4.0.0/r/srun.swg index d07218a7..2e8eda11 100644 --- a/linx64/bin/swig/share/swig/4.0.0/r/srun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/r/srun.swg @@ -73,7 +73,7 @@ function(name, .values, where = topenv(parent.frame()), suffix = "Value") { # Mirror the class definitions via the E analogous to .__C__ defName = paste(".__E__", name, sep = "") - assign(defName, .values, envir = where) + delayedAssign(defName, .values, assign.env = where) if(nchar(suffix)) name = paste(name, suffix, sep = "") diff --git a/linx64/bin/swig/share/swig/4.0.0/r/stl.i b/linx64/bin/swig/share/swig/4.0.0/r/stl.i index 37e2ccbf..91da6a2b 100644 --- a/linx64/bin/swig/share/swig/4.0.0/r/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/r/stl.i @@ -1,10 +1,9 @@ -/* initial STL definition. extended as needed in each language */ -%include std_common.i -%include std_vector.i -%include std_pair.i -%include std_string.i - - - +/* ----------------------------------------------------------------------------- + * stl.i + * ----------------------------------------------------------------------------- */ +%include +%include +%include +%include diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/rubycontainer.swg b/linx64/bin/swig/share/swig/4.0.0/ruby/rubycontainer.swg index 4d0163f5..e8830a71 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/rubycontainer.swg +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/rubycontainer.swg @@ -943,7 +943,7 @@ namespace swig } } - catch( const std::invalid_argument & ) + catch(const std::invalid_argument &) { rb_raise( rb_eArgError, "%s", Ruby_Format_TypeError( "", @@ -970,7 +970,7 @@ namespace swig Sequence::value_type val = swig::as( elem ); $self->insert( start, val ); } - catch( const std::invalid_argument & ) + catch(const std::invalid_argument &) { rb_raise( rb_eArgError, "%s", Ruby_Format_TypeError( "", diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/rubycontainer_extended.swg b/linx64/bin/swig/share/swig/4.0.0/ruby/rubycontainer_extended.swg index 7514ba2c..663dddb8 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/rubycontainer_extended.swg +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/rubycontainer_extended.swg @@ -69,7 +69,7 @@ *i = swig::as< Type >( r ); } } - catch ( const std::invalid_argument& ) + catch (const std::invalid_argument&) { rb_raise(rb_eTypeError, "Yield block did not return a valid element for " "Container"); diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/rubyhead.swg b/linx64/bin/swig/share/swig/4.0.0/ruby/rubyhead.swg index 9960087c..90f07cf6 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/rubyhead.swg +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/rubyhead.swg @@ -91,6 +91,9 @@ #ifndef RSTRUCT_PTR # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr #endif +#ifndef RTYPEDDATA_P +# define RTYPEDDATA_P(x) (TYPE(x) != T_DATA) +#endif diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/rubyrun.swg b/linx64/bin/swig/share/swig/4.0.0/ruby/rubyrun.swg index 1afc5c1d..4b2ffe4b 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/rubyrun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/rubyrun.swg @@ -247,7 +247,7 @@ typedef struct { SWIGRUNTIME swig_ruby_owntype SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own) { swig_ruby_owntype oldown = {0, 0}; - if (TYPE(obj) == T_DATA) { + if (TYPE(obj) == T_DATA && !RTYPEDDATA_P(obj)) { oldown.datafree = RDATA(obj)->dfree; RDATA(obj)->dfree = own.datafree; } @@ -266,9 +266,9 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, if (NIL_P(obj)) { if (ptr) *ptr = 0; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } else { - if (TYPE(obj) != T_DATA) { + if (TYPE(obj) != T_DATA || (TYPE(obj) == T_DATA && RTYPEDDATA_P(obj))) { return SWIG_ERROR; } Data_Get_Struct(obj, void, vptr); diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/std_deque.i b/linx64/bin/swig/share/swig/4.0.0/ruby/std_deque.i index 38048aff..b70f34ee 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/std_deque.i +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/std_deque.i @@ -14,7 +14,7 @@ template struct traits_from > { - static VALUE from(const std::deque & vec) { + static VALUE from(const std::deque& vec) { return traits_from_stdseq >::from(vec); } }; diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/std_list.i b/linx64/bin/swig/share/swig/4.0.0/ruby/std_list.i index 5f179cc6..b0b4928e 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/std_list.i +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/std_list.i @@ -14,7 +14,7 @@ template struct traits_from > { - static VALUE from(const std::list & vec) { + static VALUE from(const std::list& vec) { return traits_from_stdseq >::from(vec); } }; diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/std_queue.i b/linx64/bin/swig/share/swig/4.0.0/ruby/std_queue.i index a1293677..2a16d9cf 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/std_queue.i +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/std_queue.i @@ -14,7 +14,7 @@ template struct traits_from > { - static VALUE from(const std::queue & vec) { + static VALUE from(const std::queue& vec) { return traits_from_stdseq >::from(vec); } }; diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/std_stack.i b/linx64/bin/swig/share/swig/4.0.0/ruby/std_stack.i index 600c81c9..7df48ef1 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/std_stack.i +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/std_stack.i @@ -14,7 +14,7 @@ template struct traits_from > { - static VALUE from(const std::stack & vec) { + static VALUE from(const std::stack& vec) { return traits_from_stdseq >::from(vec); } }; diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_map.i b/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_map.i index c3f60bbb..48c87521 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_map.i @@ -6,25 +6,25 @@ %fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits") { namespace swig { - template + template inline void - assign(const RubySeq& rubyseq, std::unordered_map *map) { - typedef typename std::unordered_map::value_type value_type; + assign(const RubySeq& rubyseq, std::unordered_map *map) { + typedef typename std::unordered_map::value_type value_type; typename RubySeq::const_iterator it = rubyseq.begin(); for (;it != rubyseq.end(); ++it) { map->insert(value_type(it->first, it->second)); } } - template - struct traits_asptr > { - typedef std::unordered_map map_type; + template + struct traits_asptr > { + typedef std::unordered_map map_type; static int asptr(VALUE obj, map_type **val) { int res = SWIG_ERROR; if (TYPE(obj) == T_HASH) { static ID id_to_a = rb_intern("to_a"); VALUE items = rb_funcall(obj, id_to_a, 0); - res = traits_asptr_stdseq, std::pair >::asptr(items, val); + res = traits_asptr_stdseq, std::pair >::asptr(items, val); } else { map_type *p; swig_type_info *descriptor = swig::type_info(); @@ -35,9 +35,9 @@ } }; - template - struct traits_from > { - typedef std::unordered_map map_type; + template + struct traits_from > { + typedef std::unordered_map map_type; typedef typename map_type::const_iterator const_iterator; typedef typename map_type::size_type size_type; diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_multimap.i b/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_multimap.i index b663c129..ebc53b59 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_multimap.i +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_multimap.i @@ -6,25 +6,25 @@ %fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits") { namespace swig { - template + template inline void - assign(const RubySeq& rubyseq, std::unordered_multimap *multimap) { - typedef typename std::unordered_multimap::value_type value_type; + assign(const RubySeq& rubyseq, std::unordered_multimap *multimap) { + typedef typename std::unordered_multimap::value_type value_type; typename RubySeq::const_iterator it = rubyseq.begin(); for (;it != rubyseq.end(); ++it) { multimap->insert(value_type(it->first, it->second)); } } - template - struct traits_asptr > { - typedef std::unordered_multimap multimap_type; - static int asptr(VALUE obj, std::unordered_multimap **val) { + template + struct traits_asptr > { + typedef std::unordered_multimap multimap_type; + static int asptr(VALUE obj, std::unordered_multimap **val) { int res = SWIG_ERROR; if ( TYPE(obj) == T_HASH ) { static ID id_to_a = rb_intern("to_a"); VALUE items = rb_funcall(obj, id_to_a, 0); - return traits_asptr_stdseq, std::pair >::asptr(items, val); + return traits_asptr_stdseq, std::pair >::asptr(items, val); } else { multimap_type *p; res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info(),0); @@ -34,9 +34,9 @@ } }; - template - struct traits_from > { - typedef std::unordered_multimap multimap_type; + template + struct traits_from > { + typedef std::unordered_multimap multimap_type; typedef typename multimap_type::const_iterator const_iterator; typedef typename multimap_type::size_type size_type; diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_multiset.i b/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_multiset.i index 181aa212..dae13eef 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_multiset.i +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_multiset.i @@ -7,9 +7,9 @@ %fragment("StdUnorderedMultisetTraits","header",fragment="StdUnorderedSetTraits") %{ namespace swig { - template + template inline void - assign(const RubySeq& rubyseq, std::unordered_multiset* seq) { + assign(const RubySeq& rubyseq, std::unordered_multiset* seq) { // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented typedef typename RubySeq::value_type value_type; typename RubySeq::const_iterator it = rubyseq.begin(); @@ -18,17 +18,17 @@ } } - template - struct traits_asptr > { - static int asptr(VALUE obj, std::unordered_multiset **m) { - return traits_asptr_stdseq >::asptr(obj, m); + template + struct traits_asptr > { + static int asptr(VALUE obj, std::unordered_multiset **m) { + return traits_asptr_stdseq >::asptr(obj, m); } }; - template - struct traits_from > { - static VALUE from(const std::unordered_multiset& vec) { - return traits_from_stdseq >::from(vec); + template + struct traits_from > { + static VALUE from(const std::unordered_multiset& vec) { + return traits_from_stdseq >::from(vec); } }; } diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_set.i b/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_set.i index 3d449435..e8e1b087 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_set.i +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/std_unordered_set.i @@ -7,9 +7,9 @@ %fragment("StdUnorderedSetTraits","header",fragment="",fragment="StdSetTraits") %{ namespace swig { - template + template inline void - assign(const RubySeq& rubyseq, std::unordered_set* seq) { + assign(const RubySeq& rubyseq, std::unordered_set* seq) { // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented typedef typename RubySeq::value_type value_type; typename RubySeq::const_iterator it = rubyseq.begin(); @@ -18,17 +18,17 @@ } } - template - struct traits_asptr > { - static int asptr(VALUE obj, std::unordered_set **s) { - return traits_asptr_stdseq >::asptr(obj, s); + template + struct traits_asptr > { + static int asptr(VALUE obj, std::unordered_set **s) { + return traits_asptr_stdseq >::asptr(obj, s); } }; - template - struct traits_from > { - static VALUE from(const std::unordered_set& vec) { - return traits_from_stdseq >::from(vec); + template + struct traits_from > { + static VALUE from(const std::unordered_set& vec) { + return traits_from_stdseq >::from(vec); } }; } diff --git a/linx64/bin/swig/share/swig/4.0.0/ruby/stl.i b/linx64/bin/swig/share/swig/4.0.0/ruby/stl.i index 9d2e91ee..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/ruby/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/ruby/stl.i @@ -1,7 +1,5 @@ /* ----------------------------------------------------------------------------- * stl.i - * - * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ %include diff --git a/linx64/bin/swig/share/swig/4.0.0/scilab/scirun.swg b/linx64/bin/swig/share/swig/4.0.0/scilab/scirun.swg index c1880d32..51df9a59 100644 --- a/linx64/bin/swig/share/swig/4.0.0/scilab/scirun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/scilab/scirun.swg @@ -303,7 +303,10 @@ SwigScilabPtrToObject(void *pvApiCtx, int iVar, void **pvObj, swig_type_info *de if (pvObj) { *pvObj = pvPtr; - return SWIG_OK; + if (pvPtr) + return SWIG_OK; + else + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } else { return SWIG_ERROR; diff --git a/linx64/bin/swig/share/swig/4.0.0/scilab/std_map.i b/linx64/bin/swig/share/swig/4.0.0/scilab/std_map.i index 0255e2f6..07eb63fd 100644 --- a/linx64/bin/swig/share/swig/4.0.0/scilab/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/scilab/std_map.i @@ -22,8 +22,18 @@ 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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/scilab/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/scilab/std_pair.i index 1448d652..39ef008d 100644 --- a/linx64/bin/swig/share/swig/4.0.0/scilab/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/scilab/std_pair.i @@ -18,12 +18,14 @@ namespace std { template struct pair { + typedef T first_type; + typedef U second_type; pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/scilab/stl.i b/linx64/bin/swig/share/swig/4.0.0/scilab/stl.i index b29f7d84..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/scilab/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/scilab/stl.i @@ -1,6 +1,10 @@ -/* initial STL definition. extended as needed in each language */ +/* ----------------------------------------------------------------------------- + * stl.i + * ----------------------------------------------------------------------------- */ + %include %include %include %include %include + diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_alloc.i b/linx64/bin/swig/share/swig/4.0.0/std/std_alloc.i index 44dc8dc3..e460dc3e 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_alloc.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_alloc.i @@ -31,9 +31,9 @@ namespace std allocator() throw(); - allocator(const allocator&) throw(); + allocator(const allocator& other) throw(); template - allocator(const allocator<_Tp1>&) throw(); + allocator(const allocator<_Tp1>& other) throw(); ~allocator() throw(); diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_array.i b/linx64/bin/swig/share/swig/4.0.0/std/std_array.i index aadc3b80..3f70ef57 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_array.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_array.i @@ -53,8 +53,8 @@ namespace std { typedef _Tp value_type; typedef value_type* pointer; typedef const value_type* const_pointer; - typedef _Tp& reference; - typedef const _Tp& const_reference; + typedef value_type& reference; + typedef const value_type& const_reference; %traits_swigtype(_Tp); %traits_enum(_Tp); diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_carray.swg b/linx64/bin/swig/share/swig/4.0.0/std/std_carray.swg index ebb20ce6..de2a0762 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_carray.swg +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_carray.swg @@ -28,8 +28,8 @@ namespace std { carray() { } - carray(const carray& c) { - std::copy(c.v, c.v + size(), v); + carray(const carray& other) { + std::copy(other.v, other.v + size(), v); } template diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_container.i b/linx64/bin/swig/share/swig/4.0.0/std/std_container.i index 000163f1..570dfde4 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_container.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_container.i @@ -11,7 +11,7 @@ %define %std_container_methods_non_resizable(container...) container(); - container(const container&); + container(const container& other); bool empty() const; size_type size() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_ios.i b/linx64/bin/swig/share/swig/4.0.0/std/std_ios.i index db83c7ab..7c62ed69 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_ios.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_ios.i @@ -153,10 +153,10 @@ namespace std { //50. Copy constructor and assignment operator of ios_base private: - ios_base(const ios_base&); + ios_base(const ios_base& other); ios_base& - operator=(const ios_base&); + operator=(const ios_base& other); }; template > @@ -242,10 +242,10 @@ namespace std { // 27.4.5.1 basic_ios constructors basic_ios(); private: - basic_ios(const basic_ios&); + basic_ios(const basic_ios& other); basic_ios& - operator=(const basic_ios&); + operator=(const basic_ios& other); }; } diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_iostream.i b/linx64/bin/swig/share/swig/4.0.0/std/std_iostream.i index 7a33afe3..38a22963 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_iostream.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_iostream.i @@ -306,15 +306,15 @@ namespace std template > std::basic_ostream<_CharT, _Traits>& - endl(std::basic_ostream<_CharT, _Traits>&); + endl(std::basic_ostream<_CharT, _Traits>& value); template > std::basic_ostream<_CharT, _Traits>& - ends(std::basic_ostream<_CharT, _Traits>&); + ends(std::basic_ostream<_CharT, _Traits>& value); template > std::basic_ostream<_CharT, _Traits>& - flush(std::basic_ostream<_CharT, _Traits>&); + flush(std::basic_ostream<_CharT, _Traits>& value); } namespace std { diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_list.i b/linx64/bin/swig/share/swig/4.0.0/std/std_list.i index ebbafa22..2cc2d97c 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_list.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_list.i @@ -106,8 +106,8 @@ namespace std { typedef _Tp* value_type; typedef value_type* pointer; typedef const value_type* const_pointer; - typedef value_type reference; - typedef value_type const_reference; + typedef value_type& reference; + typedef const value_type& const_reference; typedef _Alloc allocator_type; %traits_swigtype(_Tp); diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_map.i b/linx64/bin/swig/share/swig/4.0.0/std/std_map.i index 8043f924..62f5cb37 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_map.i @@ -74,7 +74,6 @@ namespace std { typedef _Key key_type; typedef _Tp mapped_type; typedef std::pair< const _Key, _Tp > value_type; - typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; @@ -113,7 +112,7 @@ namespace std { %typemap_traits_ptr(SWIG_TYPECHECK_MAP, std::map< _Key, _Tp, _Compare, _Alloc >); - map( const _Compare& ); + map(const _Compare& other); #ifdef %swig_map_methods // Add swig/language extra methods diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_multimap.i b/linx64/bin/swig/share/swig/4.0.0/std/std_multimap.i index 7aa94990..03e76534 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_multimap.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_multimap.i @@ -50,7 +50,6 @@ namespace std { typedef _Key key_type; typedef _Tp mapped_type; typedef std::pair< const _Key, _Tp > value_type; - typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; @@ -89,7 +88,7 @@ namespace std { %typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap< _Key, _Tp, _Compare, _Alloc >); - multimap( const _Compare& ); + multimap(const _Compare& other); #ifdef %swig_multimap_methods // Add swig/language extra methods diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_multiset.i b/linx64/bin/swig/share/swig/4.0.0/std/std_multiset.i index 1aa7ccce..a1d0db81 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_multiset.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_multiset.i @@ -71,7 +71,7 @@ namespace std { %typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset< _Key, _Compare, _Alloc >); - multiset( const _Compare& ); + multiset(const _Compare& other); #ifdef %swig_multiset_methods // Add swig/language extra methods diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/std/std_pair.i index 001cd673..800155f2 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_pair.i @@ -35,9 +35,9 @@ namespace std { pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair< U1, U2 > &p); + template pair(const pair< U1, U2 > &other); T first; U second; @@ -76,8 +76,8 @@ namespace std { %typemap_traits_ptr(SWIG_TYPECHECK_PAIR, std::pair< T, U* >); pair(); - pair(T __a, U* __b); - pair(const pair& __p); + pair(T first, U* second); + pair(const pair& other); T first; U* second; @@ -112,8 +112,8 @@ namespace std { %typemap_traits_ptr(SWIG_TYPECHECK_PAIR, std::pair< T*, U >); pair(); - pair(T* __a, U __b); - pair(const pair& __p); + pair(T* first, U second); + pair(const pair& other); T* first; U second; @@ -148,8 +148,8 @@ namespace std { %typemap_traits(SWIG_TYPECHECK_PAIR, std::pair< T*, U* >); pair(); - pair(T* __a, U* __b); - pair(const pair& __p); + pair(T* first, U* second); + pair(const pair& other); T* first; U* second; diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_queue.i b/linx64/bin/swig/share/swig/4.0.0/std/std_queue.i index b2c8d8d3..51bb0447 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_queue.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_queue.i @@ -13,14 +13,14 @@ %define %std_queue_methods(queue...) queue(); - queue( const _Sequence& ); + queue(const _Sequence& other); bool empty() const; size_type size() const; const value_type& front() const; const value_type& back() const; void pop(); - void push( const value_type& ); + void push(const value_type& value); %enddef %define %std_queue_methods_val(queue...) diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_set.i b/linx64/bin/swig/share/swig/4.0.0/std/std_set.i index 107a23c7..0e05aca4 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_set.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_set.i @@ -8,7 +8,7 @@ // Set %define %std_set_methods_common(set...) set(); - set( const set& ); + set(const set& other); bool empty() const; size_type size() const; @@ -110,7 +110,7 @@ namespace std { %typemap_traits_ptr(SWIG_TYPECHECK_SET, std::set< _Key, _Compare, _Alloc >); - set( const _Compare& ); + set(const _Compare& other); #ifdef %swig_set_methods // Add swig/language extra methods diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_stack.i b/linx64/bin/swig/share/swig/4.0.0/std/std_stack.i index 5b624b57..ff714d09 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_stack.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_stack.i @@ -13,13 +13,13 @@ %define %std_stack_methods(stack...) stack(); - stack( const _Sequence& ); + stack(const _Sequence& other); bool empty() const; size_type size() const; const value_type& top() const; void pop(); - void push( const value_type& ); + void push(const value_type& value); %enddef %define %std_stack_methods_val(stack...) diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_streambuf.i b/linx64/bin/swig/share/swig/4.0.0/std/std_streambuf.i index 7efb19c6..e1724913 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_streambuf.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_streambuf.i @@ -81,7 +81,7 @@ namespace std { basic_streambuf(); private: - basic_streambuf(const basic_streambuf&); + basic_streambuf(const basic_streambuf& other); }; } diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_map.i b/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_map.i index 0d698649..1fd1eb98 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_map.i @@ -71,11 +71,12 @@ namespace std { typedef _Key key_type; typedef _Tp mapped_type; typedef std::pair< const _Key, _Tp > value_type; - typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; + typedef _Hash hasher; + typedef _Compare key_equal; typedef _Alloc allocator_type; %traits_swigtype(_Key); diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_multimap.i b/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_multimap.i index 6f1be9cf..4be6aa49 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_multimap.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_multimap.i @@ -49,11 +49,12 @@ namespace std { typedef _Key key_type; typedef _Tp mapped_type; typedef std::pair< const _Key, _Tp > value_type; - typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; + typedef _Hash hasher; + typedef _Compare key_equal; typedef _Alloc allocator_type; %traits_swigtype(_Key); diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_multiset.i b/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_multiset.i index 1817fc24..2910fb6f 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_multiset.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_multiset.i @@ -17,19 +17,19 @@ // const declarations are used to guess the intent of the function being // exported; therefore, the following rationale is applied: // -// -- f(std::unordered_multiset), f(const std::unordered_multiset&): +// -- f(std::unordered_multiset), f(const std::unordered_multiset&): // the parameter being read-only, either a sequence or a -// previously wrapped std::unordered_multiset can be passed. -// -- f(std::unordered_multiset&), f(std::unordered_multiset*): +// previously wrapped std::unordered_multiset can be passed. +// -- f(std::unordered_multiset&), f(std::unordered_multiset*): // the parameter may be modified; therefore, only a wrapped std::unordered_multiset // can be passed. -// -- std::unordered_multiset f(), const std::unordered_multiset& f(): -// the set is returned by copy; therefore, a sequence of T:s +// -- std::unordered_multiset f(), const std::unordered_multiset& f(): +// the set is returned by copy; therefore, a sequence of Key:s // is returned which is most easily used in other functions -// -- std::unordered_multiset& f(), std::unordered_multiset* f(): +// -- std::unordered_multiset& f(), std::unordered_multiset* f(): // the set is returned by reference; therefore, a wrapped std::unordered_multiset // is returned -// -- const std::unordered_multiset* f(), f(const std::unordered_multiset*): +// -- const std::unordered_multiset* f(), f(const std::unordered_multiset*): // for consistency, they expect and return a plain set pointer. // ------------------------------------------------------------------------ @@ -40,9 +40,10 @@ namespace std { //unordered_multiset - template , + template , class _Compare = std::equal_to< _Key >, - class _Alloc = allocator< _Key > > + class _Alloc = allocator< _Key > > class unordered_multiset { public: typedef size_t size_type; @@ -53,6 +54,8 @@ namespace std { typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; + typedef _Hash hasher; + typedef _Compare key_equal; typedef _Alloc allocator_type; %traits_swigtype(_Key); diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_set.i b/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_set.i index 75e955c4..91e80742 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_set.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_unordered_set.i @@ -8,7 +8,7 @@ // Unordered Set %define %std_unordered_set_methods_common(unordered_set...) unordered_set(); - unordered_set( const unordered_set& ); + unordered_set(const unordered_set& other); bool empty() const; size_type size() const; @@ -50,19 +50,19 @@ // const declarations are used to guess the intent of the function being // exported; therefore, the following rationale is applied: // -// -- f(std::unordered_set), f(const std::unordered_set&): +// -- f(std::unordered_set), f(const std::unordered_set&): // the parameter being read-only, either a sequence or a -// previously wrapped std::unordered_set can be passed. -// -- f(std::unordered_set&), f(std::unordered_set*): +// previously wrapped std::unordered_set can be passed. +// -- f(std::unordered_set&), f(std::unordered_set*): // the parameter may be modified; therefore, only a wrapped std::unordered_set // can be passed. -// -- std::unordered_set f(), const std::unordered_set& f(): -// the unordered_set is returned by copy; therefore, a sequence of T:s +// -- std::unordered_set f(), const std::unordered_set& f(): +// the unordered_set is returned by copy; therefore, a sequence of Key:s // is returned which is most easily used in other functions -// -- std::unordered_set& f(), std::unordered_set* f(): +// -- std::unordered_set& f(), std::unordered_set* f(): // the unordered_set is returned by reference; therefore, a wrapped std::unordered_set // is returned -// -- const std::unordered_set* f(), f(const std::unordered_set*): +// -- const std::unordered_set* f(), f(const std::unordered_set*): // for consistency, they expect and return a plain unordered_set pointer. // ------------------------------------------------------------------------ @@ -74,20 +74,22 @@ namespace std { - template , + template , class _Compare = std::equal_to< _Key >, - class _Alloc = allocator< _Key > > + class _Alloc = allocator< _Key > > class unordered_set { public: typedef size_t size_type; typedef ptrdiff_t difference_type; - typedef _Hash hasher; typedef _Key value_type; typedef _Key key_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; + typedef _Hash hasher; + typedef _Compare key_equal; typedef _Alloc allocator_type; %traits_swigtype(_Key); diff --git a/linx64/bin/swig/share/swig/4.0.0/std/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/std/std_vector.i index fae759a3..b35f03be 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/std/std_vector.i @@ -64,8 +64,8 @@ namespace std { typedef _Tp value_type; typedef value_type* pointer; typedef const value_type* const_pointer; - typedef _Tp& reference; - typedef const _Tp& const_reference; + typedef value_type& reference; + typedef const value_type& const_reference; typedef _Alloc allocator_type; %traits_swigtype(_Tp); @@ -101,13 +101,13 @@ namespace std { template class vector< _Tp*, _Alloc > { public: - typedef size_t size_type; + typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Tp* value_type; typedef value_type* pointer; typedef const value_type* const_pointer; - typedef value_type reference; - typedef value_type const_reference; + typedef value_type& reference; + typedef const value_type& const_reference; typedef _Alloc allocator_type; %traits_swigtype(_Tp); @@ -141,13 +141,13 @@ namespace std { template class vector< _Tp const *, _Alloc > { public: - typedef size_t size_type; + typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Tp const * value_type; typedef value_type* pointer; typedef const value_type* const_pointer; - typedef value_type reference; - typedef value_type const_reference; + typedef value_type& reference; + typedef const value_type& const_reference; typedef _Alloc allocator_type; %traits_swigtype(_Tp); @@ -182,13 +182,13 @@ namespace std { template class vector { public: - typedef size_t size_type; + 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 value_type const_reference; + typedef value_type& reference; + typedef bool const_reference; typedef _Alloc allocator_type; %traits_swigtype(bool); diff --git a/linx64/bin/swig/share/swig/4.0.0/std_except.i b/linx64/bin/swig/share/swig/4.0.0/std_except.i index 50b5a88a..0f8b23e7 100644 --- a/linx64/bin/swig/share/swig/4.0.0/std_except.i +++ b/linx64/bin/swig/share/swig/4.0.0/std_except.i @@ -19,7 +19,7 @@ * a new std_except.i file in the target library directory. * ----------------------------------------------------------------------------- */ -#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGGUILE) || defined(SWIGUTL) || defined(SWIGD) +#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGGUILE) || defined(SWIGUTL) || defined(SWIGD) || defined(SWIGOCAML) #error "This version of std_except.i should not be used" #endif diff --git a/linx64/bin/swig/share/swig/4.0.0/swigfragments.swg b/linx64/bin/swig/share/swig/4.0.0/swigfragments.swg index 63bb6c8f..2cbef7cc 100644 --- a/linx64/bin/swig/share/swig/4.0.0/swigfragments.swg +++ b/linx64/bin/swig/share/swig/4.0.0/swigfragments.swg @@ -35,7 +35,7 @@ %fragment("", "header") %{ #include -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__BORLANDC__) || defined(_WATCOM) # ifndef snprintf # define snprintf _snprintf # endif diff --git a/linx64/bin/swig/share/swig/4.0.0/swiginit.swg b/linx64/bin/swig/share/swig/4.0.0/swiginit.swg index cb72c36e..33926b10 100644 --- a/linx64/bin/swig/share/swig/4.0.0/swiginit.swg +++ b/linx64/bin/swig/share/swig/4.0.0/swiginit.swg @@ -98,7 +98,7 @@ SWIG_InitializeModule(void *clientdata) { /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); + printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size); #endif for (i = 0; i < swig_module.size; ++i) { swig_type_info *type = 0; @@ -106,7 +106,7 @@ SWIG_InitializeModule(void *clientdata) { swig_cast_info *cast; #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); #endif /* if there is another module already loaded */ @@ -182,7 +182,7 @@ SWIG_InitializeModule(void *clientdata) { for (i = 0; i < swig_module.size; ++i) { int j = 0; swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); while (cast->type) { printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); cast++; diff --git a/linx64/bin/swig/share/swig/4.0.0/swigrun.swg b/linx64/bin/swig/share/swig/4.0.0/swigrun.swg index 1ef67618..59118eca 100644 --- a/linx64/bin/swig/share/swig/4.0.0/swigrun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/swigrun.swg @@ -43,6 +43,7 @@ /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 +#define SWIG_POINTER_NO_NULL 0x4 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 diff --git a/linx64/bin/swig/share/swig/4.0.0/swigwarn.swg b/linx64/bin/swig/share/swig/4.0.0/swigwarn.swg index 560448c1..ee3be116 100644 --- a/linx64/bin/swig/share/swig/4.0.0/swigwarn.swg +++ b/linx64/bin/swig/share/swig/4.0.0/swigwarn.swg @@ -1,4 +1,4 @@ -/* SWIG warning codes */ +/* SWIG warning codes - generated from swigwarn.h - do not edit */ %define SWIGWARN_NONE 0 %enddef @@ -186,6 +186,8 @@ %define SWIGWARN_LANG_ILLEGAL_DESTRUCTOR 521 %enddef %define SWIGWARN_LANG_EXTEND_CONSTRUCTOR 522 %enddef %define SWIGWARN_LANG_EXTEND_DESTRUCTOR 523 %enddef +%define SWIGWARN_LANG_EXPERIMENTAL 524 %enddef +%define SWIGWARN_LANG_DIRECTOR_FINAL 525 %enddef /* -- Doxygen comments -- */ diff --git a/linx64/bin/swig/share/swig/4.0.0/tcl/std_map.i b/linx64/bin/swig/share/swig/4.0.0/tcl/std_map.i index 96e7cae8..2c7f40ac 100644 --- a/linx64/bin/swig/share/swig/4.0.0/tcl/std_map.i +++ b/linx64/bin/swig/share/swig/4.0.0/tcl/std_map.i @@ -26,8 +26,14 @@ namespace std { 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< K, T, C > &); + map(const map& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/tcl/std_pair.i b/linx64/bin/swig/share/swig/4.0.0/tcl/std_pair.i index 1448d652..39ef008d 100644 --- a/linx64/bin/swig/share/swig/4.0.0/tcl/std_pair.i +++ b/linx64/bin/swig/share/swig/4.0.0/tcl/std_pair.i @@ -18,12 +18,14 @@ namespace std { template struct pair { + typedef T first_type; + typedef U second_type; pair(); pair(T first, U second); - pair(const pair& p); + pair(const pair& other); - template pair(const pair &p); + template pair(const pair &other); T first; U second; diff --git a/linx64/bin/swig/share/swig/4.0.0/tcl/std_vector.i b/linx64/bin/swig/share/swig/4.0.0/tcl/std_vector.i index 3fc0fd61..5fba5379 100644 --- a/linx64/bin/swig/share/swig/4.0.0/tcl/std_vector.i +++ b/linx64/bin/swig/share/swig/4.0.0/tcl/std_vector.i @@ -208,9 +208,17 @@ namespace std { } 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(unsigned int size = 0); vector(unsigned int size, const T& value); - vector(const vector< T > &); + vector(const vector& other); unsigned int size() const; bool empty() const; @@ -359,9 +367,17 @@ namespace std { } 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(unsigned int size = 0); vector(unsigned int size, const T& value); - vector(const vector< T > &); + vector(const vector& other); unsigned int size() const; bool empty() const; diff --git a/linx64/bin/swig/share/swig/4.0.0/tcl/stl.i b/linx64/bin/swig/share/swig/4.0.0/tcl/stl.i index 40c7584e..04f86014 100644 --- a/linx64/bin/swig/share/swig/4.0.0/tcl/stl.i +++ b/linx64/bin/swig/share/swig/4.0.0/tcl/stl.i @@ -2,7 +2,6 @@ * stl.i * ----------------------------------------------------------------------------- */ -/* initial STL definition. extended as needed in each language */ %include %include %include diff --git a/linx64/bin/swig/share/swig/4.0.0/tcl/tclrun.swg b/linx64/bin/swig/share/swig/4.0.0/tcl/tclrun.swg index 408ddac3..9010b9c8 100644 --- a/linx64/bin/swig/share/swig/4.0.0/tcl/tclrun.swg +++ b/linx64/bin/swig/share/swig/4.0.0/tcl/tclrun.swg @@ -125,7 +125,8 @@ SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swi /* Pointer values must start with leading underscore */ while (*c != '_') { *ptr = (void *) 0; - if (strcmp(c,"NULL") == 0) return SWIG_OK; + if (strcmp(c,"NULL") == 0) + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; /* Empty string: not a pointer */ if (*c == 0) return SWIG_ERROR; diff --git a/linx64/bin/swig/share/swig/4.0.0/typemaps/swigtype.swg b/linx64/bin/swig/share/swig/4.0.0/typemaps/swigtype.swg index 87fab7e6..581de1a9 100644 --- a/linx64/bin/swig/share/swig/4.0.0/typemaps/swigtype.swg +++ b/linx64/bin/swig/share/swig/4.0.0/typemaps/swigtype.swg @@ -358,46 +358,46 @@ %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE & { void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0); + int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL); $1 = SWIG_CheckState(res); } %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE && { void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0); + int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL); $1 = SWIG_CheckState(res); } #if defined(__cplusplus) && defined(%implicitconv_flag) %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1,implicitconv=1) const SWIGTYPE & { - int res = SWIG_ConvertPtr($input, 0, $descriptor, %implicitconv_flag); + int res = SWIG_ConvertPtr($input, 0, $descriptor, SWIG_POINTER_NO_NULL | %implicitconv_flag); $1 = SWIG_CheckState(res); } %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1,implicitconv=1) const SWIGTYPE && { - int res = SWIG_ConvertPtr($input, 0, $descriptor, %implicitconv_flag); + int res = SWIG_ConvertPtr($input, 0, $descriptor, SWIG_POINTER_NO_NULL | %implicitconv_flag); $1 = SWIG_CheckState(res); } %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1,implicitconv=1) SWIGTYPE { - int res = SWIG_ConvertPtr($input, 0, $&descriptor, %implicitconv_flag); + int res = SWIG_ConvertPtr($input, 0, $&descriptor, SWIG_POINTER_NO_NULL | %implicitconv_flag); $1 = SWIG_CheckState(res); } #else %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) const SWIGTYPE & { void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0); + int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL); $1 = SWIG_CheckState(res); } %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) const SWIGTYPE && { void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0); + int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL); $1 = SWIG_CheckState(res); } %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE { void *vptr = 0; - int res = SWIG_ConvertPtr($input, &vptr, $&descriptor, 0); + int res = SWIG_ConvertPtr($input, &vptr, $&descriptor, SWIG_POINTER_NO_NULL); $1 = SWIG_CheckState(res); } #endif diff --git a/linx64/bin/swig/share/swig/4.0.0/uffi/uffi.swg b/linx64/bin/swig/share/swig/4.0.0/uffi/uffi.swg deleted file mode 100644 index 41b08599..00000000 --- a/linx64/bin/swig/share/swig/4.0.0/uffi/uffi.swg +++ /dev/null @@ -1,101 +0,0 @@ -/* Define a C preprocessor symbol that can be used in interface files - to distinguish between the SWIG language modules. */ - -#define SWIG_UFFI - -/* Typespecs for basic types. */ - -%typemap(ffitype) char ":char"; -%typemap(ffitype) unsigned char ":unsigned-char"; -%typemap(ffitype) signed char ":char"; -%typemap(ffitype) short ":short"; -%typemap(ffitype) signed short ":short"; -%typemap(ffitype) unsigned short ":unsigned-short"; -%typemap(ffitype) int ":int"; -%typemap(ffitype) signed int ":int"; -%typemap(ffitype) unsigned int ":unsigned-int"; -%typemap(ffitype) long ":long"; -%typemap(ffitype) signed long ":long"; -%typemap(ffitype) unsigned long ":unsigned-long"; -%typemap(ffitype) float ":float"; -%typemap(ffitype) double ":double"; -%typemap(ffitype) char * ":cstring"; -%typemap(ffitype) void * ":pointer-void"; -%typemap(ffitype) void ":void"; - -// FIXME: This is guesswork -typedef long size_t; - -%wrapper %{ -(eval-when (compile eval) - -;;; You can define your own identifier converter if you want. -;;; Use the -identifier-converter command line argument to -;;; specify its name. - -(defun identifier-convert-null (id &key type) - (declare (ignore type)) - (read-from-string id)) - -(defun identifier-convert-lispify (cname &key type) - (assert (stringp cname)) - (if (eq type :constant) - (setf cname (format nil "*~A*" cname))) - (setf cname (replace-regexp cname "_" "-")) - (let ((lastcase :other) - newcase char res) - (dotimes (n (length cname)) - (setf char (schar cname n)) - (if* (alpha-char-p char) - then - (setf newcase (if (upper-case-p char) :upper :lower)) - - (when (or (and (eq lastcase :upper) (eq newcase :lower)) - (and (eq lastcase :lower) (eq newcase :upper))) - ;; case change... add a dash - (push #\- res) - (setf newcase :other)) - - (push (char-downcase char) res) - - (setf lastcase newcase) - - else - (push char res) - (setf lastcase :other))) - (read-from-string (coerce (nreverse res) 'string)))) - -(defun identifier-convert-low-level (cname &key type) - (assert (stringp cname)) - (if (eq type :constant) - (setf cname (format nil "+~A+" cname))) - (setf cname (substitute #\- #\_ cname)) - (if (eq type :operator) - (setf cname (format nil "%~A" cname))) - (if (eq type :constant-function) - nil) - (read-from-string cname)) - - - -(defmacro swig-defconstant (string value &key (export T)) - (let ((symbol (funcall *swig-identifier-converter* string :type :constant))) - `(eval-when (compile load eval) - (uffi:def-constant ,symbol ,value ,export)))) - -(defmacro swig-defun (name &rest rest) - (let ((symbol (funcall *swig-identifier-converter* name :type :operator))) - `(eval-when (compile load eval) - (uffi:def-function (,name ,symbol) ,@rest) - (export (quote ,symbol))))) - -(defmacro swig-def-struct (name &rest fields) - "Declare a struct object" - (let ((symbol (funcall *swig-identifier-converter* name :type :type))) - `(eval-when (compile load eval) - (uffi:def-struct ,symbol ,@fields) - (export (quote ,symbol))))) - - -) ;; eval-when -%} diff --git a/linx64/bin/swig/share/swig/4.0.0/windows.i b/linx64/bin/swig/share/swig/4.0.0/windows.i index 2c093dac..3e462619 100644 --- a/linx64/bin/swig/share/swig/4.0.0/windows.i +++ b/linx64/bin/swig/share/swig/4.0.0/windows.i @@ -112,6 +112,9 @@ typedef unsigned __int64 DWORD64, *PDWORD64; // Types from winnt.h typedef void *PVOID; typedef void *PVOID64; +#ifndef VOID +#define VOID void +#endif typedef char CHAR; typedef short SHORT; typedef long LONG; diff --git a/linx64/bin/swig/share/swig/4.0.0/xml/typemaps.i b/linx64/bin/swig/share/swig/4.0.0/xml/typemaps.i new file mode 100644 index 00000000..29736135 --- /dev/null +++ b/linx64/bin/swig/share/swig/4.0.0/xml/typemaps.i @@ -0,0 +1,3 @@ +// -------------------------------------------------------------------- +// Empty file for %include to work +// -------------------------------------------------------------------- diff --git a/linx64/bin/swig/share/swig/4.0.0/xml/xml.swg b/linx64/bin/swig/share/swig/4.0.0/xml/xml.swg new file mode 100644 index 00000000..c7bdbad0 --- /dev/null +++ b/linx64/bin/swig/share/swig/4.0.0/xml/xml.swg @@ -0,0 +1 @@ +/* nothing special */ \ No newline at end of file