-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2,031 changed files
with
91,544 additions
and
172,172 deletions.
There are no files selected for viewing
File renamed without changes
File renamed without changes.
File renamed without changes.
106 changes: 53 additions & 53 deletions
106
...mport/SON/SON32/C_Sources/GetFilterMask.c → Import/SON/SON32/C_Sources/GetFilterMask.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,53 @@ | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include <windows.h> | ||
#include <matrix.h> | ||
#include "mex.h" | ||
#include "son.h" | ||
#include "machine.h" | ||
|
||
int GetFilterMask(mxArray *rhsptr, TpFilterMask pMask) | ||
|
||
{ | ||
mxArray *tmpPtr; | ||
int error; | ||
unsigned char *ptr; | ||
const int *empty[2]={0,0}; | ||
|
||
|
||
tmpPtr=mxGetField(rhsptr,0,"lFlags"); | ||
|
||
if ((tmpPtr==NULL) || mxGetClassID(tmpPtr) != mxINT32_CLASS){ | ||
mexPrintf("Bad Filter: lFlags missing or not int32 class\n"); | ||
error=1; | ||
} | ||
else { | ||
(*pMask).lFlags=mxGetScalar(tmpPtr); | ||
} | ||
|
||
tmpPtr=mxGetField(rhsptr,0,"aMask"); | ||
if (tmpPtr ==NULL){ | ||
mexPrintf("SONGetRealData Bad Filter: aMask missing\n"); | ||
error=1; | ||
} | ||
else { | ||
if ((mxGetM(tmpPtr)!=32) ||( mxGetN(tmpPtr)!=4)){ | ||
mexPrintf("SONGetRealData Bad Filter:" | ||
"aMask has wrong dimensions\n"); | ||
error=1; | ||
} | ||
if (mxGetClassID(tmpPtr) != mxUINT8_CLASS){ | ||
mexPrintf("SONGetRealData Bad Filter:" | ||
"aMask must be uint8 class\n"); | ||
error=1; | ||
} | ||
} | ||
if (error==1) | ||
return SON_BAD_PARAM; | ||
|
||
ptr=mxGetData(tmpPtr);// Mask | ||
|
||
memcpy((*pMask).aMask,ptr,sizeof((*pMask).aMask)); | ||
|
||
return 1; | ||
} | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include <windows.h> | ||
#include <matrix.h> | ||
#include "mex.h" | ||
#include "son.h" | ||
#include "machine.h" | ||
|
||
int GetFilterMask(mxArray *rhsptr, TpFilterMask pMask) | ||
|
||
{ | ||
mxArray *tmpPtr; | ||
int error; | ||
unsigned char *ptr; | ||
const int *empty[2]={0,0}; | ||
|
||
|
||
tmpPtr=mxGetField(rhsptr,0,"lFlags"); | ||
|
||
if ((tmpPtr==NULL) || mxGetClassID(tmpPtr) != mxINT32_CLASS){ | ||
mexPrintf("Bad Filter: lFlags missing or not int32 class\n"); | ||
error=1; | ||
} | ||
else { | ||
(*pMask).lFlags=mxGetScalar(tmpPtr); | ||
} | ||
|
||
tmpPtr=mxGetField(rhsptr,0,"aMask"); | ||
if (tmpPtr ==NULL){ | ||
mexPrintf("SONGetRealData Bad Filter: aMask missing\n"); | ||
error=1; | ||
} | ||
else { | ||
if ((mxGetM(tmpPtr)!=32) ||( mxGetN(tmpPtr)!=4)){ | ||
mexPrintf("SONGetRealData Bad Filter:" | ||
"aMask has wrong dimensions\n"); | ||
error=1; | ||
} | ||
if (mxGetClassID(tmpPtr) != mxUINT8_CLASS){ | ||
mexPrintf("SONGetRealData Bad Filter:" | ||
"aMask must be uint8 class\n"); | ||
error=1; | ||
} | ||
} | ||
if (error==1) | ||
return SON_BAD_PARAM; | ||
|
||
ptr=mxGetData(tmpPtr);// Mask | ||
|
||
memcpy((*pMask).aMask,ptr,sizeof((*pMask).aMask)); | ||
|
||
return 1; | ||
} |
142 changes: 71 additions & 71 deletions
142
src/Import/SON/SON32/C_Sources/SONAppID.c → Import/SON/SON32/C_Sources/SONAppID.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,71 @@ | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include <windows.h> | ||
#include <matrix.h> | ||
#include "mex.h" | ||
|
||
#include "son.h" | ||
#include "machine.h" | ||
#include "SONDef.h" | ||
|
||
HINSTANCE hinstLib; | ||
BOOL fFreeResult; | ||
|
||
int _SONAppID(short fh, TSONCreator *p1, TSONCreator *p2) | ||
{ | ||
FARPROC SONAppID; | ||
int i; | ||
SONAppID=GetProcAddress(hinstLib,"SONAppID"); | ||
if (SONAppID != NULL){ | ||
i=(*SONAppID)(fh, p1, p2); | ||
return i; | ||
} | ||
mexErrMsgTxt("SONAppID not found in library\n"); | ||
} | ||
|
||
|
||
void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[]) | ||
{ | ||
short fh, i; | ||
TSONCreator creator={""}; | ||
char buf [9]; | ||
double *p; | ||
const int dim[2]={1,8}; | ||
|
||
if (nrhs>=1) | ||
fh=mxGetScalar(prhs[0]); | ||
|
||
if (nrhs==2){ | ||
if (mxGetClassID(prhs[1])==mxCHAR_CLASS) { | ||
mxGetString(prhs[1], &buf, 9); | ||
memcpy(creator.acID, buf, 8); | ||
} | ||
else | ||
mexErrMsgTxt("SONAppID: String required on input (arg 2)"); | ||
} | ||
|
||
|
||
//Load and get pointer to the library SON32.DLL// | ||
hinstLib = LoadLibrary(SON32); | ||
if (hinstLib == NULL){ | ||
mexPrintf("%s not found",SON32); | ||
plhs[0]=mxCreateNumericArray(2, dim, mxINT32_CLASS, mxREAL); | ||
p=mxGetPr(plhs[0]); | ||
p[0]=SON_BAD_PARAM; | ||
return; | ||
} | ||
|
||
if (nrhs==1) | ||
i=_SONAppID(fh, &creator, NULL); //read | ||
else { | ||
i=_SONAppID(fh, NULL, &creator); //write | ||
_SONAppID(fh, &creator, NULL); //and read back | ||
} | ||
|
||
fFreeResult = FreeLibrary(hinstLib); | ||
|
||
memcpy(&buf, creator.acID, 8); | ||
buf[8]=0; | ||
plhs[0]=mxCreateString(&buf); | ||
return; | ||
} | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include <windows.h> | ||
#include <matrix.h> | ||
#include "mex.h" | ||
|
||
#include "son.h" | ||
#include "machine.h" | ||
#include "SONDef.h" | ||
|
||
HINSTANCE hinstLib; | ||
BOOL fFreeResult; | ||
|
||
int _SONAppID(short fh, TSONCreator *p1, TSONCreator *p2) | ||
{ | ||
FARPROC SONAppID; | ||
int i; | ||
SONAppID=GetProcAddress(hinstLib,"SONAppID"); | ||
if (SONAppID != NULL){ | ||
i=(*SONAppID)(fh, p1, p2); | ||
return i; | ||
} | ||
mexErrMsgTxt("SONAppID not found in library\n"); | ||
} | ||
|
||
|
||
void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[]) | ||
{ | ||
short fh, i; | ||
TSONCreator creator={""}; | ||
char buf [9]; | ||
double *p; | ||
const int dim[2]={1,8}; | ||
|
||
if (nrhs>=1) | ||
fh=mxGetScalar(prhs[0]); | ||
|
||
if (nrhs==2){ | ||
if (mxGetClassID(prhs[1])==mxCHAR_CLASS) { | ||
mxGetString(prhs[1], &buf, 9); | ||
memcpy(creator.acID, buf, 8); | ||
} | ||
else | ||
mexErrMsgTxt("SONAppID: String required on input (arg 2)"); | ||
} | ||
|
||
|
||
//Load and get pointer to the library SON32.DLL// | ||
hinstLib = LoadLibrary(SON32); | ||
if (hinstLib == NULL){ | ||
mexPrintf("%s not found",SON32); | ||
plhs[0]=mxCreateNumericArray(2, dim, mxINT32_CLASS, mxREAL); | ||
p=mxGetPr(plhs[0]); | ||
p[0]=SON_BAD_PARAM; | ||
return; | ||
} | ||
|
||
if (nrhs==1) | ||
i=_SONAppID(fh, &creator, NULL); //read | ||
else { | ||
i=_SONAppID(fh, NULL, &creator); //write | ||
_SONAppID(fh, &creator, NULL); //and read back | ||
} | ||
|
||
fFreeResult = FreeLibrary(hinstLib); | ||
|
||
memcpy(&buf, creator.acID, 8); | ||
buf[8]=0; | ||
plhs[0]=mxCreateString(&buf); | ||
return; | ||
} |
10 changes: 5 additions & 5 deletions
10
src/Import/SON/SON32/C_Sources/SONDef.h → Import/SON/SON32/C_Sources/SONDef.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#define SON32 "c:\\Spike5\\son32.dll" | ||
int GetFilterMask(); | ||
|
||
|
||
#define SON32 "c:\\Spike5\\son32.dll" | ||
int GetFilterMask(); | ||
|
||
|
||
|
116 changes: 58 additions & 58 deletions
116
src/Import/SON/SON32/C_Sources/SONFActive.c → Import/SON/SON32/C_Sources/SONFActive.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,58 @@ | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include <windows.h> | ||
#include <matrix.h> | ||
#include "mex.h" | ||
|
||
#include "son.h" | ||
#include "machine.h" | ||
#include "SONDef.h" | ||
|
||
HINSTANCE hinstLib; | ||
BOOL fFreeResult; | ||
|
||
int _SONFActive(TpFilterMask Mask) | ||
{ | ||
FARPROC SONFActive; | ||
int i; | ||
SONFActive=GetProcAddress(hinstLib,"SONFActive"); | ||
if (SONFActive != NULL){ | ||
i=(*SONFActive)(Mask); | ||
return i; | ||
} | ||
mexErrMsgTxt("SONFActive not found in library\n"); | ||
} | ||
|
||
|
||
void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[]) | ||
{ | ||
TFilterMask FilterMask; | ||
int i, *ret; | ||
int dim[2]={1,1}; | ||
double *p; | ||
|
||
|
||
if (nrhs<1) | ||
mexErrMsgTxt("SONFEqual: Too few input arguments\n"); | ||
|
||
if (mxIsStruct(prhs[0])==1) | ||
GetFilterMask(prhs[0], &FilterMask); | ||
|
||
//Load and get pointer to the library SON32.DLL// | ||
hinstLib = LoadLibrary(SON32); | ||
if (hinstLib == NULL){ | ||
mexPrintf("%s not found",SON32); | ||
plhs[0]=mxCreateNumericArray(2, dim, mxINT32_CLASS, mxREAL); | ||
p=mxGetPr(plhs[0]); | ||
p[0]=SON_BAD_PARAM; | ||
return; | ||
} | ||
|
||
|
||
i=_SONFActive(&FilterMask); | ||
plhs[0]=mxCreateNumericArray(2, dim, mxINT32_CLASS, mxREAL); | ||
ret=mxGetData(plhs[0]); | ||
*ret=i; | ||
fFreeResult = FreeLibrary(hinstLib); | ||
return; | ||
} | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include <windows.h> | ||
#include <matrix.h> | ||
#include "mex.h" | ||
|
||
#include "son.h" | ||
#include "machine.h" | ||
#include "SONDef.h" | ||
|
||
HINSTANCE hinstLib; | ||
BOOL fFreeResult; | ||
|
||
int _SONFActive(TpFilterMask Mask) | ||
{ | ||
FARPROC SONFActive; | ||
int i; | ||
SONFActive=GetProcAddress(hinstLib,"SONFActive"); | ||
if (SONFActive != NULL){ | ||
i=(*SONFActive)(Mask); | ||
return i; | ||
} | ||
mexErrMsgTxt("SONFActive not found in library\n"); | ||
} | ||
|
||
|
||
void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[]) | ||
{ | ||
TFilterMask FilterMask; | ||
int i, *ret; | ||
int dim[2]={1,1}; | ||
double *p; | ||
|
||
|
||
if (nrhs<1) | ||
mexErrMsgTxt("SONFEqual: Too few input arguments\n"); | ||
|
||
if (mxIsStruct(prhs[0])==1) | ||
GetFilterMask(prhs[0], &FilterMask); | ||
|
||
//Load and get pointer to the library SON32.DLL// | ||
hinstLib = LoadLibrary(SON32); | ||
if (hinstLib == NULL){ | ||
mexPrintf("%s not found",SON32); | ||
plhs[0]=mxCreateNumericArray(2, dim, mxINT32_CLASS, mxREAL); | ||
p=mxGetPr(plhs[0]); | ||
p[0]=SON_BAD_PARAM; | ||
return; | ||
} | ||
|
||
|
||
i=_SONFActive(&FilterMask); | ||
plhs[0]=mxCreateNumericArray(2, dim, mxINT32_CLASS, mxREAL); | ||
ret=mxGetData(plhs[0]); | ||
*ret=i; | ||
fFreeResult = FreeLibrary(hinstLib); | ||
return; | ||
} |
Oops, something went wrong.