Changes from tags/4.2.0 at r1896 to tags/4.2.1 at r1896
- Location:
- tags
- Files:
-
- 38 added
- 1 deleted
- 68 edited
-
4.2.1/contrib/bindings/Makefile.am (modified) (1 diff)
-
4.2.1/acinclude.m4 (modified) (1 diff)
-
4.2.1/Makefile.am (modified) (3 diffs)
-
4.2.1/examples (modified) (1 prop)
-
4.2.1/applications/NXtranslate/opengenie/Makefile.am (modified) (1 diff)
-
4.2.1/applications/NXtranslate/Makefile.am (modified) (1 diff)
-
4.2.1/applications/NXsummary/tclap/MultiArg.h (modified) (1 diff)
-
4.2.1/applications/NXsummary/tclap/ValueArg.h (modified) (1 diff)
-
4.2.1/applications/NXsummary/main.cpp (modified) (1 diff)
-
4.2.1/applications/nxdiff (modified) (1 diff)
-
4.2.1/applications/NXdir/string_util.cpp (modified) (2 diffs)
-
4.2.1/applications/NXdir/data_writer.cpp (modified) (1 diff)
-
4.2.1/applications/NXbrowse.c (modified) (10 diffs)
-
4.2.1/macosx_install_kit (added)
-
4.2.1/macosx_install_kit/bin (added)
-
4.2.1/macosx_install_kit/bin/makepkg.sh (added)
-
4.2.1/macosx_install_kit/bin/dmgpack.sh (added)
-
4.2.1/macosx_install_kit/Makefile.am (added)
-
4.2.1/macosx_install_kit/Resources (added)
-
4.2.1/macosx_install_kit/Resources/postflight (added)
-
4.2.1/macosx_install_kit/Resources/preflight (added)
-
4.2.1/macosx_install_kit/Resources/English.lproj (added)
-
4.2.1/macosx_install_kit/Resources/English.lproj/Welcome.txt (added)
-
4.2.1/macosx_install_kit/Resources/English.lproj/Conclusion.txt (added)
-
4.2.1/macosx_install_kit/Resources/English.lproj/ReadMe.txt (added)
-
4.2.1/macosx_install_kit/Resources/English.lproj/Description.plist (added)
-
4.2.1/macosx_install_kit/Resources/English.lproj/background.jpg (added)
-
4.2.1/macosx_install_kit/Resources/English.lproj/License.txt (added)
-
4.2.1/macosx_install_kit/pkg.config.in (added)
-
4.2.1/macosx_install_kit/ReadMe.txt (added)
-
4.2.1/macosx_install_kit/build_mac_kit.sh (added)
-
4.2.1/scripts (modified) (1 prop)
-
4.2.1/src/napi4.c (modified) (9 diffs)
-
4.2.1/src/nxstack.c (modified) (5 diffs)
-
4.2.1/src/napi5.c (modified) (24 diffs)
-
4.2.1/src/nxio.c (modified) (6 diffs)
-
4.2.1/src/nxstack.h (modified) (3 diffs)
-
4.2.1/src/napi.c (modified) (22 diffs)
-
4.2.1/src/Makefile.am (modified) (2 diffs)
-
4.2.1/src/nxdataset.c (modified) (2 diffs)
-
4.2.1/src/nxxml.c (modified) (12 diffs)
-
4.2.1/src/nexus_symbols.txt (modified) (3 diffs)
-
4.2.1/configure_mingw_kit (added)
-
4.2.1/bindings (modified) (1 prop)
-
4.2.1/bindings/idl/NeXusIDL-API.dlm (modified) (1 diff)
-
4.2.1/bindings/idl/NeXusIDL-API.c (modified) (2 diffs)
-
4.2.1/bindings/swig/nxinterhelper.h (modified) (1 diff)
-
4.2.1/bindings/swig/nxinter.i (modified) (1 diff)
-
4.2.1/bindings/swig/nxinterhelper.c (modified) (1 diff)
-
4.2.1/bindings/f90/Makefile.am (modified) (1 diff)
-
4.2.1/bindings/java/Makefile.am (modified) (1 diff)
-
4.2.1/bindings/java/native/NexusFile.c (modified) (71 diffs)
-
4.2.1/bindings/java/org/nexusformat/NexusFile.java (modified) (31 diffs)
-
4.2.1/bindings/java/org/nexusformat/NeXusFileInterface.java (modified) (1 diff)
-
4.2.1/bindings/python/setup.py (added)
-
4.2.1/bindings/python/Makefile.am (modified) (1 diff)
-
4.2.1/bindings/cpp/NeXusFile.cpp (modified) (3 diffs)
-
4.2.1/bindings/cpp/NeXusFile.hpp (modified) (1 diff)
-
4.2.1/bindings/cpp/Makefile.am (modified) (1 diff)
-
4.2.1/bindings/f77/napif.inc (modified) (3 diffs)
-
4.2.1/bindings/f77/Makefile.am (modified) (1 diff)
-
4.2.1/bindings/f77/napif.f (modified) (1 diff)
-
4.2.1/configure.ac (modified) (21 diffs)
-
4.2.1/doc (modified) (1 prop)
-
4.2.1/doc/doxygen/Doxyfile_f90 (added)
-
4.2.1/doc/doxygen/Doxyfile_java (added)
-
4.2.1/doc/doxygen/Doxyfile_python (added)
-
4.2.1/doc/doxygen/Doxyfile_c (added)
-
4.2.1/doc/doxygen/Doxyfile_cpp (added)
-
4.2.1/doc/doxygen/Doxyfile_f77 (added)
-
4.2.1/doc/doxygen/Makefile.am (modified) (3 diffs)
-
4.2.0/doc/doxygen/Doxyfile.in (deleted)
-
4.2.1/doc/tech_ref/methods.docbook (modified) (2 diffs)
-
4.2.1/doc/tech_ref/base_classes.docbook (modified) (6 diffs)
-
4.2.1/doc/tech_ref/tofnpd.docbook (modified) (1 diff)
-
4.2.1/doc/tech_ref/NeXus_definitions.docbook (modified) (3 diffs)
-
4.2.1/NEWS (modified) (1 diff)
-
4.2.1/InstallerBits (added)
-
4.2.1/InstallerBits/Licences (added)
-
4.2.1/InstallerBits/Licences/COPYING_libxml2.txt (added)
-
4.2.1/InstallerBits/Licences/COPYING.rtf (added)
-
4.2.1/InstallerBits/Licences/AUTHORS.txt (added)
-
4.2.1/InstallerBits/Licences/COPYING_iconv.txt (added)
-
4.2.1/InstallerBits/Licences/COPYING.txt (added)
-
4.2.1/InstallerBits/Licences/COPYING_zlib.txt (added)
-
4.2.1/InstallerBits/Licences/COPYING_nexus.txt (added)
-
4.2.1/InstallerBits/Licences/COPYING_hdf4.txt (added)
-
4.2.1/InstallerBits/Licences/COPYING_hdf5.txt (added)
-
4.2.1/test (modified) (1 prop)
-
4.2.1/test/napif4_test.f (modified) (4 diffs)
-
4.2.1/test/napif5_test.f (modified) (4 diffs)
-
4.2.1/test/napi_test.c (modified) (4 diffs)
-
4.2.1/test/data/dmc02.h5 (modified) (previous)
-
4.2.1/test/data/dmc01.hdf (modified) (previous)
-
4.2.1/test/data/dmc02.hdf (modified) (previous)
-
4.2.1/test/data/dmc01.h5 (modified) (previous)
-
4.2.1/test/napif_test.f (modified) (2 diffs)
-
4.2.1/test/atlocal.in (modified) (2 diffs)
-
4.2.1/test/napi_test_cpp.cxx (modified) (2 diffs)
-
4.2.1/test/testsuite.at (modified) (41 diffs)
-
4.2.1/test/leak_test2.cxx (modified) (1 diff)
-
4.2.1/nexus_spec.in (modified) (1 diff)
-
4.2.1/include (modified) (1 prop)
-
4.2.1/include/Makefile.am (modified) (1 diff)
-
4.2.1/include/napi.h (modified) (11 diffs)
-
4.2.1/include/napiconfig.h (modified) (2 diffs)
-
4.2.1/include/nxconfig_vms.h (added)
Legend:
- Unmodified
- Added
- Removed
-
tags/4.2.1/contrib/bindings/Makefile.am
r1896 r1896 34 34 PYSUB = python 35 35 endif 36 SUBDIRS = $( JAVASUB) $(PYSUB)36 SUBDIRS = $(PYSUB) # $(JAVASUB) -
tags/4.2.1/acinclude.m4
r1896 r1896 156 156 fi 157 157 ]) 158 159 AC_DEFUN([AC_CHECK_PYTHON_MODULE], 160 [ 161 if test -z "$PYTHON"; then PYTHON="python"; fi 162 AC_MSG_CHECKING(for python module $1) 163 $PYTHON -c "import $1" 2>/dev/null 164 if test $? -eq 0; then 165 eval PYTHON_$1=1 166 eval PYTHON_$1_found="yes" 167 AC_MSG_RESULT(found) 168 else 169 eval PYTHON_$1=0 170 eval PYTHON_$1_found="no" 171 AC_MSG_RESULT(not found) 172 fi 173 AC_SUBST(PYTHON_$1) 174 ]) -
tags/4.2.1/Makefile.am
r1896 r1896 2 2 # NeXus - Neutron & X-ray Common Data Format 3 3 # 4 # $Id$5 #6 4 # Top level Makefile for coordinating NeXus build 7 5 # … … 23 21 # MA 02111-1307 USA 24 22 # 25 # For further information, see <http://www.ne utron.anl.gov/NeXus/>23 # For further information, see <http://www.nexusformat.org> 26 24 # 27 25 # @configure_input@ … … 35 33 CONTRIB=contrib 36 34 endif 37 SUBDIRS=include src bindings applications test scripts examples doc $(CONTRIB)35 SUBDIRS=include src bindings applications test scripts examples doc macosx_install_kit $(CONTRIB) 38 36 39 37 EXTRA_DIST=build_rules.am nexus_spec.in nexus.spec autoversion.sh \ 40 38 build_rpm.in README.cygwin README.WIN32 README.macosx \ 41 README.MinGW make_mingw_links SConstruct nexus_scons_utils.py 39 README.MinGW make_mingw_links SConstruct nexus_scons_utils.py \ 40 configure_mingw_kit 42 41 43 42 # Add any flags here that you want passed to configure when you do 44 43 # a "make distcheck" 45 44 # DISTCHECK_CONFIGURE_FLAGS=--without-java 45 MAINTAINERCLEANFILES = \ 46 ChangeLog \ 47 INSTALL \ 48 aclocal.m4 \ 49 config \ 50 configure \ 51 doc/tech_ref/NeXus_definitions.pdf \ 52 doc/tech_ref/NeXus_definitions.txt \ 53 include/nxconfig_h.in \ 54 `find "$(srcdir)" -type f -name Makefile.in -print` -
tags/4.2.1/examples
-
Property
svn:mergeinfo
set to
/trunk/examples merged eligible
-
Property
svn:mergeinfo
set to
-
tags/4.2.1/applications/NXtranslate/opengenie/Makefile.am
r1896 r1896 39 39 libnxgenie_la_LDFLAGS = -no-undefined -export-dynamic -module $(LDFLAGS) 40 40 41 EXTRA_DIST = README 41 EXTRA_DIST = README nxgenie.gcl 42 42 43 43 include $(top_srcdir)/build_rules.am -
tags/4.2.1/applications/NXtranslate/Makefile.am
r1896 r1896 68 68 nxtranslate_LDFLAGS = -static @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 69 69 70 #EXTRA_DIST = CHANGES LICENSE README TODO 70 EXTRA_DIST = $(srcdir)/*.xml $(srcdir)/*.nxt $(srcdir)/*.dat $(srcdir)/*.run 71 71 72 72 include $(top_srcdir)/build_rules.am -
tags/4.2.1/applications/NXsummary/tclap/MultiArg.h
r1896 r1896 26 26 #include <string> 27 27 #include <vector> 28 #include <cstdio> 28 29 29 30 #include <tclap/Arg.h> -
tags/4.2.1/applications/NXsummary/tclap/ValueArg.h
r1896 r1896 26 26 #include <string> 27 27 #include <vector> 28 #include <cstdio> 28 29 29 30 #include <tclap/Arg.h> -
tags/4.2.1/applications/NXsummary/main.cpp
r1896 r1896 30 30 #include <string> 31 31 #include <cstring> 32 #include <cstdio> 32 33 #include <vector> 33 34 #include "data_util.hpp" -
tags/4.2.1/applications/nxdiff
r1896 r1896 28 28 29 29 def getPercentDiff(left, right, nandiff=float("nan")): 30 diffs = 100. * numpy.fabs((left-right)/left) 30 # find the difference (absolute) 31 diffs = left-right 32 combine = numpy.fabs(left) + numpy.fabs(right) 33 34 # fix the denominator so there are not nans 35 try: 36 indices = (combine == 0) 37 left[indices] = 1. 38 except IndexError: 39 if combine == 0: 40 left = 1. 41 42 # do the percent part 43 diffs = 100. * numpy.fabs(diffs/left) 31 44 try: 32 45 diffs[0] -
tags/4.2.1/applications/NXdir/string_util.cpp
r1896 r1896 282 282 */ 283 283 static string float_to_str(double value){ 284 char temp[ 20];285 s printf(temp,"%f",value);284 char temp[40]; 285 snprintf(temp,40,"%f",value); 286 286 287 287 return string(temp); … … 292 292 */ 293 293 extern string int_to_str(const long value){ 294 char temp[ 20];295 s printf(temp,"%d",value);294 char temp[40]; 295 snprintf(temp,40,"%d",value); 296 296 297 297 return string(temp); -
tags/4.2.1/applications/NXdir/data_writer.cpp
r1896 r1896 34 34 35 35 #define NXDATA "NXdata" 36 #define ATTR "ATTR"37 36 38 37 using std::string; -
tags/4.2.1/applications/NXbrowse.c
r1896 r1896 26 26 USA 27 27 28 For further information, see <http://www.ne utron.anl.gov/NeXus/>28 For further information, see <http://www.nexusformat.org> 29 29 30 30 $Id$ … … 33 33 #include <stdio.h> 34 34 #include <string.h> 35 #include <stdlib.h> 35 36 #include "napi.h" 36 37 #include "napiconfig.h" 38 static char* my_readline(const char* prompt) 39 { 40 char inputText[256]; 41 char* stringPtr; 42 fprintf(stdout, "%s", prompt); 43 if (fgets(inputText, sizeof(inputText), stdin) == NULL) 44 { 45 return NULL; 46 } 47 if ((stringPtr = strchr(inputText, '\n')) != NULL) 48 { 49 *stringPtr = '\0'; 50 } 51 return strdup(inputText); 52 } 53 #if HAVE_LIBREADLINE 54 #include <readline/readline.h> 55 #include <readline/history.h> 56 #ifndef HAVE_RL_COMPLETION_MATCHES 57 #define rl_completion_matches(a,b) completion_matches(a,b) 58 #endif /* ifndef HAVE_RL_COMPLETION_MATCHES */ 59 #else 60 #define rl_completion_matches(a,b) NULL 61 #define rl_outstream stdout 62 #define readline my_readline 63 #endif 37 64 38 65 #define StrEq(s1, s2) (strcmp((s1), (s2)) == 0) … … 57 84 static char nxFile[256]; 58 85 86 static NXhandle the_fileId; 87 88 /* 89 * Freddie Akeroyd 18/10/2009 90 * 91 * Add in support for readline and completion (nxbrowse_complete) of commands 92 * (command_generator) and on data/group names (field_generator) 93 * a / character is appended to group names for display, but stripped off 94 * by the cd command (we may want to remove this and use openpath() later) 95 * 96 */ 97 typedef struct { 98 const char* name; 99 const char* doc; 100 } COMMAND; 101 102 COMMAND commands[] = { 103 { "cd", "Move into to a group" }, 104 { "close", "Move out of a group" }, 105 { "dir", "" }, 106 { "read", "" }, 107 { "open", "" }, 108 { "help", "" }, 109 { "info", "" }, 110 { "exit", "" }, 111 { "dump", "" }, 112 { "bytesaschar", "" }, 113 { NULL, NULL } 114 }; 115 116 static char* command_generator(const char* text, int state) 117 { 118 static int len, list_index; 119 const char* name; 120 if (!state) 121 { 122 list_index = 0; 123 len = strlen(text); 124 } 125 while( (name = commands[list_index].name) != NULL ) 126 { 127 ++list_index; 128 if (strncasecmp(name, text, len) == 0) 129 { 130 return strdup(name); 131 } 132 } 133 return NULL; 134 } 135 136 struct name_item; 137 138 struct name_item 139 { 140 char* name; 141 struct name_item* next; 142 }; 143 144 static char* field_generator(const char* text, int state) 145 { 146 static int len; 147 struct name_item *item, *t_item; 148 static struct name_item *names = NULL, *last_item = NULL; 149 char* res; 150 int status, dataType; 151 NXname name, nxclass; 152 if (!state) 153 { 154 item = names; 155 while(item != NULL) 156 { 157 if (item->name != NULL) 158 { 159 free(item->name); 160 item->name = NULL; 161 } 162 t_item = item; 163 item = item->next; 164 t_item->next = NULL; 165 free(t_item); 166 } 167 last_item = names = NULL; 168 len = strlen(text); 169 if (NXinitgroupdir (the_fileId) != NX_OK) 170 { 171 return NULL; 172 } 173 do 174 { 175 status = NXgetnextentry (the_fileId, name, nxclass, &dataType); 176 if (status == NX_ERROR) break; 177 if (status == NX_OK) 178 { 179 if (strncmp(nxclass,"CDF",3) == 0){ 180 ; 181 } 182 else if (strncmp(name, text, len) == 0) 183 { 184 item = (struct name_item*)malloc(sizeof(struct name_item)); 185 item->name = strdup(name); 186 if (strcmp(nxclass,"SDS") != 0){ 187 strcat(item->name, "/"); 188 } 189 item->next = NULL; 190 if (last_item == NULL) 191 { 192 names = item; 193 } 194 else 195 { 196 last_item->next = item; 197 } 198 last_item = item; 199 } 200 } 201 } while (status == NX_OK); 202 last_item = names; 203 } 204 if (last_item != NULL) 205 { 206 res = strdup(last_item->name); 207 last_item = last_item->next; 208 } 209 else 210 { 211 res = NULL; 212 } 213 return res; 214 } 215 216 static char** nxbrowse_complete(const char* text, int start, int end) 217 { 218 char** matches = NULL; 219 static char line[512]; 220 strncpy(line, text+start, end-start); 221 line[end-start] = '\0'; 222 if (start == 0) 223 { 224 matches = rl_completion_matches(text, command_generator); 225 } 226 else 227 { 228 matches = rl_completion_matches(text, field_generator); 229 } 230 return matches; 231 } 232 233 59 234 int main(int argc, char *argv[]) 60 235 { 61 NXhandle fileId; 62 char fileName[80], inputText[255], path[80], *command, *dimensions, *stringPtr; 236 char fileName[800], path[800], *command, *dimensions, *stringPtr; 237 char prompt[512]; 238 char *inputText; 63 239 NXname groupName, dataName; 64 240 int status, groupLevel = 0, i; 65 241 66 printf ("NXBrowse %s Copyright (C) 2000 R. Osborn, M. Koennecke, P. Klosowski\n", NEXUS_VERSION); 242 #if HAVE_LIBREADLINE 243 rl_readline_name = "NXbrowse"; 244 rl_attempted_completion_function = nxbrowse_complete; 245 #if READLINE_VERSION >= 0x500 246 rl_catch_signals = 0; 247 #else 248 #define rl_crlf() fprintf(rl_outstream, "\r\n"); 249 #define rl_on_new_line() 1 250 #endif 251 using_history(); 252 #else 253 #define rl_crlf() 254 #define rl_on_new_line() 255 #define add_history(a) 256 #endif 257 258 printf ("NXBrowse %s Copyright (C) 2009 NeXus Data Format\n", NEXUS_VERSION); 67 259 68 260 /* if there is a filename given on the command line use that, … … 80 272 81 273 /* Open input file and output global attributes */ 82 if (NXopen (fileName, NXACC_READ, & fileId) != NX_OK) {274 if (NXopen (fileName, NXACC_READ, &the_fileId) != NX_OK) { 83 275 printf ("NX_ERROR: Can't open %s\n", fileName); 84 276 return NX_ERROR; 85 277 } 86 PrintAttributes ( fileId);278 PrintAttributes (the_fileId); 87 279 iByteAsChar = 0; /* Display remaining NX_INT8 and NX_UINT8 variables as integers by default */ 88 280 /* Input commands until the EXIT command is given */ 89 281 strcpy (path, "NX"); 90 282 do { 91 printf ("%s> ", path);92 if ( fgets(inputText, sizeof(inputText), stdin) == NULL)283 sprintf (prompt, "%s> ", path); 284 if (getenv("NO_READLINE") != NULL) 93 285 { 94 return NX_OK; 95 } 96 97 if ((stringPtr = strchr(inputText, '\n')) != NULL) 98 *stringPtr = '\0'; 286 inputText = my_readline(prompt); 287 } 288 else 289 { 290 inputText = readline(prompt); 291 } 292 if (inputText == NULL) 293 { 294 inputText = strdup("EXIT"); 295 } 296 if (*inputText) 297 { 298 add_history(inputText); 299 } 99 300 command = strtok(inputText," "); 100 301 /* Check if a command has been given */ … … 104 305 /* Command is to print a directory of the current group */ 105 306 if (StrEq(command, "DIR") || StrEq(command, "LS")) { 106 status = NXBdir ( fileId);307 status = NXBdir (the_fileId); 107 308 } 108 309 /* Command is to open the specified group */ 109 310 if (StrEq(command, "OPEN") || StrEq(command, "CD")) { 110 stringPtr = strtok(NULL, " ");311 stringPtr = strtok(NULL, " /"); 111 312 if (stringPtr != NULL) { 112 313 strcpy (groupName, stringPtr); 113 status = NXBopen (fileId, groupName); 114 /* Add the group to the prompt string */ 115 if (status == NX_OK) { 116 strcat (path, "/"); 117 strcat (path, groupName); 118 groupLevel++; 119 } 314 if (StrEq(groupName, "..")) { 315 strcpy(command, "CLOSE"); 316 } else { 317 status = NXBopen (the_fileId, groupName); 318 /* Add the group to the prompt string */ 319 if (status == NX_OK) { 320 strcat (path, "/"); 321 strcat (path, groupName); 322 groupLevel++; 323 } 324 } 120 325 } 121 326 else { 122 printf ("NX_ERROR: Specify a group\n");327 fprintf (rl_outstream, "NX_ERROR: Specify a group\n"); 123 328 } 124 329 } … … 131 336 if (stringPtr != NULL) { 132 337 strcpy (fileName, stringPtr); 133 status = NXBdump ( fileId, dataName, fileName);338 status = NXBdump (the_fileId, dataName, fileName); 134 339 } 135 340 else { 136 printf ("NX_ERROR: Specify a dump file name \n");341 fprintf (rl_outstream, "NX_ERROR: Specify a dump file name \n"); 137 342 } 138 343 } 139 344 else { 140 printf ("NX_ERROR: Specify a data item\n");345 fprintf (rl_outstream, "NX_ERROR: Specify a data item\n"); 141 346 } 142 347 } … … 147 352 strcpy (dataName, stringPtr); 148 353 dimensions = strtok(NULL, "[]"); 149 status = NXBread ( fileId, dataName, dimensions);354 status = NXBread (the_fileId, dataName, dimensions); 150 355 } 151 356 else { 152 printf ("NX_ERROR: Specify a data item\n");357 fprintf (rl_outstream, "NX_ERROR: Specify a data item\n"); 153 358 } 154 359 } … … 156 361 if (StrEq(command, "CLOSE")) { 157 362 if (groupLevel > 0) { 158 if (NXclosegroup ( fileId) == NX_OK) {363 if (NXclosegroup (the_fileId) == NX_OK) { 159 364 /* Remove the group from the prompt string */ 160 365 stringPtr = strrchr (path, '/'); /* position of last group delimiter */ … … 165 370 } 166 371 else { 167 printf ("NX_WARNING: Already at root level of file\n");372 fprintf (rl_outstream, "NX_WARNING: Already at root level of file\n"); 168 373 } 169 374 } … … 189 394 /* Command is to exit the program */ 190 395 if (StrEq(command, "EXIT") || StrEq(command, "QUIT")) { 191 for (i = groupLevel; i > 0; i--) NXclosegroup ( fileId);192 NXclose (& fileId);396 for (i = groupLevel; i > 0; i--) NXclosegroup (the_fileId); 397 NXclose (&the_fileId); 193 398 return NX_OK; 194 399 } 195 400 status = NX_OK; 401 free(inputText); 196 402 } while (status == NX_OK); 197 403 return NX_OK; -
tags/4.2.1/scripts
-
Property
svn:mergeinfo
set to
/trunk/scripts merged eligible
-
Property
svn:mergeinfo
set to
-
tags/4.2.1/src/napi4.c
r1896 r1896 25 25 26 26 ----------------------------------------------------------------------------*/ 27 28 #ifdef HDF4 29 27 30 #include <stdlib.h> 28 31 #include <assert.h> … … 110 113 { 111 114 int32 iNew, iRef, iTag; 112 int iN, i , status;115 int iN, i; 113 116 int32 *pArray = NULL; 114 117 NXname pText; … … 1289 1292 { 1290 1293 pNexusFile pFile; 1291 ErrFunc oldErr;1292 1294 int datalen, type = NX_CHAR; 1293 1295 … … 1300 1302 sRes->iTag = DFTAG_NDG; 1301 1303 sRes->iRef = SDidtoref (pFile->iCurrentSDS); 1302 oldErr = NXMGetError(); 1303 NXMSetError(NXpData, ignoreError); 1304 NXMDisableErrorReporting(); 1304 1305 datalen = 1024; 1305 1306 memset(&sRes->targetPath,0,1024); … … 1308 1309 NXIbuildPath(pFile,sRes->targetPath,1024); 1309 1310 } 1310 NXM SetError(NXpData,oldErr);1311 NXMEnableErrorReporting(); 1311 1312 return NX_OK; 1312 1313 } … … 1322 1323 { 1323 1324 pNexusFile pFile; 1324 int32 iVG, iRet,dataID, type = DFNT_CHAR8, length;1325 int32 dataID, type = DFNT_CHAR8, length; 1325 1326 char name[] = "target"; 1326 1327 … … 1354 1355 { 1355 1356 pNexusFile pFile; 1356 int32 iVG, iRet,dataID, type = DFNT_CHAR8, length, dataType = NX_CHAR,1357 int32 dataID, type = DFNT_CHAR8, length, dataType = NX_CHAR, 1357 1358 rank = 1, attType = NX_INT32; 1358 1359 int iDim[1]; … … 1813 1814 *iType = (int)iType32; 1814 1815 iLen = iLen * DFKNTsize (*iType); 1816 if(*iType == NX_CHAR){ 1817 iLen += 1; 1818 } 1815 1819 pData = (void *) malloc (iLen); 1816 1820 if (!pData) { … … 2006 2010 fHandle->nxprintlink=NX4printlink; 2007 2011 } 2012 2013 #endif /*HDF4*/ -
tags/4.2.1/src/nxstack.c
r1896 r1896 20 20 21 21 For further information, see <http://www.neutron.anl.gov/NeXus/> 22 23 Added code to support the path stack for NXgetpath, 24 Mark Koennecke, October 2009 22 25 */ 23 26 #include <stdlib.h> … … 40 43 int fileStackPointer; 41 44 fileStackEntry fileStack[MAXEXTERNALDEPTH]; 45 int pathPointer; 46 char pathStack[NXMAXSTACK][NX_MAXNAMELEN]; 42 47 }fileStack; 43 48 /*---------------------------------------------------------------------*/ … … 51 56 memset(pNew,0,sizeof(fileStack)); 52 57 pNew->fileStackPointer = -1; 58 pNew->pathPointer = -1; 53 59 return pNew; 54 60 } … … 58 64 free(self); 59 65 } 66 } 67 /*---------------------------------------------------------------------*/ 68 int getFileStackSize(){ 69 return sizeof(fileStack); 60 70 } 61 71 /*----------------------------------------------------------------------*/ … … 99 109 return self->fileStackPointer; 100 110 } 111 /*----------------------------------------------------------------------*/ 112 void pushPath(pFileStack self, const char *name){ 113 self->pathPointer++; 114 strncpy(self->pathStack[self->pathPointer],name,NX_MAXNAMELEN-1); 115 } 116 /*-----------------------------------------------------------------------*/ 117 void popPath(pFileStack self){ 118 self->pathPointer--; 119 if(self->pathPointer < -1){ 120 self->pathPointer = -1; 121 } 122 } 123 /*-----------------------------------------------------------------------*/ 124 int buildPath(pFileStack self, char *path, int pathlen){ 125 int i, totalPathLength; 126 char *totalPath; 127 128 for(i = 0, totalPathLength = 5; i <= self->pathPointer; i++){ 129 totalPathLength += strlen(self->pathStack[i]) + 1; 130 } 131 totalPath = malloc(totalPathLength*sizeof(char)); 132 if(totalPath == NULL){ 133 return 0; 134 } 135 memset(totalPath,0,totalPathLength*sizeof(char)); 136 for(i = 0; i <= self->pathPointer; i++){ 137 strcat(totalPath,"/"); 138 strcat(totalPath,self->pathStack[i]); 139 } 140 141 strncpy(path,totalPath,pathlen-1); 142 free(totalPath); 143 return 1; 144 } -
tags/4.2.1/src/napi5.c
r1896 r1896 23 23 24 24 ----------------------------------------------------------------------------*/ 25 26 #ifdef HDF5 27 25 28 #include <stdlib.h> 26 29 #include <assert.h> … … 94 97 static void buildCurrentPath(pNexusFile5 self, char *pathBuffer, 95 98 int pathBufferLen){ 96 int length;97 99 98 100 memset(pathBuffer,0,pathBufferLen); … … 773 775 pNexusFile5 pFile; 774 776 int chunk_size[H5S_MAX_RANK]; 775 int i; 776 777 777 778 pFile = NXI5assert (fid); 778 779 memset(chunk_size,0,H5S_MAX_RANK*sizeof(int)); 779 if (dimensions[0] == NX_UNLIMITED) 780 { 781 for (i = 0; i < H5S_MAX_RANK; i++) 782 { 783 chunk_size[i]= 1; 784 } 785 } 780 memcpy(chunk_size,dimensions,rank*sizeof(int)); 781 if (dimensions[0] == NX_UNLIMITED){ 782 chunk_size[0]= 1; 783 } 786 784 return NX5compmakedata (fid, name, datatype, rank, dimensions, NX_COMP_NONE, chunk_size); 787 785 … … 1052 1050 { 1053 1051 pNexusFile5 pFile; 1054 ErrFunc oldErr;1055 1052 int datalen, type = NX_CHAR; 1056 1053 … … 1068 1065 the path to the current node 1069 1066 */ 1070 oldErr = NXMGetError(); 1071 NXMSetError(NXpData, ignoreError); 1067 NXMDisableErrorReporting(); 1072 1068 datalen = 1024; 1073 1069 memset(&sRes->targetPath,0,datalen*sizeof(char)); … … 1076 1072 buildCurrentPath(pFile, sRes->targetPath, 1024); 1077 1073 } 1078 NXM SetError(NXpData,oldErr);1074 NXMEnableErrorReporting(); 1079 1075 sRes->linkType = 1; 1080 1076 return NX_OK; … … 1146 1142 pNexusFile5 pFile; 1147 1143 char linkTarget[1024]; 1148 int type = NX_CHAR , length;1144 int type = NX_CHAR; 1149 1145 int status; 1150 1146 … … 1181 1177 pNexusFile5 pFile; 1182 1178 char linkTarget[1024]; 1183 int type = NX_CHAR , length;1179 int type = NX_CHAR; 1184 1180 char *itemName = NULL; 1185 1181 int status; … … 1282 1278 herr_t group_info1(hid_t loc_id, const char *name, void *opdata) 1283 1279 { 1284 NexusFile5 self;1285 1280 H5G_stat_t statbuf; 1286 self.iNX = *((int*)opdata);1281 int iNX = *((int*)opdata); 1287 1282 H5Gget_objinfo(loc_id, name, 0, &statbuf); 1288 1283 … … 1290 1285 { 1291 1286 case H5G_GROUP: 1292 self.iNX++;1293 *((int*)opdata)= self.iNX;1287 iNX++; 1288 *((int*)opdata)=iNX; 1294 1289 break; 1295 1290 case H5G_DATASET: 1296 self.iNX++;1297 *((int*)opdata)= self.iNX;1291 iNX++; 1292 *((int*)opdata)=iNX; 1298 1293 break; 1299 1294 default: … … 1305 1300 /*-------------------------------------------------------------------------*/ 1306 1301 1307 NXstatus NX5getgroupinfo (NXhandle fid, int *iN, NXname pName, NXname pClass)1302 NXstatus NX5getgroupinfo_recurse (NXhandle fid, int *iN, NXname pName, NXname pClass) 1308 1303 { 1309 1304 pNexusFile5 pFile; … … 1339 1334 return NX_OK; 1340 1335 } 1341 1342 /*------------------------------------------------------------------------*/ 1343 static int hdf5ToNXType(int data_id, hid_t atype) 1336 /*---------------------------------------------------------------------------*/ 1337 static int countObjectsInGroup(hid_t loc_id) 1344 1338 { 1345 int iPtype = -1; 1346 hid_t sign_id, size_id; 1347 1348 if (data_id==H5T_STRING) 1349 { 1350 iPtype=NX_CHAR; 1351 } 1352 if (data_id==H5T_INTEGER) 1339 int count = 0, type; 1340 hsize_t numobj, i; 1341 1342 herr_t status; 1343 1344 status = H5Gget_num_objs(loc_id, &numobj); 1345 if(status < 0) { 1346 NXIReportError(NXpData,"Internal error, failed to retrive no of objects"); 1347 return 0; 1348 } 1349 1350 for(i = 0; i < numobj; i++){ 1351 type = H5Gget_objtype_by_idx(loc_id,i); 1352 if(type == H5G_GROUP || type == H5G_DATASET){ 1353 count++; 1354 } 1355 } 1356 return count; 1357 } 1358 /*----------------------------------------------------------------------------*/ 1359 NXstatus NX5getgroupinfo (NXhandle fid, int *iN, NXname pName, NXname pClass) 1360 { 1361 pNexusFile5 pFile; 1362 hid_t atype, attr_id, gid; 1363 char data[64]; 1364 int iRet; 1365 1366 pFile = NXI5assert (fid); 1367 /* check if there is a group open */ 1368 if (pFile->iCurrentG == 0) { 1369 strcpy (pName, "root"); 1370 strcpy (pClass, "NXroot"); 1371 gid = H5Gopen(pFile->iFID,"/"); 1372 *iN = countObjectsInGroup(gid); 1373 H5Gclose(gid); 1374 } 1375 else { 1376 strcpy (pName,pFile->name_ref); 1377 attr_id = H5Aopen_name(pFile->iCurrentG,"NX_class"); 1378 if (attr_id<0) { 1379 strcpy(pClass, NX_UNKNOWN_GROUP); 1380 } else { 1381 atype=H5Tcopy(H5T_C_S1); 1382 H5Tset_size(atype,sizeof(data)); 1383 H5Aread(attr_id, atype, data); 1384 strcpy(pClass,data); 1385 pFile->iNX=0; 1386 *iN = countObjectsInGroup(pFile->iCurrentG); 1387 H5Aclose(attr_id); 1388 } 1389 } 1390 return NX_OK; 1391 } 1392 1393 1394 /*------------------------------------------------------------------------- 1395 * Function: hdf5ToNXType 1396 * 1397 * Purpose: Convert a HDF5 class to a NeXus "type"; it handles the following HDF5 classes 1398 * H5T_STRING 1399 * H5T_INTEGER 1400 * H5T_FLOAT 1401 * 1402 * Return: the NeXus "type" 1403 * 1404 *------------------------------------------------------------------------- 1405 */ 1406 static int hdf5ToNXType(H5T_class_t tclass, hid_t atype) 1407 { 1408 int iPtype = -1; 1409 size_t size_id; 1410 H5T_sign_t sign_id; 1411 1412 if (tclass==H5T_STRING) 1413 { 1414 iPtype=NX_CHAR; 1415 } 1416 else if (tclass==H5T_INTEGER) 1417 { 1418 size_id=H5Tget_size(atype); 1419 sign_id=H5Tget_sign(atype); 1420 if (size_id==1) 1353 1421 { 1354 size_id=H5Tget_size(atype); 1355 sign_id=H5Tget_sign(atype); 1356 if (size_id==1) 1357 { 1358 if (sign_id==H5T_SGN_2) 1359 { 1360 iPtype=NX_INT8; 1361 } else { 1362 iPtype=NX_UINT8; 1363 } 1364 } 1365 else if (size_id==2) 1366 { 1367 if (sign_id==H5T_SGN_2) 1368 { 1369 iPtype=NX_INT16; 1370 } else { 1371 iPtype=NX_UINT16; 1372 } 1373 } 1374 else if (size_id==4) 1375 { 1376 if (sign_id==H5T_SGN_2) 1377 { 1378 iPtype=NX_INT32; 1379 } else { 1380 iPtype=NX_UINT32; 1381 } 1382 } 1383 else if(size_id == 8) 1384 { 1385 if (sign_id==H5T_SGN_2) 1386 { 1387 iPtype=NX_INT64; 1388 } else { 1389 iPtype=NX_UINT64; 1390 } 1391 } 1392 } else if (data_id==H5T_FLOAT) 1393 { 1394 size_id=H5Tget_size(atype); 1395 if (size_id==4) 1396 { 1397 iPtype=NX_FLOAT32; 1398 } 1399 else if (size_id==8) 1400 { 1401 iPtype=NX_FLOAT64; 1402 } 1403 } 1404 if (iPtype == -1) 1405 { 1406 NXIReportError (NXpData, "ERROR: hdf5ToNXtype: invalid type"); 1407 } 1408 1409 return iPtype; 1410 } 1422 if (sign_id==H5T_SGN_2) 1423 { 1424 iPtype=NX_INT8; 1425 } else { 1426 iPtype=NX_UINT8; 1427 } 1428 } 1429 else if (size_id==2) 1430 { 1431 if (sign_id==H5T_SGN_2) 1432 { 1433 iPtype=NX_INT16; 1434 } else { 1435 iPtype=NX_UINT16; 1436 } 1437 } 1438 else if (size_id==4) 1439 { 1440 if (sign_id==H5T_SGN_2) 1441 { 1442 iPtype=NX_INT32; 1443 } else { 1444 iPtype=NX_UINT32; 1445 } 1446 } 1447 else if(size_id == 8) 1448 { 1449 if (sign_id==H5T_SGN_2) 1450 { 1451 iPtype=NX_INT64; 1452 } else { 1453 iPtype=NX_UINT64; 1454 } 1455 } 1456 } 1457 else if (tclass==H5T_FLOAT) 1458 { 1459 size_id=H5Tget_size(atype); 1460 if (size_id==4) 1461 { 1462 iPtype=NX_FLOAT32; 1463 } 1464 else if (size_id==8) 1465 { 1466 iPtype=NX_FLOAT64; 1467 } 1468 } 1469 if (iPtype == -1) 1470 { 1471 NXIReportError (NXpData, "ERROR: hdf5ToNXtype: invalid type"); 1472 } 1473 1474 return iPtype; 1475 } 1411 1476 /*--------------------------------------------------------------------------*/ 1412 static int h5MemType(hid_t atype) 1413 { 1414 hid_t data_id, size_id, sign_id, memtype_id = -1; 1415 1416 data_id = H5Tget_class(atype); 1417 1418 if (data_id==H5T_INTEGER) 1419 { 1420 size_id=H5Tget_size(atype); 1421 sign_id=H5Tget_sign(atype); 1422 if (size_id==1) 1423 { 1424 if (sign_id==H5T_SGN_2) 1425 { 1426 memtype_id = H5T_NATIVE_INT8; 1427 } else { 1428 memtype_id = H5T_NATIVE_UINT8; 1429 } 1430 } 1431 else if (size_id==2) 1432 { 1433 if (sign_id==H5T_SGN_2) 1434 { 1435 memtype_id = H5T_NATIVE_INT16; 1436 } else { 1437 memtype_id = H5T_NATIVE_UINT16; 1438 } 1439 } 1440 else if (size_id==4) 1441 { 1442 if (sign_id==H5T_SGN_2) 1443 { 1444 memtype_id = H5T_NATIVE_INT32; 1445 } else { 1446 memtype_id = H5T_NATIVE_UINT32; 1447 } 1448 } 1449 else if (size_id==8) 1450 { 1451 if (sign_id==H5T_SGN_2) 1452 { 1453 memtype_id = H5T_NATIVE_INT64; 1454 } else { 1455 memtype_id = H5T_NATIVE_UINT64; 1456 } 1457 } 1477 static int h5MemType(hid_t atype) 1478 { 1479 hid_t memtype_id = -1; 1480 size_t size_id; 1481 H5T_sign_t sign_id; 1482 H5T_class_t data_id; 1483 1484 data_id = H5Tget_class(atype); 1485 1486 if (data_id==H5T_INTEGER) 1487 { 1488 size_id=H5Tget_size(atype); 1489 sign_id=H5Tget_sign(atype); 1490 if (size_id==1) 1491 { 1492 if (sign_id==H5T_SGN_2) 1493 { 1494 memtype_id = H5T_NATIVE_INT8; 1495 } else { 1496 memtype_id = H5T_NATIVE_UINT8; 1497 } 1498 } 1499 else if (size_id==2) 1500 { 1501 if (sign_id==H5T_SGN_2) 1502 { 1503 memtype_id = H5T_NATIVE_INT16; 1504 } else { 1505 memtype_id = H5T_NATIVE_UINT16; 1506 } 1507 } 1508 else if (size_id==4) 1509 { 1510 if (sign_id==H5T_SGN_2) 1511 { 1512 memtype_id = H5T_NATIVE_INT32; 1513 } else { 1514 memtype_id = H5T_NATIVE_UINT32; 1515 } 1516 } 1517 else if (size_id==8) 1518 { 1519 if (sign_id==H5T_SGN_2) 1520 { 1521 memtype_id = H5T_NATIVE_INT64; 1522 } else { 1523 memtype_id = H5T_NATIVE_UINT64; 1524 } 1525 } 1458 1526 } else if (data_id==H5T_FLOAT) 1459 {1460 size_id=H5Tget_size(atype);1461 if (size_id==4)1462 {1463 memtype_id = H5T_NATIVE_FLOAT;1464 } else if (size_id==8) {1465 memtype_id = H5T_NATIVE_DOUBLE;1466 }1527 { 1528 size_id=H5Tget_size(atype); 1529 if (size_id==4) 1530 { 1531 memtype_id = H5T_NATIVE_FLOAT; 1532 } else if (size_id==8) { 1533 memtype_id = H5T_NATIVE_DOUBLE; 1534 } 1467 1535 } 1468 1536 if (memtype_id == -1) 1469 1537 { 1470 NXIReportError (NXpData, "ERROR: h5MemType: invalid type");1538 NXIReportError (NXpData, "ERROR: h5MemType: invalid type"); 1471 1539 } 1472 1540 return memtype_id; 1473 }1541 } 1474 1542 /*-------------------------------------------------------------------------*/ 1475 1543 … … 1479 1547 hid_t grp, attr1,type,atype; 1480 1548 int iRet,iPtype, i; 1481 int idx,data_id,size_id, sign_id; 1549 int idx; 1550 H5T_class_t data_id; 1482 1551 char data[128]; 1483 1552 char ph_name[1024]; … … 1602 1671 pNexusFile5 pFile; 1603 1672 int iStart[H5S_MAX_RANK], status; 1604 hid_t data_id, memtype_id, size_id, sign_id; 1673 hid_t memtype_id; 1674 H5T_class_t data_id; 1605 1675 int dims; 1606 1676 … … 1649 1719 int i, iRank, mType, iRet; 1650 1720 hsize_t myDim[H5S_MAX_RANK]; 1651 hid_t data_id,size_id,sign_id;1721 H5T_class_t data_id; 1652 1722 1653 1723 pFile = NXI5assert (fid); … … 1684 1754 hsize_t mySize[H5S_MAX_RANK]; 1685 1755 hsize_t mStart[H5S_MAX_RANK]; 1686 hid_t memspace, iRet, data_id; 1687 hid_t memtype_id, size_id, sign_id; 1756 hid_t memspace, iRet; 1757 H5T_class_t data_id; 1758 hid_t memtype_id; 1688 1759 char *tmp_data = NULL; 1689 1760 char *data1; … … 1740 1811 } 1741 1812 /* map datatypes of other plateforms */ 1742 if (data_id ==H5T_STRING)1813 if (data_id == H5T_STRING) 1743 1814 { 1744 1815 dims = H5Tget_size(pFile->iCurrentT); … … 1762 1833 pFile->iCurrentS, H5P_DEFAULT,data); 1763 1834 } 1835 /* cleanup */ 1836 if (data_id == H5T_STRING) { /* we used H5Tcopy */ 1837 H5Tclose(memtype_id); 1838 } 1839 H5Sclose(memspace); 1764 1840 1765 1841 if (iRet < 0) 1842 1766 1843 { 1767 1844 NXIReportError (NXpData, "ERROR: Reading slab failed"); … … 1785 1862 { 1786 1863 pNexusFile5 pFile; 1787 hid_t attr_id ,size_id,sign_id;1864 hid_t attr_id; 1788 1865 hid_t iRet, atype, aspace; 1789 1866 int iPType,rank; … … 1925 2002 unsigned int idx; 1926 2003 int vid; 1927 herr_t iRet; 1928 2004 1929 2005 pFile = NXI5assert (fid); 1930 2006 idx=0; … … 1952 2028 { 1953 2029 pNexusFile5 pFile; 1954 int u, datalen, type = NX_CHAR; 1955 char group_name[64], class_name[64]; 1956 ErrFunc oldErr; 2030 int datalen, type = NX_CHAR; 1957 2031 1958 2032 pFile = NXI5assert (fileid); … … 1965 2039 the path to the current node 1966 2040 */ 1967 oldErr = NXMGetError(); 1968 NXMSetError(NXpData, ignoreError); 2041 NXMDisableErrorReporting(); 1969 2042 datalen = 1024; 1970 2043 memset(sRes->targetPath,0,datalen*sizeof(char)); … … 1972 2045 buildCurrentPath(pFile,sRes->targetPath,1024); 1973 2046 } 1974 NXM SetError(NXpData,oldErr);2047 NXMEnableErrorReporting(); 1975 2048 sRes->linkType = 0; 1976 2049 return NX_OK; … … 2049 2122 fHandle->nxprintlink=NX5printlink; 2050 2123 } 2124 2125 #endif /* HDF5 */ -
tags/4.2.1/src/nxio.c
r1896 r1896 24 24 * For further information, see <http://www.neutron.anl.gov/NeXus/> 25 25 */ 26 #include <mxml.h> 26 27 #ifdef NXXML 28 29 #include <mxml.h> 27 30 #include <assert.h> 28 31 #include "napi.h" … … 327 330 const char *typeString; 328 331 mxml_node_t* tnode; 329 mxml_type_t myType; 330 int i, nx_type = -1; 332 int nx_type = -1; 331 333 int table_mode = 0; 332 334 … … 403 405 mxml_type_t nexusTypeCallback(mxml_node_t *parent){ 404 406 const char *typeString; 405 mxml_node_t * tnode;406 407 407 408 if(strstr(parent->value.element.name,"?xml") != NULL || … … 443 444 long address, maxAddress; 444 445 pNXDS dataset = NULL; 445 int i,table_mode;446 int table_mode; 446 447 447 448 parent = node->parent; … … 479 480 static void stringIntoBuffer(char **buffer, char **bufPtr, int *bufSize, 480 481 char *string){ 481 int i;482 size_t i; 482 483 483 484 for(i = 0; i < strlen(string); i++){ … … 737 738 } 738 739 #endif 740 741 742 #endif /*NXXML*/ -
tags/4.2.1/src/nxstack.h
r1896 r1896 20 20 21 21 For further information, see <http://www.neutron.anl.gov/NeXus/> 22 23 Added functions to deal with the path stack for NXgetpath 24 Mark Koennecke, October 2009 25 22 26 */ 23 27 #ifndef NEXUSFILESTACK … … 29 33 pFileStack makeFileStack(); 30 34 void killFileStack(pFileStack self); 35 int getFileStackSize(); 31 36 32 37 void pushFileStack(pFileStack self, pNexusFunction pDriv, char *filename); … … 40 45 int fileStackDepth(pFileStack self); 41 46 47 void pushPath(pFileStack self, const char *name); 48 void popPath(pFileStack self); 49 int buildPath(pFileStack self, char *path, int pathlen); 50 42 51 #endif 43 52 -
tags/4.2.1/src/napi.c
r1896 r1896 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 … … 232 282 { 233 283 FILE *fd = NULL; 234 int iRet, fapl; 235 NXhandle handle; 284 int iRet; 236 285 237 286 /* … … 283 332 int status; 284 333 pFileStack fileStack = NULL; 285 NXhandle hfile;286 334 287 335 *gHandle = NULL; … … 538 586 pFileStack fileStack; 539 587 char nxurl[1024], exfile[512], expath[512]; 540 ErrFunc oldError;541 588 pNexusFunction pFunc = NULL; 542 589 … … 545 592 546 593 status = pFunc->nxopengroup(pFunc->pNexusData, name, nxclass); 547 oldError = NXMGetError(); 548 NXIReportError = NXNXNoReport; 594 if(status == NX_OK){ 595 pushPath(fileStack,name); 596 } 597 NXMDisableErrorReporting(); 549 598 attStatus = NXgetattr(fid,"napimount",nxurl,&length, &type); 550 NX IReportError = oldError;599 NXMEnableErrorReporting(); 551 600 if(attStatus == NX_OK){ 552 601 /* … … 580 629 fileStack = (pFileStack)fid; 581 630 if(fileStackDepth(fileStack) == 0){ 582 return pFunc->nxclosegroup(pFunc->pNexusData); 631 status = pFunc->nxclosegroup(pFunc->pNexusData); 632 if(status == NX_OK){ 633 popPath(fileStack); 634 } 635 return status; 583 636 } else { 584 637 /* we have to check for leaving an external file */ … … 590 643 } else { 591 644 status = pFunc->nxclosegroup(pFunc->pNexusData); 645 if(status == NX_OK){ 646 popPath(fileStack); 647 } 592 648 } 593 649 return status; … … 628 684 NXstatus NXopendata (NXhandle fid, CONSTCHAR *name) 629 685 { 686 int status; 687 pFileStack fileStack = NULL; 688 630 689 pNexusFunction pFunc = handleToNexusFunc(fid); 631 return pFunc->nxopendata(pFunc->pNexusData, name); 690 fileStack = (pFileStack)fid; 691 status = pFunc->nxopendata(pFunc->pNexusData, name); 692 if(status == NX_OK){ 693 pushPath(fileStack,name); 694 } 695 return status; 632 696 } 633 697 … … 637 701 NXstatus NXclosedata (NXhandle fid) 638 702 { 639 pNexusFunction pFunc = handleToNexusFunc(fid); 640 return pFunc->nxclosedata(pFunc->pNexusData); 703 int status; 704 pFileStack fileStack = NULL; 705 706 pNexusFunction pFunc = handleToNexusFunc(fid); 707 fileStack = (pFileStack)fid; 708 status = pFunc->nxclosedata(pFunc->pNexusData); 709 if(status == NX_OK){ 710 popPath(fileStack); 711 } 712 return status; 641 713 } 642 714 … … 1026 1098 return status; 1027 1099 } 1028 oldError = NXMGetError(); 1029 NXIReportError = NXNXNoReport; 1100 NXMDisableErrorReporting(); 1030 1101 attStatus = NXgetattr(fid,"napimount",nxurl,&length, &type); 1031 NX IReportError = oldError;1102 NXMEnableErrorReporting(); 1032 1103 pFunc->nxclosegroup(pFunc->pNexusData); 1033 1104 if(attStatus == NX_OK){ … … 1062 1133 } 1063 1134 /*------------------------------------------------------------------------ 1064 Implementation of NXopenpath .1135 Implementation of NXopenpath 1065 1136 --------------------------------------------------------------------------*/ 1066 1137 static int isDataSetOpen(NXhandle hfil) … … 1185 1256 { 1186 1257 int status; 1187 NXname pathElem;1188 1258 char *pPtr; 1189 1259 … … 1214 1284 static NXstatus stepOneUp(NXhandle hfil, char *name) 1215 1285 { 1216 int status,datatype;1286 int datatype; 1217 1287 NXname name2, xclass; 1218 1288 char pBueffel[256]; … … 1250 1320 static NXstatus stepOneGroupUp(NXhandle hfil, char *name) 1251 1321 { 1252 int status,datatype;1322 int datatype; 1253 1323 NXname name2, xclass; 1254 1324 char pBueffel[256]; … … 1357 1427 return NX_OK; 1358 1428 } 1359 1429 /*---------------------------------------------------------------------*/ 1360 1430 NXstatus NXIprintlink(NXhandle fid, NXlink* link) 1361 1431 { 1362 1432 pNexusFunction pFunc = handleToNexusFunc(fid); 1363 1433 return pFunc->nxprintlink(pFunc->pNexusData, link); 1434 } 1435 /*----------------------------------------------------------------------*/ 1436 NXstatus NXgetpath(NXhandle fid, char *path, int pathlen){ 1437 int status; 1438 pFileStack fileStack = NULL; 1439 1440 fileStack = (pFileStack)fid; 1441 status = buildPath(fileStack,path,pathlen); 1442 if(status != 1){ 1443 return NX_ERROR; 1444 } 1445 return NX_OK; 1364 1446 } 1365 1447 … … 1368 1450 ---------------------------------------------------------------------*/ 1369 1451 char *NXIformatNeXusTime(){ 1370 char *timeData;1371 1452 time_t timer; 1372 1453 char* time_buffer = NULL; … … 1446 1527 */ 1447 1528 NXstatus NXfopen(char * filename, NXaccess* am, 1448 N exusFunction*pHandle)1529 NXhandle pHandle) 1449 1530 { 1450 1531 NXstatus ret; … … 1453 1534 if (ret == NX_OK) 1454 1535 { 1455 memcpy(pHandle, fileid, sizeof(NexusFunction));1536 memcpy(pHandle, fileid, getFileStackSize()); 1456 1537 } 1457 1538 else 1458 1539 { 1459 memset(pHandle, 0, sizeof(NexusFunction));1540 memset(pHandle, 0, getFileStackSize()); 1460 1541 } 1461 1542 if (fileid != NULL) … … 1470 1551 * a temporary copy as NXclose will try to free() this 1471 1552 */ 1472 NXstatus NXfclose (N exusFunction*pHandle)1553 NXstatus NXfclose (NXhandle pHandle) 1473 1554 { 1474 1555 NXhandle h; 1475 1556 NXstatus ret; 1476 h = (NXhandle)malloc( sizeof(NexusFunction));1477 memcpy(h, pHandle, sizeof(NexusFunction));1557 h = (NXhandle)malloc(getFileStackSize()); 1558 memcpy(h, pHandle, getFileStackSize()); 1478 1559 ret = NXclose(&h); /* does free(h) */ 1479 memset(pHandle, 0, sizeof(NexusFunction));1560 memset(pHandle, 0, getFileStackSize()); 1480 1561 return ret; 1481 1562 } 1482 1563 1483 1564 /*---------------------------------------------------------------------*/ 1484 NXstatus NXfflush(N exusFunction*pHandle)1565 NXstatus NXfflush(NXhandle pHandle) 1485 1566 { 1486 1567 NXhandle h; 1487 1568 NXstatus ret; 1488 h = (NXhandle)malloc( sizeof(NexusFunction));1489 memcpy(h, pHandle, sizeof(NexusFunction));1569 h = (NXhandle)malloc(getFileStackSize()); 1570 memcpy(h, pHandle, getFileStackSize()); 1490 1571 ret = NXflush(&h); /* modifies and reallocates h */ 1491 memcpy(pHandle, h, sizeof(NexusFunction));1572 memcpy(pHandle, h, getFileStackSize()); 1492 1573 return ret; 1493 1574 } … … 1520 1601 } 1521 1602 1522 1603 /*-----------------------------------------------------------------------*/ 1523 1604 NXstatus NXfcompmakedata(NXhandle fid, char *name, 1524 1605 int *pDatatype, … … 1579 1660 } 1580 1661 1662 /*--------------------------------------------------------------------------*/ 1663 NXstatus NXfgetpath(NXhandle fid, char *path, int *pathlen) 1664 { 1665 return NXgetpath(fid,path,*pathlen); 1666 } 1667 1668 const char* NXgetversion() 1669 { 1670 return NEXUS_VERSION ; 1671 } -
tags/4.2.1/src/Makefile.am
r1896 r1896 30 30 31 31 AM_CPPFLAGS=-I$(top_srcdir)/include @HDF4_CPPFLAGS@ @HDF5_CPPFLAGS@ @XML_CPPFLAGS@ -DIN_NEXUS_LIBRARY 32 AM_LDFLAGS=-version-info $(NXLTVERSINFO) 32 33 AM_CFLAGS=-prefer-pic 33 34 … … 76 77 #SUBDIRS=nxdict 77 78 78 libNeXus_la_SOURCES = napi.c napiu.c nxstack.c nxstack.h stptok.c nxdataset.c nxdataset.h nx_stptok.h $(H4SRC) $(H5SRC) $(XMLSRC) $(MINGW_SRC)79 libNeXus_la_SOURCES = napi.c napiu.c nxstack.c nxstack.h stptok.c nxdataset.c nxdataset.h nx_stptok.h $(H4SRC) $(H5SRC) $(XMLSRC) $(MINGW_SRC) 79 80 libNeXus_la_LDFLAGS = -export-symbols nexus_symbols.sym @SHARED_LDFLAGS@ @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 80 81 libNeXus_la_DEPENDENCIES = nexus_symbols.sym -
tags/4.2.1/src/nxdataset.c
r1896 r1896 179 179 double getNXDatasetValue(pNXDS dataset, int pos[]){ 180 180 int address; 181 double value; 182 181 183 182 if(dataset == NULL){ 184 183 return 0; … … 230 229 char *getNXDatasetText(pNXDS dataset){ 231 230 char *resultBuffer = NULL; 232 int length,status = 1;231 int status = 1; 233 232 234 233 if(dataset == NULL){ -
tags/4.2.1/src/nxxml.c
r1896 r1896 21 21 * For further information, see <http://www.nexusformat.org> 22 22 */ 23 24 25 #ifdef NXXML 26 23 27 #include <stdio.h> 24 28 #include <napi.h> … … 71 75 #define XMLSTACK_OPTION_TABLE 0x1 /**< indicates table option in xmlStack */ 72 76 73 /**74 * Freddie Akeroyd 14/7/200875 * Add NeXus schema support - this uses BASE.xsd as the initial file76 */77 #define NEXUS_SCHEMA_VERSION "3.0" /**< version of NeXus definition schema */78 #define NEXUS_SCHEMA_NAMESPACE "http://definition.nexusformat.org/schema/" NEXUS_SCHEMA_VERSION /**< XML schema namespace specified by xmlns */79 #define NEXUS_SCHEMA_FILE NEXUS_SCHEMA_NAMESPACE "/BASE.xsd" /**< location of default schema file for namespace */80 77 81 78 /*---------------------------------------------------------------------*/ … … 184 181 mxmlElementSetAttr(current,"xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"); 185 182 mxmlElementSetAttr(current,"xsi:schemaLocation", 186 NEXUS_SCHEMA_NAMESPACE " " NEXUS_SCHEMA_ FILE);183 NEXUS_SCHEMA_NAMESPACE " " NEXUS_SCHEMA_URL); 187 184 time_buffer = NXIformatNeXusTime(); 188 185 if(time_buffer != NULL){ … … 349 346 pXMLNexus xmlHandle = NULL; 350 347 mxml_node_t *newGroup = NULL; 351 char error[1024];352 348 353 349 xmlHandle = (pXMLNexus)fid; … … 395 391 396 392 getNumberText(datatype,typestring,130); 397 if(rank > 1 || d imensions[0] > 1) {393 if(rank > 1 || datatype == NX_CHAR || dimensions[0] > 1) { 398 394 strcat(typestring,"["); 399 395 snprintf(pNumber,19,"%d",dimensions[0]); … … 727 723 const char* name; 728 724 pNXDS dataset; 729 int i, offset, length , type, rank, dim[NX_MAXRANK];725 int i, offset, length; 730 726 char *pPtr = NULL; 731 727 xmlHandle = (pXMLNexus)fid; … … 826 822 const char* name; 827 823 pNXDS dataset; 828 int i, offset, length , type, rank, dim[NX_MAXRANK];824 int i, offset, length; 829 825 xmlHandle = (pXMLNexus)fid; 830 826 assert(xmlHandle); … … 1300 1296 char error[1024]; 1301 1297 const char *attData = NULL; 1302 int iValue, nx_type; 1303 float fValue; 1298 int nx_type; 1304 1299 1305 1300 xmlHandle = (pXMLNexus)fid; … … 1671 1666 pXMLNexus xmlHandle = NULL; 1672 1667 mxml_node_t *current = NULL; 1673 int stackPtr, currentAtt,skip;1668 int stackPtr, skip; 1674 1669 1675 1670 xmlHandle = (pXMLNexus)fid; … … 1747 1742 mxml_node_t *current = NULL; 1748 1743 char *pathString = NULL, *result = NULL; 1749 int count;1750 1744 1751 1745 path = (mxml_node_t **)malloc(NXMAXSTACK*sizeof(mxml_node_t *)); 1752 1746 if(path == NULL){ 1753 NXIReportError(NXpData,"ERROR: out of memory foll woing link path");1747 NXIReportError(NXpData,"ERROR: out of memory following link path"); 1754 1748 return NULL; 1755 1749 } … … 1905 1899 /*--------------------------------------------------------------------*/ 1906 1900 int NXXcompress(NXhandle fid, int comp){ 1907 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"); */ 1908 1903 return NX_OK; 1909 1904 } … … 1942 1937 } 1943 1938 1939 1940 1941 #endif /*NXXML*/ -
tags/4.2.1/src/nexus_symbols.txt
r1896 r1896 13 13 nxifputattr_ 14 14 nxifree_ 15 nxifgetpath_ 15 16 nxigetattr_ 16 17 nxigetattrinfo_ … … 34 35 nxiopengrouppath_ 35 36 nxiopenpath_ 37 nxigetpath_ 36 38 nxiopensourcegroup_ 37 39 nxiputattr_ … … 45 47 nxiisexternalgroup_ 46 48 NXMSetError 49 NXMSetTError 47 50 NXIReportError 48 51 NXIprintlink -
tags/4.2.1/bindings
-
Property
svn:mergeinfo
set to
/trunk/bindings merged eligible
-
Property
svn:mergeinfo
set to
-
tags/4.2.1/bindings/idl/NeXusIDL-API.dlm
r1896 r1896 8 8 FUNCTION NXOPENPATH 0 IDL_MAXPARAMS 9 9 FUNCTION NXOPENGROUPPATH 0 IDL_MAXPARAMS 10 FUNCTION NXGETPATH 0 IDL_MAXPARAMS 10 11 FUNCTION NXMAKEGROUP 0 IDL_MAXPARAMS 11 12 FUNCTION NXCLOSEGROUP 0 IDL_MAXPARAMS -
tags/4.2.1/bindings/idl/NeXusIDL-API.c
r1896 r1896 217 217 218 218 return IDL_GettmpInt(status); 219 } 220 /*====================================================================== 221 * NXgetpath 222 * string = NXgetpath(file_id) 223 *======================================================================*/ 224 static IDL_VPTR NXgetpath_this(int argc, IDL_VPTR *argv) 225 { 226 int fileid; 227 NXhandle hHandle; 228 int iHandle, status; 229 char path[1024]; 230 231 if (argc != 1) { 232 IDL_Message(IDL_M_NAMED_GENERIC, IDL_MSG_INFO, "One argument expected"); 233 return IDL_StrToSTRING("One argument expected"); 234 } 235 236 IDL_ENSURE_SCALAR(argv[0]); 237 238 fileid = (int)IDL_LongScalar(argv[0]); 239 240 if(HHCheckIfHandleExists(fileid) == -1) { 241 IDL_Message(IDL_M_NAMED_GENERIC, IDL_MSG_INFO, "Unknown file id"); 242 return IDL_StrToSTRING("ERROR: Unknown file ID"); 243 } 244 245 hHandle = HHGetPointer(fileid); 246 NXMSetError(NULL,idlError); 247 248 status = NXgetpath(hHandle,path,1024); 249 if(status == NX_ERROR){ 250 IDL_Message(IDL_M_NAMED_GENERIC, IDL_MSG_INFO, nexusError); 251 return IDL_StrToSTRING(nexusError); 252 } 253 return IDL_StrToSTRING(path); 219 254 } 220 255 … … 2549 2584 { NXsetnumberformat_this, "NXSETNUMBERFORMAT", 0, IDL_MAXPARAMS, 0, 0}, 2550 2585 { NXopenpath_this, "NXOPENPATH", 0, IDL_MAXPARAMS, 0, 0}, 2551 { NXopengrouppath_this, "NXOPENGROUPPATH", 0, IDL_MAXPARAMS, 0, 0}, 2586 { NXopengrouppath_this, "NXOPENGROUPPATH", 0, IDL_MAXPARAMS, 0, 0}, 2587 { NXgetpath_this, "NXGETPATH", 0, IDL_MAXPARAMS, 0, 0}, 2552 2588 { NXmakegroup_this, "NXMAKEGROUP", 0, IDL_MAXPARAMS, 0, 0}, 2553 2589 { NXopengroup_this, "NXOPENGROUP", 0, IDL_MAXPARAMS, 0, 0}, -
tags/4.2.1/bindings/swig/nxinterhelper.h
r1896 r1896 23 23 int nx_opengrouppath(void *handle, char *path); 24 24 int nx_openpath(void *handle, char *path); 25 extern char *nx_getpath(void *handle); 25 26 int nx_closegroup(void *handle); 26 27 char *nx_getnextentry(void *handle, char separator); -
tags/4.2.1/bindings/swig/nxinter.i
r1896 r1896 57 57 extern int nx_openpath(void *handle, char *path); 58 58 extern int nx_opengrouppath(void *handle, char *path); 59 extern char *nx_getpath(void *handle); 59 60 extern int nx_closegroup(void *handle); 60 61 extern char *nx_getnextentry(void *handle, char separator); -
tags/4.2.1/bindings/swig/nxinterhelper.c
r1896 r1896 114 114 } 115 115 /*--------------------------------------------------------------------*/ 116 char *nx_getpath(void *handle){ 117 int status; 118 NXhandle hfil; 119 char path[1024]; 120 121 hfil = (NXhandle)handle; 122 status = NXgetpath(hfil,path,1024); 123 if(status == NX_OK){ 124 return strdup(path); 125 } else { 126 return strdup("Error in NXgetpath"); 127 } 128 } 129 /*--------------------------------------------------------------------*/ 116 130 int nx_closegroup(void *handle){ 117 131 int status; -
tags/4.2.1/bindings/f90/Makefile.am
r1896 r1896 29 29 #==================================================================== 30 30 lib_LTLIBRARIES = libNeXus90.la 31 AM_LDFLAGS=-version-info $(NXLTVERSINFO) 31 32 32 33 libNeXus90_la_SOURCES = NXmodule.f90 NXUmodule.f90 -
tags/4.2.1/bindings/java/Makefile.am
r1896 r1896 58 58 # jni definitions 59 59 lib_LTLIBRARIES = libjnexus.la 60 AM_LDFLAGS=-version-info $(NXLTVERSINFO) 60 61 libjnexus_la_SOURCES = native/hdfnativeImp.c \ 61 62 native/hdfexceptionImp.c \ -
tags/4.2.1/bindings/java/native/NexusFile.c
r1896 r1896 21 21 22 22 Updated for 64 bit types, Mark Koennecke, August 2007 23 24 Added NXinitattrdir and NXinitgroupdir, Mark Koennecke, October 2009 25 26 Added NXgetpath, Mark Koennecke, October 2009 23 27 24 28 IMPLEMENTATION NOTES … … 33 37 the integer first before it can do useful work. 34 38 35 36 39 */ 37 40 #include <stdlib.h> … … 49 52 #endif 50 53 51 //#define DEBUG 52 #ifdef DEBUG 53 static FILE *fd = NULL; 54 #endif 54 /* #define DEBUG */ 55 56 static JavaVM *jvm; // Global variable 57 58 JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { 59 JNIEnv *env; 60 jclass nexusException; 61 62 jint ret = (*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_1); 63 64 assert(ret == JNI_OK); 65 66 jvm = vm; 67 68 nexusException = (*env)->FindClass(env,"org/nexusformat/NexusException"); 69 if (nexusException == NULL) { 70 fprintf(stderr, "cannot find NexusException - this will not work. Terminating."); 71 assert(nexusException); 72 } 73 74 return JNI_VERSION_1_1; 75 } 55 76 56 77 /*--------------------------------------------------------------------------- 57 78 ERROR TREATMENT 58 79 59 The NAPI writes any errors to stdout through a special function. 60 This is not very feasible in a Java environment where an exception should 61 be thrown. Fortunately it is possible to define an own error processing 62 function to be used for error processing. This error handling function 63 is defined here. A NexusException is constructed and thrown. 80 The NAPI posts any errors to a customisable function. 81 We construct and throw a NexusException with the message received. 64 82 --------------------------------------------------------------------------*/ 65 static void JapiError(void *pData, char *text) 66 { 67 JNIEnv *env = (JNIEnv *)pData; 68 jclass jc; 69 jmethodID jm; 70 jobject exception; 71 jstring jtext; 72 char *args[2]; 73 74 assert(env); 83 static void JapiError(void *pData, char *text) { 84 JNIEnv *env = pData; 85 jclass nexusException; 75 86 76 87 #ifdef DEBUG 77 fprintf(fd,"JapiError called with: %s\n", text); 78 #endif 79 jc = (*env)->FindClass(env,"org/nexusformat/NexusException"); 80 assert(jc); 81 jm = (*env)->GetMethodID(env, jc, "<init>","(Ljava/lang/String;)V"); 82 assert(jm != NULL); 83 jtext = (*env)->NewStringUTF(env,text); 84 args[0] = (char *)jtext; 85 args[1] = 0; 86 exception = (*env)->NewObjectA(env, jc, jm, (jvalue *) args); 87 (*env)->Throw(env, exception); 88 fprintf(stderr,"JapiError called with: %s\n", text); 89 #endif 90 91 /* ignore env passed in seems safer */ 92 (*jvm)->AttachCurrentThread (jvm, (void **) &env, NULL); 93 94 if (env == NULL) { 95 // if there is no thread environment we do not need to throw an exception 96 return; 97 } 98 99 // Find and store the NexusException class for use in JapiError 100 nexusException = (*env)->FindClass(env,"org/nexusformat/NexusException"); 101 (*env)->ThrowNew(env, nexusException, text); 88 102 } 89 103 … … 98 112 int iRet; 99 113 100 #ifdef DEBUG 101 if(fd == NULL) 102 { 103 fd = fopen("jnexusdebug.dat","w"); 104 } 105 #endif 106 /* set error handler */ 107 NXMSetError(env,JapiError); 114 /* set error handler */ 115 NXMSetTError(env,JapiError); 108 116 109 117 /* extract the filename as a C char* */ 110 fileName = (char *) (*env)->GetStringUTFChars(env, filename,0);118 fileName = (char *) (*env)->GetStringUTFChars(env, filename, 0); 111 119 112 120 /* call NXopen */ 113 121 #ifdef DEBUG 114 fprintf( fd,"Calling NXopen on %s, with %d\n", fileName,access);122 fprintf(stderr,"Calling NXopen on %s, with %d\n", fileName, access); 115 123 #endif 116 124 iRet = NXopen(fileName,access,&handle); 117 125 118 126 #ifdef DEBUG 119 fprintf( fd,"Handle %d allocated for %s\n", handle, fileName);127 fprintf(stderr,"Handle allocated for %s\n", fileName); 120 128 #endif 121 129 … … 142 150 143 151 /* set error handler */ 144 NXMSet Error(env,JapiError);152 NXMSetTError(env,JapiError); 145 153 146 154 /* exchange the Java handler to a NXhandle */ … … 149 157 /* kill handle */ 150 158 HHRemoveHandle(handle); 151 152 159 153 160 /* call NXflush */ … … 173 180 174 181 /* set error handler */ 175 NXMSet Error(env,JapiError);182 NXMSetTError(env,JapiError); 176 183 177 184 /* exchange the Java handler to a NXhandle */ 178 185 nxhandle = (NXhandle)HHGetPointer(handle); 179 186 #ifdef DEBUG 180 fprintf( fd,"closing handle %d, nxhandle %d\n", handle, nxhandle);187 fprintf(stderr,"closing handle %d, nxhandle %d\n", handle, nxhandle); 181 188 #endif 182 189 … … 197 204 198 205 /* set error handler */ 199 NXMSet Error(env,JapiError);206 NXMSetTError(env,JapiError); 200 207 201 208 /* exchange the Java handler to a NXhandle */ … … 224 231 225 232 /* set error handler */ 226 NXMSet Error(env,JapiError);233 NXMSetTError(env,JapiError); 227 234 228 235 /* exchange the Java handler to a NXhandle */ … … 238 245 if(iRet != NX_OK) 239 246 { 240 fprintf( fd,"Cleanup code called after raising Exception\n");247 fprintf(stderr,"Cleanup code called after raising Exception\n"); 241 248 } 242 249 #endif … … 256 263 257 264 /* set error handler */ 258 NXMSet Error(env,JapiError);265 NXMSetTError(env,JapiError); 259 266 260 267 /* exchange the Java handler to a NXhandle */ … … 269 276 if(iRet != NX_OK) 270 277 { 271 fprintf( fd,"Cleanup code called after raising Exception\n");278 fprintf(stderr,"Cleanup code called after raising Exception\n"); 272 279 } 273 280 #endif … … 286 293 287 294 /* set error handler */ 288 NXMSet Error(env,JapiError);295 NXMSetTError(env,JapiError); 289 296 290 297 /* exchange the Java handler to a NXhandle */ … … 299 306 if(iRet != NX_OK) 300 307 { 301 fprintf( fd,"Cleanup code called after raising Exception\n");308 fprintf(stderr,"Cleanup code called after raising Exception\n"); 302 309 } 303 310 #endif … … 305 312 (*env)->ReleaseStringUTFChars(env,path, nxpath); 306 313 } 314 /*-----------------------------------------------------------------------*/ 315 JNIEXPORT jstring JNICALL Java_org_nexusformat_NexusFile_nxgetpath 316 (JNIEnv *env, jobject obj, jint handle) 317 { 318 NXhandle nxhandle; 319 int iRet; 320 char path[1024]; 321 322 /* set error handler */ 323 NXMSetTError(env,JapiError); 324 325 /* exchange the Java handler to a NXhandle */ 326 nxhandle = (NXhandle)HHGetPointer(handle); 327 328 iRet = NXgetpath(nxhandle, path,1024); 329 330 return (*env)->NewStringUTF(env,path); 331 } 332 307 333 /*------------------------------------------------------------------------ 308 334 nxclosegroup … … 315 341 316 342 /* set error handler */ 317 NXMSet Error(env,JapiError);343 NXMSetTError(env,JapiError); 318 344 319 345 /* exchange the Java handler to a NXhandle */ … … 336 362 337 363 /* set error handler */ 338 NXMSet Error(env,JapiError);364 NXMSetTError(env,JapiError); 339 365 340 366 /* exchange the Java handler to a NXhandle */ … … 367 393 368 394 /* set error handler */ 369 NXMSet Error(env,JapiError);395 NXMSetTError(env,JapiError); 370 396 371 397 /* exchange the Java handler to a NXhandle */ … … 401 427 402 428 /* set error handler */ 403 NXMSet Error(env,JapiError);429 NXMSetTError(env,JapiError); 404 430 405 431 /* exchange the Java handler to a NXhandle */ … … 424 450 425 451 /* set error handler */ 426 NXMSet Error(env,JapiError);452 NXMSetTError(env,JapiError); 427 453 428 454 /* exchange the Java handler to a NXhandle */ … … 442 468 443 469 /* set error handler */ 444 NXMSet Error(env,JapiError);470 NXMSetTError(env,JapiError); 445 471 446 472 /* exchange the Java handler to a NXhandle */ … … 448 474 449 475 #ifdef DEBUG 450 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); 451 477 #endif 452 478 iRet = NXcompress(nxhandle,comp_type); … … 463 489 464 490 /* set error handler */ 465 NXMSet Error(env,JapiError);491 NXMSetTError(env,JapiError); 466 492 467 493 /* exchange the Java handler to a NXhandle */ … … 478 504 if(iRet != NX_OK) 479 505 { 480 HEprint( fd,0);506 HEprint(stderr,0); 481 507 } 482 508 #endif … … 495 521 496 522 /* set error handler */ 497 NXMSet Error(env,JapiError);523 NXMSetTError(env,JapiError); 498 524 499 525 /* exchange the Java handler to a NXhandle */ … … 526 552 527 553 /* set error handler */ 528 NXMSet Error(env,JapiError);554 NXMSetTError(env,JapiError); 529 555 530 556 /* exchange the Java handler to a NXhandle */ … … 579 605 580 606 /* set error handler */ 581 NXMSet Error(env,JapiError);607 NXMSetTError(env,JapiError); 582 608 583 609 /* exchange the Java handler to a NXhandle */ … … 594 620 if(iRet != NX_OK) 595 621 { 596 HEprint( fd,0);622 HEprint(stderr,0); 597 623 } 598 624 #endif … … 611 637 612 638 /* set error handler */ 613 NXMSet Error(env,JapiError);639 NXMSetTError(env,JapiError); 614 640 615 641 /* exchange the Java handler to a NXhandle */ … … 644 670 645 671 /* set error handler */ 646 NXMSet Error(env,JapiError);672 NXMSetTError(env,JapiError); 647 673 648 674 /* exchange the Java handler to a NXhandle */ … … 654 680 iargs = (*env)->GetIntArrayElements(env,args,0); 655 681 #ifdef DEBUG 656 fprintf( fd,"nxgetattr converted types \n");682 fprintf(stderr,"nxgetattr converted types \n"); 657 683 #endif 658 684 … … 660 686 iType = iargs[1]; 661 687 #ifdef DEBUG 662 fprintf( fd,"nxgetattr: iLen %d, iType: %d\n",iLen, iType);688 fprintf(stderr,"nxgetattr: iLen %d, iType: %d\n",iLen, iType); 663 689 #endif 664 690 … … 667 693 iargs[1] = iType; 668 694 #ifdef DEBUG 669 fprintf( fd,"nxgetattr cleaning up \n");695 fprintf(stderr,"nxgetattr cleaning up \n"); 670 696 #endif 671 697 … … 689 715 690 716 /* set error handler */ 691 NXMSet Error(env,JapiError);717 NXMSetTError(env,JapiError); 692 718 693 719 /* exchange the Java handler to a NXhandle */ … … 701 727 if(cls == NULL) 702 728 { 703 NXIReportError(env,729 JapiError(env, 704 730 "ERROR: failed to locate class in nxgetgroupid"); 705 731 return; … … 708 734 if(fid == 0) 709 735 { 710 NXIReportError(env,736 JapiError(env, 711 737 "ERROR: failed to locate fieldID in nxgetgroupid"); 712 738 return; … … 717 743 if(fid == 0) 718 744 { 719 NXIReportError(env,745 JapiError(env, 720 746 "ERROR: failed to locate fieldID in nxgetgroupid"); 721 747 return; … … 730 756 if(fid == 0) 731 757 { 732 NXIReportError(env,758 JapiError(env, 733 759 "ERROR: failed to locate targetPath in nxgetgroupid"); 734 760 return; … … 740 766 if(fid == 0) 741 767 { 742 NXIReportError(env,768 JapiError(env, 743 769 "ERROR: failed to locate linkType in nxgetgroupid"); 744 770 return; … … 750 776 if(fid == 0) 751 777 { 752 NXIReportError(env,778 JapiError(env, 753 779 "ERROR: failed to locate targetPath in nxgetgroupid"); 754 780 return; … … 772 798 773 799 /* set error handler */ 774 NXMSet Error(env,JapiError);800 NXMSetTError(env,JapiError); 775 801 776 802 /* exchange the Java handler to a NXhandle */ … … 784 810 if(cls == NULL) 785 811 { 786 NXIReportError(env,812 JapiError(env, 787 813 "ERROR: failed to locate class in nxgetdataid"); 788 814 return; … … 791 817 if(fid == 0) 792 818 { 793 NXIReportError(env,819 JapiError(env, 794 820 "ERROR: failed to locate fieldID in nxgetdataid"); 795 821 return; … … 799 825 if(fid == 0) 800 826 { 801 NXIReportError(env,827 JapiError(env, 802 828 "ERROR: failed to locate fieldID in nxgetdataid"); 803 829 return; … … 812 838 if(fid == 0) 813 839 { 814 NXIReportError(env,840 JapiError(env, 815 841 "ERROR: failed to locate targetPath in nxgetgroupid"); 816 842 return; … … 822 848 if(fid == 0) 823 849 { 824 NXIReportError(env,850 JapiError(env, 825 851 "ERROR: failed to locate linkType in nxgetgroupid"); 826 852 return; … … 832 858 if(fid == 0) 833 859 { 834 NXIReportError(env,860 JapiError(env, 835 861 "ERROR: failed to locate targetPath in nxgetdataid"); 836 862 return; … … 856 882 857 883 /* set error handler */ 858 NXMSet Error(env,JapiError);884 NXMSetTError(env,JapiError); 859 885 860 886 /* exchange the Java handler to a NXhandle */ … … 865 891 if(cls == NULL) 866 892 { 867 NXIReportError(env,893 JapiError(env, 868 894 "ERROR: failed to locate class in nxmakelink"); 869 895 return; … … 872 898 if(fid == 0) 873 899 { 874 NXIReportError(env,900 JapiError(env, 875 901 "ERROR: failed to locate fieldID in nxmakelink"); 876 902 return; … … 880 906 if(fid == 0) 881 907 { 882 NXIReportError(env,908 JapiError(env, 883 909 "ERROR: failed to locate fieldID in nxmakelink"); 884 910 return; … … 893 919 if(fid == 0) 894 920 { 895 NXIReportError(env,921 JapiError(env, 896 922 "ERROR: failed to locate targetPath in nxmakelink"); 897 923 return; … … 905 931 if(fid == 0) 906 932 { 907 NXIReportError(env,933 JapiError(env, 908 934 "ERROR: failed to locate linkType in nxmakelink"); 909 935 return; … … 915 941 if(fid == 0) 916 942 { 917 NXIReportError(env,943 JapiError(env, 918 944 "ERROR: failed to locate targetPath in nxmakelink"); 919 945 return; … … 943 969 944 970 /* set error handler */ 945 NXMSet Error(env,JapiError);971 NXMSetTError(env,JapiError); 946 972 947 973 /* exchange the Java handler to a NXhandle */ … … 955 981 if(cls == NULL) 956 982 { 957 NXIReportError(env,983 JapiError(env, 958 984 "ERROR: failed to locate class in nxmakelink"); 959 985 return; … … 962 988 if(fid == 0) 963 989 { 964 NXIReportError(env,990 JapiError(env, 965 991 "ERROR: failed to locate fieldID in nxmakelink"); 966 992 return; … … 970 996 if(fid == 0) 971 997 { 972 NXIReportError(env,998 JapiError(env, 973 999 "ERROR: failed to locate fieldID in nxmakelink"); 974 1000 return; … … 983 1009 if(fid == 0) 984 1010 { 985 NXIReportError(env,1011 JapiError(env, 986 1012 "ERROR: failed to locate targetPath in nxmakelink"); 987 1013 return; … … 995 1021 if(fid == 0) 996 1022 { 997 NXIReportError(env,1023 JapiError(env, 998 1024 "ERROR: failed to locate linkType in nxmakelink"); 999 1025 return; … … 1005 1031 if(fid == 0) 1006 1032 { 1007 NXIReportError(env,1033 JapiError(env, 1008 1034 "ERROR: failed to locate targetPath in nxmakelink"); 1009 1035 return; … … 1029 1055 1030 1056 /* set error handler */ 1031 NXMSet Error(env,JapiError);1057 NXMSetTError(env,JapiError); 1032 1058 1033 1059 /* exchange the Java handler to a NXhandle */ … … 1048 1074 1049 1075 /* set error handler */ 1050 NXMSet Error(env,JapiError);1076 NXMSetTError(env,JapiError); 1051 1077 1052 1078 /* exchange the Java handler to a NXhandle */ … … 1078 1104 1079 1105 /* set error handler */ 1080 NXMSet Error(env,JapiError);1106 NXMSetTError(env,JapiError); 1081 1107 1082 1108 /* exchange the Java handler to a NXhandle */ … … 1113 1139 1114 1140 /* set error handler */ 1115 NXMSet Error(env,JapiError);1141 NXMSetTError(env,JapiError); 1116 1142 1117 1143 /* exchange the Java handler to a NXhandle */ … … 1141 1167 jint *jarray; 1142 1168 /* set error handler */ 1143 NXMSet Error(env,JapiError);1169 NXMSetTError(env,JapiError); 1144 1170 1145 1171 /* exchange the Java handler to a NXhandle */ … … 1168 1194 1169 1195 /* set error handler */ 1170 NXMSet Error(env,JapiError);1196 NXMSetTError(env,JapiError); 1171 1197 1172 1198 /* exchange the Java handler to a NXhandle */ … … 1187 1213 1188 1214 /* set error handler */ 1189 NXMSet Error(env,JapiError);1215 NXMSetTError(env,JapiError); 1190 1216 1191 1217 /* exchange the Java handler to a NXhandle */ … … 1213 1239 1214 1240 /* set error handler */ 1215 NXMSet Error(env,JapiError);1241 NXMSetTError(env,JapiError); 1216 1242 1217 1243 /* exchange the Java handler to a NXhandle */ … … 1233 1259 } 1234 1260 } 1261 /*---------------------------------------------------------------------*/ 1262 JNIEXPORT void JNICALL Java_org_nexusformat_NexusFile_initattrdir 1263 (JNIEnv *env, jobject obj, jint handle) 1264 { 1265 NXhandle nxhandle; 1266 int iRet; 1267 1268 /* set error handler */ 1269 NXMSetTError(env,JapiError); 1270 1271 /* exchange the Java handler to a NXhandle */ 1272 nxhandle = (NXhandle)HHGetPointer(handle); 1273 1274 iRet = NXinitattrdir(nxhandle); 1275 1276 } 1277 /*---------------------------------------------------------------------*/ 1278 JNIEXPORT void JNICALL Java_org_nexusformat_NexusFile_initgroupdir 1279 (JNIEnv *env, jobject obj, jint handle) 1280 { 1281 NXhandle nxhandle; 1282 int iRet; 1283 1284 /* set error handler */ 1285 NXMSetTError(env,JapiError); 1286 1287 /* exchange the Java handler to a NXhandle */ 1288 nxhandle = (NXhandle)HHGetPointer(handle); 1289 1290 iRet = NXinitgroupdir(nxhandle); 1291 } 1235 1292 /*------------------------------------------------------------------------ 1236 1293 debugstop … … 1247 1304 } 1248 1305 } 1249 1250 1251 1252 1253 1254 1255 1256 1257 -
tags/4.2.1/bindings/java/org/nexusformat/NexusFile.java
r1896 r1896 16 16 * 17 17 * copyright: see accompanying COPYRIGHT file 18 * 19 * added nxinitattrdir: Mark Koennecke, October 2009 18 20 */ 19 21 package org.nexusformat; … … 111 113 protected native void close(int handle); 112 114 protected native int nxflush(int handle); 113 115 114 116 /** 115 117 * constructs a new NexusFile Object. … … 134 136 public NexusFile(String filename, int access) throws NexusException 135 137 { 138 checkForNull(filename); 136 139 handle = init(filename,access); 137 140 if(handle < 0){ … … 182 185 protected native void nxopengrouppath(int handle, String path); 183 186 protected native void nxclosegroup(int handle); 187 protected native String nxgetpath(int handle); 184 188 185 189 /** … … 193 197 NexusException 194 198 { 199 checkForNull(name, nxclass); 195 200 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 196 201 nxmakegroup(handle, name, nxclass); … … 208 213 { 209 214 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 215 checkForNull(name, nxclass); 210 216 nxopengroup(handle, name, nxclass); 211 217 } … … 222 228 { 223 229 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 224 nxopenpath(handle,path); 230 checkForNull(path); 231 nxopenpath(handle, path); 225 232 } 226 233 /** … … 236 243 { 237 244 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 245 checkForNull(path); 238 246 nxopengrouppath(handle,path); 239 247 } 240 248 /** 249 * return the current path into the NeXus file in the 250 * form of a Unix path string. 251 * @return A unix path string 252 */ 253 public String getpath() throws NexusException 254 { 255 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 256 return nxgetpath(handle); 257 } 241 258 /** 242 259 * closegroup closes access to the current group and steps down one … … 283 300 NexusException { 284 301 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 285 checkType(type); 302 checkType(type); 303 checkForNull(name); 286 304 switch(compression_type) { 287 305 case NexusFile.NX_COMP_NONE: … … 307 325 * @exception NexusException when the dataset could not be created. 308 326 */ 309 public void makedata(String name, int type, int rank, int dim[]) throws327 public void makedata(String name, int type, int rank, int[] dim) throws 310 328 NexusException 311 329 { 312 330 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 313 331 checkType(type); 332 checkForNull(name, dim); 314 333 nxmakedata(handle,name,type,rank,dim); 315 334 } … … 325 344 { 326 345 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 346 checkForNull(name); 327 347 nxopendata(handle,name); 328 348 } … … 386 406 byte bdata[]; 387 407 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 408 checkForNull(array); 388 409 try{ 389 410 HDFArray ha = new HDFArray(array); … … 406 427 * the data. 407 428 */ 408 public void getslab(int start[], int size[],Object array)throws429 public void getslab(int[] start, int[] size, Object array) throws 409 430 NexusException 410 431 { 411 432 byte bdata[]; 412 433 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 434 checkForNull(start, size, array); 413 435 try{ 414 436 HDFArray ha = new HDFArray(array); 415 437 bdata = ha.emptyBytes(); 416 nxgetslab(handle, start,size,bdata);438 nxgetslab(handle, start, size, bdata); 417 439 array = ha.arrayify(bdata); 418 440 }catch(HDFException he) { … … 432 454 * the attribute could not be found. 433 455 */ 434 public void getattr(String name, Object array, int args[])throws456 public void getattr(String name, Object array, int[] args)throws 435 457 NexusException 436 458 { 437 459 byte bdata[]; 438 460 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 461 checkForNull(name, array, args); 439 462 checkType(args[1]); 440 463 try{ … … 468 491 469 492 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 493 checkForNull(array); 494 470 495 try{ 471 496 HDFArray ha = new HDFArray(array); … … 488 513 * @exception NexusException when an HDF error occurs. 489 514 */ 490 public void putslab(Object array, int start[], int size[]) throws515 public void putslab(Object array, int[] start, int[] size) throws 491 516 NexusException 492 517 { … … 494 519 495 520 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 521 checkForNull(array, start, size); 496 522 try{ 497 523 HDFArray ha = new HDFArray(array); … … 501 527 throw new NexusException(he.getMessage()); 502 528 } 503 nxputslab(handle, data,start,size);529 nxputslab(handle, data, start, size); 504 530 data = null; 505 531 } … … 519 545 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 520 546 checkType(iType); 547 checkForNull(name, array); 521 548 try{ 522 549 HDFArray ha = new HDFArray(array); … … 537 564 protected native int nextentry(int handle, String names[]); 538 565 protected native int nextattr(int handle, String names[], int args[]); 566 protected native void initattrdir(int handle); 567 protected native void initgroupdir(int handle); 539 568 /** 540 569 * setnumberformat sets the number format for printing number when … … 549 578 throws NexusException{ 550 579 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 580 checkType(type); 581 checkForNull(format); 551 582 nxsetnumberformat(handle,type,format); 552 583 } … … 581 612 String names[] = new String[2]; 582 613 int i; 614 615 initgroupdir(handle); 583 616 while(nextentry(handle,names) != -1) 584 617 { … … 603 636 Hashtable h = new Hashtable(); 604 637 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 638 initattrdir(handle); 605 639 while(nextattr(handle,names,args) != -1) 606 640 { … … 654 688 * @exception NexusException if an error occurs. 655 689 */ 656 public void makelink(NXlink target)throws690 public void makelink(NXlink target) throws 657 691 NexusException 658 692 { 659 693 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 660 nxmakelink(handle,target); 694 checkForNull(target); 695 nxmakelink(handle, target); 661 696 } 662 697 /** … … 668 703 * @exception NexusException if an error occurs. 669 704 */ 670 public void makenamedlink(String name, NXlink target)throws705 public void makenamedlink(String name, NXlink target) throws 671 706 NexusException { 672 707 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 673 nxmakenamedlink(handle,name, target); 708 checkForNull(name, target); 709 nxmakenamedlink(handle, name, target); 674 710 } 675 711 … … 679 715 * @exception NexusException if an error occurs. 680 716 */ 681 public void opensourcepath()throws717 public void opensourcepath() throws 682 718 NexusException 683 719 { … … 686 722 } 687 723 688 724 /** 725 * checks if any of the arguments is null, 726 * throws appropriate runtime exception if so 727 */ 728 private void checkForNull(Object... args) { 729 for (Object o : args) 730 if (o==null) throw new NullPointerException(); 731 } 732 689 733 /** 690 734 * checkType verifies if a parameter is a valid NeXus type code. … … 696 740 { 697 741 switch(type) { 742 case NexusFile.NX_FLOAT32: 743 case NexusFile.NX_FLOAT64: 698 744 case NexusFile.NX_INT8: 699 745 case NexusFile.NX_UINT8: 700 case NexusFile.NX_CHAR:701 746 case NexusFile.NX_INT16: 702 747 case NexusFile.NX_UINT16: 703 748 case NexusFile.NX_INT32: 704 749 case NexusFile.NX_UINT32: 705 case NexusFile.NX_FLOAT32: 706 case NexusFile.NX_FLOAT64: 750 case NexusFile.NX_INT64: 751 case NexusFile.NX_UINT64: 752 case NexusFile.NX_CHAR: 707 753 break; 708 754 default: … … 735 781 * @throws NexusException if things are wrong 736 782 */ 737 public void linkexternal(String name, String nxclass, String nxurl) throws NexusException{ 738 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 739 nxlinkexternal(handle,name,nxclass,nxurl); 783 public void linkexternal(String name, String nxclass, String nxurl) throws NexusException { 784 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 785 checkForNull(name, nxclass, nxurl); 786 nxlinkexternal(handle, name, nxclass, nxurl); 740 787 } 741 788 /** … … 749 796 public String isexternalgroup(String name, String nxclass) throws NexusException{ 750 797 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 798 checkForNull(name, nxclass); 751 799 String nxurl[] = new String[1]; 752 800 … … 770 818 public native void debugstop(); 771 819 } 772 773 774 775 776 777 778 779 780 -
tags/4.2.1/bindings/java/org/nexusformat/NeXusFileInterface.java
r1896 r1896 89 89 public void opengrouppath(String path) throws 90 90 NexusException; 91 /** 92 * return the current path into the NeXus file in the 93 * form of a Unix path string. 94 * @return A unix path string 95 */ 96 public String getpath() throws NexusException; 91 97 /** 92 98 * closegroup closes access to the current group and steps down one -
tags/4.2.1/bindings/python/Makefile.am
r1896 r1896 35 35 #pkgpython_PYTHON = nxstest.py 36 36 nxspython_PYTHON = nxs/__init__.py nxs/napi.py 37 EXTRA_DIST = README.html nxstest.py run_nxstest 37 EXTRA_DIST = README.html nxstest.py run_nxstest setup.py 38 38 39 39 install-data-hook : -
tags/4.2.1/bindings/cpp/NeXusFile.cpp
r1896 r1896 41 41 } 42 42 43 template<> 44 NXDLL_EXPORT NXnumtype getType(char number) { 45 stringstream msg; 46 msg << "NeXus::getType() does not know type of \"char\" " << number; 47 throw Exception(msg.str()); 48 } 49 43 50 // template specialisations for types we know 44 51 template<> … … 91 98 return UINT64; 92 99 } 100 93 101 94 102 } … … 225 233 throw Exception(msg.str(), status); 226 234 } 235 } 236 237 std::string File::getPath(){ 238 char cPath[1024]; 239 240 memset(cPath,0,1024*sizeof(char)); 241 NXstatus status = NXgetpath(this->m_file_id,cPath, 1024); 242 if (status != NX_OK) { 243 stringstream msg; 244 msg << "NXgetpath() failed"; 245 throw Exception(msg.str(), status); 246 } 247 return std::string(cPath); 227 248 } 228 249 -
tags/4.2.1/bindings/cpp/NeXusFile.hpp
r1896 r1896 181 181 */ 182 182 void openGroupPath(const std::string& path); 183 /** 184 * Get the path into the current file 185 * \return A unix like path string pointing to the current 186 * position in the file 187 */ 188 std::string getPath(); 183 189 184 190 /** -
tags/4.2.1/bindings/cpp/Makefile.am
r1896 r1896 35 35 LIBNEXUS=$(top_builddir)/src/libNeXus.la 36 36 lib_LTLIBRARIES=libNeXusCPP.la 37 AM_LDFLAGS=-version-info $(NXLTVERSINFO) 37 38 38 39 # nxincludedir=$(includedir)/nexus -
tags/4.2.1/bindings/f77/napif.inc
r1896 r1896 36 36 C *** large enough to hold an NXhandle structure 37 37 INTEGER NXHANDLESIZE 38 PARAMETER(NXHANDLESIZE=5120) 38 C PARAMETER(NXHANDLESIZE=5120) 39 PARAMETER(NXHANDLESIZE=9058) 39 40 C *** NXLINKSIZE is (at least) the size of an INTEGER*4 array that can hold 40 41 C *** an NXlink structure: we'll assume 64bit alignment of structure members for safety … … 79 80 + NXINITATTRDIR, NXFLUSH, NXCOMPMAKEDATA, NXOPENPATH, 80 81 + NXSETNUMBERFORMAT, NXOPENGROUPPATH, NXOPENSOURCEGROUP, 81 + NXMAKENAMEDLINK 82 + NXMAKENAMEDLINK, NXGETPATH 82 83 LOGICAL NXSAMEID 83 84 EXTERNAL NXOPEN, NXCLOSE, NXMAKEGROUP, NXOPENGROUP, NXCLOSEGROUP, … … 91 92 + NXOPENPATH,NXSETNUMBERFORMAT, NXOPENGROUPPATH, 92 93 + NXOPENSOURCEGROUP, NXINQUIREFILE, NXISEXTERNALGROUP, 93 + NXLINKEXTERNAL, NXMAKENAMEDLINK 94 + NXLINKEXTERNAL, NXMAKENAMEDLINK, NXGETPATH -
tags/4.2.1/bindings/f77/Makefile.am
r1896 r1896 29 29 #==================================================================== 30 30 lib_LTLIBRARIES=libNeXus77.la 31 AM_LDFLAGS=-version-info $(NXLTVERSINFO) 31 32 32 33 libNeXus77_la_SOURCES=napif.f -
tags/4.2.1/bindings/f77/napif.f
r1896 r1896 121 121 CALL EXTRACT_STRING(IPATH, 256, PATH) 122 122 NXOPENPATH = NXIOPENPATH(FILEID, IPATH) 123 END 124 125 INTEGER FUNCTION NXGETPATH(FILEID, PATH) 126 INTEGER FILEID(*),NXIGETPATH, NXIFGETPATH 127 CHARACTER*(*) PATH 128 INTEGER*1 IPATH(1024) 129 INTEGER PLEN 130 EXTERNAL NXIFGETPATH 131 PLEN = 1024 132 NXGETPATH = NXIFGETPATH(FILEID,IPATH,PLEN) 133 CALL REPLACE_STRING(PATH,IPATH) 123 134 END 124 135 -
tags/4.2.1/configure.ac
r1896 r1896 31 31 AC_PREREQ(2.61) 32 32 AC_REVISION($Revision$) 33 AC_INIT([NeXus Library], [4.2. 0], [nexus-developers@nexusformat.org], [nexus])33 AC_INIT([NeXus Library], [4.2.1], [nexus-developers@nexusformat.org], [nexus]) 34 34 AC_COPYRIGHT([Copyright (C) 2004 NeXus International Advisory Committee 35 35 This software is covered by the GNU LESSER GENERAL PUBLIC LICENSE 36 36 see file COPYING for further information]) 37 38 # used by libtool - need to get if from 4.2.1 better 39 NXLTVERSINFO="4:2:4" 37 40 38 41 AC_CONFIG_AUX_DIR(config) … … 55 58 AM_INIT_AUTOMAKE([1.6]) 56 59 60 AC_SUBST(NXLTVERSINFO) 57 61 58 62 AM_CONFIG_HEADER(include/nxconfig.h:include/nxconfig_h.in) … … 82 86 fi 83 87 88 AC_SUBST(WITH_F77) 84 89 AC_ARG_WITH([f77], AC_HELP_STRING([--with-f77=f77 compiler], [Specify name of FORTRAN 77 compiler]), 85 [ with_f77=$withval], [with_f77=no])86 if test x"$with_f77" != x"no" ; then90 [], [with_f77=no]) 91 if test ! -z "$with_f77" -a x"$with_f77" != x"no" ; then 87 92 if test x"$with_f77" != x"yes" ; then F77="$with_f77"; fi 88 93 AC_PROG_F77 … … 94 99 AC_CHECK_F77_OPTION([-I$mytop/bindings/f77],[ INCLUDE 'napif.inc']) 95 100 AC_F77_LIBRARY_LDFLAGS 101 WITH_F77=yes 96 102 else 97 103 F77= 98 fi 99 104 WITH_F77=no 105 fi 106 107 AC_SUBST(WITH_F90) 100 108 AC_ARG_WITH([f90], AC_HELP_STRING([--with-f90=f90 compiler], [Specify name of FORTRAN 90 compiler]), 101 [ with_f90=$withval], [with_f90=no])102 if test x"$with_f90" != x"no" ; then109 [], [with_f90=no]) 110 if test ! -z "$with_f90" -a x"$with_f90" != x"no" ; then 103 111 if test x"$with_f90" = x"yes" ; then 104 AC_CHECK_PROGS(FC, [g95 f90 f95 ifort])112 AC_CHECK_PROGS(FC, [g95 gfortran f90 f95 ifort]) 105 113 else 106 114 FC="$with_f90" … … 118 126 # if test x$with_f77=xno; then with_f77=$FC; fi 119 127 # if test x$with_f77=xno; then with_f77=yes; fi 128 WITH_F90=yes 120 129 else 121 130 FC= 122 fi 131 WITH_F90=no 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])]) 123 152 124 153 java_host="linux" … … 126 155 AC_ARG_WITH([java-home], AC_HELP_STRING([--with-java-home=JAVA SDK Home], [Specify location of top directory of JAVA SDK i.e. where the bin, lib and include directories live]), 127 156 [], [with_java_home=$withval]) 157 AC_ARG_WITH([java], AC_HELP_STRING([--with-java=path to java executable], [Specify location of JAVA executable]), 158 [], [with_java=no]) 159 if test -z "$with_java_home" -a x$with_java != xno; then 160 def_javac=`which javac` 161 link_javac=`readlink -e "$def_javac"` 162 with_java_home=`dirname "$link_javac"`/.. 163 fi 128 164 if test -d "$with_java_home"; then 129 165 JAVAROOT="$with_java_home" 130 166 AC_MSG_NOTICE([Java SDK home is $JAVAROOT]) 131 167 JAVAINCLUDE="-I$JAVAROOT/include" 132 AC_PATH_PROGS(JAVAC, gcj javac,,[$JAVAROOT/bin])168 AC_PATH_PROGS(JAVAC,javac gcj,,[$JAVAROOT/bin]) 133 169 if test `basename "$JAVAC"` = "gcj"; then 134 170 JAVACFLAGS="-C" # force creation of .class files 135 171 fi 136 AC_PATH_PROGS(JAVA, gij java,,[$JAVAROOT/bin])137 AC_PATH_PROGS(JAVAH, gcjh javah,,[$JAVAROOT/bin])172 AC_PATH_PROGS(JAVA,java gij,,[$JAVAROOT/bin]) 173 AC_PATH_PROGS(JAVAH,javah gcjh,,[$JAVAROOT/bin]) 138 174 AC_PATH_PROGS(JAVADOC,javadoc,,[$JAVAROOT/bin:$PATH]) 139 175 AC_PATH_PROGS(JAR,jar fastjar,,[$JAVAROOT/bin:$PATH]) … … 212 248 test -z "$PACKAGE_RELEASE" && PACKAGE_RELEASE=1 213 249 250 SHARED_LDFLAGS="" 251 214 252 NXDOCDIR='${datadir}/nexus/doc' 215 253 NXEXAMPLEDIR='${datadir}/nexus/examples' … … 244 282 fi 245 283 AM_PATH_PYTHON(,, :) 284 AC_CHECK_PYTHON_MODULE(numpy) 246 285 fi 247 286 … … 297 336 298 337 # strict aliasing causes issues with casts from NXmalloc() 299 CFLAGS=" -fno-strict-aliasing"300 CXXFLAGS=" -fno-strict-aliasing"338 CFLAGS="$CFLAGS -fno-strict-aliasing" 339 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" 301 340 302 341 # check for debug … … 375 414 376 415 *mingw*) 377 SHARED_LDFLAGS=" -no-undefined" # -Wl,--add-stdcall-alias416 SHARED_LDFLAGS="$SHARED_LDFLAGS -no-undefined" # -Wl,--add-stdcall-alias 378 417 MINGW_MSYS=yes 379 418 HDF_EXT=dll … … 384 423 385 424 *cygwin*) 386 # SHARED_LDFLAGS=" -no-undefined" # -Wl,--add-stdcall-alias425 # SHARED_LDFLAGS="$SHARED_LDFLAGS -no-undefined" # -Wl,--add-stdcall-alias 387 426 ;; 388 427 … … 403 442 dnl F90FLAGS="$F90FLAGS -g -cons -YEXT_NAMES=LCS -YEXT_SFX=_" 404 443 dnl FCFLAGS="$FCFLAGS -qextname" 405 SHARED_LDFLAGS=" -Wl,-single_module"444 SHARED_LDFLAGS="$SHARED_LDFLAGS -Wl,-single_module" 406 445 # LTF90COMPILETAG="--tag=F77" 407 446 # LTF90LINKTAG="--tag=CC" … … 579 618 fi 580 619 # for Mac/fink when hdf and hdf5 are not taken from fink, but jpeg is 581 if test -d /sw/lib; then582 LDFLAGS="$LDFLAGS -L/sw/lib"583 fi620 #if test -d /sw/lib; then 621 # LDFLAGS="$LDFLAGS -L/sw/lib" 622 #fi 584 623 # for Mac/Macports when you are not using fink at all. 585 if test -d /opt/local/lib; then586 LDFLAGS="$LDFLAGS -L/opt/local/lib"587 fi624 #if test -d /opt/local/lib; then 625 # LDFLAGS="$LDFLAGS -L/opt/local/lib" 626 #fi 588 627 589 628 # remove initial : … … 618 657 AC_CHECK_LIB(hdf5, H5open) 619 658 AC_CHECK_LIB(xml2, xmlParseDocument) 659 AC_CHECK_LIB(readline, readline) 660 AC_CHECK_LIB(history, add_history) 661 dnl AC_LANG_PUSH([C++]) 662 dnl AC_CHECK_LIB(mxmlplus, _ZN4MXML4NodeD2Ev) 663 dnl AC_LANG_POP([C++]) 620 664 621 665 dnl Checks for header files. … … 637 681 AC_TYPE_LONG_LONG_INT 638 682 AC_TYPE_UNSIGNED_LONG_LONG_INT 639 AC_CHECK_SIZEOF([int]) 640 AC_CHECK_SIZEOF([long int]) 641 AC_CHECK_SIZEOF([long long int]) 683 dnl these are not compatible with cross architecture compiling 684 if test x$cross_compiling != xyes; then 685 AC_CHECK_SIZEOF([int]) 686 AC_CHECK_SIZEOF([long int]) 687 AC_CHECK_SIZEOF([long long int]) 688 fi 642 689 AC_STRUCT_TM 643 690 … … 672 719 AC_CHECK_FUNCS([ftime memset strchr strdup strrchr strstr tzset mkstemp]) 673 720 721 AC_CHECK_FUNC([rl_completion_matches]) 722 674 723 AM_CONDITIONAL(HAVE_CPP, [test ! -z "$CXX"]) 675 724 AM_CONDITIONAL(HAVE_F77, [test "$with_f77" != "no"]) 676 725 AM_CONDITIONAL(HAVE_F90, [test "$with_f90" != "no"]) 677 AM_CONDITIONAL(HAVE_PYTHON, [test ! -z "$PYTHONROOT" ])726 AM_CONDITIONAL(HAVE_PYTHON, [test ! -z "$PYTHONROOT" -a "$PYTHON_numpy" -eq 1]) 678 727 AM_CONDITIONAL(HAVE_TCL, [test ! -z "$TCLROOT"]) 679 728 AM_CONDITIONAL(HAVE_GUILE, [test ! -z "$GUILEROOT"]) … … 686 735 AM_CONDITIONAL(HAVE_XML, [test ! -z "$MXMLROOT"]) 687 736 AM_CONDITIONAL(HAVE_LIBXML2, [ test "$ac_cv_lib_xml2_xmlParseDocument" = "yes" ]) 737 dnl AM_CONDITIONAL(HAVE_LIBMXMLPLUS, [ test "$ac_cv_lib_mxmlplus__ZN4MXML4NodeD2Ev" = "yes" ]) 688 738 AM_CONDITIONAL(HAVE_DOCBOOK, [test ! -z "$DOCBOOK2TXT" -a ! -z "$DOCBOOK2PDF"]) 689 739 AM_CONDITIONAL(HAVE_LATEX, [test ! -z "$LATEX"]) … … 730 780 doc/Makefile 731 781 doc/doxygen/Makefile 732 doc/doxygen/Doxyfile733 782 doc/api/Makefile 734 783 doc/nxdict/Makefile … … 747 796 contrib/bindings/Makefile 748 797 contrib/bindings/python/Makefile 798 macosx_install_kit/Makefile 799 macosx_install_kit/pkg.config 749 800 scripts/Makefile 750 801 scripts/nexus.pc:scripts/nexus_pc.in … … 782 833 JAVABINDING=`if test -n "$JAVAROOT" ; then echo yes ; else echo no ; fi` 783 834 IDLBINDING=`if test -n "$IDLROOT" ; then echo yes ; else echo no ; fi` 784 PYTHONBINDING=`if test -n "$ PYTHONROOT"; then echo yes; else echo no ; fi`835 PYTHONBINDING=`if test -n "$HAVE_PYTHON_FALSE"; then echo yes; else echo no ; fi` 785 836 if test -n "$SWIG" ; then 786 837 SWIGBINDING="yes (" … … 817 868 SWIG: ${SWIGBINDING} 818 869 IDL: ${IDLBINDING} (--with-idlroot=${IDLROOT}, --with-idldlm=${IDLDLM}) 819 PYTHON: ${PYTHONBINDING} (PYTHONROOT=${PYTHONROOT} )870 PYTHON: ${PYTHONBINDING} (PYTHONROOT=${PYTHONROOT}, numpy found: $PYTHON_numpy_found) 820 871 821 872 documentation: -
tags/4.2.1/doc
-
Property
svn:mergeinfo
set to
/trunk/doc merged eligible
-
Property
svn:mergeinfo
set to
-
tags/4.2.1/doc/doxygen/Makefile.am
r1896 r1896 15 15 if HAVE_PDFLATEX 16 16 if HAVE_DOT 17 rm -fr latex html 18 $(DOXYGEN) Doxyfile 19 ( cd latex; make pdf ) 17 rm -fr latex html latex-* html-* 18 env TOPSRC=$(top_srcdir) $(DOXYGEN) $(srcdir)/Doxyfile_c 19 ( cd latex-c; ) # ( cd latex-c; make pdf ) 20 env TOPSRC=$(top_srcdir) $(DOXYGEN) $(srcdir)/Doxyfile_cpp 21 ( cd latex-cpp; ) # ( cd latex-cpp; make pdf ) 22 env TOPSRC=$(top_srcdir) $(DOXYGEN) $(srcdir)/Doxyfile_java 23 ( cd latex-java; ) # ( cd latex-java; make pdf ) 24 env TOPSRC=$(top_srcdir) $(DOXYGEN) $(srcdir)/Doxyfile_python 25 ( cd latex-python; ) # ( cd latex-python; make pdf ) 26 env TOPSRC=$(top_srcdir) $(DOXYGEN) $(srcdir)/Doxyfile_f90 27 ( cd latex-f90; ) # ( cd latex-f90; make pdf ) 28 env TOPSRC=$(top_srcdir) $(DOXYGEN) $(srcdir)/Doxyfile_f77 29 ( cd latex-f77; ) # ( cd latex-f77; make pdf ) 20 30 rm -f refman.pdf 21 ln -s latex /refman.pdf .31 ln -s latex-c/refman.pdf . 22 32 endif 23 33 endif … … 25 35 touch doxy.remove_me_to_remake 26 36 37 dist-hook : 27 38 if HAVE_DOXYGEN 28 39 if HAVE_PDFLATEX 29 40 if HAVE_DOT 30 dist-hook : 31 test -f $(srcdir)/refman.pdf && cp $(srcdir)/refman.pdf $(distdir) 32 if test -d $(srcdir)/html; then \ 33 cp -r $(srcdir)/html $(distdir); \ 34 find $(distdir)/html -depth -type d -name '.svn' -exec rm -fr {} \; ;\ 41 if test -f $(srcdir)/refman.pdf; then \ 42 cp $(srcdir)/refman.pdf $(distdir); \ 35 43 fi 36 37 install-data-local : 38 $(mkinstalldirs) $(DESTDIR)$(nxdoxydir) 39 test -f $(srcdir)/refman.pdf && cp $(srcdir)/refman.pdf $(DESTDIR)$(nxdoxydir) 40 if test -d $(srcdir)/html; then \ 41 cp -r $(srcdir)/html $(DESTDIR)$(nxdoxydir); \ 42 find $(DESTDIR)$(nxdoxydir) -type f -exec chmod 0644 {} \; ;\ 43 find $(DESTDIR)$(nxdoxydir) -type d -exec chmod 0755 {} \; ;\ 44 if test -d $(srcdir)/html-c; then \ 45 for i in $(srcdir)/html-*; do \ 46 if test -d $$i; then \ 47 cp -r $$i $(distdir); \ 48 fi; \ 49 done; \ 50 find $(distdir)/html-* -depth -type d -name '.svn' -exec rm -fr {} \; ; \ 44 51 fi 45 52 endif … … 47 54 endif 48 55 56 install-data-local : 57 $(mkinstalldirs) $(DESTDIR)$(nxdoxydir) 58 if test -f $(srcdir)/refman.pdf; then \ 59 cp $(srcdir)/refman.pdf $(DESTDIR)$(nxdoxydir); \ 60 fi 61 if test -d $(srcdir)/html-c; then \ 62 for i in $(srcdir)/html-*; do \ 63 cp -r $$i $(DESTDIR)$(nxdoxydir); \ 64 done; \ 65 find $(DESTDIR)$(nxdoxydir) -type f -exec chmod 0644 {} \; ;\ 66 find $(DESTDIR)$(nxdoxydir) -type d -exec chmod 0755 {} \; ;\ 67 fi 68 49 69 clean-local : 50 rm -fr html latexrefman.pdf70 rm -fr html-* latex-* refman.pdf 51 71 52 72 uninstall-local : 53 73 rm -fr $(DESTDIR)$(nxdoxydir) 54 74 75 EXTRA_DIST=$(srcdir)/Doxyfile_* -
tags/4.2.1/doc/tech_ref/methods.docbook
r1896 r1896 31 31 definition.</para></listitem> 32 32 33 <listitem id="method.ol.write _file"><para>Write a sample NeXus file33 <listitem id="method.ol.write-file"><para>Write a sample NeXus file 34 34 conforming to the instrument definition (for example, using 35 35 NXtranslate).</para></listitem> … … 37 37 <listitem id="method.ol.test"><para>Test the file, repeating steps 38 38 <xref linkend="method.ol.niac"> and <xref 39 linkend="method.ol.write _file"> as appropriate.</para></listitem>39 linkend="method.ol.write-file"> as appropriate.</para></listitem> 40 40 41 41 <listitem id="method.ol.ratify"><para>Request ratification once the -
tags/4.2.1/doc/tech_ref/base_classes.docbook
r1896 r1896 1 1 <!-- ******************** BASE CLASSES ******************** --> 2 <chapter id="base _classes"><title>Base Classes</title>2 <chapter id="base-classes"><title>Base Classes</title> 3 3 4 4 <para>This chapter will list all of the base classes and their … … 59 59 </example> 60 60 61 <example id="NXbeam _stop.xml"><title><filename>NXbeam_stop.xml</filename></title>61 <example id="NXbeam-stop.xml"><title><filename>NXbeam_stop.xml</filename></title> 62 62 <programlisting role="XML"> 63 63 <![CDATA[<!-- … … 468 468 </example> 469 469 470 <example id="NXdisk _chopper.xml"><title><filename>NXdisk_chopper.xml</filename></title>470 <example id="NXdisk-chopper.xml"><title><filename>NXdisk_chopper.xml</filename></title> 471 471 <programlisting role="XML"> 472 472 <![CDATA[<!-- … … 625 625 </example> 626 626 627 <example id="NXevent _data.xml"><title><filename>NXevent_data.xml</filename></title>627 <example id="NXevent-data.xml"><title><filename>NXevent_data.xml</filename></title> 628 628 <programlisting role="XML"> 629 629 <![CDATA[<!-- … … 661 661 </example> 662 662 663 <example id="NXfermi _chopper.xml"><title><filename>NXfermi_chopper.xml</filename></title>663 <example id="NXfermi-chopper.xml"><title><filename>NXfermi_chopper.xml</filename></title> 664 664 <programlisting role="XML"> 665 665 <![CDATA[<!-- … … 1616 1616 </example> 1617 1617 1618 <example id="NXvelocity _selector.xml"><title><filename>NXvelocity_selector.xml</filename></title>1618 <example id="NXvelocity-selector.xml"><title><filename>NXvelocity_selector.xml</filename></title> 1619 1619 <programlisting role="XML"> 1620 1620 <![CDATA[<!-- -
tags/4.2.1/doc/tech_ref/tofnpd.docbook
r1896 r1896 45 45 </para> 46 46 47 <example id="TOFNPD-time _focus.xml"><title><filename>TOFNPD:time_focus.xml</filename></title>47 <example id="TOFNPD-time-focus.xml"><title><filename>TOFNPD:time_focus.xml</filename></title> 48 48 <programlisting role="XML"> 49 49 <![CDATA[<!-- -
tags/4.2.1/doc/tech_ref/NeXus_definitions.docbook
r1896 r1896 2 2 <!ENTITY terminology SYSTEM "terminology.docbook"> 3 3 <!ENTITY methods SYSTEM "methods.docbook"> 4 <!ENTITY base _classes SYSTEM "base_classes.docbook">4 <!ENTITY base-classes SYSTEM "base_classes.docbook"> 5 5 <!ENTITY monoref SYSTEM "monoref.docbook"> 6 6 <!ENTITY monotas SYSTEM "monotas.docbook"> … … 10 10 <!ENTITY nxtranslate "<application>NXtranslate</application>"> 11 11 <!ENTITY napi "<acronym>napi</acronym>"> 12 <!ENTITY mime _type "<parameter>NXS:mime_type</parameter>">12 <!ENTITY mime-type "<parameter>NXS:mime_type</parameter>"> 13 13 <!ENTITY source "<parameter>NXS:source</parameter>"> 14 14 <!ENTITY location "<parameter>NXS:location</parameter>"> 15 <!ENTITY make _link "<parameter>target</parameter>">16 <!ENTITY link _tag "<parameter>NAPIlink</parameter>">15 <!ENTITY make-link "<parameter>target</parameter>"> 16 <!ENTITY link-tag "<parameter>NAPIlink</parameter>"> 17 17 ]> 18 18 … … 61 61 62 62 <!-- ******************** BASE CLASSES ******************** --> 63 &base _classes63 &base-classes 64 64 65 65 <!-- ******************** DEFINITIONS ******************** --> -
tags/4.2.1/NEWS
r1896 r1896 1 2 For the latest information see 3 4 http://www.nexusformat.org/Nexus_42_Release_Notes 5 6 Version 4.2.1 7 ============= 8 9 The following new featues have been added: 10 11 * NXbrowse now has readline support (i.e. previous command line recall and 12 TAB completion of entry names) 13 * new API functions NXgetpath() and NXgetversion() added 14 * NXgetnextentry() now uses less stack space 15 1 16 Version 4.2.0 2 17 ============= 3 4 For the latest information see5 6 http://www.nexusformat.org/Nexus_42_Release_Notes7 18 8 19 ==System Requirements== -
tags/4.2.1/test
-
Property
svn:mergeinfo
set to
/trunk/test merged eligible
-
Property
svn:mergeinfo
set to
-
tags/4.2.1/test/napif4_test.f
r1896 r1896 27 27 INCLUDE 'napif.inc' 28 28 INTEGER NXRANK, NXDIMS(NX_MAXRANK), NXTYPE, NXLEN 29 INTEGER ENTRY_STATUS, ATTR_STATUS 29 INTEGER ENTRY_STATUS, ATTR_STATUS, STAT 30 30 INTEGER*4 I, J 31 31 REAL*4 R … … 41 41 CHARACTER*128 CHAR_BUFFER 42 42 INTEGER*1 CHAR_BUFFER_B(128) 43 CHARACTER*64 GROUP_NAME, CLASS_NAME 43 CHARACTER*64 GROUP_NAME, CLASS_NAME, PATH 44 44 INTEGER FILEID(NXHANDLESIZE) 45 45 INTEGER GLINK(NXLINKSIZE), DLINK(NXLINKSIZE), BLINK(NXLINKSIZE) … … 141 141 IF (NXPUTSLAB(FILEID, U_BUFFER(I), SLAB_START, 142 142 + SLAB_SIZE) .NE. NX_OK) STOP 143 STAT = NXCLOSEDATA(FILEID) 143 144 IF (NXFLUSH(FILEID) .NE. NX_OK) STOP 144 145 END DO … … 196 197 ELSE IF (ENTRY_STATUS .EQ. NX_OK) THEN 197 198 IF (NXOPENDATA(FILEID,NAME) .NE. NX_OK) STOP 199 IF(NXGETPATH(FILEID,PATH) .NE. NX_OK) STOP 200 WRITE(*,FMT='(1X,A,A)') 'Path = ', PATH(1:LEN_TRIM(PATH)) 198 201 IF (NXGETINFO(FILEID,NXRANK,NXDIMS,NXTYPE) .NE. NX_OK) STOP 199 202 WRITE(*,FMT='(4X,A,I2,A)') NAME(1:LEN_TRIM(NAME))//'(', -
tags/4.2.1/test/napif5_test.f
r1896 r1896 27 27 INCLUDE 'napif.inc' 28 28 INTEGER NXRANK, NXDIMS(NX_MAXRANK), NXTYPE, NXLEN 29 INTEGER ENTRY_STATUS, ATTR_STATUS 29 INTEGER ENTRY_STATUS, ATTR_STATUS, STAT 30 30 INTEGER*4 I, J 31 31 REAL*4 R … … 42 42 INTEGER*1 CHAR_BUFFER_B(128) 43 43 CHARACTER*64 GROUP_NAME, CLASS_NAME 44 CHARACTER*70 PATH 44 45 INTEGER FILEID(NXHANDLESIZE) 45 46 INTEGER GLINK(NXLINKSIZE), DLINK(NXLINKSIZE), BLINK(NXLINKSIZE) … … 141 142 IF (NXPUTSLAB(FILEID, U_BUFFER(I), SLAB_START, 142 143 + SLAB_SIZE) .NE. NX_OK) STOP 144 STAT = NXCLOSEDATA(FILEID) 143 145 IF (NXFLUSH(FILEID) .NE. NX_OK) STOP 144 146 END DO … … 196 198 ELSE IF (ENTRY_STATUS .EQ. NX_OK) THEN 197 199 IF (NXOPENDATA(FILEID,NAME) .NE. NX_OK) STOP 200 IF(NXGETPATH(FILEID,PATH) .NE. NX_OK) STOP 201 WRITE(*,FMT='(1X,A,A)') 'Path = ', PATH(1:LEN_TRIM(PATH)) 198 202 IF (NXGETINFO(FILEID,NXRANK,NXDIMS,NXTYPE) .NE. NX_OK) STOP 199 203 WRITE(*,FMT='(4X,A,I2,A)') NAME(1:LEN_TRIM(NAME))//'(', -
tags/4.2.1/test/napi_test.c
r1896 r1896 66 66 int64_t grossezahl[4]; 67 67 const char* ch_test_data = "NeXus ><}&{'\\&\" Data"; 68 char path[512]; 68 69 69 70 grossezahl[0] = 12; … … 244 245 NXgetattrinfo(fileid,&i); 245 246 printf("Number of group attributes: %d\n", i); 247 if(NXgetpath(fileid,path,512) != NX_OK)return 1; 248 printf("NXentry path %s\n", path); 246 249 do { 247 250 attr_status = NXgetnextattr (fileid, name, NXdims, &NXtype); … … 270 273 if (entry_status == NX_OK) { 271 274 if (NXopendata (fileid, name) != NX_OK) return 1; 272 if (NXgetinfo (fileid, &NXrank, NXdims, &NXtype) != NX_OK) return 1; 275 if(NXgetpath(fileid,path,512) != NX_OK)return 1; 276 printf("Data path %s\n", path); 277 if (NXgetinfo (fileid, &NXrank, NXdims, &NXtype) != NX_OK) return 1; 273 278 printf (" %s(%d)", name, NXtype); 274 279 if (NXmalloc ((void **) &data_buffer, NXrank, NXdims, NXtype) != NX_OK) return 1; … … 365 370 if (NXopengroup (fileid, "link", "NXentry") != NX_OK) return 1; 366 371 if (NXopengroup (fileid, "sample", "NXsample") != NX_OK) return 1; 372 if(NXgetpath(fileid,path,512) != NX_OK)return 1; 373 printf("Group path %s\n", path); 367 374 if (NXgetgroupID (fileid, &blink) != NX_OK) return 1; 368 375 if (NXsameID(fileid, &glink, &blink) != NX_OK) -
tags/4.2.1/test/napif_test.f
r1896 r1896 42 42 INTEGER*1 CHAR_BUFFER_B(128) 43 43 CHARACTER*64 GROUP_NAME, CLASS_NAME 44 CHARACTER*70 PATH 44 45 INTEGER FILEID(NXHANDLESIZE) 45 46 INTEGER GLINK(NXLINKSIZE), DLINK(NXLINKSIZE), BLINK(NXLINKSIZE) … … 196 197 ELSE IF (ENTRY_STATUS .EQ. NX_OK) THEN 197 198 IF (NXOPENDATA(FILEID,NAME) .NE. NX_OK) STOP 199 IF (NXGETPATH(FILEID,PATH) .NE. NX_OK)STOP 200 WRITE(*,FMT='(1X,A,A)') 'Path = ', PATH(1:LEN_TRIM(PATH)) 198 201 IF (NXGETINFO(FILEID,NXRANK,NXDIMS,NXTYPE) .NE. NX_OK) STOP 199 202 WRITE(*,FMT='(4X,A,I2,A)') NAME(1:LEN_TRIM(NAME))//'(', -
tags/4.2.1/test/atlocal.in
r1896 r1896 29 29 export HAVE_XML 30 30 # 31 if test ! -z "@F77@"; then31 if test "@WITH_F77@" = "yes"; then 32 32 HAVE_F77=run_test 33 33 else … … 36 36 export HAVE_F77 37 37 # 38 if test ! -z "@FC@"; then38 if test "@WITH_F90@" = "yes"; then 39 39 HAVE_F90=run_test 40 40 else -
tags/4.2.1/test/napi_test_cpp.cxx
r1896 r1896 4 4 #include <cstring> 5 5 #include <cstdlib> 6 #include <cstdio> 6 7 #include <vector> 7 8 #include "napiconfig.h" … … 274 275 cout << toString(result); 275 276 } 277 cout << endl; 278 cout << " Path = " << file.getPath() << endl; 279 file.closeData(); 276 280 } 277 281 else { 278 cout << ":" << it->second; 279 } 280 cout << endl; 282 cout << ":" << it->second << endl; 283 } 281 284 } 282 285 file.closeGroup(); -
tags/4.2.1/test/testsuite.at
r1896 r1896 31 31 [[NXinquirefile found: NXtest.hdf 32 32 Number of global attributes: 4 33 NeXus_version = 4.2. 033 NeXus_version = 4.2.1 34 34 file_name = NXtest.hdf 35 35 Number of group attributes: 2 36 NXentry path /entry 36 37 hugo = namenlos 37 38 cucumber = passion 38 39 Group: entry(NXentry) contains 9 items 40 Data path /entry/ch_data 39 41 ch_data(4) = NeXus ><}&{'\&" Data 42 Data path /entry/c1_data 40 43 c1_data(4) = abcdefghijklmnopqrst 44 Data path /entry/i1_data 41 45 i1_data(20) = 1 2 3 4 46 Data path /entry/i2_data 42 47 i2_data(22) = 1000 2000 3000 4000 48 Data path /entry/i4_data 43 49 i4_data(24) = 1000000 2000000 3000000 4000000 50 Data path /entry/r4_data 44 51 r4_data(5) 45 52 1.000000 2.000000 3.000000 4.000000 … … 48 55 13.000000 14.000000 15.000000 16.000000 49 56 17.000000 18.000000 19.000000 20.000000 57 Data path /entry/r8_data 50 58 r8_data(6) 51 59 1.000000 2.000000 3.000000 4.000000 … … 61 69 Subgroup: data(NXdata) 62 70 Subgroup: sample(NXsample) 71 Group path /link/sample 63 72 Link check OK 64 73 NXopenpath checks OK … … 77 86 [[NXinquirefile found: NXtest.h5 78 87 Number of global attributes: 4 79 NeXus_version = 4.2. 088 NeXus_version = 4.2.1 80 89 file_name = NXtest.h5 81 90 Number of group attributes: 2 91 NXentry path /entry 82 92 hugo = namenlos 83 93 cucumber = passion 84 94 Group: entry(NXentry) contains 10 items 95 Data path /entry/c1_data 85 96 c1_data(4) = abcdefghijklmnopqrst 97 Data path /entry/ch_data 86 98 ch_data(4) = NeXus ><}&{'\&" Data 87 99 Subgroup: data(NXdata) 100 Data path /entry/grosse_zahl 88 101 grosse_zahl(26) = 12 555555555555 23 777777777777 102 Data path /entry/i1_data 89 103 i1_data(20) = 1 2 3 4 104 Data path /entry/i2_data 90 105 i2_data(22) = 1000 2000 3000 4000 106 Data path /entry/i4_data 91 107 i4_data(24) = 1000000 2000000 3000000 4000000 108 Data path /entry/r4_data 92 109 r4_data(5) 93 110 1.000000 2.000000 3.000000 4.000000 … … 96 113 13.000000 14.000000 15.000000 16.000000 97 114 17.000000 18.000000 19.000000 20.000000 115 Data path /entry/r8_data 98 116 r8_data(6) 99 117 1.000000 2.000000 3.000000 4.000000 … … 108 126 target : /entry/r8_data 109 127 Subgroup: sample(NXsample) 128 Group path /link/sample 110 129 Link check OK 111 130 NXopenpath checks OK … … 124 143 [[NXinquirefile found: NXtest.hdf 125 144 Number of global attributes: 4 126 NeXus_version = 4.2. 0145 NeXus_version = 4.2.1 127 146 file_name = NXtest.hdf 128 147 Number of group attributes: 2 148 NXentry path /entry 129 149 hugo = namenlos 130 150 cucumber = passion 131 151 Group: entry(NXentry) contains 9 items 152 Data path /entry/ch_data 132 153 ch_data(4) = NeXus ><}&{'\&" Data 154 Data path /entry/c1_data 133 155 c1_data(4) = abcdefghijklmnopqrst 156 Data path /entry/i1_data 134 157 i1_data(20) = 1 2 3 4 158 Data path /entry/i2_data 135 159 i2_data(22) = 1000 2000 3000 4000 160 Data path /entry/i4_data 136 161 i4_data(24) = 1000000 2000000 3000000 4000000 162 Data path /entry/r4_data 137 163 r4_data(5) 138 164 1.000000 2.000000 3.000000 4.000000 … … 141 167 13.000000 14.000000 15.000000 16.000000 142 168 17.000000 18.000000 19.000000 20.000000 169 Data path /entry/r8_data 143 170 r8_data(6) 144 171 1.000000 2.000000 3.000000 4.000000 … … 154 181 Subgroup: data(NXdata) 155 182 Subgroup: sample(NXsample) 183 Group path /link/sample 156 184 Link check OK 157 185 NXopenpath checks OK … … 170 198 [[NXinquirefile found: NXtest.h5 171 199 Number of global attributes: 4 172 NeXus_version = 4.2. 0200 NeXus_version = 4.2.1 173 201 file_name = NXtest.h5 174 202 Number of group attributes: 2 203 NXentry path /entry 175 204 hugo = namenlos 176 205 cucumber = passion 177 206 Group: entry(NXentry) contains 10 items 207 Data path /entry/c1_data 178 208 c1_data(4) = abcdefghijklmnopqrst 209 Data path /entry/ch_data 179 210 ch_data(4) = NeXus ><}&{'\&" Data 180 211 Subgroup: data(NXdata) 212 Data path /entry/grosse_zahl 181 213 grosse_zahl(26) = 12 555555555555 23 777777777777 214 Data path /entry/i1_data 182 215 i1_data(20) = 1 2 3 4 216 Data path /entry/i2_data 183 217 i2_data(22) = 1000 2000 3000 4000 218 Data path /entry/i4_data 184 219 i4_data(24) = 1000000 2000000 3000000 4000000 220 Data path /entry/r4_data 185 221 r4_data(5) 186 222 1.000000 2.000000 3.000000 4.000000 … … 189 225 13.000000 14.000000 15.000000 16.000000 190 226 17.000000 18.000000 19.000000 20.000000 227 Data path /entry/r8_data 191 228 r8_data(6) 192 229 1.000000 2.000000 3.000000 4.000000 … … 201 238 target : /entry/r8_data 202 239 Subgroup: sample(NXsample) 240 Group path /link/sample 203 241 Link check OK 204 242 NXopenpath checks OK … … 217 255 [[NXinquirefile found: NXtest.xml 218 256 Number of global attributes: 7 219 NeXus_version = 4.2. 0257 NeXus_version = 4.2.1 220 258 file_name = NXtest.xml 221 xmlns = http://definition.nexusformat.org/schema/3. 0259 xmlns = http://definition.nexusformat.org/schema/3.1 222 260 xmlns:xsi = http://www.w3.org/2001/XMLSchema-instance 223 xsi:schemaLocation = http://definition.nexusformat.org/schema/3. 0 http://definition.nexusformat.org/schema/3.0/BASE.xsd261 xsi:schemaLocation = http://definition.nexusformat.org/schema/3.1 http://definition.nexusformat.org/schema/3.1/BASE.xsd 224 262 Number of group attributes: 2 263 NXentry path /entry 225 264 hugo = namenlos 226 265 cucumber = passion 227 266 Group: entry(NXentry) contains 10 items 267 Data path /entry/ch_data 228 268 ch_data(4) = NeXus ><}&{'\&" Data 269 Data path /entry/c1_data 229 270 c1_data(4) = abcdefghijklmnopqrst 271 Data path /entry/i1_data 230 272 i1_data(20) = 1 2 3 4 273 Data path /entry/i2_data 231 274 i2_data(22) = 1000 2000 3000 4000 275 Data path /entry/i4_data 232 276 i4_data(24) = 1000000 2000000 3000000 4000000 277 Data path /entry/r4_data 233 278 r4_data(5) 234 279 1.000000 2.000000 3.000000 4.000000 … … 237 282 13.000000 14.000000 15.000000 16.000000 238 283 17.000000 18.000000 19.000000 20.000000 284 Data path /entry/r8_data 239 285 r8_data(6) 240 286 1.000000 2.000000 3.000000 4.000000 … … 248 294 r4_attribute : 3.141593 249 295 target : /entry/r8_data 296 Data path /entry/grosse_zahl 250 297 grosse_zahl(26) = 12 555555555555 23 777777777777 251 298 Subgroup: data(NXdata) 252 299 Subgroup: sample(NXsample) 300 Group path /link/sample 253 301 Link check OK 254 302 NXopenpath checks OK … … 267 315 [[NXinquirefile found: NXtest.xml 268 316 Number of global attributes: 7 269 NeXus_version = 4.2. 0317 NeXus_version = 4.2.1 270 318 file_name = NXtest.xml 271 xmlns = http://definition.nexusformat.org/schema/3. 0319 xmlns = http://definition.nexusformat.org/schema/3.1 272 320 xmlns:xsi = http://www.w3.org/2001/XMLSchema-instance 273 xsi:schemaLocation = http://definition.nexusformat.org/schema/3. 0 http://definition.nexusformat.org/schema/3.0/BASE.xsd321 xsi:schemaLocation = http://definition.nexusformat.org/schema/3.1 http://definition.nexusformat.org/schema/3.1/BASE.xsd 274 322 Number of group attributes: 2 323 NXentry path /entry 275 324 hugo = namenlos 276 325 cucumber = passion 277 326 Group: entry(NXentry) contains 10 items 327 Data path /entry/ch_data 278 328 ch_data(4) = NeXus ><}&{'\&" Data 329 Data path /entry/c1_data 279 330 c1_data(4) = abcdefghijklmnopqrst 331 Data path /entry/i1_data 280 332 i1_data(20) = 1 2 3 4 333 Data path /entry/i2_data 281 334 i2_data(22) = 1000 2000 3000 4000 335 Data path /entry/i4_data 282 336 i4_data(24) = 1000000 2000000 3000000 4000000 337 Data path /entry/r4_data 283 338 r4_data(5) 284 339 1.000000 2.000000 3.000000 4.000000 … … 287 342 13.000000 14.000000 15.000000 16.000000 288 343 17.000000 18.000000 19.000000 20.000000 344 Data path /entry/r8_data 289 345 r8_data(6) 290 346 1.000000 2.000000 3.000000 4.000000 … … 298 354 r4_attribute : 3.141593 299 355 target : /entry/r8_data 356 Data path /entry/grosse_zahl 300 357 grosse_zahl(26) = 12 555555555555 23 777777777777 301 358 Subgroup: data(NXdata) 302 359 Subgroup: sample(NXsample) 360 Group path /link/sample 303 361 Link check OK 304 362 NXopenpath checks OK … … 317 375 [[NXinquirefile found: NXtest-table.xml 318 376 Number of global attributes: 7 319 NeXus_version = 4.2. 0377 NeXus_version = 4.2.1 320 378 file_name = NXtest-table.xml 321 xmlns = http://definition.nexusformat.org/schema/3. 0379 xmlns = http://definition.nexusformat.org/schema/3.1 322 380 xmlns:xsi = http://www.w3.org/2001/XMLSchema-instance 323 xsi:schemaLocation = http://definition.nexusformat.org/schema/3. 0 http://definition.nexusformat.org/schema/3.0/BASE.xsd381 xsi:schemaLocation = http://definition.nexusformat.org/schema/3.1 http://definition.nexusformat.org/schema/3.1/BASE.xsd 324 382 Number of group attributes: 2 383 NXentry path /entry 325 384 hugo = namenlos 326 385 cucumber = passion 327 386 Group: entry(NXentry) contains 10 items 387 Data path /entry/ch_data 328 388 ch_data(4) = NeXus ><}&{'\&" Data 389 Data path /entry/c1_data 329 390 c1_data(4) = abcdefghijklmnopqrst 391 Data path /entry/i1_data 330 392 i1_data(20) = 1 2 3 4 393 Data path /entry/i2_data 331 394 i2_data(22) = 1000 2000 3000 4000 395 Data path /entry/i4_data 332 396 i4_data(24) = 1000000 2000000 3000000 4000000 397 Data path /entry/grosse_zahl 333 398 grosse_zahl(26) = 12 555555555555 23 777777777777 399 Data path /entry/r4_data 334 400 r4_data(5) 335 401 1.000000 2.000000 3.000000 4.000000 … … 338 404 13.000000 14.000000 15.000000 16.000000 339 405 17.000000 18.000000 19.000000 20.000000 406 Data path /entry/r8_data 340 407 r8_data(6) 341 408 1.000000 2.000000 3.000000 4.000000 … … 351 418 Subgroup: data(NXdata) 352 419 Subgroup: sample(NXsample) 420 Group path /link/sample 353 421 Link check OK 354 422 NXopenpath checks OK … … 368 436 AT_CHECK([ $HAVE_F77 && $HAVE_HDF4 && $SETUP_TEST && napif_test-hdf4 | sed -e 's/\r$//' ], [], 369 437 [[ Number of global attributes: 4 370 NeXus_version = 4.2. 0438 NeXus_version = 4.2.1 371 439 file_name = NXtest.nxs 372 440 Group: entry(NXentry) contains 8 items 441 Path = /entry/ch_data 373 442 ch_data( 4) 374 443 Values : NeXus data 444 Path = /entry/i1_data 375 445 i1_data(20) 376 446 Values : 1 2 3 4 447 Path = /entry/i2_data 377 448 i2_data(22) 378 449 Values : 1000 2000 3000 4000 450 Path = /entry/i4_data 379 451 i4_data(24) 380 452 Values : 1000000 2000000 3000000 4000000 453 Path = /entry/r4_data 381 454 r4_data( 5) 382 455 Values : 1.00 2.00 3.00 4.00 … … 385 458 : 13.00 14.00 15.00 16.00 386 459 : 17.00 18.00 19.00 20.00 460 Path = /entry/r8_data 387 461 r8_data( 6) 388 462 Values : 1.00 2.00 3.00 4.00 … … 404 478 AT_CHECK([ $HAVE_F77 && $HAVE_HDF5 && $SETUP_TEST && napif_test-hdf5 | sed -e 's/\r$//' ], [], 405 479 [[ Number of global attributes: 4 406 NeXus_version = 4.2. 0480 NeXus_version = 4.2.1 407 481 file_name = NXtest.nxs 408 482 Group: entry(NXentry) contains 8 items 483 Path = /entry/ch_data 409 484 ch_data( 4) 410 485 Values : NeXus data 411 486 Subgroup: data(NXdata) 487 Path = /entry/i1_data 412 488 i1_data(20) 413 489 Values : 1 2 3 4 490 Path = /entry/i2_data 414 491 i2_data(22) 415 492 Values : 1000 2000 3000 4000 493 Path = /entry/i4_data 416 494 i4_data(24) 417 495 Values : 1000000 2000000 3000000 4000000 496 Path = /entry/r4_data 418 497 r4_data( 5) 419 498 Values : 1.00 2.00 3.00 4.00 … … 422 501 : 13.00 14.00 15.00 16.00 423 502 : 17.00 18.00 19.00 20.00 503 Path = /entry/r8_data 424 504 r8_data( 6) 425 505 Values : 1.00 2.00 3.00 4.00 … … 441 521 [[Writing character data 442 522 Number of global attributes: 4 443 NeXus_version = 4.2. 0523 NeXus_version = 4.2.1 444 524 file_name = NXtest.nxs 445 525 Group: entry(NXentry) contains 8 items … … 479 559 [[NXinquirefile found: napi_test_cpp.hdf 480 560 Number of global attributes: 4 481 NeXus_version = 4.2. 0561 NeXus_version = 4.2.1 482 562 file_name = napi_test_cpp.hdf 483 563 Number of group attributes: 2 … … 486 566 Group contains 9 items 487 567 c1_data[5,4] = 2d character array 568 Path = /entry/c1_data 488 569 ch_data[10] = NeXus_data 570 Path = /entry/ch_data 489 571 data:NXdata 490 572 i1_data[4] = [,,,] 573 Path = /entry/i1_data 491 574 i2_data[4] = [1000,2000,3000,4000] 575 Path = /entry/i2_data 492 576 i4_data[4] = [1000000,2000000,3000000,4000000] 577 Path = /entry/i4_data 493 578 r4_data[5,4] = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] 579 Path = /entry/r4_data 494 580 r8_data[5,4] = [20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39] 581 Path = /entry/r8_data 495 582 sample:NXsample 496 583 Link check OK … … 508 595 [[NXinquirefile found: napi_test_cpp.h5 509 596 Number of global attributes: 4 510 NeXus_version = 4.2. 0597 NeXus_version = 4.2.1 511 598 file_name = napi_test_cpp.h5 512 599 Number of group attributes: 2 … … 515 602 Group contains 10 items 516 603 c1_data[5,4] = 2d character array 604 Path = /entry/c1_data 517 605 ch_data[10] = NeXus_data 606 Path = /entry/ch_data 518 607 data:NXdata 519 608 grosszahl[4] = [12,555555555555,23,777777777777] 609 Path = /entry/grosszahl 520 610 i1_data[4] = [,,,] 611 Path = /entry/i1_data 521 612 i2_data[4] = [1000,2000,3000,4000] 613 Path = /entry/i2_data 522 614 i4_data[4] = [1000000,2000000,3000000,4000000] 615 Path = /entry/i4_data 523 616 r4_data[5,4] = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] 617 Path = /entry/r4_data 524 618 r8_data[5,4] = [20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39] 619 Path = /entry/r8_data 525 620 sample:NXsample 526 621 Link check OK … … 538 633 [[NXinquirefile found: napi_test_cpp.xml 539 634 Number of global attributes: 7 540 NeXus_version = 4.2. 0635 NeXus_version = 4.2.1 541 636 file_name = napi_test_cpp.xml 542 xmlns = http://definition.nexusformat.org/schema/3. 0637 xmlns = http://definition.nexusformat.org/schema/3.1 543 638 xmlns:xsi = http://www.w3.org/2001/XMLSchema-instance 544 xsi:schemaLocation = http://definition.nexusformat.org/schema/3. 0 http://definition.nexusformat.org/schema/3.0/BASE.xsd639 xsi:schemaLocation = http://definition.nexusformat.org/schema/3.1 http://definition.nexusformat.org/schema/3.1/BASE.xsd 545 640 Number of group attributes: 2 546 641 hugo = namenlos … … 548 643 Group contains 10 items 549 644 c1_data[5,4] = 2d character array 645 Path = /entry/c1_data 550 646 ch_data[10] = NeXus_data 647 Path = /entry/ch_data 551 648 data:NXdata 552 649 grosszahl[4] = [12,555555555555,23,777777777777] 650 Path = /entry/grosszahl 553 651 i1_data[4] = [,,,] 652 Path = /entry/i1_data 554 653 i2_data[4] = [1000,2000,3000,4000] 654 Path = /entry/i2_data 555 655 i4_data[4] = [1000000,2000000,3000000,4000000] 656 Path = /entry/i4_data 556 657 r4_data[5,4] = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] 658 Path = /entry/r4_data 557 659 r8_data[5,4] = [20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39] 660 Path = /entry/r8_data 558 661 sample:NXsample 559 662 Link check OK … … 713 816 714 817 attribute name: NeXus_version 715 attribute value: 4.2. 0818 attribute value: 4.2.1 716 819 717 820 NXgetnextattr status: 1 … … 1130 1233 1131 1234 attribute name: NeXus_version 1132 attribute value: 4.2. 01235 attribute value: 4.2.1 1133 1236 1134 1237 NXgetnextattr status: 1 … … 1547 1650 1548 1651 attribute name: NeXus_version 1549 attribute value: 4.2. 01652 attribute value: 4.2.1 1550 1653 1551 1654 NXgetnextattr status: 1 … … 1562 1665 1563 1666 attribute name: xmlns 1564 attribute value: http://definition.nexusformat.org/schema/3. 01667 attribute value: http://definition.nexusformat.org/schema/3.1 1565 1668 1566 1669 NXgetnextattr status: 1 … … 1572 1675 1573 1676 attribute name: xsi:schemaLocation 1574 attribute value: http://definition.nexusformat.org/schema/3. 0http://definition.nexusformat.org/schema/3.0/BASE.xsd1677 attribute value: http://definition.nexusformat.org/schema/3.1 http://definition.nexusformat.org/schema/3.0/BASE.xsd 1575 1678 1576 1679 NXgetnextattr status: 1 … … 1925 2028 AT_BANNER([[Testing NXbrowse Tool.]]) 1926 2029 AT_SETUP([Checking HDF4 test file]) 1927 AT_CHECK([$HAVE_HDF4 && nxbrowse NXtest.hdf < ${abs_srcdir}/nxbrowse.txt | grep -v 'HDF_version = ' | grep -v 'file_time = ' | sed -e 's/\r$//' | sed -e 's/[ ]*$//' ],[],1928 [[NXBrowse 4.2. 0 Copyright (C) 2000 R. Osborn, M. Koennecke, P. Klosowski1929 NeXus_version = 4.2. 02030 AT_CHECK([$HAVE_HDF4 && env NO_READLINE=1 nxbrowse NXtest.hdf < ${abs_srcdir}/nxbrowse.txt | grep -v 'HDF_version = ' | grep -v 'file_time = ' | sed -e 's/\r$//' | sed -e 's/[ ]*$//' ],[], 2031 [[NXBrowse 4.2.1 Copyright (C) 2009 NeXus Data Format 2032 NeXus_version = 4.2.1 1930 2033 file_name = NXtest.hdf 1931 2034 NX> NX Group : entry (NXentry) … … 1937 2040 AT_CLEANUP 1938 2041 AT_SETUP([Checking HDF5 test file]) 1939 AT_CHECK([$HAVE_HDF5 && nxbrowse NXtest.h5 < ${abs_srcdir}/nxbrowse.txt | grep -v 'HDF5_Version = ' | grep -v 'file_time = ' | sed -e 's/\r$//' | sed -e 's/[ ]*$//' ],[],1940 [[NXBrowse 4.2. 0 Copyright (C) 2000 R. Osborn, M. Koennecke, P. Klosowski1941 NeXus_version = 4.2. 02042 AT_CHECK([$HAVE_HDF5 && env NO_READLINE=1 nxbrowse NXtest.h5 < ${abs_srcdir}/nxbrowse.txt | grep -v 'HDF5_Version = ' | grep -v 'file_time = ' | sed -e 's/\r$//' | sed -e 's/[ ]*$//' ],[], 2043 [[NXBrowse 4.2.1 Copyright (C) 2009 NeXus Data Format 2044 NeXus_version = 4.2.1 1942 2045 file_name = NXtest.h5 1943 2046 NX> NX Group : entry (NXentry) … … 1949 2052 AT_CLEANUP 1950 2053 AT_SETUP([Checking XML test file]) 1951 AT_CHECK([$HAVE_XML && nxbrowse NXtest.xml < ${abs_srcdir}/nxbrowse.txt | grep -v 'file_time = ' | grep -v 'XML_version = ' | sed -e 's/\r$//' | sed -e 's/[ ]*$//' ],[],1952 [[NXBrowse 4.2. 0 Copyright (C) 2000 R. Osborn, M. Koennecke, P. Klosowski1953 NeXus_version = 4.2. 02054 AT_CHECK([$HAVE_XML && env NO_READLINE=1 nxbrowse NXtest.xml < ${abs_srcdir}/nxbrowse.txt | grep -v 'file_time = ' | grep -v 'XML_version = ' | sed -e 's/\r$//' | sed -e 's/[ ]*$//' ],[], 2055 [[NXBrowse 4.2.1 Copyright (C) 2009 NeXus Data Format 2056 NeXus_version = 4.2.1 1954 2057 file_name = NXtest.xml 1955 xmlns = http://definition.nexusformat.org/schema/3. 02058 xmlns = http://definition.nexusformat.org/schema/3.1 1956 2059 xmlns:xsi = http://www.w3.org/2001/XMLSchema-instance 1957 xsi:schemaLocation = http://definition.nexusformat.org/schema/3. 0 http://definition.nexusformat.org/schema/3.0/BASE.xsd2060 xsi:schemaLocation = http://definition.nexusformat.org/schema/3.1 http://definition.nexusformat.org/schema/3.1/BASE.xsd 1958 2061 NX> NX Group : entry (NXentry) 1959 2062 entry attribute: hugo = namenlos … … 1983 2086 ]]) 1984 2087 AT_CLEANUP 1985 1986 1987 AT_BANNER([[Testing validating files with the nxvalidate tool.]])1988 AT_SETUP([Checking HDF4 test file via web (wget)])1989 AT_CHECK([$HAVE_HDF4 && $HAVE_WGET && $SETUP_TEST && napi_test-hdf4 -q && nxvalidate -q -w NXtest.hdf | sed -e 's/\r$//' ],[],1990 [[]])1991 AT_CLEANUP1992 AT_SETUP([Checking HDF5 test file via web (wget)])1993 AT_CHECK([$HAVE_HDF4 && $HAVE_WGET && $SETUP_TEST && napi_test-hdf5 -q && nxvalidate -q -w NXtest.h5 | sed -e 's/\r$//' ],[],1994 [[]])1995 AT_CLEANUP1996 AT_SETUP([Checking XML test file via web (wget)])1997 AT_CHECK([$HAVE_HDF4 && $HAVE_WGET && $SETUP_TEST && napi_test-xml -q && nxvalidate -q -w NXtest.xml | sed -e 's/\r$//' ],[],1998 [[]])1999 AT_CLEANUP -
tags/4.2.1/test/leak_test2.cxx
r1896 r1896 1 1 #include <sstream> 2 2 #include <cstdlib> 3 #include <cstdio> 3 4 #include <napi.h> 4 5 #include <unistd.h> -
tags/4.2.1/nexus_spec.in
r1896 r1896 71 71 %{_datadir}/* 72 72 %{_includedir}/* 73 /usr/lib/python*/site-packages/nxs 73 74 #%files devel 74 75 #%{_libdir}/*.a -
tags/4.2.1/include
-
Property
svn:mergeinfo
set to
/trunk/include merged eligible
-
Property
svn:mergeinfo
set to
-
tags/4.2.1/include/Makefile.am
r1896 r1896 9 9 include_HEADERS = napi.h napiu.h 10 10 11 noinst_HEADERS = napi4.h napi5.h nxxml.h napiconfig.h 11 noinst_HEADERS = napi4.h napi5.h nxxml.h napiconfig.h nxconfig_vms.h -
tags/4.2.1/include/napi.h
r1896 r1896 50 50 51 51 /* NeXus HDF45 */ 52 #define NEXUS_VERSION "4.2. 0" /* major.minor.patch */52 #define NEXUS_VERSION "4.2.1" /* major.minor.patch */ 53 53 54 54 #define CONSTCHAR const char … … 180 180 # define NXopengroup MANGLE(nxiopengroup) 181 181 # define NXopenpath MANGLE(nxiopenpath) 182 # define NXgetpath MANGLE(nxigetpath) 182 183 # define NXopengrouppath MANGLE(nxiopengrouppath) 183 184 # define NXclosegroup MANGLE(nxiclosegroup) … … 217 218 # define NXisexternalgroup MANGLE(nxiisexternalgroup) 218 219 # define NXlinkexternal MANGLE(nxilinkexternal) 220 # define NXgetversion MANGLE(nxigetversion) 219 221 220 222 /* … … 228 230 # define NXfcompress MANGLE(nxifcompress) 229 231 # define NXfputattr MANGLE(nxifputattr) 230 232 # define NXfgetpath MANGLE(nxifgetpath) 231 233 232 234 /* … … 324 326 */ 325 327 extern NXstatus NXopengrouppath (NXhandle handle, CONSTCHAR *path); 328 /** 329 * Retrieve the current path in the NeXus file 330 * \param handle a NeXus file handle 331 * \param path A buffer to copy the path too 332 * \parm pathlen The maximum number of characters to copy into path 333 * \return NX_OK or NX_ERROR 334 */ 335 extern NXstatus NXgetpath(NXhandle handle, char *path, int pathlen); 326 336 327 337 /** … … 674 684 675 685 /** 686 * Utility function to return NeXus version 687 * \return pointer to string in static storage. Version in 688 * same format as NEXUS_VERSION string in napi.h i.e. "major.minor.patch" 689 * \ingroup c_metadata 690 */ 691 extern const char* NXgetversion(); 692 693 /** 676 694 * Utility function to release the memory for data. 677 695 * \param data A pointer to a pointer to free. … … 710 728 711 729 /** 712 * Set an error function. 713 * \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 714 733 * the error display function. 715 734 * \param newErr The new error display function. … … 718 737 719 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 /** 720 749 * Retrieve the current error display function 721 * \return The current erro display function.750 * \return The current error display function. 722 751 */ 723 752 extern ErrFunc NXMGetError(); … … 734 763 735 764 736 extern void (*NXIReportError)(void *pData,char *text);765 extern void NXIReportError(void *pData,char *text); 737 766 extern void *NXpData; 738 767 extern char *NXIformatNeXusTime(); … … 784 813 785 814 extern NXstatus NXfopen(char * filename, NXaccess* am, 786 N exusFunction*pHandle);787 extern NXstatus NXfclose (N exusFunction*pHandle);815 NXhandle pHandle); 816 extern NXstatus NXfclose (NXhandle pHandle); 788 817 extern NXstatus NXfputattr(NXhandle fid, char *name, void *data, 789 818 int *pDatalen, int *pIType); … … 795 824 extern NXstatus NXfmakedata(NXhandle fid, char *name, int *pDatatype, 796 825 int *pRank, int dimensions[]); 797 extern NXstatus NXfflush(N exusFunction*pHandle);798 826 extern NXstatus NXfflush(NXhandle pHandle); 827 extern NXstatus NXfgetpath(NXhandle fid, char *path, int *pathlen); 799 828 #ifdef __cplusplus 800 829 } 801 830 #endif /* __cplusplus */ 802 831 832 /** 833 * Freddie Akeroyd 11/8/2009 834 * Add NeXus schema support - this uses BASE.xsd as the initial file 835 */ 836 #define NEXUS_SCHEMA_VERSION "3.1" /**< version of NeXus definition schema */ 837 #define NEXUS_SCHEMA_ROOT "http://definition.nexusformat.org/schema/" /**< XML schema namespace specified by xmlns */ 838 #define NEXUS_SCHEMA_NAMESPACE NEXUS_SCHEMA_ROOT NEXUS_SCHEMA_VERSION /**< XML schema namespace specified by xmlns */ 839 #define NEXUS_SCHEMA_BASE "BASE" 840 #define NEXUS_SCHEMA_FILE NEXUS_SCHEMA_BASE ".xsd" /**< default schema file for namespace */ 841 #define NEXUS_SCHEMA_URL NEXUS_SCHEMA_NAMESPACE "/" NEXUS_SCHEMA_FILE /**< location of default schema file for namespace */ 842 803 843 #endif /*NEXUSAPI*/ 804 -
tags/4.2.1/include/napiconfig.h
r1896 r1896 6 6 #endif /* _WIN32 */ 7 7 8 #ifdef __VMS 9 #include <nxconfig_vms.h> 10 #else 8 11 #include <nxconfig.h> 12 #endif /* __VMS */ 13 9 14 10 15 /* … … 16 21 #if HAVE_STDINT_H 17 22 #include <stdint.h> 23 #elif HAVE_INTTYPES_H 24 #include <inttypes.h> 18 25 #endif /* HAVE_STDINT_H */ 19 26
Note: See TracChangeset
for help on using the changeset viewer.
