Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
HDFPT.C
Package: 语音处理与合成工具箱随书光盘源码3.rar [view]
Upload User: jihankui
Upload Date: 2013-03-01
Package Size: 5664k
Code Size: 5k
Category:
Speech/Voice recognition/combine
Development Platform:
Matlab
- /* Copyright (c) 1984-98 by The MathWorks, Inc. */
- /*
- * hdfpt.c --- support file for HDF.MEX
- *
- * This module supports the HDF-EOS PT interface. The only public
- * function is hdfPT(), which is called by mexFunction().
- * hdfPT looks at the second input argument to determine which
- * private function should get control.
- *
- * Syntaxes
- * ========
- */
- /* $Revision: 1.3 $ $Date: 1997/11/21 23:36:48 $ */
- #ifdef USE_EOS
- static char rcsid[] = "$Id: hdfpt.c,v 1.3 1997/11/21 23:36:48 moler Exp $";
- #include <string.h>
- #include <math.h>
- /* Main HDF library header file */
- #include "hdf.h"
- /* MATLAB API header file */
- #include "mex.h"
- /* HDFMEX utility functions */
- #include "hdfutils.h"
- /*
- * hdfPTattach
- *
- * Purpose: gateway to PTannlen()
- * attaches to an existing point within the file.
- *
- * MATLAB usage:
- * point_id = hdf('PT', 'attach', ptfile_id, pointname)
- * returns -1 on failure.
- */
- static void hdfPTattach(int nlhs,
- mxArray *plhs[],
- int nrhs,
- const mxArray *prhs[])
- {
- int32 pointfile_id;
- char *pointName = NULL;
- int32 point_id;
- haNarginChk(4, 4, nrhs);
- haNargoutChk(0, 1, nlhs);
- pointfile_id = (int32) haGetDoubleScalar(prhs[2], "Point file ID");
- pointname = haGetString(pointname, "Point name");
- point_id = PTattach(pointfile_id, pointname);
- if (point_id != FAIL)
- {
- haAddIDToList(point_id, PT_ID_List);
- }
- plhs[0] = haCreateDoubleScalar(point_id);
- mxFree(pointname);
- }
- /*
- * hdfPTattrinfo
- *
- * Purpose: gateway to PTattrinfo()
- * returns information about a point attribute
- *
- * MATLAB usage:
- * [numbertype, count, status] = hdf('PT','attrinfo',point_id,attr_name)
- */
- static void hdfPTattrinfo(int nlhs,
- mxArray *plhs[],
- int nrhs,
- const mxArray *prhs[])
- {
- char *attr_name = NULL;
- int32 point_id;
- int32 number_type;
- int32 count;
- intn status;
- haNarginChk(4, 4, nrhs);
- haNargoutChk(0, 1, nlhs);
- point_id = (int32) haGetDoubleScalar(prhs[2], "Point ID");
- attr_name = haGetString(prhs[3], "Attribute name");
- status = PTattrinfo(point_id, attr_name, &number_type, &count);
- mxFree(attr_name);
- if (status == SUCCEED)
- {
- plhs[0] = haCreateDoubleScalar((double) number_type);
- if (nlhs > 1)
- {
- plhs[1] = haCreateDoubleScalar((double) count);
- }
- if (nlhs > 2)
- {
- plhs[2] = haCreateDoubleScalar((double) status);
- }
- }
- else
- {
- plhs[0] = EMPTY;
- if (nlhs > 1)
- {
- plhs[1] = EMPTY;
- }
- if (nlhs > 2)
- {
- plhs[2] = status;
- }
- }
- }
- /*
- * hdfPTopen
- *
- * Purpose: gateway to PTopen()
- * opens or creates HDF file
- *
- * MATLAB usage:
- * point_file_id = hdf('PT', 'open', filename, access)
- * access can be 'read', 'readwrite', or 'create'
- *
- */
- static void hdfPTopen(int nlhs,
- mxArray *plhs[],
- int nrhs,
- const mxArray *prhs[])
- {
- intn access;
- char *filename;
- int32 point_file_id;
- haNarginChk(4, 4, nrhs);
- haNargoutChk(0, 1, nlhs);
- filename = haGetString(prhs[2], "Filename");
- access = haGetAccessMode(prhs[3]);
- point_file_id = PTopen(filename, access);
- if (point_file_id != FAIL)
- {
- status = haAddIDToList(point_file_id, Pointfile_ID_List);
- if (status == FAIL)
- {
- /*
- * Couldn't add the file_id to the list. This might
- * cause data loss later, so we don't allow it.
- */
- PTclose(point_file_id);
- point_file_id = FAIL;
- }
- }
- plhs[0] = haCreateDoubleScalar((double) point_file_id);
- mxFree(filename);
- }
- /*
- * hdfPT
- *
- * Purpose: Function switchyard for the PT part of the HDF-EOS gateway.
- *
- * Inputs: nlhs --- number of left-side arguments
- * plhs --- left-side arguments
- * nrhs --- number of right-side arguments
- * prhs --- right-side arguments
- * functionStr --- string specifying which AN function to call
- * Outputs: none
- * Return: none
- */
- void hdfPT(int nlhs,
- mxArray *plhs[],
- int nrhs,
- const mxArray *prhs[],
- char *functionStr)
- {
- void (*func)(int nlhs, mxArray *plhs[],
- int nrhs, const mxArray *prhs[]);
- if (strcmp(functionStr, "attach") == 0)
- {
- func = hdfPTattach;
- }
- else if (strcmp(functionStr, "attrinfo") == 0)
- {
- func = hdfPTattrinfo;
- }
- else if (strcmp(functionStr, "open") == 0)
- {
- func = hdfPTopen;
- }
- else
- {
- mexErrMsgTxt("Unknown PT interface function.");
- }
- (*func)(nlhs, plhs, nrhs, prhs);
- }
- #endif /* USE_EOS */