00001 #if !defined(__DSDP_KERNAL_H)
00002 #define __DSDP_KERNAL_H
00003
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010 #include <math.h>
00011 #include <string.h>
00012 #include <float.h>
00013
00014
00015 #ifdef __FUNCT__
00016 #undef __FUNCT__
00017 #endif
00018 #define __FUNCT__ "DSDPUnknownFunction"
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033
00034 extern void DSDPTime(double*);
00035
00036
00037 extern int DSDPLogInfoAllow(int, char*);
00038
00039 extern void DSDPError(const char*, int, const char*);
00040 extern void DSDPLogFInfo(void *vobj, int outlevel, const char message[], ...);
00041 extern int DSDPFError(void *vobj, const char *func, int linen,const char *filef, const char message[], ...);
00042
00043 extern void DSDPMemoryLog(void);
00044 extern int DSDPEventLogBegin(int);
00045 extern int DSDPEventLogEnd(int);
00046 extern int DSDPEventLogRegister(const char*, int*);
00047 extern int DSDPEventLogInitialize(void);
00048 extern int DSDPEventLogSummary(void);
00049 extern int DSDPEventLogInitialize(void);
00050
00051 #ifdef __cplusplus
00052 }
00053 #endif
00054
00055
00056 #ifndef DSDPCHKERR
00057 #define DSDPCHKERR(a) { if (a){ DSDPError(__FUNCT__,__LINE__,__FILE__); return a; } }
00058 #endif
00059
00060 #ifdef DSDPFunctionReturn
00061 #undef DSDPFunctionReturn
00062 #endif
00063 #define DSDPFunctionReturn return
00064
00065 #ifdef DSDPFunctionBegin
00066 #undef DSDPFunctionBegin
00067 #endif
00068 #define DSDPFunctionBegin { }
00069
00070 #ifdef DSDPMATLAB
00071 #include "mex.h"
00072 #define DSDPPrintf mexPrintf
00073 #define DSDPErrorPrintf mexPrintf
00074 #endif
00075
00076 #include "dsdpmem.h"
00077
00078 #ifndef DSDPPrintf
00079 #define DSDPPrintf printf
00080 #endif
00081
00082 #ifndef DSDPErrorPrintf
00083 #define DSDPErrorPrintf printf
00084 #endif
00085
00086 #define DSDPLogInfo DSDPLogFInfo
00087
00088
00089
00090
00091 #define DSDPSETERR(a,b) {DSDPFError(0,__FUNCT__,__LINE__,__FILE__,b); return (a); }
00092 #define DSDPSETERR1(a,b,c) {DSDPFError(0,__FUNCT__,__LINE__,__FILE__,b,c); return (a); }
00093 #define DSDPSETERR2(a,b,c,d) {DSDPFError(0,__FUNCT__,__LINE__,__FILE__,b,c,d); return (a); }
00094 #define DSDPSETERR3(a,b,c,d,e) {DSDPFError(0,__FUNCT__,__LINE__,__FILE__,b,c,d,e); return (a); }
00095
00096
00097
00098
00099 #define DSDPMin(a,b) ((a <= b)? (a) : (b))
00100 #define DSDPMax(a,b) ((a >= b)? (a) : (b))
00101
00102
00103 #endif