scilab: put size_t & ptrdiff_t typemaps in separate file
This commit is contained in:
parent
e9d36b6bc2
commit
cfc9f1398e
4 changed files with 71 additions and 73 deletions
|
|
@ -89,43 +89,6 @@ SWIG_SciDouble_FromInt(void *_pvApiCtx, int _iVarOut, int _iValue, char *_fname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* C-type: size_t
|
|
||||||
* Scilab type: see int
|
|
||||||
*/
|
|
||||||
|
|
||||||
%fragment(SWIG_AsVal_frag(size_t), "header", fragment="SWIG_Int_AsSize") {
|
|
||||||
%#define SWIG_AsVal_size_t(scilabValue, valuePointer) SWIG_Int_AsSize(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname())
|
|
||||||
}
|
|
||||||
%fragment("SWIG_Int_AsSize", "header", fragment=SWIG_AsVal_frag(int))
|
|
||||||
{
|
|
||||||
SWIGINTERN int
|
|
||||||
SWIG_Int_AsSize(void *_pvApiCtx, SwigSciObject _iVar, size_t *_piValue, char *_fname)
|
|
||||||
{
|
|
||||||
int iValue = 0;
|
|
||||||
if (SWIG_AsVal_dec(int)(_iVar, &iValue) != SWIG_OK)
|
|
||||||
{
|
|
||||||
return SWIG_ERROR;
|
|
||||||
}
|
|
||||||
if (_piValue)
|
|
||||||
{
|
|
||||||
*_piValue = (size_t) iValue;
|
|
||||||
}
|
|
||||||
return SWIG_OK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
%fragment(SWIG_From_frag(size_t), "header", fragment="SWIG_Int_FromSize") {
|
|
||||||
%#define SWIG_From_size_t(scilabValue) SWIG_Int_FromSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFname())
|
|
||||||
}
|
|
||||||
%fragment("SWIG_Int_FromSize", "header", fragment=SWIG_From_frag(int)) {
|
|
||||||
SWIGINTERN int
|
|
||||||
SWIG_Int_FromSize(void *_pvApiCtx, int _iVarOut, size_t _iValue, char *_fname)
|
|
||||||
{
|
|
||||||
return SWIG_From_dec(int)((int)_iValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* C-type: int
|
* C-type: int
|
||||||
* Scilab type: 32-bit signed integer matrix
|
* Scilab type: 32-bit signed integer matrix
|
||||||
|
|
|
||||||
|
|
@ -28,39 +28,3 @@ SWIG_Int_FromLong(void *_pvApiCtx, int _iVarOut, long _lValue, char *_fname) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* C-type: ptrdiff_t
|
|
||||||
* Scilab type: double or int32
|
|
||||||
*/
|
|
||||||
|
|
||||||
%fragment(SWIG_AsVal_frag(ptrdiff_t), "header", fragment="SWIG_Int_AsPtrDiff") {
|
|
||||||
%#define SWIG_AsVal_ptrdiff_t(scilabValue, valuePointer) SWIG_Int_AsPtrDiff(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname())
|
|
||||||
}
|
|
||||||
%fragment("SWIG_Int_AsPtrDiff", "header", fragment=SWIG_AsVal_frag(int))
|
|
||||||
{
|
|
||||||
SWIGINTERN int
|
|
||||||
SWIG_Int_AsPtrDiff(void *_pvApiCtx, SwigSciObject _iVar, ptrdiff_t *_piValue, char *_fname)
|
|
||||||
{
|
|
||||||
int iValue = 0;
|
|
||||||
if (SWIG_AsVal_dec(int)(_iVar, &iValue) != SWIG_OK)
|
|
||||||
{
|
|
||||||
return SWIG_ERROR;
|
|
||||||
}
|
|
||||||
if (_piValue)
|
|
||||||
{
|
|
||||||
*_piValue = (ptrdiff_t) iValue;
|
|
||||||
}
|
|
||||||
return SWIG_OK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
%fragment(SWIG_From_frag(ptrdiff_t), "header", fragment="SWIG_Int_FromPtrDiff") {
|
|
||||||
%#define SWIG_From_ptrdiff_t(scilabValue) SWIG_Int_FromPtrDiff(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFname())
|
|
||||||
}
|
|
||||||
%fragment("SWIG_Int_FromPtrDiff", "header", fragment=SWIG_From_frag(int)) {
|
|
||||||
SWIGINTERN int
|
|
||||||
SWIG_Int_FromPtrDiff(void *_pvApiCtx, int _iVarOut, ptrdiff_t _iValue, char *_fname)
|
|
||||||
{
|
|
||||||
return SWIG_From_dec(int)((int)_iValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
69
Lib/scilab/scimisctypes.swg
Normal file
69
Lib/scilab/scimisctypes.swg
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
// Other primitive such as size_t and ptrdiff_t
|
||||||
|
|
||||||
|
/*
|
||||||
|
* C-type: size_t
|
||||||
|
* Scilab type: double or int32
|
||||||
|
*/
|
||||||
|
|
||||||
|
%fragment(SWIG_AsVal_frag(size_t), "header", fragment="SWIG_Int_AsSize") {
|
||||||
|
%#define SWIG_AsVal_size_t(scilabValue, valuePointer) SWIG_Int_AsSize(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname())
|
||||||
|
}
|
||||||
|
%fragment("SWIG_Int_AsSize", "header", fragment=SWIG_AsVal_frag(int))
|
||||||
|
{
|
||||||
|
SWIGINTERN int
|
||||||
|
SWIG_Int_AsSize(void *_pvApiCtx, SwigSciObject _iVar, size_t *_piValue, char *_fname) {
|
||||||
|
int iValue = 0;
|
||||||
|
if (SWIG_AsVal_dec(int)(_iVar, &iValue) != SWIG_OK)
|
||||||
|
return SWIG_ERROR;
|
||||||
|
|
||||||
|
if (_piValue)
|
||||||
|
*_piValue = (size_t) iValue;
|
||||||
|
|
||||||
|
return SWIG_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%fragment(SWIG_From_frag(size_t), "header", fragment="SWIG_Int_FromSize") {
|
||||||
|
%#define SWIG_From_size_t(scilabValue) SWIG_Int_FromSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFname())
|
||||||
|
}
|
||||||
|
%fragment("SWIG_Int_FromSize", "header", fragment=SWIG_From_frag(int))
|
||||||
|
{
|
||||||
|
SWIGINTERN int
|
||||||
|
SWIG_Int_FromSize(void *_pvApiCtx, int _iVarOut, size_t _iValue, char *_fname) {
|
||||||
|
return SWIG_From_dec(int)((int)_iValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* C-type: ptrdiff_t
|
||||||
|
* Scilab type: double or int32
|
||||||
|
*/
|
||||||
|
|
||||||
|
%fragment(SWIG_AsVal_frag(ptrdiff_t), "header", fragment="SWIG_Int_AsPtrDiff") {
|
||||||
|
%#define SWIG_AsVal_ptrdiff_t(scilabValue, valuePointer) SWIG_Int_AsPtrDiff(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname())
|
||||||
|
}
|
||||||
|
%fragment("SWIG_Int_AsPtrDiff", "header", fragment=SWIG_AsVal_frag(int))
|
||||||
|
{
|
||||||
|
SWIGINTERN int
|
||||||
|
SWIG_Int_AsPtrDiff(void *_pvApiCtx, SwigSciObject _iVar, ptrdiff_t *_piValue, char *_fname) {
|
||||||
|
int iValue = 0;
|
||||||
|
if (SWIG_AsVal_dec(int)(_iVar, &iValue) != SWIG_OK)
|
||||||
|
return SWIG_ERROR;
|
||||||
|
|
||||||
|
if (_piValue)
|
||||||
|
*_piValue = (ptrdiff_t) iValue;
|
||||||
|
|
||||||
|
return SWIG_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%fragment(SWIG_From_frag(ptrdiff_t), "header", fragment="SWIG_Int_FromPtrDiff") {
|
||||||
|
%#define SWIG_From_ptrdiff_t(scilabValue) SWIG_Int_FromPtrDiff(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFname())
|
||||||
|
}
|
||||||
|
%fragment("SWIG_Int_FromPtrDiff", "header", fragment=SWIG_From_frag(int)) {
|
||||||
|
SWIGINTERN int
|
||||||
|
SWIG_Int_FromPtrDiff(void *_pvApiCtx, int _iVarOut, ptrdiff_t _iValue, char *_fname) {
|
||||||
|
return SWIG_From_dec(int)((int)_iValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -16,6 +16,8 @@
|
||||||
%include <scisignedchar.swg>
|
%include <scisignedchar.swg>
|
||||||
%include <sciunsignedchar.swg>
|
%include <sciunsignedchar.swg>
|
||||||
|
|
||||||
|
%include <scimisctypes.swg>
|
||||||
|
|
||||||
%include <scipointer.swg>
|
%include <scipointer.swg>
|
||||||
%include <scibool.swg>
|
%include <scibool.swg>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue