/* $Revision: 1.1.6.4 $ */ /* shrlibsample.c * * Sample C shared library for use with MATLAB Shared * Library Calling (CALLLIB) * Copyright 2002-2003 The MathWorks, Inc. * */ #include #include /* only needed because of mexFunction below */ /*#include "windows.h"*/ #define EXPORT_FCNS #include "shrhelp.h" #include "shrlibsample.h" EXPORTED_FUNCTION void multDoubleArray(double *x,int size) { /* Multiple each element of the array by 3 */ int i; for (i=0;ip1+st->p2+st->p3; st->p1=5.5; st->p2=1234; st->p3=12345678; return t; } EXPORTED_FUNCTION void allocateStruct(struct c_struct** val) { *val=(struct c_struct*) malloc(sizeof(struct c_struct)); (*val)->p1 = 12.4; (*val)->p2 = 222; (*val)->p3 = 333333; } EXPORTED_FUNCTION void deallocateStruct(void *ptr) { free(ptr); } EXPORTED_FUNCTION void multiplyShort(short *x, int size) { int i; for (i=0; i