1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
// ----------------------------------------------------------------------
// MATLAB.map
// Dave Beazley
// Copyright (C) 1997
// All Rights Reserved
//
// This file contains SWIG mappings for MATLAB cmex functions
// ----------------------------------------------------------------------
// ---------------------------- Function inputs -------------------------
%typemap(in) int SWIG_DEFAULT_TYPE,
short SWIG_DEFAULT_TYPE,
long SWIG_DEFAULT_TYPE,
unsigned int SWIG_DEFAULT_TYPE,
unsigned short SWIG_DEFAULT_TYPE,
unsigned long SWIG_DEFAULT_TYPE,
signed char SWIG_DEFAULT_TYPE,
unsigned char SWIG_DEFAULT_TYPE,
double SWIG_DEFAULT_TYPE,
float SWIG_DEFAULT_TYPE
{
int m,n;
double *p;
m = mxGetM($source);
n = mxGetN($source);
if (!mxIsNumeric($source) || mxIsComplex($source) ||
mxIsSparse($source) || !mxIsDouble($source) ||
!(m==1 && n==1)) {
mexErrMsgTxt("Argument must be a scalar\n");
}
p = mxGetPr($source);
$target = ($type) (*p);
}
%typemap(in) char * SWIG_DEFAULT_TYPE
{
int len,status;
len = (mxGetM($source)*mxGetN($source))+1;
$target = mxCalloc(len,sizeof(char));
status = mxGetString($source,$target,len);
if (status)
mexErrMsgTxt("Unable to convert string data");
}
%typemap(in) User * SWIG_DEFAULT_TYPE
{
int len, status;
char *ptr;
len = (mxGetM($source)*mxGetN($source))+1;
ptr = mxCalloc(len,sizeof(char));
status = mxGetString($source,ptr,len);
if (status)
mexErrMsgTxt("Unable to convert string data");
if (SWIG_GetPtr(ptr,(void **) &$target, "$mangle")) {
mexErrMsgTxt("Type error. Expected a $mangle");
}
}
%typemap(in) void * SWIG_DEFAULT_TYPE
{
int len, status;
char *ptr;
len = (mxGetM($source)*mxGetN($source))+1;
ptr = mxCalloc(len,sizeof(char));
status = mxGetString($source,ptr,len);
if (status)
mexErrMsgTxt("Unable to convert string data");
if (SWIG_GetPtr(ptr,(void **) &$target, 0)) {
mexErrMsgTxt("Type error. Expected a $mangle");
}
}
// ---------------------------- Function outputs -------------------------
%typemap(out) int SWIG_DEFAULT_TYPE,
short SWIG_DEFAULT_TYPE,
long SWIG_DEFAULT_TYPE,
unsigned int SWIG_DEFAULT_TYPE,
unsigned short SWIG_DEFAULT_TYPE,
unsigned long SWIG_DEFAULT_TYPE,
signed char SWIG_DEFAULT_TYPE,
unsigned char SWIG_DEFAULT_TYPE,
double SWIG_DEFAULT_TYPE,
float SWIG_DEFAULT_TYPE
{
double *p;
$target = mxCreateDoubleMatrix(1,1,mxREAL);
p = mxGetPr($target);
*p = (double) $source;
}
%typemap(out) char * SWIG_DEFAULT_TYPE
{
$target = mxCreateString($source);
}
%typemap(out) User * SWIG_DEFAULT_TYPE,
void * SWIG_DEFAULT_TYPE
{
char temp[64];
SWIG_MakePtr(temp,(void *) $source, "$mangle");
$target = mxCreateString(temp);
}
// ------------------------------ Constants -----------------------------
%typemap(const) int SWIG_DEFAULT_TYPE,
short SWIG_DEFAULT_TYPE,
long SWIG_DEFAULT_TYPE,
unsigned int SWIG_DEFAULT_TYPE,
unsigned short SWIG_DEFAULT_TYPE,
unsigned long SWIG_DEFAULT_TYPE,
signed char SWIG_DEFAULT_TYPE,
unsigned char SWIG_DEFAULT_TYPE,
double SWIG_DEFAULT_TYPE,
float SWIG_DEFAULT_TYPE
{
double *p;
mxArray *m = mxCreateDoubleMatrix(1,1,mxREAL);
p = mxGetPr(m);
*p = (double) $value;
mxSetName(m, "$target");
mexPutMatrix(m);
}
%typemap(const) char * SWIG_DEFAULT_TYPE
{
mxArray *m = mxCreateString("$value");
mxSetName(m,"$target");
mexPutMatrix(m);
}
%typemap(const) User * SWIG_DEFAULT_TYPE
{
char temp[80];
mxArray *m;
SWIG_MakePtr(temp,(void *) $value, "$mangle");
m = mxCreateString(temp);
mxSetName(m,"$target");
mexPutMatrix(m);
}
|