Changeset 1598
- Timestamp:
- 05/07/11 11:55:15 (11 months ago)
- Location:
- branches/4.2
- Files:
-
- 10 edited
-
bindings/java/native/NexusFile.c (modified) (74 diffs)
-
configure.ac (modified) (1 diff)
-
include/napi.h (modified) (3 diffs)
-
src/napi.c (modified) (5 diffs)
-
src/napi4.c (modified) (3 diffs)
-
src/napi5.c (modified) (6 diffs)
-
src/nexus_symbols.txt (modified) (1 diff)
-
src/nxstack.c (modified) (1 diff)
-
src/nxstack.h (modified) (1 diff)
-
src/nxxml.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2/bindings/java/native/NexusFile.c
r1427 r1598 37 37 the integer first before it can do useful work. 38 38 39 40 39 */ 41 40 #include <stdlib.h> … … 53 52 #endif 54 53 55 //#define DEBUG 56 #ifdef DEBUG 57 static FILE *fd = NULL; 58 #endif 59 60 static jclass nexusException; // Global variable 54 /* #define DEBUG */ 55 61 56 static JavaVM *jvm; // Global variable 62 57 63 58 JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { 64 59 JNIEnv *env; 60 jclass nexusException; 65 61 66 62 jint ret = (*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_1); … … 68 64 assert(ret == JNI_OK); 69 65 70 // Find and store the NexusException class for use in JapiError 66 jvm = vm; 67 71 68 nexusException = (*env)->FindClass(env,"org/nexusformat/NexusException"); 72 assert(nexusException); 73 74 jvm = vm; 69 if (nexusException == NULL) { 70 fprintf(stderr, "cannot find NexusException - this will not work. Terminating."); 71 assert(nexusException); 72 } 75 73 76 74 return JNI_VERSION_1_1; … … 84 82 --------------------------------------------------------------------------*/ 85 83 static void JapiError(void *pData, char *text) { 86 // better ignore the env passed in via pData, it is unsafe due to #21987 JNIEnv *env;84 JNIEnv *env = pData; 85 jclass nexusException; 88 86 89 87 #ifdef DEBUG 90 fprintf(fd,"JapiError called with: %s\n", text); 91 #endif 92 88 fprintf(stderr,"JapiError called with: %s\n", text); 89 #endif 90 91 /* ignore env passed in seems safer */ 93 92 (*jvm)->AttachCurrentThread (jvm, (void **) &env, NULL); 94 93 … … 98 97 } 99 98 99 // Find and store the NexusException class for use in JapiError 100 nexusException = (*env)->FindClass(env,"org/nexusformat/NexusException"); 100 101 (*env)->ThrowNew(env, nexusException, text); 101 102 } … … 111 112 int iRet; 112 113 113 #ifdef DEBUG 114 if(fd == NULL) 115 { 116 fd = fopen("jnexusdebug.dat","w"); 117 } 118 #endif 119 /* set error handler */ 120 NXMSetError(env,JapiError); 114 /* set error handler */ 115 NXMSetTError(env,JapiError); 121 116 122 117 /* extract the filename as a C char* */ 123 fileName = (char *) (*env)->GetStringUTFChars(env, filename,0);118 fileName = (char *) (*env)->GetStringUTFChars(env, filename, 0); 124 119 125 120 /* call NXopen */ 126 121 #ifdef DEBUG 127 fprintf( fd,"Calling NXopen on %s, with %d\n", fileName,access);122 fprintf(stderr,"Calling NXopen on %s, with %d\n", fileName, access); 128 123 #endif 129 124 iRet = NXopen(fileName,access,&handle); 130 125 131 126 #ifdef DEBUG 132 fprintf( fd,"Handle %d allocated for %s\n", handle, fileName);127 fprintf(stderr,"Handle allocated for %s\n", fileName); 133 128 #endif 134 129 … … 155 150 156 151 /* set error handler */ 157 NXMSet Error(env,JapiError);152 NXMSetTError(env,JapiError); 158 153 159 154 /* exchange the Java handler to a NXhandle */ … … 162 157 /* kill handle */ 163 158 HHRemoveHandle(handle); 164 165 159 166 160 /* call NXflush */ … … 186 180 187 181 /* set error handler */ 188 NXMSet Error(env,JapiError);182 NXMSetTError(env,JapiError); 189 183 190 184 /* exchange the Java handler to a NXhandle */ 191 185 nxhandle = (NXhandle)HHGetPointer(handle); 192 186 #ifdef DEBUG 193 fprintf( fd,"closing handle %d, nxhandle %d\n", handle, nxhandle);187 fprintf(stderr,"closing handle %d, nxhandle %d\n", handle, nxhandle); 194 188 #endif 195 189 … … 210 204 211 205 /* set error handler */ 212 NXMSet Error(env,JapiError);206 NXMSetTError(env,JapiError); 213 207 214 208 /* exchange the Java handler to a NXhandle */ … … 237 231 238 232 /* set error handler */ 239 NXMSet Error(env,JapiError);233 NXMSetTError(env,JapiError); 240 234 241 235 /* exchange the Java handler to a NXhandle */ … … 251 245 if(iRet != NX_OK) 252 246 { 253 fprintf( fd,"Cleanup code called after raising Exception\n");247 fprintf(stderr,"Cleanup code called after raising Exception\n"); 254 248 } 255 249 #endif … … 269 263 270 264 /* set error handler */ 271 NXMSet Error(env,JapiError);265 NXMSetTError(env,JapiError); 272 266 273 267 /* exchange the Java handler to a NXhandle */ … … 282 276 if(iRet != NX_OK) 283 277 { 284 fprintf( fd,"Cleanup code called after raising Exception\n");278 fprintf(stderr,"Cleanup code called after raising Exception\n"); 285 279 } 286 280 #endif … … 299 293 300 294 /* set error handler */ 301 NXMSet Error(env,JapiError);295 NXMSetTError(env,JapiError); 302 296 303 297 /* exchange the Java handler to a NXhandle */ … … 312 306 if(iRet != NX_OK) 313 307 { 314 fprintf( fd,"Cleanup code called after raising Exception\n");308 fprintf(stderr,"Cleanup code called after raising Exception\n"); 315 309 } 316 310 #endif … … 327 321 328 322 /* set error handler */ 329 NXMSet Error(env,JapiError);323 NXMSetTError(env,JapiError); 330 324 331 325 /* exchange the Java handler to a NXhandle */ … … 347 341 348 342 /* set error handler */ 349 NXMSet Error(env,JapiError);343 NXMSetTError(env,JapiError); 350 344 351 345 /* exchange the Java handler to a NXhandle */ … … 368 362 369 363 /* set error handler */ 370 NXMSet Error(env,JapiError);364 NXMSetTError(env,JapiError); 371 365 372 366 /* exchange the Java handler to a NXhandle */ … … 399 393 400 394 /* set error handler */ 401 NXMSet Error(env,JapiError);395 NXMSetTError(env,JapiError); 402 396 403 397 /* exchange the Java handler to a NXhandle */ … … 433 427 434 428 /* set error handler */ 435 NXMSet Error(env,JapiError);429 NXMSetTError(env,JapiError); 436 430 437 431 /* exchange the Java handler to a NXhandle */ … … 456 450 457 451 /* set error handler */ 458 NXMSet Error(env,JapiError);452 NXMSetTError(env,JapiError); 459 453 460 454 /* exchange the Java handler to a NXhandle */ … … 474 468 475 469 /* set error handler */ 476 NXMSet Error(env,JapiError);470 NXMSetTError(env,JapiError); 477 471 478 472 /* exchange the Java handler to a NXhandle */ … … 480 474 481 475 #ifdef DEBUG 482 fprintf( fd,"Compressing at %d with type %d\n", nxhandle, comp_type);476 fprintf(stderr,"Compressing at %d with type %d\n", nxhandle, comp_type); 483 477 #endif 484 478 iRet = NXcompress(nxhandle,comp_type); … … 495 489 496 490 /* set error handler */ 497 NXMSet Error(env,JapiError);491 NXMSetTError(env,JapiError); 498 492 499 493 /* exchange the Java handler to a NXhandle */ … … 510 504 if(iRet != NX_OK) 511 505 { 512 HEprint( fd,0);506 HEprint(stderr,0); 513 507 } 514 508 #endif … … 527 521 528 522 /* set error handler */ 529 NXMSet Error(env,JapiError);523 NXMSetTError(env,JapiError); 530 524 531 525 /* exchange the Java handler to a NXhandle */ … … 558 552 559 553 /* set error handler */ 560 NXMSet Error(env,JapiError);554 NXMSetTError(env,JapiError); 561 555 562 556 /* exchange the Java handler to a NXhandle */ … … 611 605 612 606 /* set error handler */ 613 NXMSet Error(env,JapiError);607 NXMSetTError(env,JapiError); 614 608 615 609 /* exchange the Java handler to a NXhandle */ … … 626 620 if(iRet != NX_OK) 627 621 { 628 HEprint( fd,0);622 HEprint(stderr,0); 629 623 } 630 624 #endif … … 643 637 644 638 /* set error handler */ 645 NXMSet Error(env,JapiError);639 NXMSetTError(env,JapiError); 646 640 647 641 /* exchange the Java handler to a NXhandle */ … … 676 670 677 671 /* set error handler */ 678 NXMSet Error(env,JapiError);672 NXMSetTError(env,JapiError); 679 673 680 674 /* exchange the Java handler to a NXhandle */ … … 686 680 iargs = (*env)->GetIntArrayElements(env,args,0); 687 681 #ifdef DEBUG 688 fprintf( fd,"nxgetattr converted types \n");682 fprintf(stderr,"nxgetattr converted types \n"); 689 683 #endif 690 684 … … 692 686 iType = iargs[1]; 693 687 #ifdef DEBUG 694 fprintf( fd,"nxgetattr: iLen %d, iType: %d\n",iLen, iType);688 fprintf(stderr,"nxgetattr: iLen %d, iType: %d\n",iLen, iType); 695 689 #endif 696 690 … … 699 693 iargs[1] = iType; 700 694 #ifdef DEBUG 701 fprintf( fd,"nxgetattr cleaning up \n");695 fprintf(stderr,"nxgetattr cleaning up \n"); 702 696 #endif 703 697 … … 721 715 722 716 /* set error handler */ 723 NXMSet Error(env,JapiError);717 NXMSetTError(env,JapiError); 724 718 725 719 /* exchange the Java handler to a NXhandle */ … … 733 727 if(cls == NULL) 734 728 { 735 NXIReportError(env,729 JapiError(env, 736 730 "ERROR: failed to locate class in nxgetgroupid"); 737 731 return; … … 740 734 if(fid == 0) 741 735 { 742 NXIReportError(env,736 JapiError(env, 743 737 "ERROR: failed to locate fieldID in nxgetgroupid"); 744 738 return; … … 749 743 if(fid == 0) 750 744 { 751 NXIReportError(env,745 JapiError(env, 752 746 "ERROR: failed to locate fieldID in nxgetgroupid"); 753 747 return; … … 762 756 if(fid == 0) 763 757 { 764 NXIReportError(env,758 JapiError(env, 765 759 "ERROR: failed to locate targetPath in nxgetgroupid"); 766 760 return; … … 772 766 if(fid == 0) 773 767 { 774 NXIReportError(env,768 JapiError(env, 775 769 "ERROR: failed to locate linkType in nxgetgroupid"); 776 770 return; … … 782 776 if(fid == 0) 783 777 { 784 NXIReportError(env,778 JapiError(env, 785 779 "ERROR: failed to locate targetPath in nxgetgroupid"); 786 780 return; … … 804 798 805 799 /* set error handler */ 806 NXMSet Error(env,JapiError);800 NXMSetTError(env,JapiError); 807 801 808 802 /* exchange the Java handler to a NXhandle */ … … 816 810 if(cls == NULL) 817 811 { 818 NXIReportError(env,812 JapiError(env, 819 813 "ERROR: failed to locate class in nxgetdataid"); 820 814 return; … … 823 817 if(fid == 0) 824 818 { 825 NXIReportError(env,819 JapiError(env, 826 820 "ERROR: failed to locate fieldID in nxgetdataid"); 827 821 return; … … 831 825 if(fid == 0) 832 826 { 833 NXIReportError(env,827 JapiError(env, 834 828 "ERROR: failed to locate fieldID in nxgetdataid"); 835 829 return; … … 844 838 if(fid == 0) 845 839 { 846 NXIReportError(env,840 JapiError(env, 847 841 "ERROR: failed to locate targetPath in nxgetgroupid"); 848 842 return; … … 854 848 if(fid == 0) 855 849 { 856 NXIReportError(env,850 JapiError(env, 857 851 "ERROR: failed to locate linkType in nxgetgroupid"); 858 852 return; … … 864 858 if(fid == 0) 865 859 { 866 NXIReportError(env,860 JapiError(env, 867 861 "ERROR: failed to locate targetPath in nxgetdataid"); 868 862 return; … … 888 882 889 883 /* set error handler */ 890 NXMSet Error(env,JapiError);884 NXMSetTError(env,JapiError); 891 885 892 886 /* exchange the Java handler to a NXhandle */ … … 897 891 if(cls == NULL) 898 892 { 899 NXIReportError(env,893 JapiError(env, 900 894 "ERROR: failed to locate class in nxmakelink"); 901 895 return; … … 904 898 if(fid == 0) 905 899 { 906 NXIReportError(env,900 JapiError(env, 907 901 "ERROR: failed to locate fieldID in nxmakelink"); 908 902 return; … … 912 906 if(fid == 0) 913 907 { 914 NXIReportError(env,908 JapiError(env, 915 909 "ERROR: failed to locate fieldID in nxmakelink"); 916 910 return; … … 925 919 if(fid == 0) 926 920 { 927 NXIReportError(env,921 JapiError(env, 928 922 "ERROR: failed to locate targetPath in nxmakelink"); 929 923 return; … … 937 931 if(fid == 0) 938 932 { 939 NXIReportError(env,933 JapiError(env, 940 934 "ERROR: failed to locate linkType in nxmakelink"); 941 935 return; … … 947 941 if(fid == 0) 948 942 { 949 NXIReportError(env,943 JapiError(env, 950 944 "ERROR: failed to locate targetPath in nxmakelink"); 951 945 return; … … 975 969 976 970 /* set error handler */ 977 NXMSet Error(env,JapiError);971 NXMSetTError(env,JapiError); 978 972 979 973 /* exchange the Java handler to a NXhandle */ … … 987 981 if(cls == NULL) 988 982 { 989 NXIReportError(env,983 JapiError(env, 990 984 "ERROR: failed to locate class in nxmakelink"); 991 985 return; … … 994 988 if(fid == 0) 995 989 { 996 NXIReportError(env,990 JapiError(env, 997 991 "ERROR: failed to locate fieldID in nxmakelink"); 998 992 return; … … 1002 996 if(fid == 0) 1003 997 { 1004 NXIReportError(env,998 JapiError(env, 1005 999 "ERROR: failed to locate fieldID in nxmakelink"); 1006 1000 return; … … 1015 1009 if(fid == 0) 1016 1010 { 1017 NXIReportError(env,1011 JapiError(env, 1018 1012 "ERROR: failed to locate targetPath in nxmakelink"); 1019 1013 return; … … 1027 1021 if(fid == 0) 1028 1022 { 1029 NXIReportError(env,1023 JapiError(env, 1030 1024 "ERROR: failed to locate linkType in nxmakelink"); 1031 1025 return; … … 1037 1031 if(fid == 0) 1038 1032 { 1039 NXIReportError(env,1033 JapiError(env, 1040 1034 "ERROR: failed to locate targetPath in nxmakelink"); 1041 1035 return; … … 1061 1055 1062 1056 /* set error handler */ 1063 NXMSet Error(env,JapiError);1057 NXMSetTError(env,JapiError); 1064 1058 1065 1059 /* exchange the Java handler to a NXhandle */ … … 1080 1074 1081 1075 /* set error handler */ 1082 NXMSet Error(env,JapiError);1076 NXMSetTError(env,JapiError); 1083 1077 1084 1078 /* exchange the Java handler to a NXhandle */ … … 1110 1104 1111 1105 /* set error handler */ 1112 NXMSet Error(env,JapiError);1106 NXMSetTError(env,JapiError); 1113 1107 1114 1108 /* exchange the Java handler to a NXhandle */ … … 1145 1139 1146 1140 /* set error handler */ 1147 NXMSet Error(env,JapiError);1141 NXMSetTError(env,JapiError); 1148 1142 1149 1143 /* exchange the Java handler to a NXhandle */ … … 1173 1167 jint *jarray; 1174 1168 /* set error handler */ 1175 NXMSet Error(env,JapiError);1169 NXMSetTError(env,JapiError); 1176 1170 1177 1171 /* exchange the Java handler to a NXhandle */ … … 1200 1194 1201 1195 /* set error handler */ 1202 NXMSet Error(env,JapiError);1196 NXMSetTError(env,JapiError); 1203 1197 1204 1198 /* exchange the Java handler to a NXhandle */ … … 1219 1213 1220 1214 /* set error handler */ 1221 NXMSet Error(env,JapiError);1215 NXMSetTError(env,JapiError); 1222 1216 1223 1217 /* exchange the Java handler to a NXhandle */ … … 1245 1239 1246 1240 /* set error handler */ 1247 NXMSet Error(env,JapiError);1241 NXMSetTError(env,JapiError); 1248 1242 1249 1243 /* exchange the Java handler to a NXhandle */ … … 1273 1267 1274 1268 /* set error handler */ 1275 NXMSet Error(env,JapiError);1269 NXMSetTError(env,JapiError); 1276 1270 1277 1271 /* exchange the Java handler to a NXhandle */ … … 1289 1283 1290 1284 /* set error handler */ 1291 NXMSet Error(env,JapiError);1285 NXMSetTError(env,JapiError); 1292 1286 1293 1287 /* exchange the Java handler to a NXhandle */ … … 1310 1304 } 1311 1305 } 1312 1313 1314 1315 1316 1317 1318 1319 1320 -
branches/4.2/configure.ac
r1455 r1598 131 131 WITH_F90=no 132 132 fi 133 134 AC_ARG_WITH([matlabroot], AC_HELP_STRING([--with-matlabroot=path to matlab install dir], [Specify location of matlab installation directory]), 135 [], [with_matlabroot=no]) 136 if test x"$with_matlabroot" != x"no" ; then 137 MATLABROOT="$with_matlabroot" 138 fi 139 AC_PATH_PROG(MATLAB,matlab,[],[$MATLABROOT/bin:/usr/local/matlab/bin:/opt/matlab/bin:$PATH]) 140 if test x"$MATLABROOT" = x -a x"$MATLAB" != x; then 141 MATLABROOT=`dirname $MATLAB`/.. 142 fi 143 144 dnl thread local storage 145 AC_MSG_CHECKING([for __thread]) 146 AC_LINK_IFELSE([AC_LANG_PROGRAM([#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC__MINOR__ < 1) || (__GNUC__ == 4 && __GNUC__MINOR__ == 1 && __GNUC_PATCHLEVEL__ < 2)) 147 #endif], [static __thread int p = 0])], 148 [AC_DEFINE(HAVE_TLS, 1, 149 Define to 1 if compiler supports __thread) 150 AC_MSG_RESULT([yes])], 151 [AC_MSG_RESULT([no])]) 133 152 134 153 java_host="linux" -
branches/4.2/include/napi.h
r1453 r1598 728 728 729 729 /** 730 * Set an error function. 731 * \param pData A pointer to a user defined data structure which be passed opaquely to 730 * Set a global error function. 731 * Not threadsafe. 732 * \param pData A pointer to a user defined data structure which be passed to 732 733 * the error display function. 733 734 * \param newErr The new error display function. … … 736 737 737 738 /** 739 * Set an error function for the current thread. 740 * When used this overrides anything set in NXMSetError (for the current thread). 741 * Use this method in threaded applications. 742 * \param pData A pointer to a user defined data structure which be passed to 743 * the error display function. 744 * \param newErr The new error display function. 745 */ 746 extern void NXMSetTError(void *pData, ErrFunc newErr); 747 748 /** 738 749 * Retrieve the current error display function 739 * \return The current erro display function.750 * \return The current error display function. 740 751 */ 741 752 extern ErrFunc NXMGetError(); … … 752 763 753 764 754 extern void (*NXIReportError)(void *pData,char *text);765 extern void NXIReportError(void *pData,char *text); 755 766 extern void *NXpData; 756 767 extern char *NXIformatNeXusTime(); -
branches/4.2/src/napi.c
r1429 r1598 178 178 static void NXNXNXReportError(void *pData, char *string) 179 179 { 180 printf("%s \n",string);180 fprintf(stderr, "%s \n", string); 181 181 } 182 182 /*---------------------------------------------------------------------*/ 183 183 184 void *NXpData = NULL; 184 void (*NXIReportError)(void *pData, char *string) = NXNXNXReportError; 185 void *NXEHpData = NULL; 186 void (*NXEHIReportError)(void *pData, char *string) = NXNXNXReportError; 187 #ifdef HAVE_TLS 188 __thread void *NXEHpTData = NULL; 189 __thread void (*NXEHIReportTError)(void *pData, char *string) = NULL; 190 #endif 191 192 void NXIReportError(void *pData, char *string) { 193 #ifdef HAVE_TLS 194 if (NXEHIReportTError) { 195 (*NXEHIReportTError)(NXEHpTData, string); 196 return; 197 } 198 #endif 199 200 (*NXEHIReportError)(NXEHpData, string); 201 } 202 185 203 /*---------------------------------------------------------------------*/ 186 extern void NXMSetError(void *pData, 187 void (*NewError)(void *pD, char *text)) 188 { 189 NXpData = pData; 190 NXIReportError = NewError; 204 extern void NXMSetError(void *pData, void (*NewError)(void *pD, char *text)) 205 { 206 NXEHpData = pData; 207 NXEHIReportError = NewError; 208 } 209 /*----------------------------------------------------------------------*/ 210 extern void NXMSetTError(void *pData, void (*NewError)(void *pD, char *text)) 211 { 212 #ifdef HAVE_TLS 213 NXEHpTData = pData; 214 NXEHIReportTError = NewError; 215 #else 216 NXMSetError(pData, NewError); 217 #endif 191 218 } 192 219 /*----------------------------------------------------------------------*/ 193 220 extern ErrFunc NXMGetError(){ 194 return NXIReportError; 221 #ifdef HAVE_TLS 222 if (NXEHIReportTError) { 223 return NXEHIReportTError; 224 } 225 #endif 226 return NXEHIReportError; 195 227 } 196 228 … … 201 233 /*----------------------------------------------------------------------*/ 202 234 203 static ErrFunc last_errfunc = NXNXNXReportError; 235 ErrFunc last_global_errfunc = NXNXNXReportError; 236 #ifdef HAVE_TLS 237 __thread ErrFunc last_thread_errfunc = NULL; 238 #endif 204 239 205 240 extern void NXMDisableErrorReporting() 206 241 { 207 last_errfunc = NXMGetError(); 208 NXMSetError(NXpData, NXNXNoReport); 242 #ifdef HAVE_TLS 243 if (NXEHIReportTError) { 244 last_thread_errfunc = NXEHIReportTError; 245 NXEHIReportTError = NXNXNoReport; 246 return; 247 } 248 last_thread_errfunc = NULL; 249 #endif 250 last_global_errfunc = NXEHIReportError; 251 NXEHIReportError = NXNXNoReport; 209 252 } 210 253 211 254 extern void NXMEnableErrorReporting() 212 255 { 213 NXMSetError(NXpData, last_errfunc); 256 #ifdef HAVE_TLS 257 if (last_thread_errfunc) { 258 NXEHIReportTError = last_thread_errfunc; 259 last_thread_errfunc = NULL; 260 return; 261 } 262 #endif 263 NXEHIReportError = last_global_errfunc; 214 264 } 215 265 … … 536 586 pFileStack fileStack; 537 587 char nxurl[1024], exfile[512], expath[512]; 538 ErrFunc oldError;539 588 pNexusFunction pFunc = NULL; 540 589 … … 546 595 pushPath(fileStack,name); 547 596 } 548 oldError = NXMGetError(); 549 NXIReportError = NXNXNoReport; 597 NXMDisableErrorReporting(); 550 598 attStatus = NXgetattr(fid,"napimount",nxurl,&length, &type); 551 NX IReportError = oldError;599 NXMEnableErrorReporting(); 552 600 if(attStatus == NX_OK){ 553 601 /* … … 1050 1098 return status; 1051 1099 } 1052 oldError = NXMGetError(); 1053 NXIReportError = NXNXNoReport; 1100 NXMDisableErrorReporting(); 1054 1101 attStatus = NXgetattr(fid,"napimount",nxurl,&length, &type); 1055 NX IReportError = oldError;1102 NXMEnableErrorReporting(); 1056 1103 pFunc->nxclosegroup(pFunc->pNexusData); 1057 1104 if(attStatus == NX_OK){ -
branches/4.2/src/napi4.c
r1427 r1598 1292 1292 { 1293 1293 pNexusFile pFile; 1294 ErrFunc oldErr;1295 1294 int datalen, type = NX_CHAR; 1296 1295 … … 1303 1302 sRes->iTag = DFTAG_NDG; 1304 1303 sRes->iRef = SDidtoref (pFile->iCurrentSDS); 1305 oldErr = NXMGetError(); 1306 NXMSetError(NXpData, ignoreError); 1304 NXMDisableErrorReporting(); 1307 1305 datalen = 1024; 1308 1306 memset(&sRes->targetPath,0,1024); … … 1311 1309 NXIbuildPath(pFile,sRes->targetPath,1024); 1312 1310 } 1313 NXM SetError(NXpData,oldErr);1311 NXMEnableErrorReporting(); 1314 1312 return NX_OK; 1315 1313 } -
branches/4.2/src/napi5.c
r1427 r1598 1050 1050 { 1051 1051 pNexusFile5 pFile; 1052 ErrFunc oldErr;1053 1052 int datalen, type = NX_CHAR; 1054 1053 … … 1066 1065 the path to the current node 1067 1066 */ 1068 oldErr = NXMGetError(); 1069 NXMSetError(NXpData, ignoreError); 1067 NXMDisableErrorReporting(); 1070 1068 datalen = 1024; 1071 1069 memset(&sRes->targetPath,0,datalen*sizeof(char)); … … 1074 1072 buildCurrentPath(pFile, sRes->targetPath, 1024); 1075 1073 } 1076 NXM SetError(NXpData,oldErr);1074 NXMEnableErrorReporting(); 1077 1075 sRes->linkType = 1; 1078 1076 return NX_OK; … … 2031 2029 pNexusFile5 pFile; 2032 2030 int datalen, type = NX_CHAR; 2033 ErrFunc oldErr;2034 2031 2035 2032 pFile = NXI5assert (fileid); … … 2042 2039 the path to the current node 2043 2040 */ 2044 oldErr = NXMGetError(); 2045 NXMSetError(NXpData, ignoreError); 2041 NXMDisableErrorReporting(); 2046 2042 datalen = 1024; 2047 2043 memset(sRes->targetPath,0,datalen*sizeof(char)); … … 2049 2045 buildCurrentPath(pFile,sRes->targetPath,1024); 2050 2046 } 2051 NXM SetError(NXpData,oldErr);2047 NXMEnableErrorReporting(); 2052 2048 sRes->linkType = 0; 2053 2049 return NX_OK; -
branches/4.2/src/nexus_symbols.txt
r1427 r1598 47 47 nxiisexternalgroup_ 48 48 NXMSetError 49 NXMSetTError 49 50 NXIReportError 50 51 NXIprintlink -
branches/4.2/src/nxstack.c
r1427 r1598 110 110 } 111 111 /*----------------------------------------------------------------------*/ 112 void pushPath(pFileStack self, c har *name){112 void pushPath(pFileStack self, const char *name){ 113 113 self->pathPointer++; 114 114 strncpy(self->pathStack[self->pathPointer],name,NX_MAXNAMELEN-1); -
branches/4.2/src/nxstack.h
r1427 r1598 45 45 int fileStackDepth(pFileStack self); 46 46 47 void pushPath(pFileStack self, c har *name);47 void pushPath(pFileStack self, const char *name); 48 48 void popPath(pFileStack self); 49 49 int buildPath(pFileStack self, char *path, int pathlen); -
branches/4.2/src/nxxml.c
r1427 r1598 1745 1745 path = (mxml_node_t **)malloc(NXMAXSTACK*sizeof(mxml_node_t *)); 1746 1746 if(path == NULL){ 1747 NXIReportError(NXpData,"ERROR: out of memory foll woing link path");1747 NXIReportError(NXpData,"ERROR: out of memory following link path"); 1748 1748 return NULL; 1749 1749 } … … 1899 1899 /*--------------------------------------------------------------------*/ 1900 1900 int NXXcompress(NXhandle fid, int comp){ 1901 NXIReportError(NXpData,"NXcompress is deprecated, IGNORED"); 1901 /* that will throw an exception in the Java API, errors have to be fatal */ 1902 /* NXIReportError(NXpData,"NXcompress is deprecated, IGNORED"); */ 1902 1903 return NX_OK; 1903 1904 }
Note: See TracChangeset
for help on using the changeset viewer.
