Changeset 13034
- Timestamp:
- 08/14/12 16:02:21 (13 years ago)
- Location:
- issm/trunk-jpl/src/modules
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/modules/EnumToString/EnumToString.cpp
r12518 r13034 5 5 #include "./EnumToString.h" 6 6 7 void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){7 WRAPPER(EnumToString){ 8 8 9 9 char *name = NULL; 10 10 int enum_in; 11 11 12 /*checks on arguments on the matlab side: */ 13 if(nrhs!=NRHS){ 14 EnumToStringUsage(); _error2_("usage. See above"); 15 } 12 /*Boot module: */ 13 MODULEBOOT(); 14 15 /*checks on arguments: */ 16 CHECKARGUMENTS(NLHS,NRHS,&EnumToStringUsage); 16 17 17 18 /*Fetch inputs: */ … … 23 24 /* output: */ 24 25 WriteData(NAME,name); 26 27 /*end module: */ 28 MODULEEND(); 25 29 } 26 30 -
issm/trunk-jpl/src/modules/EnumToString/EnumToString.h
r12013 r13034 6 6 #define _ENUMTOSTRING_H 7 7 8 /* local prototypes: */ 9 void EnumToStringUsage(void); 8 #ifdef HAVE_CONFIG_H 9 #include <config.h> 10 #else 11 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 12 #endif 10 13 14 /*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/ 15 #ifdef _HAVE_PYTHON_ 16 #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol 17 #endif 18 19 /*Header files: */ 11 20 #include "../../c/include/globals.h" 12 21 #include "../../c/modules/modules.h" … … 15 24 #include "../../c/issm-binding.h" 16 25 26 #ifdef _HAVE_MATLAB_MODULES_ 17 27 /* serial input macros: */ 18 28 #define ENUMIN (mxArray*)prhs[0] 19 20 29 /* serial output macros: */ 21 30 #define NAME (mxArray**)&plhs[0] 31 #endif 32 33 #ifdef _HAVE_PYTHON_MODULES_ 34 /* serial input macros: */ 35 #define ENUMIN PyTuple_GetItem(args,0) 36 /* serial output macros: */ 37 #define NAME output,0 38 #endif 22 39 23 40 /* serial arg counts: */ … … 30 47 #define __FUNCT__ "EnumToString" 31 48 49 /* local prototypes: */ 50 void EnumToStringUsage(void); 51 32 52 #endif /* _TEST_H */ -
issm/trunk-jpl/src/modules/StringToEnum/StringToEnum.cpp
r12518 r13034 5 5 #include "./StringToEnum.h" 6 6 7 void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){7 WRAPPER(StringToEnum){ 8 8 9 9 char *name = NULL; 10 10 int enum_out; 11 11 12 /*checks on arguments on the matlab side: */ 13 if(nrhs!=NRHS){ 14 StringToEnumUsage(); _error2_("usage. See above"); 15 } 12 /*Boot module: */ 13 MODULEBOOT(); 14 15 /*checks on arguments: */ 16 CHECKARGUMENTS(NLHS,NRHS,&StringToEnumUsage); 16 17 17 18 /*Fetch inputs: */ … … 23 24 /* output: */ 24 25 WriteData(ENUMOUT,enum_out); 26 27 /*end module: */ 28 MODULEEND(); 25 29 } 26 30 -
issm/trunk-jpl/src/modules/StringToEnum/StringToEnum.h
r12013 r13034 6 6 #define _STRINGTOENUM_H 7 7 8 /* local prototypes: */ 9 void StringToEnumUsage(void); 8 #ifdef HAVE_CONFIG_H 9 #include <config.h> 10 #else 11 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 12 #endif 10 13 14 /*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/ 15 #ifdef _HAVE_PYTHON_ 16 #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol 17 #endif 18 19 /*Header files: */ 11 20 #include "../../c/include/globals.h" 12 21 #include "../../c/modules/modules.h" … … 15 24 #include "../../c/issm-binding.h" 16 25 26 #ifdef _HAVE_MATLAB_MODULES_ 17 27 /* serial input macros: */ 18 28 #define NAME (mxArray*)prhs[0] 19 20 29 /* serial output macros: */ 21 30 #define ENUMOUT (mxArray**)&plhs[0] 31 #endif 32 33 #ifdef _HAVE_PYTHON_MODULES_ 34 /* serial input macros: */ 35 #define NAME PyTuple_GetItem(args,0) 36 /* serial output macros: */ 37 #define ENUMOUT output,0 38 #endif 22 39 23 40 /* serial arg counts: */ … … 30 47 #define __FUNCT__ "StringToEnum" 31 48 49 /* local prototypes: */ 50 void StringToEnumUsage(void); 51 32 52 #endif /* _TEST_H */
Note:
See TracChangeset
for help on using the changeset viewer.