/* Copyright 1984-2002 The MathWorks, Inc. */ /* * hdfvfh.c --- support file for HDF.MEX * * This module supports the HDF VH interface. The only public * function is hdfVH(), which is called by mexFunction(). * hdfVH looks at the second input argument to determine which * private function should get control. * * Syntaxes * ======== * vgroup_ref = hdf('VH', 'makegroup', file_id, tags, refs, vgroup_name, vgroup_class) * vdata_ref = hdf('VH', 'storedata', file_id, fieldname, data, vdata_name, vdata_class) * count = hdf('VH', 'storedatam', file_id, fieldname, data, vdata_name, vdata_class) */ /* $Revision: 1.1.6.1 $ $Date: 2003/12/13 03:02:29 $ */ static char rcsid[] = "$Id: hdfvh.c,v 1.1.6.1 2003/12/13 03:02:29 batserve Exp $"; #include #include /* Main HDF library header file */ #include "hdf.h" /* MATLAB API header file */ #include "mex.h" /* HDFMEX utility functions */ #include "hdfutils.h" #include "hdfvh.h" /* * hdfVHmakegroup * * Purpose: gateway to VHmakegroup() * * MATLAB usage: * vgroup_ref = hdf('VH', 'makegroup', file_id, tags, refs, vgroup_name, vgroup_class) */ static void hdfVHmakegroup(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int32 file_id; int32 *tags; int32 *refs; int32 n; char *vgroup_name; char *vgroup_class; int i; double *pr; int32 status; haNarginChk(7, 7, nrhs); haNargoutChk(0, 1, nlhs); file_id = (int32) haGetDoubleScalar(prhs[2], "File identifier"); n = mxGetNumberOfElements(prhs[3]); if (n != mxGetNumberOfElements(prhs[4])) mexErrMsgTxt("Lengths of the TAGS and REFS vectors must match."); tags = mxCalloc(n,sizeof(int32)); pr = mxGetPr(prhs[3]); for (i=0; i 0) functionStr = haGetString(prhs[1],"Function name"); else mexErrMsgTxt("Not enough input arguments."); while (Fcns[i].func != NULL) { if (strcmp(functionStr,Fcns[i].name)==0) { (*(Fcns[i].func))(nlhs, plhs, nrhs, prhs); mxFree(functionStr); return; } i++; } mexErrMsgTxt("Unknown HDF VH interface function."); }