mex.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 2001-2012 Paul Kienzle
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 /*
00024 
00025 This code was originally distributed as part of Octave Forge under
00026 the following terms:
00027 
00028 Author: Paul Kienzle
00029 I grant this code to the public domain.
00030 2001-03-22
00031 
00032 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
00033 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00034 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00035 ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
00036 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00037 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00038 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00039 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00040 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00041 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00042 SUCH DAMAGE.
00043 
00044 */
00045 
00046 /* mex.h is for use in C-programs only; do NOT include it in mex.cc */
00047 
00048 #if ! defined (MEX_H)
00049 #define MEX_H
00050 
00051 #define HAVE_OCTAVE
00052 
00053 typedef void mxArray;
00054 
00055 #if ! defined (__cplusplus)
00056 typedef int bool;
00057 #endif
00058 
00059 /* -V4 stuff */
00060 #if defined (V4)
00061 #define Matrix mxArray
00062 #define REAL mxREAL
00063 #endif
00064 
00065 #define mxMAXNAME 64
00066 
00067 #if defined (__cplusplus)
00068 extern "C" {
00069 #endif
00070 
00071 #if defined (V4)
00072 void mexFunction (int nlhs, mxArray* plhs[], int nrhs, mxArray *prhs[]);
00073 #else
00074 void mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray *prhs[]);
00075 #endif
00076 
00077 #include "mexproto.h"
00078 
00079 /* V4 floating point routines renamed in V5.  */
00080 #define mexIsNaN mxIsNaN
00081 #define mexIsFinite mxIsFinite
00082 #define mexIsInf mxIsInf
00083 #define mexGetEps mxGetEps
00084 #define mexGetInf mxGetInf
00085 #define mexGetNaN mxGetNan
00086 
00087 #define mexGetGlobal(nm) mexGetArray (nm, "global")
00088 #define mexGetMatrix(nm) mexGetArray (nm, "caller")
00089 #define mexGetMatrixPtr(nm) mexGetArrayPtr (nm, "caller")
00090 
00091 #define mexGetArray(nm, space) mexGetVariable (space, nm)
00092 #define mexGetArrayPtr(nm, space) mexGetVariablePtr (space, nm)
00093 
00094 #define mexPutMatrix(ptr) mexPutVariable ("caller", "", ptr)
00095 #define mexPutArray(ptr, space) mexPutVariable (space, "", ptr)
00096 
00097 #define mxCreateFull mxCreateDoubleMatrix
00098 
00099 #define mxCreateScalarDouble mxCreateDoubleScalar
00100 
00101 #define mxFreeMatrix mxDestroyArray
00102 
00103 #define mxIsString mxIsChar
00104 
00105 /* Apparently these are also defined.  */
00106 
00107 #ifndef UINT64_T
00108 #define UINT64_T uint64_t
00109 #endif
00110 
00111 #ifndef uint64_T
00112 #define uint64_T uint64_t
00113 #endif
00114 
00115 #ifndef INT64_T
00116 #define INT64_T int64_t
00117 #endif
00118 
00119 #ifndef int64_T
00120 #define int64_T int64_t
00121 #endif
00122 
00123 #ifndef UINT32_T
00124 #define UINT32_T uint32_t
00125 #endif
00126 
00127 #ifndef uint32_T
00128 #define uint32_T uint32_t
00129 #endif
00130 
00131 #ifndef INT32_T
00132 #define INT32_T int32_t
00133 #endif
00134 
00135 #ifndef int32_T
00136 #define int32_T int32_t
00137 #endif
00138 
00139 #ifndef UINT16_T
00140 #define UINT16_T uint16_t
00141 #endif
00142 
00143 #ifndef uint16_T
00144 #define uint16_T uint16_t
00145 #endif
00146 
00147 #ifndef INT16_T
00148 #define INT16_T int16_t
00149 #endif
00150 
00151 #ifndef int16_T
00152 #define int16_T int16_t
00153 #endif
00154 
00155 #ifndef UINT8_T
00156 #define UINT8_T uint8_t
00157 #endif
00158 
00159 #ifndef uint8_T
00160 #define uint8_T uint8_t
00161 #endif
00162 
00163 #ifndef INT8_T
00164 #define INT8_T int8_t
00165 #endif
00166 
00167 #ifndef int8_T
00168 #define int8_T int8_t
00169 #endif
00170 
00171 #if defined (__cplusplus)
00172 }
00173 #endif
00174 
00175 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines