HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: //usr/share/swig4.0/octave/octtypemaps.swg
// Include fundamental fragment definitions
%include <typemaps/fragments.swg>

// Look for user fragments file.
%include <octfragments.swg>

// Octave fragments for primitive types
%include <octprimtypes.swg>

// Octave fragments for char* strings
//%include <octstrings.swg>


#ifndef SWIG_DIRECTOR_TYPEMAPS
#define SWIG_DIRECTOR_TYPEMAPS
#endif

// Octave types
#define SWIG_Object                      octave_value
#define VOID_Object                      octave_value()

/*
// Octave allows implicit conversion
#define %implicitconv_flag              $implicitconv 
*/

// append output
#define SWIG_AppendOutput(result, obj)  SWIG_Octave_AppendOutput(result, obj)

// set constant
#define SWIG_SetConstant(name, obj)     SWIG_Octave_SetConstant(module_ns,name,obj) 

// raise
%runtime %{
SWIGINTERN void SWIG_Octave_Raise(const octave_value &obj, const char *type) {
  if (obj.is_string())
    error("%s", obj.string_value().c_str());
  else
    error("C++ side threw an exception of type %s", type);
}
%}
#define SWIG_Raise(obj, type, desc)     SWIG_Octave_Raise(obj, type)

// Include the unified typemap library
%include <typemaps/swigtypemaps.swg>

%typecheck(SWIG_TYPECHECK_SWIGOBJECT) SWIG_Object "$1 = (*$input).is_defined();";
%typecheck(SWIG_TYPECHECK_SWIGOBJECT) octave_value_list "$1 = true;";

%typemap(in) (octave_value_list varargs,...) {
  for (int j=$argnum-1;j<args.length();++j)
    $1.append(args(j));
}
%typecheck(2000) (octave_value_list varargs,...) {
  $1=1;
}

%typemap(in) (const octave_value_list& varargs,...) (octave_value_list tmp) {
  for (int j=$argnum-1;j<args.length();++j)
    tmp.append(args(j));
  $1=&tmp;
}
%typecheck(2000) (const octave_value_list& varargs,...) {
  $1=1;
}

%typemap(out) octave_value_list {
  _outp->append($1);
}
%typemap(out,noblock=1) octave_map, Octave_map {
  $result=$1;
}
%typemap(out,noblock=1) NDArray {
  $result=$1;
}
%typemap(out,noblock=1) Cell {
  $result=$1;
}

/*
// Smart Pointers
%typemap(out,noblock=1) const SWIGTYPE & SMARTPOINTER  {
  $result = SWIG_NewPointerObj(%new_copy(*$1, $*ltype), $descriptor, SWIG_POINTER_OWN | %newpointer_flags);
}

%typemap(ret) const SWIGTYPE & SMARTPOINTER, SWIGTYPE SMARTPOINTER {
  octave_swig_type* lobj=Swig::swig_value_deref($result);
  if (lobj) {
    std::list<octave_value_list> idx;
    idx.push_back(octave_value("__deref__"));
    idx.push_back(octave_value_list());
    octave_value_list ovl(lobj->subsref(".(",idx));
    octave_swig_type* robj=ovl.length()>=1?Swig::swig_value_deref(ovl(0)):0;
    if (robj && !error_state)
      lobj->append(robj);
  }
}
*/