diff options
author | Shashank | 2017-05-29 12:40:26 +0530 |
---|---|---|
committer | Shashank | 2017-05-29 12:40:26 +0530 |
commit | 0345245e860375a32c9a437c4a9d9cae807134e9 (patch) | |
tree | ad51ecbfa7bcd3cc5f09834f1bb8c08feaa526a4 /modules/mexlib/examples/mexdll | |
download | scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.gz scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.bz2 scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.zip |
CMSCOPE changed
Diffstat (limited to 'modules/mexlib/examples/mexdll')
-rwxr-xr-x | modules/mexlib/examples/mexdll/Makelib.mak | 13 | ||||
-rwxr-xr-x | modules/mexlib/examples/mexdll/demo.sce | 23 | ||||
-rwxr-xr-x | modules/mexlib/examples/mexdll/libtst.c | 25 | ||||
-rwxr-xr-x | modules/mexlib/examples/mexdll/readme.txt | 8 | ||||
-rwxr-xr-x | modules/mexlib/examples/mexdll/xtimesy.def | 3 | ||||
-rwxr-xr-x | modules/mexlib/examples/mexdll/xtimesy.dll | bin | 0 -> 40960 bytes |
6 files changed, 72 insertions, 0 deletions
diff --git a/modules/mexlib/examples/mexdll/Makelib.mak b/modules/mexlib/examples/mexdll/Makelib.mak new file mode 100755 index 000000000..52c4079ce --- /dev/null +++ b/modules/mexlib/examples/mexdll/Makelib.mak @@ -0,0 +1,13 @@ +SCIDIR =../../../.. +SCIDIR1 =..\..\..\.. +# name of the dll to be built +LIBRARY = libtst +# list of objects file +OBJS = libtst.obj +# added libraries +OTHERLIBS = xtimesy.lib +!include $(SCIDIR)/Makefile.incl.mak +CFLAGS = $(CC_OPTIONS) -DFORDLL -I"$(SCIDIR)\libs\MALLOC\includes" -I"$(SCIDIR)\modules\core\includes" -I"$(SCIDIR)/libs/f2c" -I"$(SCIDIR)/modules/mexlib/includes" +FFLAGS = $(FC_OPTIONS) -DFORDLL -I"$(SCIDIR)\libs\MALLOC\includes" -I"$(SCIDIR)\modules\core\includes" -I"$(SCIDIR)/libs/f2c" -I"$(SCIDIR)/modules/mexlib/includes" +EXTRA_LDFLAGS = +!include $(SCIDIR1)\modules\dynamic_link\src\scripts\Makedll.incl diff --git a/modules/mexlib/examples/mexdll/demo.sce b/modules/mexlib/examples/mexdll/demo.sce new file mode 100755 index 000000000..4a81d2ef1 --- /dev/null +++ b/modules/mexlib/examples/mexdll/demo.sce @@ -0,0 +1,23 @@ + +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) INRIA +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +// Allan CORNET +// INRIA 2007 + +cd "SCI/modules/mexlib/examples/mexdll" + +if (findmsvccompiler() <> "unknown") then + unix_w("lib /def:xtimesy.def"); + unix_w("nmake /f makelib.mak all"); + + addinter("libtst.dll","libtst","xtimesy") + xtimesy(2,3) + +end diff --git a/modules/mexlib/examples/mexdll/libtst.c b/modules/mexlib/examples/mexdll/libtst.c new file mode 100755 index 000000000..0a19c7a38 --- /dev/null +++ b/modules/mexlib/examples/mexdll/libtst.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + */ + +#include <mex.h> +extern Gatefunc mexFunction; +static GenericTable Tab[] = +{ + {mex_gateway, mexFunction, "errmsg"}, +}; + +int C2F(libtst)() +{ + Rhs = Max(0, Rhs); + (*(Tab[Fin - 1].f))(Tab[Fin - 1].name, Tab[Fin - 1].F); + return 0; +} diff --git a/modules/mexlib/examples/mexdll/readme.txt b/modules/mexlib/examples/mexdll/readme.txt new file mode 100755 index 000000000..80d46e1d4 --- /dev/null +++ b/modules/mexlib/examples/mexdll/readme.txt @@ -0,0 +1,8 @@ +Linking a .mexglx, say xtimesy.mexglx, file with Scilab. +VISUAL C++ environment. + +exec(SCI+'/modules/mexlib/examples/mexdll/demo.sce'); + +Note that for each mex .dll file a second .dll file must be +constructed. It is not possible to call several mex .dll +files by a unique gateway (such as libtst). diff --git a/modules/mexlib/examples/mexdll/xtimesy.def b/modules/mexlib/examples/mexdll/xtimesy.def new file mode 100755 index 000000000..54b598032 --- /dev/null +++ b/modules/mexlib/examples/mexdll/xtimesy.def @@ -0,0 +1,3 @@ +LIBRARY xtimesy.dll +EXPORTS + mexFunction diff --git a/modules/mexlib/examples/mexdll/xtimesy.dll b/modules/mexlib/examples/mexdll/xtimesy.dll Binary files differnew file mode 100755 index 000000000..58fbedc37 --- /dev/null +++ b/modules/mexlib/examples/mexdll/xtimesy.dll |