00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 static JavaVMAttachArgs attachArgs = { JNI_VERSION_1_2, NULL, NULL} ;
00022
00023
00024
00025
00026
00027
00028
00029
00030 #define JVR_NONE 0
00031 #define JVR_INFO 1
00032 #define JVR_WARNING 2
00033 #define JVR_ERROR 3
00034 #define JVR_ALL 99
00035 #define JVR_DEBUG(level) level <= jvr_getdebuglevel()
00036
00037 #define JVR_LOG e,__FILE__,__LINE__
00038
00039 #define JVR_ENTER JVR_EELOG("ENTER")
00040 #define JVR_EXIT JVR_EELOG("EXIT ")
00041 #define JVR_EELOG(JVR_EE) do \
00042 { \
00043 if (JVR_DEBUG(JVR_ALL)) { \
00044 time_t now; \
00045 struct tm *t; \
00046 struct timeb tp; \
00047 char timebuf[1024]; \
00048 time(&now); \
00049 t = localtime(&now); \
00050 ftime(&tp); \
00051 strftime(timebuf,1000,"%Y.%m.%d %H:%M:%S",t); \
00052 jvr_log(JVR_LOG,"%s.%hd %s %s",timebuf,tp.millitm,JVR_EE,__PRETTY_FUNCTION__); \
00053 } \
00054 } while(0)
00055 #define JVR_LOG e,__FILE__,__LINE__
00056
00057
00058
00059 #define JVR_DVTPT_MAXSIZE 10
00060
00061
00062 #define JVR_DXIOTT_MAXSIZE 10
00063
00064
00065 #define JVR_MSCDT_MAXSIZE 10
00066
00067
00068
00069
00070 JavaVM* jvr_getVM();
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 void jvr_throw (JNIEnv *e, const char* exceptionClass, const char* file, int line, const char* format, ...);
00085
00086
00087
00088
00089 void jvr_log (JNIEnv *e, const char* file, int line, const char* format, ...);
00090
00091
00092
00093
00094
00095 int jvr_convert_sctsinfo_j2n(JNIEnv *e, jobject jtsinfo, SC_TSINFO *tsinfo);
00096
00097
00098
00099 int jvr_convert_sctsinfo_n2j(JNIEnv *e, jobject jtsinfo, SC_TSINFO *tsinfo);
00100
00101
00102
00103
00104 int jvr_convert_dxcap_j2n (JNIEnv *e, jobject jdxcap, DX_CAP *dxcap);
00105
00106
00107
00108
00109 int jvr_convert_tngen_n2j (JNIEnv *e, jobject jtngen, TN_GEN *tngen);
00110
00111
00112
00113
00114
00115
00116
00117 int jvr_convert_dvtpt_j2n (JNIEnv *e, jobjectArray jtpt, DV_TPT *tpt);
00118
00119
00120
00121
00122 int jvr_convert_tngen_j2n (JNIEnv *e, jobject jtngen, TN_GEN *tngen);
00123
00124
00125
00126
00127 int jvr_convert_tngencad_j2n(JNIEnv *e, jobject jtngencad, TN_GENCAD *tngencad);
00128
00129
00130
00131
00132 int jvr_convert_dxxpb_j2n (JNIEnv *e, jobject jxpb, DX_XPB *xpb);
00133
00134
00135 #define JVR_IOTT_SIZE 500
00136
00137
00138
00139
00140 int jvr_convert_dxiott_j2n(JNIEnv *e, jobjectArray jiott, DX_IOTT **iottp);
00141
00142
00143
00144
00145 int jvr_convert_mscdtarray_j2n (JNIEnv *e, jobjectArray jmscdt, MS_CDT *cdt, int *numParties);
00146
00147
00148
00149
00150 int jvr_convert_mscdtarray_n2j (JNIEnv *e, jobjectArray jmscdt, MS_CDT *cdt, int numParties);
00151
00152
00153
00154
00155 int jvr_convert_mscdt_j2n (JNIEnv *e, jobject jmscdt, MS_CDT *cdt);
00156
00157
00158
00159
00160 int jvr_convert_mscdt_n2j (JNIEnv *e, jobject jmscdt, MS_CDT *cdt);
00161
00162
00163
00164
00165 int jvr_convert_metaevent_n2j (JNIEnv *e, jobject jmeta, METAEVENT *meta);
00166
00167
00168
00169
00170 jobject jvr_convert_evtdatap_n2j (JNIEnv *e, long type, long len, void *datap, METAEVENT *meta);
00171
00172
00173
00174
00175 int jvr_convert_gcinfo_n2j (JNIEnv *e, jobject jgcinfo, GC_INFO *gcinfo);
00176
00177
00178
00179
00180 int jvr_convert_ctdevinfo_n2j (JNIEnv *e, jobject jdevinfo, CT_DEVINFO *devinfo);
00181
00182
00183
00184
00185 int jvr_convert_gccallackblk_j2n (JNIEnv *e, jobject jcallack, GC_CALLACK_BLK *callack);
00186
00187
00188
00189
00190 int jvr_convert_ieblk_j2n (JNIEnv *e, jobject jieblk, IE_BLK *ieblk);
00191
00192
00193
00194
00195 void jvr_setdebuglevel (int level);
00196
00197
00198
00199
00200 int jvr_getdebuglevel();
00201
00202
00203
00204
00205 int jvr_convert_gcparm_j2n (JNIEnv *e, jobject jgcparm, GC_PARM *gcparm);
00206
00207
00208
00209
00210 int jvr_convert_intValue (JNIEnv *e, jobject intObject);