Changes from tags/4.1.0 at r1896 to tags/4.2.0 at r1896


Ignore:
Location:
tags
Files:
92 added
8 deleted
76 edited

Legend:

Unmodified
Added
Removed
  • tags/4.2.0/applications/NXdir/main.cpp

    r1896 r1896  
    2828#include <string> 
    2929#include <vector> 
    30 #include <stdlib.h> 
     30#include <cstdlib> 
    3131#include <fstream> 
    32 #include <stdio.h> 
     32#include <cstdio> 
     33#include <cstring> 
    3334 
    3435// -------------------- begin TIMING TEST stuff 
  • tags/4.2.0/applications/NXdir/Makefile.am

    r1896 r1896  
    3636                nxdir.h nxdir_help.h 
    3737nxdir_LDADD = $(LIBNEXUS) 
    38 nxdir_LDFLAGS = -static $(LDFLAGS) 
     38nxdir_LDFLAGS = -static @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 
    3939EXTRA_DIST = CHANGES LICENSE README TODO 
    4040 
  • tags/4.2.0/applications/NXdir/data.cpp

    r1896 r1896  
    2626#include <iostream> 
    2727#include "nxdir.h" 
     28#include <cstring> 
    2829#include <string> 
    2930#include <map> 
  • tags/4.2.0/applications/NXbrowse.c

    r1896 r1896  
    224224{ 
    225225   int status, dataType, dataRank, dataDimensions[NX_MAXRANK], length; 
    226    NXname name, class, nxurl; 
     226   NXname name, nxclass, nxurl; 
    227227 
    228228   if (NXinitgroupdir (fileId) != NX_OK) return NX_ERROR; 
    229229   do { 
    230       status = NXgetnextentry (fileId, name, class, &dataType); 
     230      status = NXgetnextentry (fileId, name, nxclass, &dataType); 
    231231      if (status == NX_ERROR) break; 
    232232      if (status == NX_OK) { 
    233         if (strncmp(class,"CDF",3) == 0){  
     233        if (strncmp(nxclass,"CDF",3) == 0){  
    234234            ; 
    235235        } 
    236         else if (strcmp(class,"SDS") == 0){  
     236        else if (strcmp(nxclass,"SDS") == 0){  
    237237            printf ("  NX Data  : %s", name); 
    238238            if (NXopendata (fileId, name) != NX_OK) return NX_ERROR; 
     
    245245        } else { 
    246246            length = sizeof(nxurl); 
    247             if(NXisexternalgroup(fileId, name,class,nxurl,length) == NX_OK){ 
    248               printf ("  NX external Group: %s (%s), linked to: %s \n",name,class,nxurl);  
     247            if(NXisexternalgroup(fileId, name,nxclass,nxurl,length) == NX_OK){ 
     248              printf ("  NX external Group: %s (%s), linked to: %s \n",name,nxclass,nxurl);  
    249249            } else { 
    250               printf ("  NX Group : %s (%s)\n", name, class); 
    251               if((status = NXopengroup(fileId,name,class)) != NX_OK){ 
     250              printf ("  NX Group : %s (%s)\n", name, nxclass); 
     251              if((status = NXopengroup(fileId,name,nxclass)) != NX_OK){ 
    252252                return status; 
    253253              }  
     
    354354         for(i=0; i<total_size / dataDimensions[dataRank-1]; i++) 
    355355         { 
    356              PrintData (dataBuffer + i * dataDimensions[dataRank-1], dataType, dataDimensions[dataRank-1]); 
     356             PrintData ((char*)dataBuffer + i * dataDimensions[dataRank-1], dataType, dataDimensions[dataRank-1]); 
    357357             PrintData ("\n", NX_CHAR, 1); 
    358358         } 
     
    636636void PrintData (void *data, int dataType, int numElements) 
    637637{ 
    638    WriteData (stdout, data, dataType, numElements); 
     638   WriteData (stdout, (char*)data, dataType, numElements); 
    639639} 
    640640/* Searches group for requested group and return its class */ 
     
    642642{ 
    643643   int status, dataType; 
    644    NXname name, class; 
     644   NXname name, nxclass; 
    645645 
    646646   NXinitgroupdir (fileId); 
    647647   do { 
    648       status = NXgetnextentry (fileId, name, class, &dataType); 
     648      status = NXgetnextentry (fileId, name, nxclass, &dataType); 
    649649      if (status == NX_ERROR) return NX_ERROR; 
    650650      if (status == NX_OK) { 
    651651          if (StrEq (groupName, name)) { 
    652             strcpy (groupClass, class); 
     652            strcpy (groupClass, nxclass); 
    653653            if (!strncmp(groupClass,"NX",2)) { 
    654654               return NX_OK; 
     
    672672{ 
    673673   int status, dataType; 
    674    NXname name, class; 
     674   NXname name, nxclass; 
    675675 
    676676   NXinitgroupdir (fileId); 
    677677   do { 
    678       status = NXgetnextentry (fileId, name, class, &dataType); 
     678      status = NXgetnextentry (fileId, name, nxclass, &dataType); 
    679679      if (status == NX_ERROR) return NX_ERROR; 
    680680      if (status == NX_OK) { 
    681681         if (StrEq(dataName,name)) { 
    682             if (!strncmp(class,"SDS",3)) { /* Data has class "SDS" */ 
     682            if (!strncmp(nxclass,"SDS",3)) { /* Data has class "SDS" */ 
    683683               return NX_OK; 
    684684            } 
  • tags/4.2.0/applications/NXtranslate/binary/BinaryRetriever.cpp

    r1896 r1896  
    33#include <stdexcept> 
    44#include <vector> 
     5#include <cstdlib> 
     6#include <cstring> 
    57#include "napiconfig.h" 
    68#include "binary/BinaryRetriever.hpp" 
     
    1416using std::endl; 
    1517 
    16 static const string INT8("INT8"); 
    17 static const string INT16("INT16"); 
    18 static const string INT32("INT32"); 
    19 static const string UINT8("UINT8"); 
    20 static const string UINT16("UINT16"); 
    21 static const string UINT32("UINT32"); 
    22 static const string FLOAT32("FLOAT32"); 
    23 static const string FLOAT64("FLOAT64"); 
    24 static const string BYTE("BYTE"); 
    25  
    26 static const int DEFAULT_TYPE=NX_UINT32; 
     18static const string myINT8("INT8"); 
     19static const string myINT16("INT16"); 
     20static const string myINT32("INT32"); 
     21static const string myUINT8("UINT8"); 
     22static const string myUINT16("UINT16"); 
     23static const string myUINT32("UINT32"); 
     24static const string myFLOAT32("FLOAT32"); 
     25static const string myFLOAT64("FLOAT64"); 
     26static const string myBYTE("BYTE"); 
     27 
     28static const int NX_DEFAULT_TYPE=NX_UINT32; 
    2729 
    2830/** 
     
    9496static int getDataType(const string &str_type){ 
    9597  if(str_type.empty()){ 
    96     return DEFAULT_TYPE; 
    97   }else if(str_type==INT8){ 
     98    return NX_DEFAULT_TYPE; 
     99  }else if(str_type==myINT8){ 
    98100    return NX_INT8; 
    99   }else if(str_type==INT16){ 
     101  }else if(str_type==myINT16){ 
    100102    return NX_INT16; 
    101   }else if(str_type==INT32){ 
     103  }else if(str_type==myINT32){ 
    102104    return NX_INT32; 
    103   }else if(str_type==UINT8){ 
     105  }else if(str_type==myUINT8){ 
    104106    return NX_UINT8; 
    105   }else if(str_type==UINT16){ 
     107  }else if(str_type==myUINT16){ 
    106108    return NX_UINT16; 
    107   }else if(str_type==UINT32){ 
     109  }else if(str_type==myUINT32){ 
    108110    return NX_UINT32; 
    109   }else if(str_type==FLOAT32){ 
     111  }else if(str_type==myFLOAT32){ 
    110112    return NX_FLOAT32; 
    111   }else if(str_type==FLOAT64){ 
     113  }else if(str_type==myFLOAT64){ 
    112114    return NX_FLOAT64; 
    113   }else if(str_type==BYTE){ 
     115  }else if(str_type==myBYTE){ 
    114116    return NX_CHAR; 
    115117  }else{ 
  • tags/4.2.0/applications/NXtranslate/retriever.cpp

    r1896 r1896  
    11#include <stdexcept> 
     2#include <map> 
    23#include "retriever.h" 
    34#include "nexus_retriever.h" 
     
    3738#endif 
    3839 
     40using std::map; 
    3941using std::string; 
    4042using std::invalid_argument; 
    4143 
    42 // Implementation of a pure virtual destructor. This makes the compiler happy. 
    43 Retriever::~Retriever(){} 
     44typedef Ptr<Retriever> RetrieverPtr; 
    4445 
    45 // factory method 
    46 Retriever::RetrieverPtr Retriever::getInstance(const string & type, const string &source){ 
     46// hold a map of retrievers that have been instantiated so it can be cached 
     47map<string, RetrieverPtr> retrievers; 
     48 
     49RetrieverPtr getNewInstance(const string & type, 
     50                            const string & source) { 
    4751  // return appropriate retriever based on type 
    4852  if(type==NexusRetriever::MIME_TYPE){ 
     
    109113  throw invalid_argument("do not understand mime_type ("+type+") in retriever_factory"); 
    110114} 
     115 
     116// Implementation of a pure virtual destructor. This makes the compiler happy. 
     117Retriever::~Retriever(){} 
     118 
     119// factory method 
     120Retriever::RetrieverPtr Retriever::getInstance(const string & type, 
     121                                               const string &source){ 
     122  map<string, RetrieverPtr>::iterator existing = retrievers.find(source); 
     123  if (existing != retrievers.end()) { 
     124    return (existing->second); 
     125  } 
     126  else { 
     127    RetrieverPtr retriever = getNewInstance(type, source); 
     128    retrievers.insert(make_pair(source, retriever)); 
     129    return retriever; 
     130  } 
     131} 
  • tags/4.2.0/applications/NXtranslate/attr.cpp

    r1896 r1896  
    11#include <napi.h> 
    2 #include <stdlib.h> 
     2#include <cstdlib> 
     3#include <cstring> 
    34#include <stdexcept> 
    45#include <vector> 
  • tags/4.2.0/applications/NXtranslate/xml_parser.cpp

    r1896 r1896  
    33#include <iostream> 
    44#include <string> 
     5#include <cstring> 
     6#include <algorithm> 
    57#include <stdarg.h> 
    68#include <stdexcept> 
     
    1618#include "tree.hh" 
    1719#include "nxtranslate_debug.h" 
     20#ifdef USE_TIMING 
     21#include <sstream> 
     22#endif 
    1823 
    1924// ----- start of declaring debug levels 
     
    6267  int status;             // status of parsing 
    6368  bool is_link;           // whether the current node is a link 
    64   map<string,string> map; // store macros for replacement 
     69  std::map<string,string> map; // store macros for replacement 
    6570  vector<StrVector> loc_to_source; // mapping for links 
    6671  NodeVector nodes;       // vector to current node listing 
     
    7075  vector<RetrieverPtr> retrievers; // vector of retrievers (for nesting) 
    7176}UserData; 
     77 
     78#ifdef USE_TIMING 
     79static time_t start_time = time(NULL); 
     80static time_t intermediate_time = time(NULL); 
     81extern string print_time(const time_t & start, 
     82                         const  time_t & stop) { 
     83  double seconds = difftime(stop, start); 
     84  long minutes = static_cast<long>(seconds/60.); 
     85  seconds = seconds - 60. * static_cast<double>(minutes); 
     86  std::stringstream result; 
     87  result << minutes << "m" << seconds  << "s"; 
     88  return result.str(); 
     89} 
     90#endif 
    7291 
    7392// variable so the line and column numbers can be accessed 
     
    525544extern bool xml_parser::parse_xml_file(const std::map<string,string> &map, 
    526545                                       const string &filename, 
    527                                        NXhandle *handle){ 
     546                                       NXhandle *handle, 
     547                                       const bool timing){ 
    528548#ifdef DEBUG3_XML_PARSER 
    529549  std::cout << "xml_parser::parse_xml_file" << std::endl; 
     
    551571    return true; // return generic error 
    552572 
     573#ifdef USE_TIMING 
     574  if (timing) { 
     575    cout << print_time(intermediate_time) << " to add new information" << endl; 
     576    intermediate_time = time(NULL); 
     577  } 
     578#endif 
     579 
    553580  // work on links 
    554581  try{ 
     
    559586  } 
    560587   
     588#ifdef USE_TIMING 
     589  if (timing) { 
     590    cout << print_time(intermediate_time) << " to create links" << endl; 
     591    intermediate_time = time(NULL); 
     592  } 
     593#endif 
     594 
    561595  // return that everything went well 
    562596  return false; 
  • tags/4.2.0/applications/NXtranslate/node_util.cpp

    r1896 r1896  
    11#include <iostream> 
    22#include <string> 
     3#include <cstring> 
    34#include <stdexcept> 
    45#include <vector> 
  • tags/4.2.0/applications/NXtranslate/main.cpp

    r1896 r1896  
    44#include <map> 
    55#include <string> 
     6#include <cstring> 
    67#include "xml_parser.h" 
    78#include <napi.h> 
     
    2324  NXaccess base; 
    2425  bool append; 
     26  bool timing; 
    2527  std::map<string,string> map; 
    2628}Options; 
     
    100102  cout << "  -D <macro>   Specify a macro. The macro should be in the form of\n" 
    101103       << "               \"FILE=old_nexus.nxs\". The \"=\" is required." << endl; 
     104#ifdef USE_TIMING 
     105  cout << "  --timing     Print out timing information for the execution of the program." << endl; 
     106#endif 
    102107} 
    103108 
    104109int main(int argc, char *argv[]){ 
     110#ifdef USE_TIMING 
     111  time_t start_time = time(NULL); 
     112#endif 
    105113  Options options; 
    106114  options.base=NXACC_CREATE; 
    107115  options.append=false; 
     116  options.timing=false; 
    108117 
    109118  // parse the command line options (i=0 is the program name 
     
    152161      string key=split(arg1); 
    153162      options.map.insert(make_pair(key,arg1)); 
     163    }else if(starts_with(arg1, "--timing")) { 
     164      options.timing = true; 
    154165#ifdef HDF4 
    155166    }else if(starts_with(arg1,"--hdf4")){ 
     
    212223 
    213224  // parse the file 
    214   bool result=xml_parser::parse_xml_file(options.map,options.infile,&handle); 
     225  bool result=xml_parser::parse_xml_file(options.map,options.infile,&handle, 
     226                                         options.timing); 
    215227 
    216228  // close the output file 
     
    222234      std::perror("ERROR DELETING FILE"); 
    223235  } 
    224  
     236   
     237#ifdef USE_TIMING 
     238  if (options.timing) { 
     239    cout << print_time(start_time) << " total time" << endl; 
     240  } 
     241#endif 
    225242  return result; 
    226243} 
  • tags/4.2.0/applications/NXtranslate/node.cpp

    r1896 r1896  
    11#include <napi.h> 
    2 #include <stdlib.h> 
     2#include <cstdlib> 
     3#include <cstring> 
    34#include <stdexcept> 
    45#include <vector> 
  • tags/4.2.0/applications/NXtranslate/Makefile.am

    r1896 r1896  
    6666        esrf_edf/libEdf.la 
    6767 
    68 nxtranslate_LDFLAGS = -static $(LDFLAGS) 
     68nxtranslate_LDFLAGS = -static @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 
    6969 
    7070#EXTRA_DIST = CHANGES LICENSE README TODO 
  • tags/4.2.0/applications/NXtranslate/sns_histogram/string_location_format.cpp

    r1896 r1896  
    44#include <sstream> 
    55#include <iostream> 
     6#include <algorithm> 
    67 
    78using std::string; 
  • tags/4.2.0/applications/NXtranslate/nexus_util.cpp

    r1896 r1896  
    33#include <stdexcept> 
    44#include <string> 
     5#include <cstring> 
     6#include <cstdlib> 
    57#include <vector> 
    68#include "nexus_util.h" 
  • tags/4.2.0/applications/NXtranslate/spec/SPEClib.h

    r1896 r1896  
    2525#include <cstdio> 
    2626#include <cctype> 
     27#include <cstdlib> 
    2728#include <fstream> 
    2829#include <iomanip> 
  • tags/4.2.0/applications/NXtranslate/xml_parser.h

    r1896 r1896  
    66#include <map> 
    77 
     8#ifdef USE_TIMING 
     9#include <time.h> 
     10#include <string> 
     11extern std::string print_time(const time_t & start, 
     12                         const  time_t & stop = time(NULL)); 
     13#endif 
     14 
     15 
    816namespace xml_parser{ 
    917  extern bool parse_xml_file(const std::map<std::string,std::string>&map, 
    10                              const std::string &filename, NXhandle *handle); 
     18                             const std::string &filename, NXhandle *handle, 
     19                             const bool timing); 
    1120} 
    1221#endif 
  • tags/4.2.0/applications/NXtranslate/FRM2/frm2_retriever.cpp

    r1896 r1896  
    1313#include "../tree.hh" 
    1414#include <math.h> 
     15#include <cstring> 
     16#include <cstdlib> 
    1517 
    1618using std::ifstream; 
  • tags/4.2.0/applications/NXtranslate/nexus_retriever.cpp

    r1896 r1896  
    22#include <stdexcept> 
    33#include <string> 
     4#include <cstring> 
    45#include "nexus_retriever.h" 
    56#include "nexus_util.h" 
  • tags/4.2.0/applications/NXtranslate/IPNS_CPP/Header.cpp

    r1896 r1896  
     1#include <cstring> 
    12#include "Header.h" 
    23#include "RandomAccessRunfile.h" 
  • tags/4.2.0/applications/NXtranslate/IPNS_CPP/ipns_retriever.cpp

    r1896 r1896  
    11#include <stdexcept> 
    22#include <string> 
     3#include <cstring> 
     4#include <cstdlib> 
    35#include "ipns_retriever.h" 
    46#include "../node.h" 
  • tags/4.2.0/applications/NXtranslate/IPNS_CPP/TimeField.cpp

    r1896 r1896  
     1#include <cstring> 
    12#include "TimeField.h" 
    23#include "RandomAccessRunfile.h" 
  • tags/4.2.0/applications/NXtranslate/IPNS_CPP/Runfile.cpp

    r1896 r1896  
     1#include <string> 
     2#include <cstring> 
     3#include <stdexcept> 
     4#include <algorithm> 
    15#include "Runfile.h" 
    2 #include <string> 
    3 #include <stdexcept> 
    46//#include <algorithm.h> 
    57float PI = 3.14159; 
     
    963965  } 
    964966  sort(overflows.begin(), overflows.end()); 
    965  
    966967   
    967968} 
  • tags/4.2.0/applications/NXtranslate/IPNS_CPP/DetectorMap.cpp

    r1896 r1896  
     1#include <cstring> 
    12#include "DetectorMap.h" 
    23#include "RandomAccessRunfile.h" 
  • tags/4.2.0/applications/NXtranslate/esrf_edf/edf_reader.h

    r1896 r1896  
    2727#include <map> 
    2828#include <string> 
     29#include <cstring> 
     30#include <cstdlib> 
    2931 
    3032using namespace std;  
  • tags/4.2.0/applications/NXtranslate/text_collist/collist_retriever.cpp

    r1896 r1896  
    33#include <stdexcept> 
    44#include <string> 
     5#include <cstring> 
    56#include <vector> 
    67#include "collist_retriever.h" 
  • tags/4.2.0/applications/NXsummary/main.cpp

    r1896 r1896  
    2929#include <sstream> 
    3030#include <string> 
     31#include <cstring> 
    3132#include <vector> 
    3233#include "data_util.hpp" 
  • tags/4.2.0/applications/NXsummary/data_util.cpp

    r1896 r1896  
    22#include <sstream> 
    33#include <stdexcept> 
     4#include <cstring> 
    45#include "data_util.hpp" 
    56#include "nxsummary.hpp" 
  • tags/4.2.0/applications/NXsummary/Makefile.am

    r1896 r1896  
    3737nxsummary_SOURCES = data_util.cpp main.cpp string_util.cpp preferences.cpp output.cpp 
    3838nxsummary_LDADD = $(LIBNEXUS) 
    39 nxsummary_LDFLAGS = -static $(LDFLAGS) 
     39nxsummary_LDFLAGS = -static @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 
    4040EXTRA_DIST = LICENSE tclap/AUTHORS tclap/COPYING tclap/README 
    4141include $(top_srcdir)/build_rules.am 
  • tags/4.2.0/applications/nxconvert.c

    r1896 r1896  
    3030#include <unistd.h> 
    3131#include "napi.h" 
    32  
    33 static int WriteGroup (int write_data); 
    34 static int WriteAttributes (int write_data); 
    35  
    36 static NXhandle inId, outId; 
    37  
    38 #define NX_XML  0 
    39 #define NX_HDF4 1 
    40 #define NX_HDF5 2 
    41 #define NX_DTD  3 
     32#include "nxconvert_common.h" 
    4233 
    4334static void print_usage() 
    4435{ 
    45     printf("Usage: nxconvert [ -x | -h4 | -h5 | -o keepws ] [ infile ] [ outfile ]\n"); 
     36    printf("Usage: nxconvert [ -x | -h4 | -h5 | -d | -o keepws | -o table ] [ infile ] [ outfile ]\n"); 
    4637} 
    4738 
    4839#define NXCONVERT_EXIT_ERROR    exit(1) 
    4940 
    50 static const char* nx_formats[] = { "XML", "HDF4", "HDF5", "DTD", NULL }; 
     41static const char* definition_name = "BASE"; 
    5142 
    5243int main(int argc, char *argv[]) 
     
    5445   char inFile[256], outFile[256], *stringPtr; 
    5546   int opt, nx_format = -1, nx_write_access = 0; 
    56    int nx_write_data = 1; 
    5747   int nx_read_access = NXACC_READ; 
    5848 
     
    7363            break; 
    7464 
    75 /* 
    7665          case 'd': 
    77             nx_format = NX_DTD; 
     66            nx_format = NX_DEFINITION; 
    7867            nx_write_access |= NXACC_CREATEXML; 
    79             nx_write_data = 0;  
     68            if (optarg != NULL && *optarg != '\0') 
     69            { 
     70                definition_name = optarg; 
     71            } 
    8072            break; 
    81 */ 
    8273 
    8374          case 'h': 
     
    10596                nx_write_access |= NXACC_NOSTRIP; 
    10697                nx_read_access |= NXACC_NOSTRIP; 
     98            } 
     99            else if (!strcmp(optarg, "table")) 
     100            { 
     101                nx_write_access |= NXACC_TABLE; 
    107102            } 
    108103            else 
     
    149144   printf("Converting %s to %s NeXus file %s\n", inFile, nx_formats[nx_format], outFile); 
    150145 
    151 /* Open NeXus input file and NeXus output file */ 
    152    if (NXopen (inFile, nx_read_access, &inId) != NX_OK) { 
    153       printf ("NX_ERROR: Can't open %s\n", inFile); 
     146   if (convert_file(nx_format, inFile, nx_read_access, outFile, nx_write_access) != NX_OK) { 
    154147      NXCONVERT_EXIT_ERROR; 
    155    } 
    156  
    157    if (NXopen (outFile, nx_write_access, &outId) != NX_OK) { 
    158       printf ("NX_ERROR: Can't open %s\n", outFile); 
    159       NXCONVERT_EXIT_ERROR; 
    160    } 
    161     
    162 /* Output global attributes */ 
    163    if (WriteAttributes (nx_write_data) != NX_OK) 
    164    { 
    165         NXCONVERT_EXIT_ERROR; 
    166    } 
    167 /* Recursively cycle through the groups printing the contents */ 
    168    if (WriteGroup (nx_write_data) != NX_OK) 
    169    { 
    170         NXCONVERT_EXIT_ERROR; 
    171    } 
    172 /* Close the input and output files */ 
    173    if (NXclose (&outId) != NX_OK) 
    174    { 
    175         NXCONVERT_EXIT_ERROR; 
    176    } 
    177    if (NXclose (&inId) != NX_OK) 
    178    { 
    179         NXCONVERT_EXIT_ERROR; 
    180148   } 
    181149   printf("Convertion successful.\n"); 
     
    183151} 
    184152 
    185 /* Prints the contents of each group as XML tags and values */ 
    186 int WriteGroup (int write_data) 
    187 {  
    188    int status, dataType, dataRank, dataDimensions[NX_MAXRANK], dataLen;      
    189    NXname name, class; 
    190    void *dataBuffer; 
    191  
    192    do { 
    193       status = NXgetnextentry (inId, name, class, &dataType); 
    194       if (status == NX_ERROR) return NX_ERROR; 
    195       if (status == NX_OK) { 
    196          if (!strncmp(class,"NX",2)) { 
    197             if (NXopengroup (inId, name, class) != NX_OK) return NX_ERROR; 
    198             if (NXmakegroup (outId, name, class) != NX_OK) return NX_ERROR; 
    199             if (NXopengroup (outId, name, class) != NX_OK) return NX_ERROR; 
    200             if (WriteGroup (write_data) != NX_OK) return NX_ERROR; 
    201          } 
    202          else if (!strncmp(class,"SDS",3)) { 
    203             if (NXopendata (inId, name) != NX_OK) return NX_ERROR; 
    204             if (NXgetinfo (inId, &dataRank, dataDimensions, &dataType) != NX_OK) return NX_ERROR; 
    205             if (NXmakedata (outId, name, dataType, dataRank, dataDimensions) != NX_OK) return NX_ERROR; 
    206             if (NXopendata (outId, name) != NX_OK) return NX_ERROR; 
    207             if (WriteAttributes (write_data) != NX_OK) return NX_ERROR; 
    208             if (write_data == 1) 
    209             { 
    210                 if (NXmalloc (&dataBuffer, dataRank, dataDimensions, dataType) != NX_OK) return NX_ERROR; 
    211                 if (NXgetdata (inId, dataBuffer)  != NX_OK) return NX_ERROR; 
    212                 if (NXputdata (outId, dataBuffer) != NX_OK) return NX_ERROR; 
    213                 if (NXfree((void**)&dataBuffer) != NX_OK) return NX_ERROR; 
    214             } 
    215             if (NXclosedata (inId) != NX_OK) return NX_ERROR; 
    216             if (NXclosedata (outId) != NX_OK) return NX_ERROR; 
    217          } 
    218       } 
    219       else if (status == NX_EOD) { 
    220          if (NXclosegroup (inId) != NX_OK) return NX_ERROR; 
    221          if (NXclosegroup (outId) != NX_OK) return NX_ERROR; 
    222          return NX_OK; 
    223       } 
    224    } while (status == NX_OK); 
    225    return NX_OK; 
    226 } 
    227  
    228 int WriteAttributes (int write_data) 
    229 { 
    230    int status, i, attrLen, attrType; 
    231    NXname attrName; 
    232    void *attrBuffer; 
    233  
    234    i = 0; 
    235    do { 
    236       status = NXgetnextattr (inId, attrName, &attrLen, &attrType); 
    237       if (status == NX_ERROR) return NX_ERROR; 
    238       if (status == NX_OK) { 
    239          if (strcmp(attrName, "NeXus_version") && strcmp(attrName, "XML_version") && 
    240              strcmp(attrName, "HDF_version") && strcmp(attrName, "HDF5_Version") &&  
    241              strcmp(attrName, "file_name") && strcmp(attrName, "file_time")) { 
    242             attrLen++; /* Add space for string termination */ 
    243             if (NXmalloc((void**)&attrBuffer, 1, &attrLen, attrType) != NX_OK) return NX_ERROR; 
    244             if (NXgetattr (inId, attrName, attrBuffer, &attrLen , &attrType) != NX_OK) return NX_ERROR; 
    245             if (write_data == 1) 
    246             { 
    247                 if (NXputattr (outId, attrName, attrBuffer, attrLen , attrType) != NX_OK) return NX_ERROR; 
    248             } 
    249             else 
    250             { 
    251                 if (NXputattr (outId, attrName, attrBuffer, attrLen , attrType) != NX_OK) return NX_ERROR; 
    252             } 
    253             if (NXfree((void**)&attrBuffer) != NX_OK) return NX_ERROR; 
    254          } 
    255          i++; 
    256       } 
    257    } while (status != NX_EOD); 
    258    return NX_OK; 
    259 } 
    260  
  • tags/4.2.0/applications/Makefile.am

    r1896 r1896  
    3131LIBNEXUS90=$(top_builddir)/bindings/f90/libNeXus90.la 
    3232AM_CPPFLAGS=-I. -I$(top_srcdir)/include 
     33AM_FCFLAGS=-I$(top_builddir)/bindings/f90 
    3334 
     35EXTRA_DIST=SConscript 
     36 
     37if HAVE_XML 
     38NXINGEST = nxingest 
     39endif 
    3440if HAVE_LIBXML2 
    3541NXTRANSLATE=NXtranslate 
    3642NXSUMMARY=NXsummary 
    3743endif 
    38 SUBDIRS = NXdir $(NXTRANSLATE) $(NXSUMMARY) 
     44SUBDIRS = NXdir $(NXTRANSLATE) $(NXSUMMARY) $(NXINGEST) 
    3945#if HAVE_HDF4 
    4046#HDF4_TARGETS = NXtoNX4 
     
    4854endif 
    4955 
    50 bin_PROGRAMS = nxbrowse nx2dtd nxconvert $(F90_TARGETS) 
     56bin_PROGRAMS = nxbrowse nx2dtd nxconvert nxvalidate $(F90_TARGETS) 
    5157 
    52 nxconvert_SOURCES = nxconvert.c 
     58nxconvert_SOURCES = nxconvert.c nxconvert_common.c nxconvert_common.h 
    5359nxconvert_LDADD = $(LIBNEXUS) 
    54 nxconvert_LDFLAGS = -static $(LDFLAGS) 
     60nxconvert_LDFLAGS = -static @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 
     61 
     62nxvalidate_SOURCES = nxvalidate.c nxconvert_common.c nxconvert_common.h 
     63nxvalidate_LDADD = $(LIBNEXUS) 
     64nxvalidate_LDFLAGS = -static @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 
    5565 
    5666nxbrowse_SOURCES = NXbrowse.c 
    5767nxbrowse_LDADD = $(LIBNEXUS) 
    58 nxbrowse_LDFLAGS = -static $(LDFLAGS) 
     68nxbrowse_LDFLAGS = -static @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 
    5969 
    6070#NXtoXML_SOURCES = NXtoXML.c  
     
    6474nx2dtd_SOURCES = NXtoDTD.c  
    6575nx2dtd_LDADD = $(LIBNEXUS) 
    66 nx2dtd_LDFLAGS = -static $(LDFLAGS) 
     76nx2dtd_LDFLAGS = -static @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 
    6777 
    6878#NXtoNX4_SOURCES = NXtoNX4.c  
     
    7585NXdump_LDADD = $(LIBNEXUS90) 
    7686NXdump_LINK = $(FCLINK) 
    77 NXdump_LDFLAGS = -static $(LDFLAGS) 
     87NXdump_LDFLAGS = -static @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 
    7888 
    7989NXbrowse90_SOURCES = NXbrowse90.f90 
    8090NXbrowse90_LDADD = $(LIBNEXUS90) 
    8191NXbrowse90_LINK = $(FCLINK) 
    82 NXbrowse90_LDFLAGS = -static $(LDFLAGS) 
     92NXbrowse90_LDFLAGS = -static @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 
    8393 
    8494include $(top_srcdir)/build_rules.am 
  • tags/4.2.0/scripts/nxbuild.in

    r1896 r1896  
    3939libexecdir="@libexecdir@" 
    4040datadir="@datadir@" 
     41datarootdir="@datarootdir@" 
    4142libdir="@libdir@" 
    4243infodir="@infodir@" 
  • tags/4.2.0/src/nxxml.c

    r1896 r1896  
    5050    mxml_node_t *currentChild; 
    5151    int currentAttribute; 
     52    int options; /**< additional information about the node */ 
    5253}xmlStack; 
     54 
     55/* 
     56 * Freddie Akeroyd, 19/03/2008 
     57 * 
     58 * Add in support for table style data writing - this is  
     59 * indicated internally via the XMLSTACK_OPTION_TABLE flag 
     60 * and separates the dimensions and data into separate nodes contained 
     61 * in DIMS_NODE_NAME and DATA_NODE_NAME. This is a first commit and  
     62 * involves some code duplication that will need to be cleaned up later. 
     63 * Also writing in table style is only enabled for 1D arrays as 
     64 * I haven't done slab writing yet which the nexus test program uses 
     65 * for writing 2D arrays.  
     66 * 
     67 * Table output is enabled by opening a file with (NXACC_CREATEXML | NXACC_TABLE) 
     68 * 
     69 * See http://trac.nexusformat.org/code/ticket/111 for further details 
     70 */ 
     71#define XMLSTACK_OPTION_TABLE           0x1 /**< indicates table option in xmlStack */ 
     72 
     73/** 
     74 * Freddie Akeroyd 14/7/2008 
     75 * Add NeXus schema support - this uses BASE.xsd as the initial file 
     76 */ 
     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 
    5381/*---------------------------------------------------------------------*/ 
    5482typedef struct { 
    5583  mxml_node_t *root;           /* root node */ 
    5684  int readOnly;                /* read only flag */ 
     85  int tableStyle;              /**< whether to output data in XML table style */ 
    5786  int stackPointer;            /* stack pointer */ 
    5887  char filename[1024];         /* file name, for NXflush, NXclose */ 
     
    118147  mxmlSetErrorCallback(errorCallbackForMxml); 
    119148 
     149  xmlHandle->tableStyle = ((am & NXACC_TABLE) ? 1 : 0); 
    120150  /* 
    121151    open file 
    122152  */ 
    123153  strncpy(xmlHandle->filename,filename,1023); 
    124   switch(am){ 
     154  switch(am & NXACCMASK_REMOVEFLAGS){ 
    125155  case NXACC_READ: 
    126156    xmlHandle->readOnly = 1; 
     
    141171    xmlHandle->stack[0].currentChild = NULL; 
    142172    xmlHandle->stack[0].currentAttribute = 0; 
     173    xmlHandle->stack[0].options = 0; 
    143174    fclose(fp); 
    144175    break; 
     
    150181    mxmlElementSetAttr(current,"XML_version","mxml"); 
    151182    mxmlElementSetAttr(current,"file_name",filename); 
     183    mxmlElementSetAttr(current,"xmlns", NEXUS_SCHEMA_NAMESPACE); 
     184    mxmlElementSetAttr(current,"xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"); 
     185    mxmlElementSetAttr(current,"xsi:schemaLocation", 
     186        NEXUS_SCHEMA_NAMESPACE " " NEXUS_SCHEMA_FILE); 
    152187    time_buffer = NXIformatNeXusTime(); 
    153188    if(time_buffer != NULL){ 
     
    158193    xmlHandle->stack[0].currentChild = NULL; 
    159194    xmlHandle->stack[0].currentAttribute = 0; 
     195    xmlHandle->stack[0].options = 0; 
    160196    break; 
    161197  default: 
     
    306342  xmlHandle->stack[xmlHandle->stackPointer].currentChild = NULL; 
    307343  xmlHandle->stack[xmlHandle->stackPointer].currentAttribute = 0; 
     344  xmlHandle->stack[xmlHandle->stackPointer].options = 0; 
    308345  return NX_OK; 
    309346} 
     
    370407  return typestring; 
    371408} 
     409 
    372410/*------------------------------------------------------------------------*/ 
     411NXstatus  NXXmakedatatable (NXhandle fid,  
     412                                    CONSTCHAR *name, int datatype,  
     413                                    int rank, int dimensions[]){ 
     414  pXMLNexus xmlHandle = NULL; 
     415  mxml_node_t *dataNode = NULL, *dataNodeRoot = NULL, *dimsNode = NULL, *dimsNodeRoot = NULL; 
     416  mxml_node_t *newData = NULL; 
     417  mxml_node_t *current; 
     418  char *typestring; 
     419  int i, ndata;  
     420  static int one = 1; 
     421 
     422  xmlHandle = (pXMLNexus)fid; 
     423  assert(xmlHandle); 
     424 
     425  if(isDataNode(xmlHandle->stack[xmlHandle->stackPointer].current)){ 
     426    NXIReportError(NXpData,"Close dataset before trying to create a dataset"); 
     427    return NX_ERROR; 
     428  } 
     429  if(dimensions[0] < 0){ 
     430    dimensions[0] = 1; 
     431  } 
     432 
     433  current = xmlHandle->stack[xmlHandle->stackPointer].current; 
     434 
     435  dimsNodeRoot = mxmlFindElement(current, current, DIMS_NODE_NAME, NULL, NULL, MXML_DESCEND_FIRST); 
     436  if (dimsNodeRoot == NULL) 
     437  { 
     438      dimsNodeRoot = mxmlNewElement(current, DIMS_NODE_NAME); 
     439  } 
     440  dimsNode = mxmlNewElement(dimsNodeRoot, name); 
     441  mxmlNewOpaque(dimsNode, ""); 
     442  typestring = buildTypeString(datatype,rank,dimensions); 
     443  if(typestring != NULL){ 
     444    mxmlElementSetAttr(dimsNode,TYPENAME,typestring); 
     445    free(typestring); 
     446  } else { 
     447    NXIReportError(NXpData,"Failed to allocate typestring"); 
     448    return NX_ERROR; 
     449  } 
     450  ndata = 1; 
     451  for(i=0; i<rank; i++) 
     452  { 
     453     ndata *= dimensions[i]; 
     454  } 
     455  dataNodeRoot = current; 
     456  for(i=0; i<ndata; i++) 
     457  { 
     458      dataNodeRoot = mxmlFindElement(dataNodeRoot, current, DATA_NODE_NAME, NULL, NULL, (i == 0 ? MXML_DESCEND_FIRST : MXML_NO_DESCEND) ); 
     459      if (dataNodeRoot == NULL) 
     460      { 
     461          dataNodeRoot = mxmlNewElement(current, DATA_NODE_NAME); 
     462      } 
     463      dataNode = mxmlNewElement(dataNodeRoot,name); 
     464      newData = (mxml_node_t *)malloc(sizeof(mxml_node_t)); 
     465      if(!newData){ 
     466        NXIReportError(NXpData,"Failed to allocate space for dataset"); 
     467        return NX_ERROR; 
     468      } 
     469      memset(newData,0,sizeof(mxml_node_t)); 
     470      mxmlAdd(dataNode, MXML_ADD_AFTER, MXML_ADD_TO_PARENT, newData); 
     471      newData->type = MXML_CUSTOM; 
     472/*        newData->value.custom.data = createNXDataset(rank,datatype,dimensions); */ 
     473      newData->value.custom.data = createNXDataset(1,datatype,&one); 
     474      if(!newData->value.custom.data){ 
     475        NXIReportError(NXpData,"Failed to allocate space for dataset"); 
     476        return NX_ERROR; 
     477      } 
     478      newData->value.custom.destroy = destroyDataset; 
     479  } 
     480  return NX_OK; 
     481} 
     482 
    373483NXstatus  NXXmakedata (NXhandle fid,  
    374484                                    CONSTCHAR *name, int datatype,  
     
    380490  char *typestring; 
    381491 
    382   xmlHandle = (pXMLNexus)fid; 
    383   assert(xmlHandle); 
     492 
     493  xmlHandle = (pXMLNexus)fid; 
     494  assert(xmlHandle); 
     495 
     496  if (xmlHandle->tableStyle && datatype != NX_CHAR && dimensions[0] != NX_UNLIMITED && rank == 1) 
     497  { 
     498      return NXXmakedatatable(fid,name,datatype,rank,dimensions); 
     499  } 
    384500 
    385501  if(isDataNode(xmlHandle->stack[xmlHandle->stackPointer].current)){ 
     
    389505  if(dimensions[0] < 0){ 
    390506    dimensions[0] = 1; 
    391   } 
    392   if ((datatype == NX_CHAR) && (rank > 1)) { 
    393     NXIReportError(NXpData,"NeXus XML-API does not yet support multi-dimensional character arrays"); 
    394     return NX_ERROR; 
    395507  } 
    396508 
     
    461573} 
    462574/*-----------------------------------------------------------------------*/ 
     575NXstatus  NXXopendatatable (NXhandle fid, CONSTCHAR *name){ 
     576  pXMLNexus xmlHandle = NULL; 
     577  mxml_node_t *dataNode = NULL, *dimsNode = NULL; 
     578  char error[1024]; 
     579 
     580  xmlHandle = (pXMLNexus)fid; 
     581  assert(xmlHandle); 
     582 
     583 
     584  if(isDataNode(xmlHandle->stack[xmlHandle->stackPointer].current)){ 
     585    /* 
     586      silently fix this 
     587    */ 
     588    xmlHandle->stackPointer--; 
     589    if(xmlHandle->stackPointer < 0){ 
     590      xmlHandle->stackPointer = 0; 
     591    } 
     592  } 
     593   
     594  dimsNode = mxmlFindElement(xmlHandle->stack[xmlHandle->stackPointer].current, 
     595                             xmlHandle->stack[xmlHandle->stackPointer].current, 
     596                             DIMS_NODE_NAME, 
     597                             NULL, 
     598                             NULL, 
     599                             MXML_DESCEND_FIRST); 
     600 
     601  if(!dimsNode){ 
     602    snprintf(error,1023,"Failed to open dataset %s",name); 
     603    NXIReportError(NXpData,error); 
     604    return NX_ERROR; 
     605  } 
     606 
     607  dataNode = mxmlFindElement(dimsNode, 
     608                             dimsNode, 
     609                             name, 
     610                             NULL, 
     611                             NULL, 
     612                             MXML_DESCEND_FIRST); 
     613  if(dataNode == NULL){ 
     614    dataNode = searchSDSLinks(xmlHandle,name); 
     615  } 
     616  if(!dataNode){ 
     617    snprintf(error,1023,"Failed to open dataset %s",name); 
     618    NXIReportError(NXpData,error); 
     619    return NX_ERROR; 
     620  } 
     621  xmlHandle->stackPointer++; 
     622  xmlHandle->stack[xmlHandle->stackPointer].current = dataNode; 
     623  xmlHandle->stack[xmlHandle->stackPointer].currentChild = NULL; 
     624  xmlHandle->stack[xmlHandle->stackPointer].currentAttribute = 0; 
     625  xmlHandle->stack[xmlHandle->stackPointer].options = XMLSTACK_OPTION_TABLE; 
     626  return NX_OK; 
     627} 
     628 
     629 
    463630NXstatus  NXXopendata (NXhandle fid, CONSTCHAR *name){ 
    464631  pXMLNexus xmlHandle = NULL; 
    465   mxml_node_t *dataNode = NULL; 
     632  mxml_node_t *dataNode = NULL, *current = NULL; 
    466633  char error[1024]; 
    467634 
    468635  xmlHandle = (pXMLNexus)fid; 
    469636  assert(xmlHandle); 
     637 
     638  /* is this a table style node ? */ 
     639  current = xmlHandle->stack[xmlHandle->stackPointer].current; 
     640  dataNode = mxmlFindElement(current, 
     641                             current, 
     642                             DATA_NODE_NAME, 
     643                             NULL, 
     644                             NULL, 
     645                             MXML_DESCEND_FIRST); 
     646  if (dataNode != NULL) 
     647  { 
     648      dataNode = mxmlFindElement(dataNode, 
     649                             dataNode, 
     650                             name, 
     651                             NULL, 
     652                             NULL, 
     653                             MXML_DESCEND_FIRST); 
     654  } 
     655  if (dataNode != NULL) 
     656  { 
     657        return NXXopendatatable(fid, name); 
     658  } 
    470659 
    471660  if(isDataNode(xmlHandle->stack[xmlHandle->stackPointer].current)){ 
     
    497686  xmlHandle->stack[xmlHandle->stackPointer].currentChild = NULL; 
    498687  xmlHandle->stack[xmlHandle->stackPointer].currentAttribute = 0; 
     688  xmlHandle->stack[xmlHandle->stackPointer].options = 0; 
    499689  return NX_OK; 
    500690} 
    501691/*----------------------------------------------------------------------*/ 
     692 
    502693NXstatus  NXXclosedata (NXhandle fid){ 
    503694  pXMLNexus xmlHandle = NULL; 
     
    525716  return NULL; 
    526717} 
     718 
     719/* we only havv to deal with non-character data here */ 
     720NXstatus  NXXputdatatable (NXhandle fid, void *data){ 
     721  pXMLNexus xmlHandle = NULL; 
     722  mxml_node_t *userData = NULL; 
     723  mxml_node_t *current = NULL; 
     724  mxml_node_t *nodeRoot = NULL; 
     725  mxml_node_t *dataNodeRoot = NULL; 
     726  mxml_node_t *dataNode = NULL; 
     727  const char* name; 
     728  pNXDS dataset; 
     729  int i, offset, length, type, rank, dim[NX_MAXRANK]; 
     730  char *pPtr = NULL; 
     731  xmlHandle = (pXMLNexus)fid; 
     732  assert(xmlHandle); 
     733  /* current points at the Idims node as done in NXXopendatatable */ 
     734  current = xmlHandle->stack[xmlHandle->stackPointer].current; 
     735  name = current->value.element.name; 
     736  /* we want to walk all Idata nodes and set name */ 
     737  nodeRoot =  current->parent->parent; 
     738  dataNodeRoot = nodeRoot; 
     739  offset = 0; 
     740  for(i=0; dataNodeRoot != NULL; i++) 
     741  { 
     742      dataNodeRoot = mxmlFindElement(dataNodeRoot, nodeRoot, DATA_NODE_NAME, NULL, NULL, (i == 0 ? MXML_DESCEND_FIRST : MXML_NO_DESCEND) ); 
     743      if (dataNodeRoot != NULL) 
     744      { 
     745        dataNode = mxmlFindElement(dataNodeRoot,dataNodeRoot,name,NULL,NULL,MXML_DESCEND_FIRST); 
     746        if (dataNode != NULL) 
     747        { 
     748            userData = findData(dataNode); 
     749            assert(userData != NULL); 
     750            dataset = (pNXDS)userData->value.custom.data; 
     751            assert(dataset); 
     752            length = getNXDatasetByteLength(dataset); 
     753            memcpy(dataset->u.ptr,(char*)data + offset,length); 
     754            offset += length; 
     755        } 
     756      } 
     757    }  
     758    return NX_OK; 
     759} 
     760 
    527761/*------------------------------------------------------------------------*/ 
    528762NXstatus  NXXputdata (NXhandle fid, void *data){ 
     
    531765  mxml_node_t *current = NULL; 
    532766  pNXDS dataset; 
    533   int length, type, rank, dim[NX_MAXRANK]; 
     767  int i, length, type, rank, dim[NX_MAXRANK]; 
    534768  char *pPtr = NULL; 
    535769 
    536770  xmlHandle = (pXMLNexus)fid; 
    537771  assert(xmlHandle); 
     772 
     773  if (xmlHandle->stack[xmlHandle->stackPointer].options & XMLSTACK_OPTION_TABLE) 
     774  { 
     775      return NXXputdatatable(fid,data); 
     776  } 
    538777 
    539778  if(!isDataNode(xmlHandle->stack[xmlHandle->stackPointer].current)){ 
     
    551790    */ 
    552791    if(NXXgetinfo(fid,&rank, dim, &type) == NX_OK){ 
    553       pPtr = (char *)malloc((dim[0]+1)*sizeof(char)); 
     792      length = 1; 
     793      for(i=0; i<rank; i++) 
     794      { 
     795        length *= dim[i]; 
     796      } 
     797      pPtr = (char *)malloc((length+1)*sizeof(char)); 
    554798      if(pPtr != NULL){ 
    555         memcpy(pPtr,data,dim[0]); 
    556         pPtr[dim[0]] = '\0'; 
     799        memcpy(pPtr,data,length); 
     800        pPtr[length] = '\0'; 
    557801        mxmlSetOpaque(userData,(const char *)pPtr); 
    558802        free(pPtr); 
    559803      } 
    560804    } 
    561     mxmlSetOpaque(userData,(const char *)data); 
     805    else 
     806    { 
     807        NXIReportError(NXpData,"Unable to determine size of character dataset"); 
     808        return NX_ERROR; 
     809    } 
    562810  } else { 
    563811    dataset = (pNXDS)userData->value.custom.data; 
     
    568816  return NX_OK; 
    569817} 
     818 
     819NXstatus  NXXgetdatatable (NXhandle fid, void *data){ 
     820  pXMLNexus xmlHandle = NULL; 
     821  mxml_node_t *userData = NULL; 
     822  mxml_node_t *current = NULL; 
     823  mxml_node_t *nodeRoot = NULL; 
     824  mxml_node_t *dataNodeRoot = NULL; 
     825  mxml_node_t *dataNode = NULL; 
     826  const char* name; 
     827  pNXDS dataset; 
     828  int i, offset, length, type, rank, dim[NX_MAXRANK]; 
     829  xmlHandle = (pXMLNexus)fid; 
     830  assert(xmlHandle); 
     831 
     832  /* current points at the Idims node as done in NXXopendatatable */ 
     833  current = xmlHandle->stack[xmlHandle->stackPointer].current; 
     834  name = current->value.element.name; 
     835  /* we want to walk all Idata nodes and set name */ 
     836  nodeRoot =  current->parent->parent; 
     837  dataNodeRoot = nodeRoot; 
     838  offset = 0; 
     839  for(i=0; dataNodeRoot != NULL; i++) 
     840  { 
     841      dataNodeRoot = mxmlFindElement(dataNodeRoot, nodeRoot, DATA_NODE_NAME, NULL, NULL, (i == 0 ? MXML_DESCEND_FIRST : MXML_NO_DESCEND) ); 
     842      if (dataNodeRoot != NULL) 
     843      { 
     844        dataNode = mxmlFindElement(dataNodeRoot,dataNodeRoot,name,NULL,NULL,MXML_DESCEND_FIRST); 
     845        if (dataNode != NULL) 
     846        { 
     847            userData = findData(dataNode); 
     848            assert(userData != NULL); 
     849            dataset = (pNXDS)userData->value.custom.data; 
     850            assert(dataset); 
     851            length = getNXDatasetByteLength(dataset); 
     852            memcpy((char*)data + offset, dataset->u.ptr, length); 
     853            offset += length; 
     854        } 
     855      } 
     856    }  
     857    return NX_OK; 
     858} 
     859 
     860 
    570861/*------------------------------------------------------------------------*/ 
    571862NXstatus  NXXgetdata (NXhandle fid, void *data){ 
     
    574865  mxml_node_t *current = NULL; 
    575866  pNXDS dataset; 
    576   int length, type, rank, dim[NX_MAXRANK]; 
    577  
    578   xmlHandle = (pXMLNexus)fid; 
    579   assert(xmlHandle); 
     867  int i, length, type, rank, dim[NX_MAXRANK]; 
     868 
     869  xmlHandle = (pXMLNexus)fid; 
     870  assert(xmlHandle); 
     871 
     872  if (xmlHandle->stack[xmlHandle->stackPointer].options & XMLSTACK_OPTION_TABLE) 
     873  { 
     874      return NXXgetdatatable(fid,data); 
     875  } 
    580876 
    581877  if(!isDataNode(xmlHandle->stack[xmlHandle->stackPointer].current)){ 
     
    592888    */ 
    593889    if(NXXgetinfo(fid,&rank, dim, &type) == NX_OK){ 
    594       strncpy((char *)data,userData->value.opaque,dim[0]); 
     890      length = 1; 
     891      for(i=0; i<rank; i++) 
     892      { 
     893          length *= dim[i]; 
     894      } 
     895      strncpy((char *)data,userData->value.opaque,length); 
    595896    } else { 
    596897      strcpy((char *)data,nxitrim(userData->value.opaque)); 
     
    636937      dimension[0]= strlen(userData->value.opaque); 
    637938    } else { 
     939      *iType = translateTypeCode(attr); 
    638940      analyzeDim(attr,rank,dimension,iType); 
    639       *rank = 1; 
    640       *iType = NX_CHAR; 
     941      if (dimension[0] == -1) /* 1D strings are NX_CHAR not NX_CHAR[] so length will not be correct */ 
     942      { 
     943        dimension[0] = strlen(userData->value.opaque); 
     944      } 
     945       
    641946    } 
    642947  } else {  
     
    7341039  return 1; 
    7351040} 
     1041 
     1042NXstatus  NXXputslabtable (NXhandle fid, void *data,  
     1043                                   int iStart[], int iSize[]){ 
     1044    return NX_OK; 
     1045} 
    7361046/*----------------------------------------------------------------------*/ 
    7371047NXstatus  NXXputslab (NXhandle fid, void *data,  
     
    7461056  xmlHandle = (pXMLNexus)fid; 
    7471057  assert(xmlHandle); 
     1058 
     1059  if (xmlHandle->stack[xmlHandle->stackPointer].options & XMLSTACK_OPTION_TABLE) 
     1060  { 
     1061      return NXXputslabtable(fid,data,iStart,iSize); 
     1062  } 
    7481063 
    7491064  if(!isDataNode(xmlHandle->stack[xmlHandle->stackPointer].current)){ 
     
    9841299  const char *attribute = NULL; 
    9851300  char error[1024]; 
    986   char *attData = NULL; 
     1301  const char *attData = NULL; 
    9871302  int iValue, nx_type; 
    9881303  float fValue; 
     
    10241339  switch(nx_type){ 
    10251340  case NX_CHAR: 
    1026     strncpy((char *)data, attribute, *datalen); 
    1027     *datalen = strlen(attribute); 
     1341    /* enforce NULL termination regardless of length of datalen */ 
     1342    strncpy((char *)data, attribute, *datalen-1); 
     1343    ((char*)data)[*datalen-1] = '\0'; 
     1344    /* *datalen = strlen(attribute); */ 
     1345    *datalen = strlen((char*)data); 
    10281346    *iType = NX_CHAR; 
    10291347    break; 
     
    10641382  return NX_OK; 
    10651383} 
     1384 
     1385/* find the next node, ignoring Idata */ 
     1386static mxml_node_t* find_node(mxml_node_t* node, int next) 
     1387{ 
     1388  int done = 0; 
     1389  mxml_node_t* parent_next = NULL; /* parent to use if we are in an Idims  search */ 
     1390   if (node == NULL) 
     1391   { 
     1392        return NULL; 
     1393   } 
     1394   if ( (node->parent != NULL)  && !strcmp(node->parent->value.element.name, DIMS_NODE_NAME) ) 
     1395   { 
     1396        parent_next = node->parent->next; 
     1397   } 
     1398   else 
     1399   { 
     1400        parent_next = NULL; 
     1401   } 
     1402   if (next) 
     1403   { 
     1404       if (node->next != NULL) 
     1405       { 
     1406            node = node->next; 
     1407       } 
     1408       else 
     1409       { 
     1410            node = parent_next; 
     1411       } 
     1412   } 
     1413   while(node != NULL && !done) 
     1414   { 
     1415     if ( (node->parent != NULL)  && !strcmp(node->parent->value.element.name, DIMS_NODE_NAME) ) 
     1416     { 
     1417        parent_next = node->parent->next; 
     1418     } 
     1419     else 
     1420     { 
     1421        parent_next = NULL; 
     1422     } 
     1423     if ( (node->type != MXML_ELEMENT) || !strcmp(node->value.element.name, DATA_NODE_NAME) ) 
     1424     { 
     1425        if (node->next != NULL) 
     1426        { 
     1427            node = node->next; 
     1428        } 
     1429        else 
     1430        { 
     1431            node = parent_next; 
     1432        } 
     1433        continue; 
     1434     } 
     1435     if (!strcmp(node->value.element.name, DIMS_NODE_NAME)) 
     1436     { 
     1437        node = node->child; 
     1438        continue; 
     1439     } 
     1440     done = 1; 
     1441  } 
     1442  return node; 
     1443} 
     1444 
    10661445/*====================== search functions =================================*/ 
    10671446NXstatus  NXXgetnextentry (NXhandle fid,NXname name,  
    10681447                                        NXname nxclass, int *datatype){ 
    10691448  pXMLNexus xmlHandle = NULL; 
    1070   mxml_node_t *next = NULL, *userData; 
     1449  mxml_node_t *next = NULL, *userData, *node = NULL; 
    10711450  int stackPtr; 
    10721451  const char *target = NULL, *attname = NULL; 
     
    10901469      initialization of search 
    10911470    */ 
    1092     xmlHandle->stack[stackPtr].currentChild =  
    1093       xmlHandle->stack[stackPtr].current->child; 
     1471      node = find_node(xmlHandle->stack[stackPtr].current->child, 0); 
    10941472  } else { 
    10951473    /* 
    10961474      proceed 
    10971475    */ 
    1098     xmlHandle->stack[stackPtr].currentChild =  
    1099       xmlHandle->stack[stackPtr].currentChild->next; 
    1100   } 
    1101   next = xmlHandle->stack[stackPtr].currentChild; 
     1476    node = find_node(xmlHandle->stack[stackPtr].currentChild, 1); 
     1477  } 
     1478  xmlHandle->stack[stackPtr].currentChild = node; 
     1479  next = node; 
    11021480  if(next == NULL){ 
    11031481    return NX_EOD; 
     
    12361614                                        NXname pName, NXname pClass){ 
    12371615  pXMLNexus xmlHandle = NULL; 
    1238   mxml_node_t *child = NULL; 
     1616  mxml_node_t *node = NULL, *child = NULL; 
    12391617  mxml_node_t *current = NULL; 
    12401618  const char *nameAtt = NULL; 
     
    12561634  strcpy(pClass,current->value.element.name); 
    12571635 
     1636/* count all child nodes, but need to ignore DATA_NODE_NAME and 
     1637 * descend into DIMS_NODE_NAME  
     1638 */ 
    12581639  childCount = 0; 
    1259   child = current->child; 
    1260   while(child != NULL){ 
    1261     childCount++; 
    1262     child = child->next; 
     1640  node = current->child; 
     1641  while(node != NULL) 
     1642  { 
     1643        if (!strcmp(node->value.element.name, DATA_NODE_NAME)) 
     1644        { 
     1645            ;   /* names also exist in DIMS_NODE_NAME so do nothing here */ 
     1646        } 
     1647        else if (!strcmp(node->value.element.name, DIMS_NODE_NAME)) 
     1648        { 
     1649            child = node->child; 
     1650            while(child != NULL) 
     1651            { 
     1652                /* not sure why this check is needed, but you double count otherwise */ 
     1653                if (child->type == MXML_ELEMENT)  
     1654                { 
     1655                    childCount++; 
     1656                } 
     1657                child = child->next; 
     1658            } 
     1659        } 
     1660        else 
     1661        { 
     1662            childCount++; 
     1663        } 
     1664        node = node->next; 
    12631665  } 
    12641666  *iN = childCount; 
     
    12691671  pXMLNexus xmlHandle = NULL; 
    12701672  mxml_node_t *current = NULL; 
    1271   int stackPtr, currentAtt; 
     1673  int stackPtr, currentAtt, skip; 
    12721674 
    12731675  xmlHandle = (pXMLNexus)fid; 
     
    12811683    hide type and group name attributes 
    12821684  */ 
    1283   if(!isDataNode(current)) { 
    1284     *iN = current->value.element.num_attrs -1; 
    1285     return NX_OK; 
    1286   } 
    1287   if(mxmlElementGetAttr(current,TYPENAME) != NULL){ 
    1288     *iN = current->value.element.num_attrs -1; 
     1685  skip=0; 
     1686  if(isDataNode(current)) { 
     1687    /* data nodes may have type */ 
     1688    if(mxmlElementGetAttr(current,TYPENAME) != NULL) skip=1; 
    12891689  } else { 
    1290     *iN = current->value.element.num_attrs; 
    1291   } 
     1690    /* group nodes (except root) have name */ 
     1691    if(mxmlElementGetAttr(current,"name") != NULL) skip=1; 
     1692  } 
     1693  *iN = current->value.element.num_attrs - skip; 
    12921694  return NX_OK; 
    12931695} 
  • tags/4.2.0/src/nexus_symbols.txt

    r1896 r1896  
    5454NXMEnableErrorReporting 
    5555nximakenamedlink_ 
     56createNXDataset 
     57createTextNXDataset 
     58dropNXDataset 
     59getNXDatasetByteLength 
     60getNXDatasetDim 
     61getNXDatasetLength 
     62getNXDatasetRank 
     63getNXDatasetText 
     64getNXDatasetType 
     65getNXDatasetValue 
     66getNXDatasetValueAt 
     67putNXDatasetValue 
     68putNXDatasetValueAt 
     69nxigetrawinfo_ 
  • tags/4.2.0/src/napi_exports.c

    r1896 r1896  
    88 
    99#define CALL_MODE       __stdcall 
     10 
     11#ifdef __cplusplus 
     12extern "C" { 
     13#endif /* __cplusplus */ 
     14 
    1015#include "napi_exports.h" 
     16 
     17#ifdef __cplusplus 
     18} 
     19#endif /* __cplusplus */ 
  • tags/4.2.0/src/napi4.c

    r1896 r1896  
    5353    char iAccess[2]; 
    5454  } NexusFile, *pNexusFile; 
    55  
     55   /*-------------------------------------------------------------------*/ 
     56   static void ignoreError(void *data, char *text){ 
     57   } 
    5658   /*--------------------------------------------------------------------*/ 
    5759 
     
    174176    int32 i, iN, iA, iD1, iD2; 
    175177    NXname pNam; 
    176     int32 iDim[MAX_VAR_DIMS]; 
     178    int32 iDim[H4_MAX_VAR_DIMS]; 
    177179   
    178180    self = NXIassert (fid); 
     
    292294    int iRet; 
    293295    int32 iData, iAtt, iRank, iType; 
    294     int32 iDim[MAX_VAR_DIMS]; 
     296    int32 iDim[H4_MAX_VAR_DIMS]; 
    295297    NXname pNam; 
    296298   
     
    337339  { 
    338340    int i; 
    339     int32 groupID, iA, iD1, iD2, iDim[MAX_VAR_DIMS]; 
     341    int32 groupID, iA, iD1, iD2, iDim[H4_MAX_VAR_DIMS]; 
    340342    NXname pText; 
    341343 
    342344    buffer[0] = '\0'; 
    343     for(i = 0; i < pFile->iStackPtr; i++){ 
     345    for(i = 1; i <= pFile->iStackPtr; i++){ 
    344346      strncat(buffer,"/",bufLen-strlen(buffer)); 
    345       groupID = Vattach(pFile->iVID,pFile->iStack[pFile->iStackPtr].iVref, 
    346                          "r"); 
    347       Vgetname(groupID, pText); 
    348       strncat(buffer,pText,bufLen-strlen(buffer)); 
    349       Vdetach(groupID); 
     347      groupID = Vattach(pFile->iVID,pFile->iStack[i].iVref, "r"); 
     348      if (groupID != -1) 
     349      { 
     350          if (Vgetname(groupID, pText) != -1) { 
     351              strncat(buffer,pText,bufLen-strlen(buffer)); 
     352          } else { 
     353              NXIReportError (NXpData, "ERROR: NXIbuildPath cannot get vgroup name"); 
     354          } 
     355          Vdetach(groupID); 
     356      } 
     357      else 
     358      { 
     359          NXIReportError (NXpData, "ERROR: NXIbuildPath cannot attach to vgroup"); 
     360      } 
    350361    } 
    351362    if(pFile->iCurrentSDS != 0){ 
    352       strncat(buffer,"/",bufLen-strlen(buffer)); 
    353       SDgetinfo(pFile->iCurrentSDS,pText,&iA,iDim,&iD1,&iD2); 
    354       strncat(buffer,pText,bufLen-strlen(buffer)); 
     363      if (SDgetinfo(pFile->iCurrentSDS,pText,&iA,iDim,&iD1,&iD2) != -1) { 
     364          strncat(buffer,"/",bufLen-strlen(buffer)); 
     365          strncat(buffer,pText,bufLen-strlen(buffer)); 
     366      } 
     367      else 
     368      { 
     369          NXIReportError (NXpData, "ERROR: NXIbuildPath cannot read SDS"); 
     370      } 
    355371    } 
    356372  }  
     
    374390   
    375391    *pHandle = NULL; 
     392 
     393    /* mask off any options for now */ 
     394    am = (NXaccess)(am & NXACCMASK_REMOVEFLAGS); 
    376395    /* map Nexus NXaccess types to HDF4 types */ 
    377396    if (am == NXACC_CREATE) { 
     
    651670    char pBuffer[256]; 
    652671    int i, iRet, type; 
    653     int32 myDim[MAX_VAR_DIMS];   
     672    int32 myDim[H4_MAX_VAR_DIMS];   
    654673 
    655674    pFile = NXIassert (fid); 
     
    780799    int32 iNew, iRet, type; 
    781800    char pBuffer[256]; 
    782     int i; 
    783     int32 myDim[MAX_VAR_DIMS];   
     801    int i, compress_level; 
     802    int32 myDim[H4_MAX_VAR_DIMS];   
    784803    comp_info compstruct; 
    785804 
     
    891910      
    892911    /* compress SD data set */ 
     912    compress_level = 6; 
     913    if( (compress_type / 100) == NX_COMP_LZW ) 
     914    { 
     915        compress_level = compress_type % 100; 
     916        compress_type = NX_COMP_LZW; 
     917    } 
    893918 
    894919    if(compress_type == NX_COMP_LZW) 
    895920    { 
    896       compstruct.deflate.level = 6;  
     921      compstruct.deflate.level = compress_level;  
    897922      iRet = SDsetcompress(iNew, COMP_CODE_DEFLATE, &compstruct); 
    898923      if (iRet < 0)  
     
    950975    pNexusFile pFile; 
    951976    int32 iRank, iAtt, iType, iRet; 
    952     int32 iSize[MAX_VAR_DIMS]; 
    953     int compress_typei = COMP_CODE_NONE; 
     977    int32 iSize[H4_MAX_VAR_DIMS]; 
     978    comp_coder_t compress_typei = COMP_CODE_NONE; 
    954979    NXname pBuffer; 
    955980    char pError[512]; 
    956981    comp_info compstruct;   
     982    int compress_level = 6; 
    957983    
    958984    pFile = NXIassert (fid); 
     
    971997      { 
    972998        compress_typei = COMP_CODE_DEFLATE; 
     999      } 
     1000      else if ( (compress_type / 100) == NX_COMP_LZW ) 
     1001      { 
     1002        compress_typei = COMP_CODE_DEFLATE; 
     1003        compress_level = compress_type % 100; 
     1004        compress_type = NX_COMP_LZW; 
    9731005      } 
    9741006      else if (compress_type == NX_COMP_RLE) 
     
    9911023    if(compress_type == NX_COMP_LZW) 
    9921024    { 
    993          compstruct.deflate.level = 6; 
     1025         compstruct.deflate.level = compress_level; 
    9941026    } 
    9951027    else if(compress_type == NX_COMP_HUF) 
     
    10891121  { 
    10901122    pNexusFile pFile; 
    1091     int32 iStart[MAX_VAR_DIMS], iSize[MAX_VAR_DIMS], iStride[MAX_VAR_DIMS]; 
     1123    int32 iStart[H4_MAX_VAR_DIMS], iSize[H4_MAX_VAR_DIMS], iStride[H4_MAX_VAR_DIMS]; 
    10921124    NXname pBuffer; 
    10931125    int32 iRank, iAtt, iType, iRet, i; 
     
    11021134    } 
    11031135    /* first read dimension information */ 
    1104     memset (iStart, 0, MAX_VAR_DIMS * sizeof (int32)); 
     1136    memset (iStart, 0, H4_MAX_VAR_DIMS * sizeof (int32)); 
    11051137    SDgetinfo (pFile->iCurrentSDS, pBuffer, &iRank, iSize, &iType, &iAtt); 
    11061138   
     
    11131145    iRet = SDwritedata (pFile->iCurrentSDS, iStart, iStride, iSize, data); 
    11141146    if (iRet < 0) { 
     1147      /* HEprint(stdout,0); */ 
    11151148      sprintf (pError, "ERROR: failure to write data to %s", pBuffer); 
    11161149      NXIReportError (NXpData, pError); 
     
    12001233    pNexusFile pFile; 
    12011234    int iRet; 
    1202     int32 iStride[MAX_VAR_DIMS]; 
    1203     int32 myStart[MAX_VAR_DIMS], mySize[MAX_VAR_DIMS]; 
     1235    int32 iStride[H4_MAX_VAR_DIMS]; 
     1236    int32 myStart[H4_MAX_VAR_DIMS], mySize[H4_MAX_VAR_DIMS]; 
    12041237    int32 i, iRank, iType, iAtt; 
    12051238    NXname pBuffer;   
     
    12141247    } 
    12151248    /* initialise stride to 1 */ 
    1216     for (i = 0; i < MAX_VAR_DIMS; i++) { 
     1249    for (i = 0; i < H4_MAX_VAR_DIMS; i++) { 
    12171250      iStride[i] = 1; 
    12181251    } 
     
    12561289  { 
    12571290    pNexusFile pFile; 
    1258    
     1291    ErrFunc oldErr; 
     1292    int datalen, type = NX_CHAR; 
     1293 
    12591294    pFile = NXIassert (fid); 
    12601295   
     
    12651300      sRes->iTag = DFTAG_NDG; 
    12661301      sRes->iRef = SDidtoref (pFile->iCurrentSDS); 
    1267       NXIbuildPath(pFile,sRes->targetPath,1024); 
     1302      oldErr = NXMGetError(); 
     1303      NXMSetError(NXpData, ignoreError); 
     1304      datalen = 1024; 
     1305      memset(&sRes->targetPath,0,1024); 
     1306      if(NX4getattr(fid,"target",&sRes->targetPath,&datalen,&type) != NX_OK) 
     1307      { 
     1308        NXIbuildPath(pFile,sRes->targetPath,1024); 
     1309      } 
     1310      NXMSetError(NXpData,oldErr); 
    12681311      return NX_OK; 
    12691312    } 
     
    14531496    int iRet, iStackPtr, iCurDir; 
    14541497    int32 iTemp, iD1, iD2, iA; 
    1455     int32 iDim[MAX_VAR_DIMS]; 
     1498    int32 iDim[H4_MAX_VAR_DIMS]; 
    14561499   
    14571500    pFile = NXIassert (fid); 
     
    15361579  { 
    15371580    pNexusFile pFile; 
    1538     int32 iStart[MAX_VAR_DIMS], iSize[MAX_VAR_DIMS]; 
     1581    int32 iStart[H4_MAX_VAR_DIMS], iSize[H4_MAX_VAR_DIMS]; 
    15391582    NXname pBuffer; 
    15401583    int32 iRank, iAtt, iType; 
     
    15481591    } 
    15491592    /* first read dimension information */ 
    1550     memset (iStart, 0, MAX_VAR_DIMS * sizeof (int32)); 
     1593    memset (iStart, 0, H4_MAX_VAR_DIMS * sizeof (int32)); 
    15511594    SDgetinfo (pFile->iCurrentSDS, pBuffer, &iRank, iSize, &iType, &iAtt); 
    15521595    /* actually read */ 
     
    15631606    pNexusFile pFile; 
    15641607    NXname pBuffer; 
    1565     int32 iAtt, myDim[MAX_VAR_DIMS], i, iRank, mType; 
     1608    int32 iAtt, myDim[H4_MAX_VAR_DIMS], i, iRank, mType; 
    15661609   
    15671610    pFile = NXIassert (fid); 
     
    15931636  { 
    15941637    pNexusFile pFile; 
    1595     int32 myStart[MAX_VAR_DIMS], mySize[MAX_VAR_DIMS]; 
     1638    int32 myStart[H4_MAX_VAR_DIMS], mySize[H4_MAX_VAR_DIMS]; 
    15961639    int32 i, iRank, iType, iAtt; 
    15971640    NXname pBuffer;   
     
    17961839    if ((*datalen <= iLen) &&  
    17971840     (*iType == DFNT_UINT8 || *iType == DFNT_CHAR8 || *iType == DFNT_UCHAR8)) { 
    1798       iLen = *datalen - 1; 
     1841      iLen = *datalen - 1; /* this enforces NULL termination regardless of size of datalen */ 
    17991842    } 
    18001843    memcpy (data, pData, iLen); 
     
    18121855    int iRet; 
    18131856    int32 iData, iAtt, iRank, iType; 
    1814     int32 iDim[MAX_VAR_DIMS]; 
     1857    int32 iDim[H4_MAX_VAR_DIMS]; 
    18151858    NXname pNam; 
    18161859   
     
    19041947     
    19051948    pFile = NXIassert (fid); 
    1906     NXIKillAttDir (fid); 
     1949    NXIKillAttDir (pFile); 
    19071950    iRet = NXIInitAttDir (pFile); 
    19081951    if (iRet == NX_ERROR) 
     
    19211964     
    19221965    pFile = NXIassert (fid); 
    1923     NXIKillDir (fid); 
     1966    NXIKillDir (pFile); 
    19241967    iRet = NXIInitDir (pFile); 
    19251968    if (iRet < 0) { 
  • tags/4.2.0/src/nxstack.c

    r1896 r1896  
    4545  pFileStack pNew = NULL; 
    4646   
    47   pNew = malloc(sizeof(fileStack)); 
     47  pNew = (pFileStack)malloc(sizeof(fileStack)); 
    4848  if(pNew == NULL){ 
    4949    return NULL; 
  • tags/4.2.0/src/napi5.c

    r1896 r1896  
    135135  size_t rdcc_nbytes; 
    136136  double rdcc_w0; 
     137 
     138  /* mask of any options for now */ 
     139  am = (NXaccess)(am & NXACCMASK_REMOVEFLAGS); 
    137140 
    138141  /* turn off the automatic HDF error handling */   
     
    378381    } 
    379382    iVID = iRet; 
    380     strncpy(pFile->name_ref,pBuffer,1023); 
    381383    aid2 = H5Screate(H5S_SCALAR); 
    382384    aid1 = H5Tcopy(H5T_C_S1); 
     
    460462        } 
    461463        atype=H5Tcopy(H5T_C_S1); 
    462         H5Tset_size(atype,128);   
     464        H5Tset_size(atype,sizeof(data));   
    463465        iRet = H5Aread(attr1, atype, data); 
    464466        if (strcmp(data, nxclass) == 0) { 
     
    616618    hsize_t size[H5S_MAX_RANK]; 
    617619    hsize_t maxdims[H5S_MAX_RANK]; 
     620    int compress_level; 
    618621 
    619622    pFile = NXI5assert (fid); 
     
    652655/*  
    653656 *  This assumes string lenght is in the last dimensions and 
    654  *  the logic must be the same as used in NX5getglab and NX5getinfo 
     657 *  the logic must be the same as used in NX5getslab and NX5getinfo 
    655658 * 
    656659 *  search for tests on H5T_STRING 
    657660 */ 
    658661      byte_zahl=dimensions[rank-1];  
    659       dimensions[rank-1]=1; 
    660662      for(i = 0; i < rank; i++) 
    661663         { 
    662664         mydim1[i] = dimensions[i]; 
    663665         } 
    664       dimensions[rank-1] = byte_zahl; 
    665          dataspace=H5Screate_simple(rank,mydim1,NULL); 
     666       mydim1[rank-1] = 1; 
     667       if (dimensions[rank-1] > 1) 
     668       { 
     669           mydim[rank-1] = maxdims[rank-1] = size[rank-1] = 1; 
     670       } 
     671       if (chunkdims[rank-1] > 1)  
     672       {  
     673            chunkdims[rank-1] = 1;  
     674       } 
     675       if (dimensions[0] == NX_UNLIMITED) 
     676       { 
     677          mydim1[0] = 1; 
     678          maxdims[0] = H5S_UNLIMITED; 
     679       } 
     680         dataspace=H5Screate_simple(rank,mydim1,maxdims); 
    666681    } else { 
    667682      if (dimensions[0] == NX_UNLIMITED) 
     
    681696/*       H5Tset_strpad(H5T_STR_SPACEPAD); */ 
    682697    } 
     698    compress_level = 6; 
     699    if ( (compress_type / 100) ==  NX_COMP_LZW ) 
     700    { 
     701        compress_level = compress_type % 100; 
     702        compress_type = NX_COMP_LZW; 
     703    } 
    683704    if(compress_type == NX_COMP_LZW) 
    684705    { 
     
    689710        return NX_ERROR; 
    690711      } 
    691       H5Pset_deflate(cparms,6);  
     712      H5Pset_deflate(cparms,compress_level);  
    692713      iRet = H5Dcreate (pFile->iCurrentG, (char*)name, datatype1,  
    693714                        dataspace, cparms);    
     
    886907 
    887908  NXstatus  NX5putattr (NXhandle fid, CONSTCHAR *name, void *data,  
    888                                   int datalen, int iType) 
     909 
     910                        int datalen, int iType) 
    889911  { 
    890912    pNexusFile5 pFile; 
     
    910932      iRet=H5Adelete(vid,name); 
    911933      if (iRet<0) { 
    912         NXIReportError (NXpData, "ERROR: Old attribute cannot removed! "); 
     934        NXIReportError (NXpData, "ERROR: Old attribute cannot be removed! "); 
    913935        killAttVID(pFile,vid); 
    914936        return NX_ERROR; 
     
    944966    hsize_t myStart[H5S_MAX_RANK]; 
    945967    hsize_t mySize[H5S_MAX_RANK]; 
    946     hsize_t size[1],maxdims[H5S_MAX_RANK]; 
     968    hsize_t size[H5S_MAX_RANK],maxdims[H5S_MAX_RANK]; 
    947969    hid_t   filespace,dataspace;  
    948970   
     
    954976    } 
    955977    rank = H5Sget_simple_extent_ndims(pFile->iCurrentS);     
     978    iRet = H5Sget_simple_extent_dims(pFile->iCurrentS, NULL, maxdims); 
    956979    for(i = 0; i < rank; i++) 
    957980    { 
    958981       myStart[i] = iStart[i]; 
    959982       mySize[i]  = iSize[i]; 
    960     } 
    961     iRet = H5Sget_simple_extent_dims(pFile->iCurrentS, NULL, maxdims); 
     983       size[i]    = iSize[i]; 
     984    } 
     985    if (H5Tget_class(pFile->iCurrentT) == H5T_STRING) 
     986    { 
     987        mySize[rank - 1] = 1; 
     988        size[rank - 1] = 1; 
     989        myStart[rank - 1] = 0; 
     990    } 
    962991    dataspace = H5Screate_simple (rank, mySize, NULL); 
    963992    if (maxdims[0] == NX_UNLIMITED) 
     
    965994       size[0]=iStart[0] + iSize[0]; 
    966995       iRet = H5Dextend(pFile->iCurrentD, size); 
     996       if (iRet < 0)  
     997       { 
     998           NXIReportError (NXpData, "ERROR: extend slab failed"); 
     999           return NX_ERROR; 
     1000       } 
     1001 
    9671002       filespace = H5Dget_space(pFile->iCurrentD); 
    9681003        
     
    9791014       iRet = H5Dwrite(pFile->iCurrentD, pFile->iCurrentT, dataspace,  
    9801015                    filespace, H5P_DEFAULT,data); 
     1016       if (iRet < 0) 
     1017       { 
     1018           NXIReportError (NXpData, "ERROR: writing slab failed"); 
     1019       } 
    9811020       iRet = H5Sclose(filespace);              
    9821021   } else { 
     
    9931032       iRet = H5Dwrite(pFile->iCurrentD, pFile->iCurrentT, dataspace,  
    9941033                    pFile->iCurrentS, H5P_DEFAULT,data); 
     1034       if (iRet < 0) 
     1035       { 
     1036           NXIReportError (NXpData, "ERROR: writing slab failed"); 
     1037       } 
    9951038   } 
    9961039   /* deal with HDF errors */ 
     
    9981041   if (iRet < 0)  
    9991042   { 
    1000       NXIReportError (NXpData, "ERROR: writing slab failed"); 
     1043      NXIReportError (NXpData, "ERROR: closing slab failed"); 
    10011044      return NX_ERROR; 
    10021045   } 
     
    12851328      } else { 
    12861329        atype=H5Tcopy(H5T_C_S1); 
    1287         H5Tset_size(atype,64);   
     1330        H5Tset_size(atype,sizeof(data));   
    12881331        H5Aread(attr_id, atype, data); 
    12891332        strcpy(pClass,data); 
     
    15061549               type=H5T_C_S1; 
    15071550               atype=H5Tcopy(type); 
    1508                H5Tset_size(atype,128);   
     1551               H5Tset_size(atype,sizeof(data));   
    15091552               iRet = H5Aread(attr1, atype, data); 
    15101553               strcpy(nxclass,data); 
     
    17131756                     H5S_ALL, H5P_DEFAULT,tmp_data); 
    17141757          data1 = tmp_data + myStart[0]; 
    1715           strncpy(data,data1,(hsize_t)iSize[0]); 
     1758          strncpy((char*)data,data1,(hsize_t)iSize[0]); 
    17161759          free(tmp_data);            
    17171760      } else {     
     
    17551798     vid = getAttVID(pFile); 
    17561799 
     1800     pName[0] = '\0'; 
    17571801     idx=pFile->iAtt5.iCurrentIDX; 
    17581802     iRet=0; 
     
    17841828       } 
    17851829       strcpy(pName, iname); 
     1830       free(iname); 
    17861831       iname = NULL; 
    1787        free(iname); 
    17881832     } else { 
    17891833       strcpy(pName,"What is this?"); 
     
    18191863   { 
    18201864     pNexusFile5 pFile; 
    1821      int iNew, iRet, vid; 
     1865     int iNew, iRet, vid, asize; 
    18221866     hid_t type, atype = -1, glob; 
    18231867     char pBuffer[256]; 
     
    18411885     if (type==H5T_C_S1) 
    18421886     { 
     1887        atype = H5Aget_type(pFile->iCurrentA); 
     1888        asize = H5Tget_size(atype); 
     1889        H5Tclose(atype); 
    18431890        atype=H5Tcopy(type); 
    18441891        H5Tset_size(atype,*datalen);   
     1892        // use these two lines and remove the strlen one to not force NULL termination 
     1893        // H5Tset_strpad(atype, H5T_STR_NULLPAD); 
     1894        // *datalen = asize; 
    18451895        iRet = H5Aread(pFile->iCurrentA, atype, data); 
    1846         *datalen=strlen(data); 
     1896        *datalen = strlen((char*)data); 
    18471897     } else { 
    18481898       iRet = H5Aread(pFile->iCurrentA, type, data); 
     
    19512001         
    19522002    pFile = NXI5assert (fid); 
    1953     NXI5KillAttDir (fid); 
     2003    NXI5KillAttDir (pFile); 
    19542004    return NX_OK; 
    19552005  } 
     
    19622012         
    19632013    pFile = NXI5assert (fid); 
    1964     NXI5KillDir (fid); 
     2014    NXI5KillDir (pFile); 
    19652015    return NX_OK; 
    19662016  } 
  • tags/4.2.0/src/nxio.c

    r1896 r1896  
    228228 actual stuff for implementing the callback functions 
    229229 =====================================================================*/ 
     230 
     231/* 
     232 * if passed NX_CHAR, then returns dimension of -1 and the caller 
     233 * needs to do a strlen() or equivalent  
     234 */ 
    230235void analyzeDim(const char *typeString, int *rank,  
    231236                            int *iDim, int *type){ 
    232237  char dimString[132]; 
    233238  char dim[20]; 
    234   char *dimStart, *dimEnd; 
     239  const char *dimStart, *dimEnd; 
     240  char* dimTemp; 
    235241  int myRank; 
    236242 
    237243  if(strchr(typeString,(int)'[') == NULL){ 
     244    *rank = 1; 
    238245    switch(*type){ 
    239246    case NX_INT8: 
     
    250257      break; 
    251258    case NX_CHAR: 
    252       iDim[0] = -1; 
     259      iDim[0] = -1;     /* length unknown, caller needs to determine later */ 
     260      break; 
     261    default: 
     262      mxml_error("ERROR: (analyzeDim) unknown type code %d for typeString %s", *type, typeString); 
    253263      break; 
    254264    } 
     
    270280    memset(dimString,0,132); 
    271281    memcpy(dimString,dimStart,(dimEnd-dimStart)*sizeof(char)); 
    272     dimStart = stptok(dimString,dim,19,","); 
     282    dimTemp = stptok(dimString,dim,19,","); 
    273283    myRank = 0; 
    274     while(dimStart != NULL){ 
     284    while(dimTemp != NULL){ 
    275285      iDim[myRank] = atoi(dim); 
    276       dimStart = stptok(dimStart,dim,19,","); 
     286      dimTemp = stptok(dimTemp,dim,19,","); 
    277287      myRank++; 
    278288    } 
     
    281291} 
    282292/*--------------------------------------------------------------------*/ 
    283 int translateTypeCode(char *code){ 
     293int translateTypeCode(const char *code){ 
    284294  int i, result = -1; 
    285295   
     
    292302  return result; 
    293303} 
     304 
     305/*  
     306 * This is used to locate an Idims node from the new style table data layout 
     307 */ 
     308static mxml_node_t* findDimsNode(mxml_node_t *node) 
     309{ 
     310    mxml_node_t *tnode = NULL; 
     311    const char* name = node->value.element.name; 
     312    if ( (node->parent != NULL) && !strcmp(node->parent->value.element.name, DATA_NODE_NAME) ) 
     313    { 
     314        tnode = mxmlFindElement(node->parent->parent, node->parent->parent, DIMS_NODE_NAME, NULL, NULL, MXML_DESCEND_FIRST); 
     315        if (tnode != NULL) 
     316        { 
     317            tnode = mxmlFindElement(tnode,tnode,name,NULL,NULL,MXML_DESCEND_FIRST); 
     318        } 
     319    } 
     320    return tnode; 
     321} 
     322 
    294323/*---------------------------------------------------------------------*/ 
    295 static void analyzeDataType(mxml_node_t *parent, int *rank, int *type, 
     324/*return 1 if in table mode , 0 if not */ 
     325static int analyzeDataType(mxml_node_t *parent, int *rank, int *type, 
    296326                            int *iDim){ 
    297327  const char *typeString; 
     328  mxml_node_t* tnode; 
    298329  mxml_type_t myType; 
    299330  int i, nx_type = -1; 
     331  int table_mode = 0; 
    300332 
    301333  *rank = 1; 
     
    306338    get the type attribute. No attribute means: plain text 
    307339  */  
     340  tnode = findDimsNode(parent); 
     341  if (tnode != NULL) 
     342  { 
     343        table_mode = 1; 
     344        parent = tnode; 
     345  } 
    308346  typeString = mxmlElementGetAttr(parent,TYPENAME); 
    309347  if(typeString == NULL){ 
    310     return; 
     348    return table_mode; 
    311349  } 
    312350 
     
    321359     typeString); 
    322360    *type =NX_CHAR; 
    323     return; 
     361    return table_mode; 
    324362  } 
    325363 
     
    327365   
    328366  analyzeDim(typeString, rank, iDim, type); 
     367  if (table_mode) 
     368  { 
     369        *rank = 1; 
     370        iDim[0] = 1; 
     371  } 
     372  return table_mode; 
    329373} 
    330374/*-------------------------------------------------------------------*/ 
     
    359403mxml_type_t nexusTypeCallback(mxml_node_t *parent){ 
    360404  const char *typeString; 
     405  mxml_node_t * tnode; 
    361406 
    362407  if(strstr(parent->value.element.name,"?xml") != NULL || 
    363      strstr(parent->value.element.name,"NX") != NULL){ 
     408     !strncmp(parent->value.element.name,"NX",2) || 
     409     !strcmp(parent->value.element.name,DATA_NODE_NAME) || 
     410     !strcmp(parent->value.element.name,DIMS_NODE_NAME)){ 
    364411    return MXML_ELEMENT; 
    365412  } else { 
     413    /* data nodes do not habe TYPENAME in table style but are always CUSTOM */ 
     414    if (parent->parent != NULL && !strcmp(parent->parent->value.element.name, DATA_NODE_NAME)) 
     415    { 
     416        return MXML_CUSTOM; 
     417    } 
     418    if (parent->parent != NULL && !strcmp(parent->parent->value.element.name, DIMS_NODE_NAME)) 
     419    { 
     420        return MXML_OPAQUE; 
     421    } 
    366422    typeString = mxmlElementGetAttr(parent,TYPENAME); 
    367423    if(typeString == NULL){ 
     
    387443  long address, maxAddress; 
    388444  pNXDS dataset = NULL; 
    389   int i; 
     445  int i, table_mode; 
    390446 
    391447  parent = node->parent; 
    392   analyzeDataType(parent,&rank,&type,iDim); 
    393   if(iDim[0] == -1){ 
     448  table_mode = analyzeDataType(parent,&rank,&type,iDim); 
     449  if(iDim[0] == -1 || !strcmp(parent->parent->value.element.name, DIMS_NODE_NAME)){ 
    394450    iDim[0] = strlen(buffer); 
    395451    node->value.custom.data = strdup(buffer); 
     
    476532  char *buffer, *bufPtr; 
    477533  pNXDS dataset; 
    478   int bufsize, i, length, currentLen;  
    479  
     534  int bufsize, i, length, currentLen, table_style = 0;  
     535  int is_definition = 0; 
     536  /* this is set by nxconvert when making a definiton */ 
     537  is_definition = (getenv("NX_IS_DEFINITION") != NULL); 
     538 
     539  if (!strcmp(node->parent->parent->value.element.name, DATA_NODE_NAME)) 
     540  { 
     541        table_style = 1; 
     542  } 
    480543  /* 
    481544    allocate output buffer 
     
    505568  */ 
    506569  type = getNXDatasetType(dataset); 
    507   length = getNXDatasetLength(dataset); 
     570  if (is_definition) { 
     571    length = 1; 
     572  } else { 
     573    length = getNXDatasetLength(dataset); 
     574  } 
    508575  if(dataset->format != NULL){ 
    509576    strcpy(format,dataset->format); 
     
    515582    actually get the data out 
    516583  */ 
    517   currentLen = col; 
    518   myxml_add_char('\n',&bufPtr,&buffer,&bufsize); 
    519   stringIntoBuffer(&buffer,&bufPtr,&bufsize,indent); 
    520   for(i = 0; i < length; i++){ 
    521     formatNumber(getNXDatasetValueAt(dataset,i),pNumber,79,format,type); 
    522     if(currentLen + strlen(pNumber) > MXML_WRAP){ 
    523       /* 
    524         wrap line 
    525       */ 
     584  if (table_style) 
     585  { 
     586      for(i = 0; i < length; i++){ 
     587        formatNumber(getNXDatasetValueAt(dataset,i),pNumber,79,format,type); 
     588        stringIntoBuffer(&buffer,&bufPtr,&bufsize,pNumber); 
     589      } 
     590  } 
     591  else 
     592  { 
     593      currentLen = col; 
    526594      myxml_add_char('\n',&bufPtr,&buffer,&bufsize); 
    527595      stringIntoBuffer(&buffer,&bufPtr,&bufsize,indent); 
    528       currentLen = col; 
    529     } 
    530     stringIntoBuffer(&buffer,&bufPtr,&bufsize,pNumber); 
    531     myxml_add_char(' ',&bufPtr,&buffer,&bufsize); 
    532     currentLen += strlen(pNumber) + 1; 
     596      for(i = 0; i < length; i++){ 
     597        formatNumber(getNXDatasetValueAt(dataset,i),pNumber,79,format,type); 
     598        if(currentLen + strlen(pNumber) > MXML_WRAP){ 
     599          /* 
     600            wrap line 
     601          */ 
     602          myxml_add_char('\n',&bufPtr,&buffer,&bufsize); 
     603          stringIntoBuffer(&buffer,&bufPtr,&bufsize,indent); 
     604          currentLen = col; 
     605        } 
     606        stringIntoBuffer(&buffer,&bufPtr,&bufsize,pNumber); 
     607        myxml_add_char(' ',&bufPtr,&buffer,&bufsize); 
     608        currentLen += strlen(pNumber) + 1; 
     609      } 
    533610  } 
    534611  myxml_add_char('\0',&bufPtr,&buffer,&bufsize); 
     
    543620    return 0; 
    544621  } 
     622  if(strcmp(node->value.element.name,DIMS_NODE_NAME) == 0){ 
     623    return 0; 
     624  } 
     625  if(strcmp(node->value.element.name,DATA_NODE_NAME) == 0){ 
     626    return 0; 
     627  } 
    545628  if(strcmp(node->value.element.name,"NAPIlink") == 0){ 
    546629    return 0; 
     
    551634static int isTextData(mxml_node_t *node){ 
    552635  const char *attr = NULL; 
    553   int rank, type = 0, iDim[NX_MAXRANK]; 
    554636 
    555637  if(!isDataNode(node)){ 
     
    563645    return 1; 
    564646  } 
    565   analyzeDim(attr,&rank,iDim,&type); 
    566   if(type == NX_CHAR){ 
     647  if(strstr(attr,"NX_CHAR") != NULL){ 
    567648    return 1; 
    568649  } else { 
     
    580661 
    581662  if(strstr(node->value.element.name,"?xml") != NULL){ 
     663    return NULL; 
     664  } 
     665  if (node->parent != NULL && !strcmp(node->parent->value.element.name, DATA_NODE_NAME)) 
     666  { 
     667    return NULL; 
     668  } 
     669  if (where == MXML_WS_BEFORE_CLOSE && !strcmp(node->value.element.name, DATA_NODE_NAME)) 
     670  { 
    582671    return NULL; 
    583672  } 
  • tags/4.2.0/src/napi_exports.h

    r1896 r1896  
    256256    return NXmakenamedlink(fid, newname, pLink); 
    257257} 
     258 
     259NXstatus CALL_MODE NXIGETRAWINFO(NXhandle handle, int* rank, int dimension[], int* datatype) 
     260{ 
     261    return NXgetrawinfo(handle, rank, dimension, datatype); 
     262} 
     263 
  • tags/4.2.0/src/nxio.h

    r1896 r1896  
    3030#define TYPENAME "NAPItype" 
    3131 
     32#define DIMS_NODE_NAME "columns" 
     33#define DATA_NODE_NAME "row" 
     34 
    3235mxml_type_t nexusTypeCallback(mxml_node_t *parent); 
    3336const char *NXwhitespaceCallback(mxml_node_t *node, int where); 
     
    3942void getNumberText(int nx_type, char *typestring, int typeLen); 
    4043void destroyDataset(void *data); 
    41 int translateTypeCode(char *code); 
     44int translateTypeCode(const char *code); 
    4245int isDataNode(mxml_node_t *node); 
    4346void analyzeDim(const char *typeString, int *rank,  
  • tags/4.2.0/src/nexus_symbols_win.txt

    r1896 r1896  
    2222NXIGETNEXTATTR@16 
    2323NXIGETNEXTENTRY@16 
     24NXIGETRAWINFO@16 
    2425NXIGETSLAB@16 
    2526NXIINITATTRDIR@4 
  • tags/4.2.0/src/stptok.c

    r1896 r1896  
    1313#include <string.h> 
    1414#include <stdlib.h> 
     15#include "nx_stptok.h" 
    1516 
    1617char *stptok(const char *s, char *tok, size_t toklen, char *brk) 
     
    3839} 
    3940/*---------------------------------------------------------------------------*/ 
    40  char *SkipSpace(char *pText) 
     41 static char *SkipSpace(char *pText) 
    4142 { 
    4243   char *pRes; 
  • tags/4.2.0/src/napi.c

    r1896 r1896  
    3636#include "nxstack.h" 
    3737 
     38/** 
     39 * \mainpage NeXus API documentation 
     40 * \section sec_purpose Purpose of API 
     41 * The NeXus Application Program Interface is a suite of subroutines, written in C but with wrappers in Fortran 77 and 90.  
     42 *  The subroutines call HDF routines to read and write the NeXus files with the correct structure.  
     43 * An API serves a number of useful purposes:  
     44 * - It simplifies the reading and writing of NeXus files.  
     45 * - It ensures a certain degree of compliance with the NeXus standard.  
     46 * - It allows the development of sophisticated input/output features such as automatic unit conversion. This has not been implemented yet.  
     47 * - It hides the implementation details of the format. In particular, the API can read and write HDF4,  
     48     HDF5 (and shortly XML) files using the same routines.  
     49 * For these reasons, we request that all NeXus files are written using the supplied API. We cannot be  
     50 * sure that anything written using the underlying HDF API will be recognized by NeXus-aware utilities.  
     51 * 
     52 * \section sec_core Core API 
     53 * The core API provides the basic routines for reading, writing and navigating NeXus files. It is designed to be modal;  
     54 * there is a hidden state that determines which groups and data sets are open at any given moment, and  
     55 * subsequent operations are implicitly performed on these entities. This cuts down the number of parameters  
     56 * to pass around in API calls, at the cost of forcing a certain pre-approved mode d'emploi. This mode d'emploi  
     57 * will be familiar to most: it is very similar to navigating a directory hierarchy; in our case, NeXus groups are the  
     58 * directories, which contain data sets and/or other directories.  
     59 * 
     60 * The core API comprises several functional groups which are listed on the \b Modules tab  
     61 * 
     62 * C programs that call the above routines should include the following header file:  
     63 * \code 
     64 * #include "napi.h" 
     65 * \endcode 
     66 */ 
     67 
     68 
     69 
    3870/*--------------------------------------------------------------------- 
    3971 Recognized and handled napimount URLS 
     
    5486#define PATHSEP "/" 
    5587#endif 
    56 extern char *stptok(char *s, char *tok, size_t toklen, char *brk); 
     88 
     89#include "nx_stptok.h" 
     90 
    5791/*--------------------------------------------------------------------- 
    5892 wrapper for getenv. This is a future proofing thing for porting to OS 
     
    93127  while(pPtr != NULL){ 
    94128    length = strlen(pathPrefix) + strlen(startName) + strlen(PATHSEP) + 2; 
    95     testPath = malloc(length*sizeof(char)); 
     129    testPath = (char*)malloc(length*sizeof(char)); 
    96130    if(testPath == NULL){ 
    97131      return strdup(startName); 
     
    251285  NXhandle hfile; 
    252286 
     287  *gHandle = NULL; 
    253288  fileStack = makeFileStack(); 
    254289  if(fileStack == NULL){ 
     
    275310    char error[1024]; 
    276311    char *filename = NULL; 
     312    int my_am = (am & NXACCMASK_REMOVEFLAGS); 
    277313         
    278314    /* configure fortify  
     
    297333    if(am & NXACC_NOSTRIP){ 
    298334      fHandle->stripFlag = 0; 
    299       am -= NXACC_NOSTRIP; 
    300     } 
    301  
    302     if (am==NXACC_CREATE) { 
     335      am = (NXaccess)(am & ~NXACC_NOSTRIP); 
     336    } 
     337 
     338    if (my_am==NXACC_CREATE) { 
    303339      /* HDF4 will be used ! */ 
    304340      hdf_type=1; 
    305341      filename = strdup(userfilename); 
    306     } else if (am==NXACC_CREATE4) { 
     342    } else if (my_am==NXACC_CREATE4) { 
    307343      /* HDF4 will be used ! */ 
    308344      hdf_type=1;    
    309345      filename = strdup(userfilename); 
    310     } else if (am==NXACC_CREATE5) { 
     346    } else if (my_am==NXACC_CREATE5) { 
    311347      /* HDF5 will be used ! */ 
    312348      hdf_type=2;    
    313349      filename = strdup(userfilename); 
    314     } else if (am==NXACC_CREATEXML) { 
     350    } else if (my_am==NXACC_CREATEXML) { 
    315351      /* XML will be used ! */ 
    316352      hdf_type=3;    
     
    422458    int status; 
    423459    pFileStack fileStack = NULL; 
    424     
    425460    pNexusFunction pFunc=NULL; 
     461    if (*fid == NULL) 
     462    { 
     463        return NX_OK; 
     464    } 
    426465    fileStack = (pFileStack)*fid; 
    427466    pFunc = peekFileOnStack(fileStack); 
     
    433472    if(fileStackDepth(fileStack) < 0){ 
    434473      killFileStack(fileStack); 
    435     } 
     474      *fid = NULL; 
     475    } 
     476    /* we can't set fid to NULL always as the handle points to a stack of files for external file support */ 
    436477    /*  
    437478    Fortify_CheckAllMemory(); 
    438479    */ 
     480 
    439481    return status;    
    440482  } 
     
    613655  { 
    614656    pNexusFunction pFunc = handleToNexusFunc(fid); 
    615     return pFunc->nxputattr(pFunc->pNexusData, name, data, datalen, iType); 
     657    if (datalen > 1 && iType != NX_CHAR) 
     658    { 
     659        NXIReportError(NXpData,"NXputattr: numeric arrays are not allowed as attributes - only character strings and single numbers"); 
     660        return NX_ERROR; 
     661    } 
     662    else 
     663    { 
     664        return pFunc->nxputattr(pFunc->pNexusData, name, data, datalen, iType); 
     665    } 
    616666  } 
    617667 
     
    807857    return status; 
    808858  } 
    809      
     859/*---------------------------------------------------------------------------*/ 
     860  NXstatus  NXgetrawinfo (NXhandle fid, int *rank,  
     861                                    int dimension[], int *iType) 
     862  { 
     863    int status; 
     864    char *pPtr = NULL; 
     865 
     866    pNexusFunction pFunc = handleToNexusFunc(fid); 
     867    status = pFunc->nxgetinfo(pFunc->pNexusData, rank, dimension, iType); 
     868    return status; 
     869  } 
    810870  /*-------------------------------------------------------------------------*/ 
    811871  
     
    9541014} 
    9551015/*------------------------------------------------------------------------*/ 
    956 NXstatus  NXisexternalgroup(NXhandle fid, CONSTCHAR *name, CONSTCHAR *class,  
     1016NXstatus  NXisexternalgroup(NXhandle fid, CONSTCHAR *name, CONSTCHAR *nxclass,  
    9571017                            char *url, int urlLen){ 
    9581018  int status, attStatus, length = 1023, type = NX_CHAR; 
     
    9621022  pNexusFunction pFunc = handleToNexusFunc(fid); 
    9631023 
    964   status = pFunc->nxopengroup(pFunc->pNexusData, name,class); 
     1024  status = pFunc->nxopengroup(pFunc->pNexusData, name,nxclass); 
    9651025  if(status != NX_OK){ 
    9661026    return status; 
     
    9841044} 
    9851045/*------------------------------------------------------------------------*/ 
    986 NXstatus  NXlinkexternal(NXhandle fid, CONSTCHAR *name, CONSTCHAR *class,  
     1046NXstatus  NXlinkexternal(NXhandle fid, CONSTCHAR *name, CONSTCHAR *nxclass,  
    9871047                         CONSTCHAR *url){ 
    9881048  int status, type = NX_CHAR, length; 
    9891049  pNexusFunction pFunc = handleToNexusFunc(fid); 
    9901050 
    991   status = pFunc->nxopengroup(pFunc->pNexusData,name,class); 
     1051  status = pFunc->nxopengroup(pFunc->pNexusData,name,nxclass); 
    9921052  if(status != NX_OK){ 
    9931053    return status; 
     
    13531413        if (gmt_offset < 0) 
    13541414        { 
    1355             time_format = "%04d-%02d-%02d %02d:%02d:%02d-%02d%02d"; 
     1415            time_format = "%04d-%02d-%02dT%02d:%02d:%02d-%02d:%02d"; 
    13561416        } 
    13571417        else 
    13581418        { 
    1359             time_format = "%04d-%02d-%02d %02d:%02d:%02d+%02d%02d"; 
     1419            time_format = "%04d-%02d-%02dT%02d:%02d:%02d+%02d:%02d"; 
    13601420        } 
    13611421        sprintf(time_buffer, time_format, 
     
    13721432    else 
    13731433    { 
    1374         strcpy(time_buffer, "1970-01-01 00:00:00+0000"); 
     1434        strcpy(time_buffer, "1970-01-01T00:00:00+00:00"); 
    13751435    } 
    13761436    return time_buffer; 
  • tags/4.2.0/src/Makefile.am

    r1896 r1896  
    4141 
    4242if HAVE_XML 
    43 XMLSRC = nxxml.c nxio.c nxio.h nxdataset.h nxdataset.c 
     43XMLSRC = nxxml.c nxio.c nxio.h 
    4444endif 
    4545##  the LIBS variable should contain all needed libs for the HDF support 
     
    7676#SUBDIRS=nxdict 
    7777 
    78 libNeXus_la_SOURCES = napi.c napiu.c nxstack.c nxstack.h stptok.c $(H4SRC) $(H5SRC) $(XMLSRC) $(MINGW_SRC) 
     78libNeXus_la_SOURCES = napi.c napiu.c nxstack.c nxstack.h stptok.c nxdataset.c nxdataset.h nx_stptok.h $(H4SRC) $(H5SRC) $(XMLSRC) $(MINGW_SRC) 
    7979libNeXus_la_LDFLAGS = -export-symbols nexus_symbols.sym @SHARED_LDFLAGS@ @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 
    8080libNeXus_la_DEPENDENCIES = nexus_symbols.sym 
     
    9393## endif 
    9494 
    95 EXTRA_DIST=nexus_symbols.txt nexus_symbols_win.txt 
     95EXTRA_DIST=nexus_symbols.txt nexus_symbols_win.txt SConscript 
    9696CLEANFILES=libNeXus.def libNeXus.dll.lib libNeXus.dll.exp nexus_symbols.sym 
    9797 
  • tags/4.2.0/src/nxdataset.c

    r1896 r1896  
    4747    length *= dim[i]; 
    4848  } 
    49   pNew->u.ptr = malloc(length*getTypeSize(typecode)); 
     49  /* add +1 in case of string NULL termination */ 
     50  pNew->u.ptr = malloc(length*getTypeSize(typecode)+1); 
    5051 
    5152  if(pNew->dim == NULL || pNew->u.ptr == NULL){ 
     
    6061  } 
    6162  pNew->magic = MAGIC; 
    62   memset(pNew->u.ptr,0,length*getTypeSize(typecode)); 
     63  /* add +1 in case of string NULL termination  - see above */ 
     64  memset(pNew->u.ptr,0,length*getTypeSize(typecode)+1); 
    6365  return pNew; 
    6466} 
  • tags/4.2.0/src/napi_exports2.c

    r1896 r1896  
    88 
    99#define CALL_MODE       __cdecl 
     10 
     11#ifdef __cplusplus 
     12extern "C" { 
     13#endif /* __cplusplus */ 
     14 
    1015#include "napi_exports.h" 
     16 
     17#ifdef __cplusplus 
     18} 
     19#endif /* __cplusplus */ 
     20 
  • tags/4.2.0/bindings/Makefile.am

    r1896 r1896  
    2727# 
    2828#==================================================================== 
     29if HAVE_CPP 
     30CPPSUB = cpp 
     31endif 
    2932if HAVE_F77 
    3033F77SUB = f77 
     
    3942SWIGSUB = swig 
    4043endif 
    41 SUBDIRS = $(F77SUB) $(F90SUB) $(JAVASUB) $(SWIGSUB) 
     44if HAVE_IDL 
     45IDLSUB = idl 
     46endif 
     47if HAVE_PYTHON 
     48PYSUB = python 
     49endif 
     50SUBDIRS = $(CPPSUB) $(F77SUB) $(F90SUB) $(JAVASUB) $(SWIGSUB) $(IDLSUB) $(PYSUB) 
  • tags/4.2.0/bindings/swig/Makefile.am

    r1896 r1896  
    2828# 
    2929#==================================================================== 
    30 AM_CPPFLAGS=-I$(top_srcdir)/include 
     30AM_CPPFLAGS=-I$(top_srcdir)/include -I$(top_srcdir)/src 
    3131lib_LTLIBRARIES=$(LIBNXTCL) $(LIBNXSCHEME) $(LIBNXGUILE) # $(LIBNXPERL) 
    32 python_LTLIBRARIES=$(LIBNXPYTHON) 
    3332bin_PROGRAMS=$(NXINTER) $(NXGUILE) 
    3433 
    35 # python wrapper 
    36 if HAVE_SWIG 
    37 if HAVE_PYTHON 
    38 NXPYTHONWRAP=nxpython.py 
    39 nodist_python_PYTHON=$(NXPYTHONWRAP) 
    40 LIBNXPYTHON=libnxpython.la 
    41 libnxpython_la_SOURCES=$(COMMON_SRC) 
    42 nodist_libnxpython_la_SOURCES=$(PYTHONWRAP) 
    43 libnxpython_la_CFLAGS=-I$(PYTHONROOT)/include/python$(PYTHON_VERSION) -I$(PYTHONROOT)/include $(CFLAGS) 
    44 libnxpython_la_LDFLAGS=-L$(PYTHONROOT)/lib/python$(PYTHON_VERSION)/config -lpython$(PYTHON_VERSION) $(top_builddir)/src/libNeXus.la @SHARED_LDFLAGS@ $(LDFLAGS) 
    45 PYTHONWRAP=nxpython_wrap.c 
    46 endif 
    47 nxpython_wrap.c: nxinter.i nxdataset.i 
    48         $(SWIG) -I$(srcdir) -o $@ -python -module nxpython -interface libnxpython nxinter.i  
    49 endif 
     34# old python wrapper 
     35#python_LTLIBRARIES=$(LIBNXPYTHON) 
     36#if HAVE_SWIG 
     37#if HAVE_PYTHON 
     38#NXPYTHONWRAP=nxpython.py 
     39#nodist_python_PYTHON=$(NXPYTHONWRAP) 
     40#LIBNXPYTHON=libnxpython.la 
     41#libnxpython_la_SOURCES=$(COMMON_SRC) 
     42#nodist_libnxpython_la_SOURCES=$(PYTHONWRAP) 
     43#libnxpython_la_CFLAGS=-I$(PYTHONROOT)/include/python$(PYTHON_VERSION) -I$(PYTHONROOT)/include $(CFLAGS) 
     44#libnxpython_la_LDFLAGS=-L$(PYTHONROOT)/lib/python$(PYTHON_VERSION)/config -lpython$(PYTHON_VERSION) $(top_builddir)/src/libNeXus.la @SHARED_LDFLAGS@ $(LDFLAGS) 
     45#PYTHONWRAP=nxpython_wrap.c 
     46#endif 
     47#nxpython_wrap.c: nxinter.i nxdataset.i 
     48#       $(SWIG) -I$(srcdir) -o $@ -python -module nxpython -interface libnxpython nxinter.i  
     49#endif 
    5050 
    5151# perl wrapper (not working yet) 
     
    120120 
    121121DOC_SRC         = nxinter.tex 
    122 swigdocdir      = $(NXDOCDIR) 
    123 swigdoc_DATA    = $(DOC_OUTPUT) 
    124122if HAVE_LATEX 
    125123DOC_OUTPUT=nxinter.ps nxinter.pdf 
     
    128126        latex nxinter.tex 
    129127        dvips -f nxinter.dvi > nxinter.ps 
     128 
     129nxinter.pdf : nxinter.ps 
    130130        ps2pdf12 nxinter.ps nxinter.pdf 
    131131endif 
     132swigdocdir      = $(NXDOCDIR)/swig 
     133swigdoc_DATA    = $(DOC_OUTPUT) 
     134 
     135EXAMPLE_FILES = nxdstest.tcl nxexam.tcl nxintertest.tcl 
     136swigexampledir  = $(NXEXAMPLEDIR)/swig 
     137swigexample_DATA = $(EXAMPLE_FILES) 
    132138 
    133139include $(top_srcdir)/build_rules.am 
    134140 
    135 # if we have XML support, we already have nxdataset unless 
    136 # we are on windows when it is hidden 
    137 if HAVE_XML 
    138 if MINGW_MSYS 
    139 NXDATASET=nxdataset.c 
    140 endif 
    141 else 
    142 NXDATASET=nxdataset.c 
    143 endif 
     141COMMON_SRC=nxinterhelper.c 
    144142 
    145 COMMON_SRC=nxinterhelper.c $(NXDATASET) 
    146  
    147 EXTRA_DIST=nxinter.i nxdataset.i nxdataset.h nxinterhelper.h \ 
    148                 $(DOC_OUTPUT) $(DOC_SRC) nxpython_test.py 
     143EXTRA_DIST=nxinter.i nxdataset.i nxinterhelper.h \ 
     144                $(DOC_OUTPUT) $(DOC_SRC) $(EXAMPLE_FILES) 
    149145 
    150146BUILT_SOURCES=$(TCLWRAP) $(GUILEWRAP) $(PYTHONWRAP) $(SCHEMEWRAP) $(NXPYTHONWRAP) 
  • tags/4.2.0/bindings/java/org/nexusformat/NexusFile.java

    r1896 r1896  
    3737    public final static int NXACC_CREATE5 = 5; 
    3838    public final static int NXACC_CREATEXML = 6; 
     39    public final static int NXACC_NOSTRIP = 128; 
    3940     
    4041    /** 
     
    125126      * <DD>For opening a file for reading. 
    126127      * </dl> 
     128      * <DT>NXACC_NOSTRIP 
     129      * <DD>To keep leading and trailing whitespace on strings 
     130      * </dl> 
    127131      * @exception NexusException when the file could not be found or 
    128132      * an HDF error occurred. 
     
    448452    protected native void nxputdata(int handle, byte array[]);  
    449453    protected native void nxputslab(int handle, byte array[],  
    450                                     int start[],int end[]);  
     454                                    int start[],int size[]);  
    451455    protected native void nxputattr(int handle, String name, 
    452456                                    byte array[], int type);  
     
    480484      * @param start An integer array of dimension rank which holds the 
    481485      * startcoordinates of the data subset in the larger dataset. 
    482       * @param end An integer array of dimension rank which holds the 
     486      * @param size An integer array of dimension rank which holds the 
    483487      * size in each dimension of the data subset to write. 
    484488      * @exception NexusException when an HDF error occurs. 
    485489      */  
    486     public void putslab(Object array, int start[], int end[]) throws 
     490    public void putslab(Object array, int start[], int size[]) throws 
    487491                          NexusException 
    488492    { 
     
    497501           throw new NexusException(he.getMessage()); 
    498502       } 
    499        nxputslab(handle,data,start,end); 
     503       nxputslab(handle,data,start,size); 
    500504       data = null; 
    501505    } 
  • tags/4.2.0/configure.ac

    r1896 r1896  
    2929dnl 
    3030 
    31 AC_PREREQ(2.52) 
     31AC_PREREQ(2.61) 
    3232AC_REVISION($Revision$) 
    33 AC_INIT([NeXus Library], [4.1.0], [nexus-developers@nexusformat.org], [nexus]) 
    34 AC_COPYRIGHT([Copyright (C) 2004 Freddie Akeroyd  
     33AC_INIT([NeXus Library], [4.2.0], [nexus-developers@nexusformat.org], [nexus]) 
     34AC_COPYRIGHT([Copyright (C) 2004 NeXus International Advisory Committee 
    3535This software is covered by the GNU LESSER GENERAL PUBLIC LICENSE 
    3636see file COPYING for further information]) 
     
    3939AC_CONFIG_SRCDIR([src/napi.c]) 
    4040AC_CANONICAL_TARGET 
     41AC_CANONICAL_BUILD 
    4142 
    4243dnl $EGREP is used in macros included from acinclude.m4 
     
    5859 
    5960AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug],[Turn off optimisation]), [enable_debug=$enableval],[enable_debug=no]) 
     61 
     62AC_ARG_ENABLE([32bit], AC_HELP_STRING([--enable-32bit],[build 32bit binary on 64 bit computer]), [enable_32bit=$enableval],[enable_32bit=no]) 
    6063 
    6164dnl Checks for programs. 
     
    7780else 
    7881        CXX= 
     82fi 
     83 
     84AC_ARG_WITH([f77], AC_HELP_STRING([--with-f77=f77 compiler], [Specify name of FORTRAN 77 compiler]), 
     85        [with_f77=$withval], [with_f77=no]) 
     86if test x"$with_f77" != x"no" ; then 
     87        if test x"$with_f77" != x"yes" ; then F77="$with_f77"; fi 
     88        AC_PROG_F77 
     89        dnl Check FORTRAN compiler options 
     90        dnl     AC_CHECK_F77_OPTION([-Wno-globals]) 
     91        dnl     AC_CHECK_F77_OPTION([-fno-common])  # use with caution 
     92        mytop=`pwd` 
     93        dnl get right F77 include option 
     94        AC_CHECK_F77_OPTION([-I$mytop/bindings/f77],[      INCLUDE 'napif.inc']) 
     95        AC_F77_LIBRARY_LDFLAGS 
     96else 
     97        F77= 
    7998fi 
    8099 
     
    103122fi 
    104123 
    105 AC_ARG_WITH([f77], AC_HELP_STRING([--with-f77=f77 compiler], [Specify name of FORTRAN 77 compiler]), 
    106         [with_f77=$withval], [with_f77=no]) 
    107 if test x"$with_f77" != x"no" ; then 
    108         if test x"$with_f77" != x"yes" ; then F77="$with_f77"; fi 
    109         AC_PROG_F77 
    110         dnl Check FORTRAN compiler options 
    111         dnl     AC_CHECK_F77_OPTION([-Wno-globals]) 
    112         dnl     AC_CHECK_F77_OPTION([-fno-common])  # use with caution 
    113         mytop=`pwd` 
    114         dnl get right F77 include option 
    115         AC_CHECK_F77_OPTION([-I$mytop/bindings/f77],[      INCLUDE 'napif.inc']) 
    116         AC_F77_LIBRARY_LDFLAGS 
    117 else 
    118         F77= 
    119 fi 
    120  
    121124java_host="linux" 
    122 javaroot="" 
    123 with_java=no 
     125JAVAROOT="" 
    124126AC_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]), 
    125127        [], [with_java_home=$withval]) 
    126128if test -d "$with_java_home"; then 
    127         javaroot="$with_java_home" 
    128         AC_MSG_NOTICE([Java SDK home is $javaroot]) 
    129         JAVAINCLUDE="-I$javaroot/include" 
    130         AC_PATH_PROGS(JAVAC,gcj javac,,[$javaroot/bin]) 
     129        JAVAROOT="$with_java_home" 
     130        AC_MSG_NOTICE([Java SDK home is $JAVAROOT]) 
     131        JAVAINCLUDE="-I$JAVAROOT/include" 
     132        AC_PATH_PROGS(JAVAC,gcj javac,,[$JAVAROOT/bin]) 
    131133        if test `basename "$JAVAC"` = "gcj"; then 
    132134            JAVACFLAGS="-C"     # force creation of .class files 
    133135        fi 
    134         AC_PATH_PROGS(JAVA,gij java,,[$javaroot/bin]) 
    135         AC_PATH_PROGS(JAVAH,gcjh javah,,[$javaroot/bin]) 
    136         AC_PATH_PROGS(JAVADOC,javadoc,,[$javaroot/bin:$PATH]) 
    137         AC_PATH_PROGS(JAR,jar fastjar,,[$javaroot/bin:$PATH]) 
     136        AC_PATH_PROGS(JAVA,gij java,,[$JAVAROOT/bin]) 
     137        AC_PATH_PROGS(JAVAH,gcjh javah,,[$JAVAROOT/bin]) 
     138        AC_PATH_PROGS(JAVADOC,javadoc,,[$JAVAROOT/bin:$PATH]) 
     139        AC_PATH_PROGS(JAR,jar fastjar,,[$JAVAROOT/bin:$PATH]) 
    138140fi 
    139141 
     
    165167#       JAVAINCLUDE= 
    166168#fi 
     169 
     170AC_ARG_WITH([contrib], AC_HELP_STRING([--with-contrib=names_of_apps_to_build], [Specify a list of targets from the contrib directory to build]), 
     171        [CONTRIB=$withval], [CONTRIB=no]) 
     172AM_CONDITIONAL(BUILD_CONTRIB, [test "$CONTRIB" != "no"]) 
     173AC_SUBST(CBFLIBROOT) 
     174AC_ARG_WITH([cbflib], 
     175        AC_HELP_STRING([--with-cbflib=/path/to/cbflib], 
     176                       [Specify location of CBFLib files]), 
     177        [if test $withval != no; then CBFLIBROOT=$withval; fi]) 
     178AM_CONDITIONAL(HAVE_CBFLIB, [test "$CBFLIBROOT" != ""]) 
     179 
     180AC_SUBST(IDLROOT) 
     181AC_ARG_WITH([idlroot], 
     182        AC_HELP_STRING([--with-idlroot=/path/to/idlroot], 
     183                       [Specify root directory of system idl installation]), 
     184        [if test $withval != no; then IDLROOT=$withval; fi]) 
     185AM_CONDITIONAL(HAVE_IDL, [test "$IDLROOT" != ""]) 
     186 
     187IDLDLM="\${prefix}/lib" 
     188AC_SUBST(IDLDLM) 
     189AC_ARG_WITH([idldlm], 
     190        AC_HELP_STRING([--with-idldlm=/path/to/idldlm], 
     191                       [Specify location ito install idl dlm files to]), 
     192        [if test $withval != no; then IDLDLM=$withval; fi]) 
     193 
     194AC_ARG_WITH([doxygen], AC_HELP_STRING([--with-doxygen=/path/to/doxygen], [Specify path to doxygen]), [with_doxygen=$withval], [with_doxygen=no]) 
     195if test x"$with_doxygen" != x"no" ; then 
     196        if test x"$with_doxygen" != x"yes" ; then DOXYGEN="$with_doxygen"; fi 
     197        AC_CHECK_PROGS(DOXYGEN,[doxygen]) 
     198        AC_CHECK_PROGS(DOT,[dot]) 
     199        AC_CHECK_PROGS(PDFLATEX,[pdflatex]) 
     200        AC_PROG_CXX 
     201else 
     202        DOXYGEN= 
     203        PDFLATEX= 
     204        DOT= 
     205fi 
     206 
    167207AC_SUBST(FCFLAGS) 
    168208AC_SUBST(JAVACFLAGS) 
     
    180220 
    181221AM_PROG_GCJ 
     222AM_PROG_CC_C_O 
    182223 
    183224AC_PROG_LIBTOOL 
     
    198239if test x$with_python != xno; then 
    199240    AC_CHECK_ROOT([python],[PYTHONROOT],[/usr /usr/local],[bin/python]) 
    200     if test x$PYTHONROOT != x; then PYTHON=$PYTHONROOT/bin/python; fi 
     241    if test x$PYTHONROOT != x; then 
     242        if test -r "$PYTHONROOT/bin/python"; then PYTHON="$PYTHONROOT/bin/python"; fi 
     243        if test -r "$PYTHONROOT/python"; then PYTHON="$PYTHONROOT/python"; fi 
     244    fi 
    201245    AM_PATH_PYTHON(,, :) 
    202246fi 
    203247 
    204248AC_ARG_WITH([swig], AC_HELP_STRING([--with-swig=swig compiler], [Specify path of swig compiler]), [with_swig=$withval], [with_swig=]) 
    205 if test x$with_python != xno -o x$with_tcl != xno -o x$with_guile != xno; then 
     249if test x$with_tcl != xno -o x$with_guile != xno; then 
    206250    if test x$with_swig != xyes; then 
    207251        SWIG=$with_swig 
     
    217261AC_CHECK_PROGS(GUILE,[guile]) 
    218262AC_CHECK_PROGS(LATEX,[latex]) 
    219 AC_CHECK_PROGS(PDFLATEX,[pdflatex]) 
    220 AC_CHECK_PROGS(DOXYGEN,[doxygen]) 
    221 AC_CHECK_PROGS(DOT,[dot]) 
     263AC_CHECK_PROGS(WGET,[wget]) 
     264AC_CHECK_PROGS(XMLLINT,[xmllint]) 
    222265 
    223266 
     
    253296AM_CONDITIONAL(HAVE_MS_LIB, [test ! -z "$MS_LIB"]) 
    254297 
     298# strict aliasing causes issues with casts from NXmalloc() 
     299CFLAGS="-fno-strict-aliasing" 
     300CXXFLAGS="-fno-strict-aliasing" 
     301 
    255302# check for debug 
    256303if test "$enable_debug" = "yes"; then 
    257     CFLAGS="-O0 -g" 
    258     CXXFLAGS="-O0 -g" 
     304    CFLAGS="$CFLAGS -O0 -g" 
     305    CXXFLAGS="$CXXFLAGS -O0 -g" 
     306fi 
     307 
     308if test "$enable_32bit" = "yes"; then 
     309    CFLAGS="$CFLAGS -m32" 
     310    CXXFLAGS="$CXXFLAGS -m32" 
    259311fi 
    260312 
     
    296348 
    297349HDF_EXT=a # library file extent to look for with HDF libraries 
     350HDF5_EXT=so # library file extent to look for with HDF5 libraries 
    298351 
    299352AC_SUBST(LIBXML2_CFLAGS) 
    300353LIBXML2_CFLAGS='`xml2-config --cflags`' 
     354 
     355# set up for linux here - mac is covered in the case $host statement 
     356AS_CASE([$build_cpu], [x86|i386|i686], [IDLCPU=x86], [IDLCPU=$build_cpu]) 
     357if test $enable_32bit = yes; then 
     358    IDL_HOST="bin.linux.x86"    # force 32 bit on a 64 bit machine 
     359else 
     360    IDL_HOST="bin.linux.$IDLCPU" 
     361fi 
     362AC_SUBST(IDL_HOST) 
    301363 
    302364case $host in 
     
    316378        MINGW_MSYS=yes 
    317379        HDF_EXT=dll 
     380        HDF5_EXT=dll 
    318381        LIBXML2_CFLAGS=-I/usr/local/include 
    319382        java_host="win32" 
     
    330393        CFLAGS="$CFLAGS -g" 
    331394        FFLAGS="$FFLAGS -g" 
     395        HDF5_EXT=dylib 
    332396dnl This is a hack for libtool - for some reason the F77 tag 
    333397dnl does not get set with the commands to create a shared library 
     
    349413dnl           archive_cmds='$CC -dynamiclib -single_module' 
    350414dnl     fi 
     415        if test $enable_32bit = yes; then 
     416            IDL_HOST="bin.darwin.i386" # force 32bit build 
     417        else 
     418            IDL_HOST="bin.darwin.x86_64" 
     419        fi 
    351420        ;; 
    352421esac 
     
    354423if test ! -z "$JAVAINCLUDE" -a ! -z "$java_host"; then 
    355424# avoid adding /usr/include/linux to include path 
    356     if test "$javaroot" != "/usr" -a "$javaroot" != "/usr/"; then 
    357         JAVAINCLUDE="$JAVAINCLUDE -I$javaroot/include/$java_host" 
     425    if test "$JAVAROOT" != "/usr" -a "$JAVAROOT" != "/usr/"; then 
     426        JAVAINCLUDE="$JAVAINCLUDE -I$JAVAROOT/include/$java_host" 
    358427    fi 
    359428fi 
     
    375444        AC_HELP_STRING([--with-hdf4=/path/to/hdf4], 
    376445                       [Specify location of HDF4 files]), 
    377         [if test $withval != no; then H4ROOT=$withval; fi]) 
     446        [if test $withval != no -a $withval != yes; then H4ROOT=$withval; fi]) 
    378447AC_ARG_WITH([hdf5], 
    379448        AC_HELP_STRING([--with-hdf5=/path/to/hdf5], 
    380449                       [Specify location of HDF5 files]), 
    381         [if test $withval != no; then H5ROOT=$withval; fi]) 
     450        [if test $withval != no -a $withval != yes; then H5ROOT=$withval; fi]) 
    382451AC_ARG_WITH([xml], 
    383452        AC_HELP_STRING([--with-xml=/path/to/mxml], 
    384453                       [Specify location of MXML library files]), 
    385         [if test $withval != no; then MXMLROOT=$withval; fi]) 
     454        [if test $withval != no -a $withval != yes; then MXMLROOT=$withval; fi]) 
    386455dnl otherwise try and find HDF path, but not if 
    387456dnl e.g. --without-hdf4 has been specified (hence check on $with_hdf4 != no ) 
    388457dnl first HDF4 
    389 HDF4SEARCH="/usr/local/hdf4 /usr/local/hdf /usr/local /sw /usr" 
     458EXTRA_LDPATH="" 
     459EXTRA_LD_LIBRARY_PATH="" 
     460AC_SUBST(EXTRA_LD_LIBRARY_PATH) 
     461HDF4SEARCH="/usr/local/hdf4 /usr/local/hdf /usr/local /sw /opt/local /usr" 
    390462if test "$with_hdf4" != "no" -a -z "$H4ROOT"; then 
    391463    AC_MSG_CHECKING(for location of HDF4 libraries) 
     
    411483fi 
    412484if test "$H4ROOT"; then 
    413     H4VERSION=`grep LIBVER_STRING ${H4ROOT}/include/${H4INCSUBROOT}/hfile.h | cut -d '"' -f 2 | cut -d ' ' -f4,6 | tr ' ,' '. '` 
     485    H4MAJORVERSION=`grep LIBVER_MAJOR ${H4ROOT}/include/${H4INCSUBROOT}/hfile.h | awk '{ print $3}'` 
     486    H4MINORVERSION=`grep LIBVER_MINOR ${H4ROOT}/include/${H4INCSUBROOT}/hfile.h | awk '{ print $3}'` 
     487    H4RELEASE=`grep LIBVER_RELEASE ${H4ROOT}/include/${H4INCSUBROOT}/hfile.h | awk '{ print $3}'` 
     488    H4VERSION=$H4MAJORVERSION.$H4MINORVERSION.$H4RELEASE 
    414489    case $H4VERSION in 
    415490        4.[[12]]*)  
    416                 HDF4_LDFLAGS="-lmfhdf -ldf"; 
     491                HDF4_LDFLAGS=""; 
    417492                for j in lib lib64; do 
    418                     if test -d $H4ROOT/$j/$H4LIBSUBROOT; then HDF4_LDFLAGS="-L$H4ROOT/$j/$H4LIBSUBROOT $HDF4_LDFLAGS"; fi 
     493                    if test -d $H4ROOT/$j/$H4LIBSUBROOT; then  
     494                        HDF4_LDFLAGS="-L$H4ROOT/$j/$H4LIBSUBROOT $HDF4_LDFLAGS" 
     495                        EXTRA_LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:$H4ROOT/$j/$H4LIBSUBROOT 
     496                    fi 
    419497                done 
     498                EXTRA_LDPATH="$EXTRA_LDPATH $HDF4_LDFLAGS" 
     499                HDF4_LDFLAGS="$HDF4_LDFLAGS -lmfhdf -ldf"; 
    420500                if test -z "$H4INCSUBROOT"; then 
    421501                    HDF4_CPPFLAGS="-I$H4ROOT/include -DHDF4" 
     
    433513 
    434514dnl HDF5 
    435 HDF5SEARCH="/usr/local/hdf5 /usr/local/hdf /usr/local /sw /usr" 
     515HDF5SEARCH="/usr/local/hdf5 /usr/local/hdf /usr/local /sw /opt/local /usr" 
    436516if test "$with_hdf5" != "no" -a -z "$H5ROOT"; then 
    437517    AC_MSG_CHECKING(for location of HDF5 libraries) 
    438518    for i in $HDF5SEARCH; do 
    439519        for j in lib lib64; do 
    440             if test -z "$H5ROOT" -a -r ${i}/$j/libhdf5.$HDF_EXT; then H5ROOT=$i; fi 
     520            if test -z "$H5ROOT" -a -r ${i}/$j/libhdf5.$HDF5_EXT; then H5ROOT=$i; fi 
    441521        done 
    442522    done 
     
    450530    H5VERSION=`grep H5_VERS_INFO ${H5ROOT}/include/H5public.h | cut -d '"' -f 2 | cut -d ' ' -f 4` 
    451531    case $H5VERSION in 
    452         1.[[6]]*) 
    453                 HDF5_LDFLAGS="-lhdf5 -lz" 
     532        1.[[68]]*) 
     533                HDF5_LDFLAGS="" 
    454534                for j in lib lib64; do 
    455                     if test -d $H5ROOT/$j; then HDF5_LDFLAGS="-L$H5ROOT/$j $HDF5_LDFLAGS"; fi 
     535                    if test -d $H5ROOT/$j; then  
     536                        HDF5_LDFLAGS="-L$H5ROOT/$j $HDF5_LDFLAGS" 
     537                        EXTRA_LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:$H5ROOT/$j 
     538                    fi 
    456539                done 
    457                 HDF5_CPPFLAGS="-I$H5ROOT/include -DHDF5";; 
     540                EXTRA_LDPATH="$EXTRA_LDPATH $HDF5_LDFLAGS" 
     541                HDF5_LDFLAGS="$HDF5_LDFLAGS -lhdf5 -lz" 
     542                HDF5_CPPFLAGS="-I$H5ROOT/include -DHDF5 -DH5_USE_16_API";; 
    458543        *)      AC_MSG_WARN([The HDF 5 installation has not the right version ($H5VERSION). You need at least 1.6])  
    459544                H5ROOT="";; 
     
    480565    XML_LDFLAGS="-L$MXMLROOT/lib $XML_LDFLAGS" 
    481566    XML_CPPFLAGS="-I$MXMLROOT/include -DNXXML" 
     567# meed to allow for lib64 
     568#    EXTRA_LDPATH="$EXTRA_LDPATH $XML_LDFLAGS" 
     569#    export LD_LIBRARY_PATH=$MXMLROOT/lib:$LD_LIBRARY_PATH 
    482570fi 
    483571AC_SUBST(XML_LDFLAGS) 
    484572AC_SUBST(XML_CPPFLAGS) 
     573 
     574if test ! -z "$EXTRA_LDPATH"; then 
     575    LDFLAGS="$LDFLAGS $EXTRA_LDPATH" 
     576fi 
    485577if test -d /usr/local/lib; then 
    486578    LDFLAGS="$LDFLAGS -L/usr/local/lib" 
    487579fi 
     580# for Mac/fink when hdf and hdf5 are not taken from fink, but jpeg is 
     581if test -d /sw/lib; then 
     582    LDFLAGS="$LDFLAGS -L/sw/lib" 
     583fi 
     584# for Mac/Macports when you are not using fink at all. 
     585if test -d /opt/local/lib; then 
     586    LDFLAGS="$LDFLAGS -L/opt/local/lib" 
     587fi 
     588 
     589# remove initial : 
     590if test ! -z "$EXTRA_LD_LIBRARY_PATH"; then 
     591    EXTRA_LD_LIBRARY_PATH=`expr substr "$EXTRA_LD_LIBRARY_PATH" 2 1024` 
     592fi 
     593if test ! -z "$LD_LIBRARY_PATH"; then 
     594    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${EXTRA_LD_LIBRARY_PATH} 
     595else 
     596    export LD_LIBRARY_PATH=${EXTRA_LD_LIBRARY_PATH} 
     597fi 
     598 
    488599AC_SUBST(LIBG2C) 
    489600 
     
    499610AC_CHECK_LIB(rpc, xdr_float) 
    500611AC_CHECK_LIB(dl, dlopen) 
     612AC_CHECK_LIB(pthread, pthread_create) 
    501613AC_CHECK_LIB(z, gzopen) 
    502614AC_CHECK_LIB(jpeg, jpeg_CreateCompress) 
     
    509621dnl Checks for header files. 
    510622AC_HEADER_STDC 
    511 AC_CHECK_HEADERS([stdlib.h string.h]) 
     623AC_HEADER_SYS_WAIT 
     624AC_CHECK_HEADERS([stdlib.h string.h stdint.h]) 
    512625 
    513626dnl Checks for typedefs, structures, and compiler characteristics. 
    514627AC_C_CONST 
    515628AC_TYPE_SIZE_T 
     629AC_TYPE_INT8_T 
     630AC_TYPE_UINT8_T 
     631AC_TYPE_INT16_T 
     632AC_TYPE_UINT16_T 
     633AC_TYPE_INT32_T 
     634AC_TYPE_UINT32_T 
    516635AC_TYPE_INT64_T 
    517636AC_TYPE_UINT64_T 
    518637AC_TYPE_LONG_LONG_INT 
    519638AC_TYPE_UNSIGNED_LONG_LONG_INT 
     639AC_CHECK_SIZEOF([int]) 
     640AC_CHECK_SIZEOF([long int]) 
     641AC_CHECK_SIZEOF([long long int]) 
    520642AC_STRUCT_TM 
     643 
     644AC_SYS_LARGEFILE 
     645case "$ac_cv_sys_file_offset_bits" in 
     646  "no" | "unknown" | "")  
     647    ;; 
     648  *) 
     649    CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" 
     650    CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" 
     651    ;; 
     652esac 
    521653 
    522654if test $MINGW_MSYS = yes; then 
     
    529661 
    530662dnl Checks for library functions. 
    531 AC_FUNC_MALLOC 
    532 AC_FUNC_MEMCMP 
    533 AC_FUNC_MKTIME 
    534 AC_FUNC_STRFTIME 
    535 AC_CHECK_FUNCS([ftime memset strchr strdup strrchr strstr tzset]) 
    536  
    537 AM_CONDITIONAL(HAVE_F77, [test ! -z "$F77"]) 
    538 AM_CONDITIONAL(HAVE_F90, [test ! -z "$FC"]) 
     663#this can cause link errors with rpl_malloc undefined 
     664#AC_FUNC_MALLOC 
     665#this no needed 
     666#AC_FUNC_MEMCMP 
     667#this hangs on FC9 at the moment 
     668#AC_FUNC_MKTIME 
     669 
     670#AC_FUNC_STRFTIME 
     671 
     672AC_CHECK_FUNCS([ftime memset strchr strdup strrchr strstr tzset mkstemp]) 
     673 
     674AM_CONDITIONAL(HAVE_CPP, [test ! -z "$CXX"]) 
     675AM_CONDITIONAL(HAVE_F77, [test "$with_f77" != "no"]) 
     676AM_CONDITIONAL(HAVE_F90, [test "$with_f90" != "no"]) 
    539677AM_CONDITIONAL(HAVE_PYTHON, [test ! -z "$PYTHONROOT"]) 
    540678AM_CONDITIONAL(HAVE_TCL, [test ! -z "$TCLROOT"]) 
    541679AM_CONDITIONAL(HAVE_GUILE, [test ! -z "$GUILEROOT"]) 
    542680AM_CONDITIONAL(HAVE_SWIG, [test ! -z "$SWIG"]) 
    543 AM_CONDITIONAL(HAVE_JAVA, [test ! -z "$JAVA"]) 
    544 AM_CONDITIONAL(HAVE_JAVAC, [test ! -z "$JAVAC"]) 
    545 AM_CONDITIONAL(HAVE_JAVADOC, [test ! -z "$JAVADOC"]) 
     681AM_CONDITIONAL(HAVE_JAVA, [test ! -z "$JAVA" -a ! -z "$JAVAROOT"]) 
     682AM_CONDITIONAL(HAVE_JAVAC, [test ! -z "$JAVAC" -a ! -z "$JAVAROOT"]) 
     683AM_CONDITIONAL(HAVE_JAVADOC, [test ! -z "$JAVADOC" -a ! -z "$JAVAROOT"]) 
    546684AM_CONDITIONAL(HAVE_HDF4, [test ! -z "$H4ROOT"]) 
    547685AM_CONDITIONAL(HAVE_HDF5, [test ! -z "$H5ROOT"]) 
     
    558696AM_CONDITIONAL(HAVE_DOT, [test ! -z "$DOT"]) 
    559697 
     698AM_CONDITIONAL(HAVE_WGET, [test ! -z "$WGET"]) 
     699AM_CONDITIONAL(HAVE_XMLLINT, [test ! -z "$XMLLINT"]) 
     700 
    560701AC_CONFIG_TESTDIR(test) 
    561702AC_CONFIG_FILES(test/Makefile test/atlocal) 
     
    571712                applications/Makefile 
    572713                applications/NXdir/Makefile 
     714                applications/nxingest/Makefile 
    573715                applications/NXsummary/Makefile 
    574716                applications/NXtranslate/Makefile 
     
    593735                doc/tech_ref/Makefile 
    594736                bindings/Makefile  
     737                bindings/cpp/Makefile 
    595738                bindings/f77/Makefile 
    596739                bindings/f90/Makefile 
    597740                bindings/java/Makefile 
    598741                bindings/swig/Makefile 
     742                bindings/idl/Makefile 
     743                bindings/python/Makefile 
    599744                contrib/Makefile 
    600745                contrib/applications/Makefile 
     746                contrib/applications/CBFLib/Makefile 
    601747                contrib/bindings/Makefile 
     748                contrib/bindings/python/Makefile 
    602749                scripts/Makefile 
    603750                scripts/nexus.pc:scripts/nexus_pc.in 
     
    606753AC_OUTPUT 
    607754 
     755if test ! -z "$DOXYGEN" -a ! -z "$PDFLATEX" -a ! -z "$DOT"; then 
     756    DOXYGENDOCS="yes" 
     757else 
     758    if test x"$with_doxygen" != x"no" ; then 
     759        DOXYGENDOCS="no  - missing " 
     760        if test -z "$DOXYGEN"; then DOXYGENDOCS="$DOXYGENDOCS doxygen"; fi 
     761        if test -z "$PDFLATEX"; then DOXYGENDOCS="$DOXYGENDOCS pdflatex"; fi 
     762        if test -z "$DOT"; then DOXYGENDOCS="$DOXYGENDOCS graphviz"; fi 
     763    else 
     764        DOXYGENDOCS="no    --with-doxygen  not specified" 
     765    fi 
     766fi 
     767 
     768if test ! -z "$DOCBOOK2TXT" -a ! -z "$DOCBOOK2PDF"; then 
     769    DOCBOOKDOCS="yes" 
     770else 
     771    DOCBOOKDOCS="no  - missing " 
     772    if test -z "$DOCBOOK2TXT"; then DOCBOOKDOCS="$DOCBOOKDOCS docbook2txt"; fi 
     773    if test -z "$DOCBOOK2PDF"; then DOCBOOKDOCS="$DOCBOOKDOCS docbook2pdf"; fi 
     774fi 
     775 
    608776HDF4SUPPORT=`if test -n "$H4ROOT" ; then echo yes ; else echo no ; echo "                found version $H4VERSION"; fi` 
    609777HDF5SUPPORT=`if test -n "$H5ROOT" ; then echo yes ; else echo no ; echo "                found version $H5VERSION"; fi` 
    610778XMLSUPPORT=`if test -n "$MXMLROOT" ; then echo yes ; else echo no ; fi` 
     779CPPBINDING=`if test -n "$CXX" ; then echo yes ; else echo no ; fi` 
    611780F77BINDING=`if test -n "$F77" ; then echo yes ; else echo no ; fi` 
    612781F90BINDING=`if test -n "$FC" ; then echo yes ; else echo no ; fi` 
    613 JAVABINDING=`if test -n "$JAVAC" ; then echo yes ; else echo no ; fi`  
     782JAVABINDING=`if test -n "$JAVAROOT" ; then echo yes ; else echo no ; fi`  
     783IDLBINDING=`if test -n "$IDLROOT" ; then echo yes ; else echo no ; fi`  
     784PYTHONBINDING=`if test -n "$PYTHONROOT" ; then echo yes; else echo no ; fi`  
    614785if test -n "$SWIG" ; then  
    615786    SWIGBINDING="yes (" 
    616787    test -n "$TCLROOT" && SWIGBINDING="$SWIGBINDING tcl" 
    617788    test -n "$GUILEROOT" && SWIGBINDING="$SWIGBINDING guile" 
    618     test -n "$PYTHONROOT" && SWIGBINDING="$SWIGBINDING python" 
    619789    SWIGBINDING="$SWIGBINDING ) SWIG=${SWIG}" 
    620790else 
     
    622792fi 
    623793 
    624 if test -z "$javaroot"; then 
    625     javaroot="not specified" 
     794if test -z "$JAVAROOT"; then 
     795    JAVAROOT="not specified" 
    626796fi 
    627797AC_MSG_RESULT([ 
     
    629799Configuration (NeXus): 
    630800 
     801        Install prefix:        ${prefix} 
    631802        Source code location:  ${srcdir} 
    632803        Version:               ${VERSION} 
     
    635806build: 
    636807        NeXus with: 
    637                 HDF4 support:  ${HDF4SUPPORT}  
    638                 HDF5 support:  ${HDF5SUPPORT} 
     808                HDF4 support:  ${HDF4SUPPORT} ($H4VERSION) 
     809                HDF5 support:  ${HDF5SUPPORT} ($H5VERSION) 
    639810                XML support:   ${XMLSUPPORT} 
    640811 
    641812        bindings: 
     813                C++ :          ${CPPBINDING} (--with-cxx=${CXX}) 
    642814                F77 :          ${F77BINDING} (--with-f77=${F77}) 
    643815            F90/F95 :          ${F90BINDING} (--with-f90=${FC}) 
    644                 JAVA:          ${JAVABINDING} (--with-java-home=${javaroot}, JAVA=${JAVA}, JAVAC=${JAVAC}, JAVAH=${JAVAH}) 
     816                JAVA:          ${JAVABINDING} (--with-java-home=${JAVAROOT}, JAVA=${JAVA}, JAVAC=${JAVAC}, JAVAH=${JAVAH}) 
    645817                SWIG:          ${SWIGBINDING} 
     818                 IDL:          ${IDLBINDING} (--with-idlroot=${IDLROOT}, --with-idldlm=${IDLDLM}) 
     819              PYTHON:          ${PYTHONBINDING} (PYTHONROOT=${PYTHONROOT}) 
     820 
     821        documentation: 
     822             Doxygen:          ${DOXYGENDOCS} 
     823             Docbook:          ${DOCBOOKDOCS} 
    646824 
    647825Please check whether the configuration I detected matches what you would 
  • tags/4.2.0/README.developers

    r1896 r1896  
    6161ftp://ftp.gnu.org/gnu/libtool 
    6262 
     63Most likely it will be autoconf that will need updating - NeXus 
     64now requires autoconf 2.61 or above 
     65 
    6366NeXus Developer Mailing Lists 
    6467----------------------------- 
  • tags/4.2.0/doc/Makefile.am

    r1896 r1896  
    66 
    77# documenttion subdirectories 
    8 if HAVE_DOXYGEN 
    9 if HAVE_PDFLATEX 
    10 if HAVE_DOT 
    11 DOXYSUB=doxygen 
    12 endif 
    13 endif 
    14 endif 
    15 SUBDIRS=api nxdict tech_ref $(DOXYSUB) 
     8SUBDIRS=api nxdict tech_ref doxygen 
    169 
    1710nxdocdir                = $(NXDOCDIR) 
  • tags/4.2.0/doc/doxygen/Doxyfile.in

    r1896 r1896  
    407407# by doxygen. Possible values are YES and NO. If left blank NO is used. 
    408408 
    409 QUIET                  = NO 
     409QUIET                  = YES 
    410410 
    411411# The WARNINGS tag can be used to turn on/off the warning messages that are  
     
    460460# with spaces. 
    461461 
    462 INPUT                  = @top_srcdir@/src @top_srcdir@/include 
     462INPUT                  = @top_srcdir@/src @top_srcdir@/include @top_srcdir@/bindings/cpp 
    463463 
    464464# If the value of the INPUT tag contains directories, you can use the  
     
    10071007 
    10081008PREDEFINED             = \ 
    1009         HDF4 \ 
    1010         HDF5 \ 
    1011         NXXML 
     1009        HDF4=1 \ 
     1010        HDF5=1 \ 
     1011        NXXML=1 \ 
     1012        NXDLL_EXPORT= 
    10121013 
    10131014# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then  
  • tags/4.2.0/doc/doxygen/Makefile.am

    r1896 r1896  
    66 
    77# documenttion subdirectories 
    8 nxdocdir        = $(NXDOCDIR) 
     8nxdoxydir       = $(NXDOCDIR)/doxygen 
     9CLEANFILES =  doxy.remove_me_to_remake 
     10 
     11all : doxy.remove_me_to_remake 
     12 
     13doxy.remove_me_to_remake : 
     14if HAVE_DOXYGEN 
     15if HAVE_PDFLATEX 
     16if HAVE_DOT 
     17        rm -fr latex html 
     18        $(DOXYGEN) Doxyfile 
     19        ( cd latex; make pdf ) 
     20        rm -f refman.pdf 
     21        ln -s latex/refman.pdf . 
     22endif 
     23endif 
     24endif 
     25        touch doxy.remove_me_to_remake 
    926 
    1027if HAVE_DOXYGEN 
    1128if HAVE_PDFLATEX 
    1229if HAVE_DOT 
    13 DOXY_STUFF = refman.pdf # html 
     30dist-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 {} \; ;\ 
     35        fi 
    1436 
    15 refman.pdf : 
    16         $(DOXYGEN) Doxyfile 
    17         ( cd latex; make pdf ) 
    18         cp latex/refman.pdf $@ 
     37install-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        fi 
    1945endif 
    2046endif 
    2147endif 
    2248 
    23 nxdoc_DATA      = $(DOXY_STUFF) 
     49clean-local : 
     50        rm -fr html latex refman.pdf 
    2451 
    25 EXTRA_DIST = $(DOXY_STUFF) 
     52uninstall-local : 
     53        rm -fr $(DESTDIR)$(nxdoxydir) 
     54 
  • tags/4.2.0/doc/tech_ref/Makefile.am

    r1896 r1896  
    66IMAGES=tofnpd.jpg tofnpd.gif 
    77DOC_SRC=NeXus_definitions.docbook terminology.docbook methods.docbook base_classes.docbook tofnpd.docbook tofnref.docbook monoref.docbook tofdgs.docbook monotas.docbook 
     8DOC_OUTPUT=NeXus_definitions.pdf NeXus_definitions.txt 
    89 
    910nxtechrefdocdir         = $(NXDOCDIR)/tech_ref 
     
    1213 
    1314if HAVE_DOCBOOK 
    14 DOC_OUTPUT=NeXus_definitions.pdf NeXus_definitions.txt 
    1515NeXus_definitions.pdf: $(DOC_SRC) $(IMAGES) 
    1616        $(DOCBOOK2PDF) NeXus_definitions.docbook 
     
    1818NeXus_definitions.txt: $(DOC_SRC) 
    1919        $(DOCBOOK2TXT) NeXus_definitions.docbook 
     20else 
     21NeXus_definitions.pdf: 
     22        touch NeXus_definitions.pdf 
     23 
     24NeXus_definitions.txt: 
     25        touch NeXus_definitions.txt 
    2026endif 
  • tags/4.2.0/autogen.sh

    r1896 r1896  
    2727echo "Using $libtoolversion" 
    2828case $autoconfversion in 
    29     *2.5[2-79]) 
    30         ;; 
    3129    *2.6*) 
    3230        ;; 
     
    3533    *) 
    3634        echo "This autoconf version is not supported by NeXus." 
    37         echo "NeXus only supports autoconf 2.5[2-79]." 
     35        echo "NeXus only supports autoconf 2.61 and above" 
    3836        echo "You may download it from ftp://ftp.gnu.org/gnu/autoconf" 
    3937        exit 
     
    4442    *1.[4-9]*) 
    4543        ;; 
     44    *1.1[0-9]*) 
     45        ;; 
    4646    *) 
    4747        echo "This automake version is not supported by NeXus." 
    48         echo "NeXus only supports automake 1.[5-8].*." 
     48        echo "NeXus only supports automake 1.4 and above" 
    4949        echo "You may download it from ftp://ftp.gnu.org/gnu/automake" 
    5050        exit 
     
    5353 
    5454case $libtoolversion in 
    55     *1.[45]*) 
     55    *1.[456]*) 
     56        ;; 
     57    *[2-9].*) 
    5658        ;; 
    5759    *) 
    5860        echo "This libtool version is not supported by NeXus." 
    59         echo "NeXus only supports libtool 1.[45].*." 
     61        echo "NeXus only supports libtool 1.4 and above" 
    6062        echo "You may download it from ftp://ftp.gnu.org/gnu/libtool" 
    6163        exit 
  • tags/4.2.0/NEWS

    r1896 r1896  
     1Version 4.2.0 
     2============= 
     3 
     4For the latest information see  
     5 
     6    http://www.nexusformat.org/Nexus_42_Release_Notes 
     7 
     8==System Requirements== 
     9'''MXML XML Parsing Library''' 
     10 
     11Version 2.2.2 or higher of mxml is required. Earlier versions have a bug and the XML API will not work. This package can be downloded in [http://www.easysw.com/~mike/mxml/software.php both source and binary rpm form] and is also available as part of [http://fedoraproject.org/wiki/Extras/UsingExtras Fedora Extras]. IMPORTANT NOTE: Debian also provides the mxml package, but it based on 2.0 and will not work properly. 
     12 
     13'''Python Interface''' 
     14You will need both the numpy and ctypes modules to be available.  These are provided in both the Fedora and EPEL repositories. 
     15 
     16==Building Notes== 
     17===NAG F90/F95 Compiler=== 
     18The NAG compiler needs the '''-mismatch''' flag to be specified or else it will not compile NXmodule.f90 This is achieve by running configure with the '''FCFLAGS''' environment variable set to contain the flag e.g. 
     19<pre> 
     20env FCFLAGS="-mismatch" ./configure --with-f90=f95 
     21</pre> 
     22===HDF4 on Intel Macs=== 
     23There is a problem with the include file, hdfi.h (normally in /usr/local/include).  See http://coastwatch.noaa.gov/helparc/software/msg00069.html for details of the modifications necessary to fix it. 
     24 
     25==New Features== 
     26===C++ Interface=== 
     27See the [http://download.nexusformat.org/doxygen/html/classNeXus_1_1File.html doxygen documentation] and 
     28[http://svn.nexusformat.org/code/branches/4.2/test/napi_test_cpp.cxx NeXus API test program] 
     29 
     30===C++ Stream Like interface=== 
     31The idea is to provide an IOSteam like interface and allow you to type  
     32<pre> 
     33    // create an entry and a data item 
     34    File nf(fname, NXACC_CREATE); 
     35    nf << Group("entry1", "NXentry") << Data("dat1", w, "int_attr", 3); 
     36    nf.close(); 
     37 
     38    File nf1(fname, NXACC_RDWR); 
     39    // add a double_attr to an existing setup 
     40    nf1 >> Group("entry1", "NXentry") >> Data("dat1") << Attr("double_attr", 6.0); 
     41    nf1.close(); 
     42 
     43    // read back data items 
     44    File nf2(fname, NXACC_READ); 
     45    nf2 >> Group("entry1", "NXentry") >> Data("dat1", w1, "int_attr", i, "double_attr", d); 
     46    // alternative way to read d1 
     47    nf2 >> Data("dat1") >> Attr("double_attr", d1); 
     48</pre> 
     49See also the [http://svn.nexusformat.org/code/branches/4.2/test/napi_test_cpp.cxx NeXus API test program] 
     50 
     51===IDL Interface=== 
     52There is a new interface to RSI's Interactive Data Language, IDL for NeXus. This  
     53interface has to be considered beta. Nevertheless it is working most of the time.  
     54Known issues include: 
     55* Compressed reading and writing do not work for HDF-4 files, probably because of a library version conflict on libz.  
     56* There is an issue using NXgetslab on 64 bit operating systems; expect a fix for this pretty soon. 
     57 
     58===Python Interface=== 
     59There is now, thanks to David Kienzle, a supported interface for the python scripting language. Arrays are stored in numpy arrays and thus allow for efficient data manipulations. 
     60 
     61==Changed Features== 
     62 
     63==Known Issues== 
     64See the comments on the IDL interface. 
     65 
     66==Miscellaneous bug fixes== 
     67The following items are bugs reported in previous releases and resolved in 
     68the 4.2 release. 
     69 
     70==Upcoming Features== 
     71 
    172Version 4.1.0 
    273============= 
  • tags/4.2.0/test/testsuite.at

    r1896 r1896  
    3131[[NXinquirefile found: NXtest.hdf 
    3232Number of global attributes: 4 
    33    NeXus_version = 4.1.0 
     33   NeXus_version = 4.2.0 
    3434   file_name = NXtest.hdf 
    3535Number of group attributes: 2 
    3636   hugo = namenlos 
    3737   cucumber = passion 
    38 Group: entry(NXentry) contains 8 items 
    39    ch_data(4) = NeXus data 
     38Group: entry(NXentry) contains 9 items 
     39   ch_data(4) = NeXus ><}&{'\&" Data 
     40   c1_data(4) = abcdefghijklmnopqrst 
    4041   i1_data(20) =  1 2 3 4 
    4142   i2_data(22) =  1000 2000 3000 4000 
     
    5455       17.000000 18.000000 19.000000 20.000000 
    5556      Number of attributes : 4 
    56          ch_attribute : NeXus 
     57         ch_attribute : NeXus ><}&{'\&" Data 
    5758         i4_attribute : 42 
    5859         r4_attribute : 3.141593 
     
    7677[[NXinquirefile found: NXtest.h5 
    7778Number of global attributes: 4 
    78    NeXus_version = 4.1.0 
     79   NeXus_version = 4.2.0 
    7980   file_name = NXtest.h5 
    8081Number of group attributes: 2 
    8182   hugo = namenlos 
    8283   cucumber = passion 
    83 Group: entry(NXentry) contains 9 items 
    84    ch_data(4) = NeXus data 
     84Group: entry(NXentry) contains 10 items 
     85   c1_data(4) = abcdefghijklmnopqrst 
     86   ch_data(4) = NeXus ><}&{'\&" Data 
    8587   Subgroup: data(NXdata) 
    8688   grosse_zahl(26) =  12 555555555555 23 777777777777 
     
    101103       17.000000 18.000000 19.000000 20.000000 
    102104      Number of attributes : 4 
    103          ch_attribute : NeXus 
     105         ch_attribute : NeXus ><}&{'\&" Data 
    104106         i4_attribute : 42 
    105107         r4_attribute : 3.141593 
     
    122124[[NXinquirefile found: NXtest.hdf 
    123125Number of global attributes: 4 
    124    NeXus_version = 4.1.0 
     126   NeXus_version = 4.2.0 
    125127   file_name = NXtest.hdf 
    126128Number of group attributes: 2 
    127129   hugo = namenlos 
    128130   cucumber = passion 
    129 Group: entry(NXentry) contains 8 items 
    130    ch_data(4) = NeXus data 
     131Group: entry(NXentry) contains 9 items 
     132   ch_data(4) = NeXus ><}&{'\&" Data 
     133   c1_data(4) = abcdefghijklmnopqrst 
    131134   i1_data(20) =  1 2 3 4 
    132135   i2_data(22) =  1000 2000 3000 4000 
     
    145148       17.000000 18.000000 19.000000 20.000000 
    146149      Number of attributes : 4 
    147          ch_attribute : NeXus 
     150         ch_attribute : NeXus ><}&{'\&" Data 
    148151         i4_attribute : 42 
    149152         r4_attribute : 3.141593 
     
    167170[[NXinquirefile found: NXtest.h5 
    168171Number of global attributes: 4 
    169    NeXus_version = 4.1.0 
     172   NeXus_version = 4.2.0 
    170173   file_name = NXtest.h5 
    171174Number of group attributes: 2 
    172175   hugo = namenlos 
    173176   cucumber = passion 
    174 Group: entry(NXentry) contains 9 items 
    175    ch_data(4) = NeXus data 
     177Group: entry(NXentry) contains 10 items 
     178   c1_data(4) = abcdefghijklmnopqrst 
     179   ch_data(4) = NeXus ><}&{'\&" Data 
    176180   Subgroup: data(NXdata) 
    177181   grosse_zahl(26) =  12 555555555555 23 777777777777 
     
    192196       17.000000 18.000000 19.000000 20.000000 
    193197      Number of attributes : 4 
    194          ch_attribute : NeXus 
     198         ch_attribute : NeXus ><}&{'\&" Data 
    195199         i4_attribute : 42 
    196200         r4_attribute : 3.141593 
     
    212216AT_CHECK([ $HAVE_XML && $SETUP_TEST && napi_test-xml | sed -e 's/\r$//' ], [],  
    213217[[NXinquirefile found: NXtest.xml 
    214 Number of global attributes: 3 
    215    NeXus_version = 4.1.0 
     218Number of global attributes: 7 
     219   NeXus_version = 4.2.0 
    216220   file_name = NXtest.xml 
     221   xmlns = http://definition.nexusformat.org/schema/3.0 
     222   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.xsd 
    217224Number of group attributes: 2 
    218225   hugo = namenlos 
    219226   cucumber = passion 
    220 Group: entry(NXentry) contains 9 items 
    221    ch_data(4) = NeXus data 
     227Group: entry(NXentry) contains 10 items 
     228   ch_data(4) = NeXus ><}&{'\&" Data 
     229   c1_data(4) = abcdefghijklmnopqrst 
    222230   i1_data(20) =  1 2 3 4 
    223231   i2_data(22) =  1000 2000 3000 4000 
     
    236244       17.000000 18.000000 19.000000 20.000000 
    237245      Number of attributes : 4 
    238          ch_attribute : NeXus 
     246         ch_attribute : NeXus ><}&{'\&" Data 
    239247         i4_attribute : 42 
    240248         r4_attribute : 3.141593 
     
    258266AT_CHECK([ $HAVE_XML && $SETUP_TEST && napi_test-xml-static | sed -e 's/\r$//' ], [],  
    259267[[NXinquirefile found: NXtest.xml 
    260 Number of global attributes: 3 
    261    NeXus_version = 4.1.0 
     268Number of global attributes: 7 
     269   NeXus_version = 4.2.0 
    262270   file_name = NXtest.xml 
     271   xmlns = http://definition.nexusformat.org/schema/3.0 
     272   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.xsd 
    263274Number of group attributes: 2 
    264275   hugo = namenlos 
    265276   cucumber = passion 
    266 Group: entry(NXentry) contains 9 items 
    267    ch_data(4) = NeXus data 
     277Group: entry(NXentry) contains 10 items 
     278   ch_data(4) = NeXus ><}&{'\&" Data 
     279   c1_data(4) = abcdefghijklmnopqrst 
    268280   i1_data(20) =  1 2 3 4 
    269281   i2_data(22) =  1000 2000 3000 4000 
     
    282294       17.000000 18.000000 19.000000 20.000000 
    283295      Number of attributes : 4 
    284          ch_attribute : NeXus 
     296         ch_attribute : NeXus ><}&{'\&" Data 
    285297         i4_attribute : 42 
    286298         r4_attribute : 3.141593 
     
    301313AT_CLEANUP 
    302314 
    303 AT_BANNER([Check the FORTRAN 77 binding.]) 
     315AT_SETUP([Check the XML table binding (static library)]) 
     316AT_CHECK([ $HAVE_XML && $SETUP_TEST && napi_test-xml-table-static | sed -e 's/\r$//' ], [],  
     317[[NXinquirefile found: NXtest-table.xml 
     318Number of global attributes: 7 
     319   NeXus_version = 4.2.0 
     320   file_name = NXtest-table.xml 
     321   xmlns = http://definition.nexusformat.org/schema/3.0 
     322   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.xsd 
     324Number of group attributes: 2 
     325   hugo = namenlos 
     326   cucumber = passion 
     327Group: entry(NXentry) contains 10 items 
     328   ch_data(4) = NeXus ><}&{'\&" Data 
     329   c1_data(4) = abcdefghijklmnopqrst 
     330   i1_data(20) =  1 2 3 4 
     331   i2_data(22) =  1000 2000 3000 4000 
     332   i4_data(24) =  1000000 2000000 3000000 4000000 
     333   grosse_zahl(26) =  12 555555555555 23 777777777777 
     334   r4_data(5) 
     335       1.000000 2.000000 3.000000 4.000000 
     336       5.000000 6.000000 7.000000 8.000000 
     337       9.000000 10.000000 11.000000 12.000000 
     338       13.000000 14.000000 15.000000 16.000000 
     339       17.000000 18.000000 19.000000 20.000000 
     340   r8_data(6) 
     341       1.000000 2.000000 3.000000 4.000000 
     342       5.000000 6.000000 7.000000 8.000000 
     343       9.000000 10.000000 11.000000 12.000000 
     344       13.000000 14.000000 15.000000 16.000000 
     345       17.000000 18.000000 19.000000 20.000000 
     346      Number of attributes : 4 
     347         ch_attribute : NeXus ><}&{'\&" Data 
     348         i4_attribute : 42 
     349         r4_attribute : 3.141593 
     350         target : /entry/r8_data 
     351   Subgroup: data(NXdata) 
     352   Subgroup: sample(NXsample) 
     353Link check OK 
     354NXopenpath checks OK 
     355First file time: 2005-05-27 05:44:13 
     356NXinquirefile found: data/dmc01.xml 
     357Second file sample: Ga0.94Mn0.04Sb_8mm 
     358NXinquirefile found: data/dmc02.xml 
     359Second file time: 2005-05-27 05:48:56 
     360entry1 external URL = nxfile://data/dmc01.xml#/entry1 
     361External File Linking tested OK 
     362]]) 
     363AT_CLEANUP 
     364 
     365AT_BANNER([Check the FORTRAN binding.]) 
    304366 
    305367AT_SETUP([Check the F77 binding using HDF4.]) 
    306368AT_CHECK([ $HAVE_F77 && $HAVE_HDF4 && $SETUP_TEST && napif_test-hdf4 | sed -e 's/\r$//' ], [],  
    307369[[ Number of global attributes:  4 
    308     NeXus_version = 4.1.0 
     370    NeXus_version = 4.2.0 
    309371    file_name = NXtest.nxs 
    310372 Group: entry(NXentry) contains  8 items 
     
    342404AT_CHECK([ $HAVE_F77 && $HAVE_HDF5 && $SETUP_TEST && napif_test-hdf5 | sed -e 's/\r$//' ], [],  
    343405[[ Number of global attributes:  4 
    344     NeXus_version = 4.1.0 
     406    NeXus_version = 4.2.0 
    345407    file_name = NXtest.nxs 
    346408 Group: entry(NXentry) contains  8 items 
     
    379441[[Writing character data 
    380442Number of global attributes:        4 
    381    NeXus_version = 4.1.0 
     443   NeXus_version = 4.2.0 
    382444   file_name = NXtest.nxs 
    383445Group: entry(NXentry) contains        8 items 
     
    412474AT_CLEANUP 
    413475 
     476AT_BANNER([Check the C++ binding.]) 
     477AT_SETUP([Check the C++ binding with HDF4.]) 
     478AT_CHECK([ $HAVE_HDF4 && $SETUP_TEST && napi_test_cpp-hdf4 | sed -e 's/\r$//' ], [],  
     479[[NXinquirefile found: napi_test_cpp.hdf 
     480Number of global attributes: 4 
     481   NeXus_version = 4.2.0 
     482   file_name = napi_test_cpp.hdf 
     483Number of group attributes: 2 
     484   hugo = namenlos 
     485   cucumber = passion 
     486Group contains 9 items 
     487   c1_data[5,4] = 2d character array 
     488   ch_data[10] = NeXus_data 
     489   data:NXdata 
     490   i1_data[4] = [,,,] 
     491   i2_data[4] = [1000,2000,3000,4000] 
     492   i4_data[4] = [1000000,2000000,3000000,4000000] 
     493   r4_data[5,4] = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] 
     494   r8_data[5,4] = [20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39] 
     495   sample:NXsample 
     496Link check OK 
     497NXopenpath checks OK 
     498First file time: 2005-05-27 05:44:13 
     499NXinquirefile found: data/dmc01.hdf 
     500Second file sample: Ga0.94Mn0.04Sb_8mm 
     501NXinquirefile found: data/dmc02.hdf 
     502Second file time: 2005-05-27 05:48:56 
     503entry1 external URL = nxfile://data/dmc01.hdf#entry1 
     504]]) 
     505AT_CLEANUP 
     506AT_SETUP([Check the C++ binding with HDF5.]) 
     507AT_CHECK([ $HAVE_HDF5 && $SETUP_TEST && napi_test_cpp-hdf5 | sed -e 's/\r$//' ], [],  
     508[[NXinquirefile found: napi_test_cpp.h5 
     509Number of global attributes: 4 
     510   NeXus_version = 4.2.0 
     511   file_name = napi_test_cpp.h5 
     512Number of group attributes: 2 
     513   hugo = namenlos 
     514   cucumber = passion 
     515Group contains 10 items 
     516   c1_data[5,4] = 2d character array 
     517   ch_data[10] = NeXus_data 
     518   data:NXdata 
     519   grosszahl[4] = [12,555555555555,23,777777777777] 
     520   i1_data[4] = [,,,] 
     521   i2_data[4] = [1000,2000,3000,4000] 
     522   i4_data[4] = [1000000,2000000,3000000,4000000] 
     523   r4_data[5,4] = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] 
     524   r8_data[5,4] = [20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39] 
     525   sample:NXsample 
     526Link check OK 
     527NXopenpath checks OK 
     528First file time: 2005-05-27 05:44:13 
     529NXinquirefile found: data/dmc01.h5 
     530Second file sample: Ga0.94Mn0.04Sb_8mm 
     531NXinquirefile found: data/dmc02.h5 
     532Second file time: 2005-05-27 05:48:56 
     533entry1 external URL = nxfile://data/dmc01.h5#entry1 
     534]]) 
     535AT_CLEANUP 
     536AT_SETUP([Check the C++ binding with xml.]) 
     537AT_CHECK([ $HAVE_XML && $SETUP_TEST && napi_test_cpp-xml | sed -e 's/\r$//' ], [],  
     538[[NXinquirefile found: napi_test_cpp.xml 
     539Number of global attributes: 7 
     540   NeXus_version = 4.2.0 
     541   file_name = napi_test_cpp.xml 
     542   xmlns = http://definition.nexusformat.org/schema/3.0 
     543   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.xsd 
     545Number of group attributes: 2 
     546   hugo = namenlos 
     547   cucumber = passion 
     548Group contains 10 items 
     549   c1_data[5,4] = 2d character array 
     550   ch_data[10] = NeXus_data 
     551   data:NXdata 
     552   grosszahl[4] = [12,555555555555,23,777777777777] 
     553   i1_data[4] = [,,,] 
     554   i2_data[4] = [1000,2000,3000,4000] 
     555   i4_data[4] = [1000000,2000000,3000000,4000000] 
     556   r4_data[5,4] = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] 
     557   r8_data[5,4] = [20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39] 
     558   sample:NXsample 
     559Link check OK 
     560NXopenpath checks OK 
     561First file time: 2005-05-27 05:44:13 
     562NXinquirefile found: data/dmc01.xml 
     563Second file sample: Ga0.94Mn0.04Sb_8mm 
     564NXinquirefile found: data/dmc02.xml 
     565Second file time: 2005-05-27 05:48:56 
     566entry1 external URL = nxfile://data/dmc01.xml#entry1 
     567]]) 
     568AT_CLEANUP 
     569 
     570AT_BANNER([[Testing the Python bindings.]]) 
     571AT_SETUP([Checking HDF4 test file]) 
     572AT_CHECK([skip_test && $HAVE_HDF4 && $HAVE_PYTHON && $PYTHON $abs_srcdir/../bindings/python/nxstest.py -q hdf4 | sed -e 's/\r$//' ],[],  
     573[[]]) 
     574AT_CLEANUP 
     575AT_SETUP([Checking HDF5 test file]) 
     576AT_CHECK([$HAVE_HDF5 && $HAVE_PYTHON && $PYTHON $abs_srcdir/../bindings/python/nxstest.py -q hdf5 | sed -e 's/\r$//' ],[],  
     577[[]]) 
     578AT_CLEANUP 
     579AT_SETUP([Checking XML test file]) 
     580AT_CHECK([$HAVE_XML && $HAVE_PYTHON && $PYTHON $abs_srcdir/../bindings/python/nxstest.py -q xml | sed -e 's/\r$//' ],[],  
     581[[]]) 
     582AT_CLEANUP 
     583 
     584AT_BANNER([[Testing the IDL bindings.]]) 
     585AT_SETUP([Checking HDF4 test file]) 
     586AT_CHECK([skip_test && $HAVE_HDF4 && $HAVE_IDL && $SETUP_TEST && $SHELL $abs_srcdir/../bindings/idl/testidlnapi "'hdf4'" | sed -e 's/\r$//' ],[],  
     587[['hdf4' 
     588NeXus IDL Api Write test 
     589Using HDF4 
     590% Loaded DLM: NEXUSIDL-API. 
     591nxopen status:        1 
     592nxsetnumberformat status:        1 
     593nxmakegroup status:        1 
     594nxopengroup status:        1 
     595nxputattr status:        1 
     596nxputattr status:        1 
     597nxmakedata status:        1 
     598opendata status:        1 
     599nxputdata status:       1 
     600nxclosedata status:        1 
     601nxmakedata status:        1 
     602opendata status:        1 
     603nxputdata status:       1 
     604nxclosedata status:        1 
     605nxmakedata status:        1 
     606opendata status:        1 
     607nxputdata status:       1 
     608nxclosedata status:        1 
     609nxmakedata status:        1 
     610opendata status:        1 
     611nxputdata status:       0 
     612nxclosedata status:        1 
     613nxmakedata status:        1 
     614opendata status:        1 
     615nxputslab status:       1 
     616nxputattr status :        1 
     617nxputattr status :        1 
     618nxputattr status :        1 
     619nxgetdataid status:        1 
     620nxclosedata status:        1 
     621nxmakegroup status:        1 
     622nxopengroup status:        1 
     623nxmakelink status:        1 
     624nxmakecompdata status:       1 
     625opendata status:        1 
     626nxputdata status:       0 
     627nxclosedata status:        1 
     628nxflush status:        1 
     629nxmakedata status:        1 
     630opendata status:        1 
     631nxputslab            1 status:       1 
     632nxflush status:        1 
     633opendata status:        1 
     634nxputslab            2 status:       1 
     635nxflush status:        1 
     636opendata status:        1 
     637nxputslab            3 status:       1 
     638nxflush status:        1 
     639opendata status:        1 
     640nxputslab            4 status:       1 
     641nxflush status:        1 
     642opendata status:        1 
     643nxputslab            5 status:       1 
     644nxflush status:        1 
     645opendata status:        1 
     646nxputslab            6 status:       1 
     647nxflush status:        1 
     648opendata status:        1 
     649nxputslab            7 status:       1 
     650nxflush status:        1 
     651nxclosegroup status:        1 
     652nxmakegroup status:        1 
     653nxopengroup status:        1 
     654nxmakedata status:        1 
     655opendata status:        1 
     656nxputdata status:       1 
     657nxclosedata status:        1 
     658nxgetgroupid status:        1 
     659groupid handle:        2 
     660nxclosegroup status:        1 
     661nxclosegroup status:        1 
     662nxmakegroup status:        1 
     663nxopengroup status:        1 
     664nxmakelink status:        1 
     665groupid handle       2 
     666nxmakenamedlink status :        1 
     667dataid handle       1 
     668nxmakenamedlink status :        1 
     669nxclosegroup status:        1 
     670nxclose status:        1 
     671 
     672 ####################  Test external linking  ###################### 
     673 
     674nxopen status:        1 
     675nxmakegroup status:        1 
     676nxlinkexternal:        1 
     677nxmakegroup status:        1 
     678nxlinkexternal:        1 
     679nxclose status:        1 
     680nxopen status:        1 
     681nxopenpath status       1 
     682 
     683nxget data status:        1 
     684First file time : 
     6852005-05-27 05:44:13 
     686 
     687nxinquirefile status:        1 
     688current file: data/dmc01.hdf 
     689nxopenpath status       1 
     690nxget data status:        1 
     691Second file sample : 
     692Ga0.94Mn0.04Sb_8mm 
     693 
     694nxinquirefile status:        1 
     695current file: data/dmc01.hdf 
     696nxopenpath status       1 
     697nxget data status:        1 
     698Second file time : 
     6992005-05-27 05:44:13 
     700 
     701nxisexternalgroup status       1 
     702entry1 external URL = 
     703nxclose status:        1 
     704% Compiled module: READ_TEST. 
     705Opening file: NXtest.hdf 
     706nxopen status:        1 
     707nxinquirefile status:        1 
     708nxinquirefile found: NXtest.hdf 
     709nxgetattrinfo status:       1 
     710Number of global attributes:        4 
     711 
     712NXgetnextattr status:        1 
     713 
     714attribute name: NeXus_version 
     715attribute value: 4.2.0 
     716 
     717NXgetnextattr status:        1 
     718 
     719attribute name: HDF_version 
     720attribute value: NCSA HDF Version 4.2 Release 2, October 4, 2007 
     721 
     722NXgetnextattr status:        1 
     723 
     724attribute name: file_name 
     725attribute value: NXtest.hdf 
     726 
     727NXgetnextattr status:        1 
     728 
     729 
     730NXgetnextattr status:       -1 
     731 
     732nxopengroup status:       1 
     733nxgetattrinfo status:       1 
     734Number of group attributes:        2 
     735NXgetnextattr status:        1 
     736nxgetattr status       1 
     737attribute name: hugo 
     738attrubute lenght:        8 
     739attribute type:        4 
     740attribute value: namenlos 
     741 
     742NXgetnextattr status:        1 
     743nxgetattr status       1 
     744attribute name: cucumber 
     745attrubute lenght:        7 
     746attribute type:        4 
     747attribute value: passion 
     748 
     749NXgetnextattr status:       -1 
     750nxgetgroupinfo status       1 
     751current group name: entry 
     752current group class: NXentry 
     753number of items in group:        7 
     754 
     755nxgetnextentry status:        1 
     756nxgetnextentry name: ch_data 
     757nxgetnextentry class: SDS 
     758nxgetnextentry data_type       4 
     759 
     760opening data: ch_data 
     761nxopendata status:        1 
     762 
     763nxgetinfo Status:       1 
     764Rank:       1 
     765Dim [       0]:      10 
     766Data Type:       4 
     767 
     768nxget data status:        1 
     769data : 
     770NeXus Data 
     771 
     772nxgetattrinfo status:       1 
     773Number of group attributes:        0 
     774nxgetnextattr status:       -1 
     775nxclosedata status:        1 
     776nxgetnextentry status:        1 
     777nxgetnextentry name: i1_data 
     778nxgetnextentry class: SDS 
     779nxgetnextentry data_type      21 
     780 
     781opening data: i1_data 
     782nxopendata status:        1 
     783 
     784nxgetinfo Status:       1 
     785Rank:       2 
     786Dim [       0]:       4 
     787Dim [       1]:       4 
     788Data Type:      21 
     789 
     790nxgetslab status:        1 
     791data : 
     792   0   4   8  12 
     793 
     794nxgetslab status:        1 
     795data : 
     796   1   5   9  13 
     797 
     798nxgetslab status:        1 
     799data : 
     800   2   6  10  14 
     801 
     802nxgetslab status:        1 
     803data : 
     804   4   7  11  15 
     805 
     806nxgetattrinfo status:       1 
     807Number of group attributes:        0 
     808nxgetnextattr status:       -1 
     809nxclosedata status:        1 
     810nxgetnextentry status:        1 
     811nxgetnextentry name: i4_data 
     812nxgetnextentry class: SDS 
     813nxgetnextentry data_type      24 
     814 
     815opening data: i4_data 
     816nxopendata status:        1 
     817 
     818nxgetinfo Status:       1 
     819Rank:       2 
     820Dim [       0]:       4 
     821Dim [       1]:       4 
     822Data Type:      24 
     823 
     824nxgetslab status:        1 
     825data : 
     826           0           4           8          12 
     827 
     828nxgetslab status:        1 
     829data : 
     830           1           5           9          13 
     831 
     832nxgetslab status:        1 
     833data : 
     834           2           6          10          14 
     835 
     836nxgetslab status:        1 
     837data : 
     838           3           7          11          15 
     839 
     840nxgetattrinfo status:       1 
     841Number of group attributes:        0 
     842nxgetnextattr status:       -1 
     843nxclosedata status:        1 
     844nxgetnextentry status:        1 
     845nxgetnextentry name: r4_data 
     846nxgetnextentry class: SDS 
     847nxgetnextentry data_type       5 
     848 
     849opening data: r4_data 
     850nxopendata status:        1 
     851 
     852nxgetinfo Status:       1 
     853Rank:       2 
     854Dim [       0]:       4 
     855Dim [       1]:       4 
     856Data Type:       5 
     857 
     858nxgetslab status:        1 
     859data : 
     860  9.96921e+36  9.96921e+36  9.96921e+36  9.96921e+36 
     861 
     862nxgetslab status:        1 
     863data : 
     864  9.96921e+36  9.96921e+36  9.96921e+36  9.96921e+36 
     865 
     866nxgetslab status:        1 
     867data : 
     868  9.96921e+36  9.96921e+36  9.96921e+36  9.96921e+36 
     869 
     870nxgetslab status:        1 
     871data : 
     872  9.96921e+36  9.96921e+36  9.96921e+36  9.96921e+36 
     873 
     874nxgetattrinfo status:       1 
     875Number of group attributes:        0 
     876nxgetnextattr status:       -1 
     877nxclosedata status:        1 
     878nxgetnextentry status:        1 
     879nxgetnextentry name: r8_data 
     880nxgetnextentry class: SDS 
     881nxgetnextentry data_type       6 
     882 
     883opening data: r8_data 
     884nxopendata status:        1 
     885 
     886nxgetinfo Status:       1 
     887Rank:       2 
     888Dim [       0]:       4 
     889Dim [       1]:       4 
     890Data Type:       6 
     891 
     892nxgetslab status:        1 
     893data : 
     894   9.9692100e+36   9.9692100e+36   9.9692100e+36   9.9692100e+36 
     895 
     896nxgetslab status:        1 
     897data : 
     898   9.9692100e+36   9.9692100e+36   9.9692100e+36   9.9692100e+36 
     899 
     900nxgetslab status:        1 
     901data : 
     902     0.011111200     0.021222220      0.23333333      0.34444444 
     903 
     904nxgetslab status:        1 
     905data : 
     906   9.9692100e+36   9.9692100e+36   9.9692100e+36   9.9692100e+36 
     907 
     908nxgetattrinfo status:       1 
     909Number of group attributes:        4 
     910Number of global attributes:        4 
     911nxgetnextattr status:        1 
     912nxgetattr status       1 
     913attribute name: ch_attribute 
     914attribute value: NeXus 
     915 
     916nxgetnextattr status:        1 
     917nxgetattr status       1 
     918attribute name: i4_attribute 
     919attribute value:           42 
     920 
     921nxgetnextattr status:        1 
     922nxgetattr status       1 
     923attribute name: r4_attribute 
     924attribute value:       3.14159 
     925 
     926nxgetnextattr status:        1 
     927nxgetattr status       1 
     928attribute name: target 
     929attribute value: /entry/r8_data 
     930 
     931nxgetnextattr status:       -1 
     932nxclosedata status:        1 
     933nxgetnextentry status:        1 
     934nxgetnextentry name: data 
     935nxgetnextentry class: NXdata 
     936nxgetnextentry data_type    1965 
     937 
     938nxgetnextentry status:        1 
     939nxgetnextentry name: sample 
     940nxgetnextentry class: NXsample 
     941nxgetnextentry data_type    1965 
     942 
     943nxgetnextentry status:       -1 
     944nxclosegroup status:        1 
     945 
     946#######################  Checking Links ########################### 
     947 
     948nxopengroup status:       1 
     949 
     950nxopengroup status:       1 
     951 
     952nxgetgroupid status:        1 
     953groupid handle:        1 
     954 
     955nxclosegroup status:        1 
     956 
     957nxopengroup status:       1 
     958 
     959nxopendata status:        1 
     960 
     961nxgetdataid status:        1 
     962nxclosedata status:        1 
     963nxclosegroup status:        1 
     964 
     965nxopendata status:        1 
     966 
     967nxgetdataid status:        1 
     968nxclosedata status:        1 
     969debug 
     970nxsamid status:        1 
     971Data id: Link check succesfull 
     972nxclosegroup status:        1 
     973 
     974nxopengroup status:       1 
     975 
     976nxopengroup status:       1 
     977 
     978nxgetgroupid status:        1 
     979 
     980Group Id: Link check succesfull 
     981nxclosegroup status:        1 
     982 
     983nxopengroup status:       1 
     984 
     985nxgetgroupid status:        1 
     986 
     987Group Id Named: Link check succesfull 
     988 
     989nxclosegroup status:        1 
     990 
     991nxopendata status:        1 
     992 
     993nxgetdataid status:        1 
     994Data Id Named: Link check succesfull 
     995nxclosedata status:        1 
     996Openpath succesfull (/entry/data/comp_data) 
     997Openpath on a relative path  (../r8_data) succesfull 
     998nxclose status:        1 
     999finished napi test 
     1000]]) 
     1001AT_CLEANUP 
     1002AT_SETUP([Checking HDF5 test file]) 
     1003AT_CHECK([$HAVE_HDF5 && $HAVE_IDL && $SETUP_TEST && $SHELL $abs_srcdir/../bindings/idl/testidlnapi "'hdf5'" | sed -e 's/\r$//' ],[],  
     1004[['hdf5' 
     1005NeXus IDL Api Write test 
     1006Using HDF5 
     1007% Loaded DLM: NEXUSIDL-API. 
     1008nxopen status:        1 
     1009nxsetnumberformat status:        1 
     1010nxmakegroup status:        1 
     1011nxopengroup status:        1 
     1012nxputattr status:        1 
     1013nxputattr status:        1 
     1014nxmakedata status:        1 
     1015opendata status:        1 
     1016nxputdata status:       1 
     1017nxclosedata status:        1 
     1018nxmakedata status:        1 
     1019opendata status:        1 
     1020nxputdata status:       1 
     1021nxclosedata status:        1 
     1022nxmakedata status:        1 
     1023opendata status:        1 
     1024nxputdata status:       1 
     1025nxclosedata status:        1 
     1026nxmakedata status:        1 
     1027opendata status:        1 
     1028nxputdata status:       1 
     1029nxclosedata status:        1 
     1030nxmakedata status:        1 
     1031opendata status:        1 
     1032nxputslab status:       1 
     1033nxputattr status :        1 
     1034nxputattr status :        1 
     1035nxputattr status :        1 
     1036nxgetdataid status:        1 
     1037nxclosedata status:        1 
     1038nxmakegroup status:        1 
     1039nxopengroup status:        1 
     1040nxmakelink status:        1 
     1041nxmakecompdata status:       1 
     1042opendata status:        1 
     1043nxputdata status:       1 
     1044nxclosedata status:        1 
     1045nxflush status:        1 
     1046nxmakedata status:        1 
     1047opendata status:        1 
     1048nxputslab            1 status:       1 
     1049nxflush status:        1 
     1050opendata status:        1 
     1051nxputslab            2 status:       1 
     1052nxflush status:        1 
     1053opendata status:        1 
     1054nxputslab            3 status:       1 
     1055nxflush status:        1 
     1056opendata status:        1 
     1057nxputslab            4 status:       1 
     1058nxflush status:        1 
     1059opendata status:        1 
     1060nxputslab            5 status:       1 
     1061nxflush status:        1 
     1062opendata status:        1 
     1063nxputslab            6 status:       1 
     1064nxflush status:        1 
     1065opendata status:        1 
     1066nxputslab            7 status:       1 
     1067nxflush status:        1 
     1068nxclosegroup status:        1 
     1069nxmakegroup status:        1 
     1070nxopengroup status:        1 
     1071nxmakedata status:        1 
     1072opendata status:        1 
     1073nxputdata status:       1 
     1074nxclosedata status:        1 
     1075nxgetgroupid status:        1 
     1076groupid handle:        2 
     1077nxclosegroup status:        1 
     1078nxclosegroup status:        1 
     1079nxmakegroup status:        1 
     1080nxopengroup status:        1 
     1081nxmakelink status:        1 
     1082groupid handle       2 
     1083nxmakenamedlink status :        1 
     1084dataid handle       1 
     1085nxmakenamedlink status :        1 
     1086nxclosegroup status:        1 
     1087nxclose status:        1 
     1088 
     1089 ####################  Test external linking  ###################### 
     1090 
     1091nxopen status:        1 
     1092nxmakegroup status:        1 
     1093nxlinkexternal:        1 
     1094nxmakegroup status:        1 
     1095nxlinkexternal:        1 
     1096nxclose status:        1 
     1097nxopen status:        1 
     1098nxopenpath status       1 
     1099 
     1100nxget data status:        1 
     1101First file time : 
     11022005-05-27 05:44:13 
     1103 
     1104nxinquirefile status:        1 
     1105current file: data/dmc01.h5 
     1106nxopenpath status       1 
     1107nxget data status:        1 
     1108Second file sample : 
     1109Ga0.94Mn0.04Sb_8mm 
     1110 
     1111nxinquirefile status:        1 
     1112current file: data/dmc01.h5 
     1113nxopenpath status       1 
     1114nxget data status:        1 
     1115Second file time : 
     11162005-05-27 05:44:13 
     1117 
     1118nxisexternalgroup status       1 
     1119entry1 external URL = 
     1120nxclose status:        1 
     1121% Compiled module: READ_TEST. 
     1122Opening file: NXtest.h5 
     1123nxopen status:        1 
     1124nxinquirefile status:        1 
     1125nxinquirefile found: NXtest.h5 
     1126nxgetattrinfo status:       1 
     1127Number of global attributes:        4 
     1128 
     1129NXgetnextattr status:        1 
     1130 
     1131attribute name: NeXus_version 
     1132attribute value: 4.2.0 
     1133 
     1134NXgetnextattr status:        1 
     1135 
     1136attribute name: file_name 
     1137attribute value: NXtest.h5 
     1138 
     1139NXgetnextattr status:        1 
     1140 
     1141attribute name: HDF5_Version 
     1142attribute value: 1.6.8 
     1143 
     1144NXgetnextattr status:        1 
     1145 
     1146 
     1147NXgetnextattr status:       -1 
     1148 
     1149nxopengroup status:       1 
     1150nxgetattrinfo status:       1 
     1151Number of group attributes:        2 
     1152NXgetnextattr status:        1 
     1153nxgetattr status       1 
     1154attribute name: hugo 
     1155attrubute lenght:        8 
     1156attribute type:        4 
     1157attribute value: namenlos 
     1158 
     1159NXgetnextattr status:        1 
     1160nxgetattr status       1 
     1161attribute name: cucumber 
     1162attrubute lenght:        7 
     1163attribute type:        4 
     1164attribute value: passion 
     1165 
     1166NXgetnextattr status:       -1 
     1167nxgetgroupinfo status       1 
     1168current group name: entry 
     1169current group class: NXentry 
     1170number of items in group:        7 
     1171 
     1172nxgetnextentry status:        1 
     1173nxgetnextentry name: ch_data 
     1174nxgetnextentry class: SDS 
     1175nxgetnextentry data_type       4 
     1176 
     1177opening data: ch_data 
     1178nxopendata status:        1 
     1179 
     1180nxgetinfo Status:       1 
     1181Rank:       1 
     1182Dim [       0]:      10 
     1183Data Type:       4 
     1184 
     1185nxget data status:        1 
     1186data : 
     1187NeXus Data 
     1188 
     1189nxgetattrinfo status:       1 
     1190Number of group attributes:        0 
     1191nxgetnextattr status:       -1 
     1192nxclosedata status:        1 
     1193nxgetnextentry status:        1 
     1194nxgetnextentry name: data 
     1195nxgetnextentry class: NXdata 
     1196nxgetnextentry data_type       0 
     1197 
     1198nxgetnextentry status:        1 
     1199nxgetnextentry name: i1_data 
     1200nxgetnextentry class: SDS 
     1201nxgetnextentry data_type      21 
     1202 
     1203opening data: i1_data 
     1204nxopendata status:        1 
     1205 
     1206nxgetinfo Status:       1 
     1207Rank:       2 
     1208Dim [       0]:       4 
     1209Dim [       1]:       4 
     1210Data Type:      21 
     1211 
     1212nxgetslab status:        1 
     1213data : 
     1214   0   4   8  12 
     1215 
     1216nxgetslab status:        1 
     1217data : 
     1218   1   5   9  13 
     1219 
     1220nxgetslab status:        1 
     1221data : 
     1222   2   6  10  14 
     1223 
     1224nxgetslab status:        1 
     1225data : 
     1226   4   7  11  15 
     1227 
     1228nxgetattrinfo status:       1 
     1229Number of group attributes:        0 
     1230nxgetnextattr status:       -1 
     1231nxclosedata status:        1 
     1232nxgetnextentry status:        1 
     1233nxgetnextentry name: i4_data 
     1234nxgetnextentry class: SDS 
     1235nxgetnextentry data_type      24 
     1236 
     1237opening data: i4_data 
     1238nxopendata status:        1 
     1239 
     1240nxgetinfo Status:       1 
     1241Rank:       2 
     1242Dim [       0]:       4 
     1243Dim [       1]:       4 
     1244Data Type:      24 
     1245 
     1246nxgetslab status:        1 
     1247data : 
     1248           0           4           8          12 
     1249 
     1250nxgetslab status:        1 
     1251data : 
     1252           1           5           9          13 
     1253 
     1254nxgetslab status:        1 
     1255data : 
     1256           2           6          10          14 
     1257 
     1258nxgetslab status:        1 
     1259data : 
     1260           3           7          11          15 
     1261 
     1262nxgetattrinfo status:       1 
     1263Number of group attributes:        0 
     1264nxgetnextattr status:       -1 
     1265nxclosedata status:        1 
     1266nxgetnextentry status:        1 
     1267nxgetnextentry name: r4_data 
     1268nxgetnextentry class: SDS 
     1269nxgetnextentry data_type       5 
     1270 
     1271opening data: r4_data 
     1272nxopendata status:        1 
     1273 
     1274nxgetinfo Status:       1 
     1275Rank:       2 
     1276Dim [       0]:       4 
     1277Dim [       1]:       4 
     1278Data Type:       5 
     1279 
     1280nxgetslab status:        1 
     1281data : 
     1282    0.0111112     0.344333     0.666669     -12.2000 
     1283 
     1284nxgetslab status:        1 
     1285data : 
     1286    0.0212222     0.555556      1.00000     -13.4444 
     1287 
     1288nxgetslab status:        1 
     1289data : 
     1290     0.233333     0.666667      10.1000     -14.2222 
     1291 
     1292nxgetslab status:        1 
     1293data : 
     1294     0.344444     0.777773      11.2222     -15.4444 
     1295 
     1296nxgetattrinfo status:       1 
     1297Number of group attributes:        0 
     1298nxgetnextattr status:       -1 
     1299nxclosedata status:        1 
     1300nxgetnextentry status:        1 
     1301nxgetnextentry name: r8_data 
     1302nxgetnextentry class: SDS 
     1303nxgetnextentry data_type       6 
     1304 
     1305opening data: r8_data 
     1306nxopendata status:        1 
     1307 
     1308nxgetinfo Status:       1 
     1309Rank:       2 
     1310Dim [       0]:       4 
     1311Dim [       1]:       4 
     1312Data Type:       6 
     1313 
     1314nxgetslab status:        1 
     1315data : 
     1316       0.0000000       0.0000000       0.0000000       0.0000000 
     1317 
     1318nxgetslab status:        1 
     1319data : 
     1320       0.0000000       0.0000000       0.0000000       0.0000000 
     1321 
     1322nxgetslab status:        1 
     1323data : 
     1324     0.011111200     0.021222220      0.23333333      0.34444444 
     1325 
     1326nxgetslab status:        1 
     1327data : 
     1328       0.0000000       0.0000000       0.0000000       0.0000000 
     1329 
     1330nxgetattrinfo status:       1 
     1331Number of group attributes:        4 
     1332Number of global attributes:        4 
     1333nxgetnextattr status:        1 
     1334nxgetattr status       1 
     1335attribute name: ch_attribute 
     1336attribute value: NeXus 
     1337 
     1338nxgetnextattr status:        1 
     1339nxgetattr status       1 
     1340attribute name: i4_attribute 
     1341attribute value:           42 
     1342 
     1343nxgetnextattr status:        1 
     1344nxgetattr status       1 
     1345attribute name: r4_attribute 
     1346attribute value:       3.14159 
     1347 
     1348nxgetnextattr status:        1 
     1349nxgetattr status       1 
     1350attribute name: target 
     1351attribute value: /entry/r8_data 
     1352 
     1353nxgetnextattr status:       -1 
     1354nxclosedata status:        1 
     1355nxgetnextentry status:        1 
     1356nxgetnextentry name: sample 
     1357nxgetnextentry class: NXsample 
     1358nxgetnextentry data_type       0 
     1359 
     1360nxgetnextentry status:       -1 
     1361nxclosegroup status:        1 
     1362 
     1363#######################  Checking Links ########################### 
     1364 
     1365nxopengroup status:       1 
     1366 
     1367nxopengroup status:       1 
     1368 
     1369nxgetgroupid status:        1 
     1370groupid handle:        1 
     1371 
     1372nxclosegroup status:        1 
     1373 
     1374nxopengroup status:       1 
     1375 
     1376nxopendata status:        1 
     1377 
     1378nxgetdataid status:        1 
     1379nxclosedata status:        1 
     1380nxclosegroup status:        1 
     1381 
     1382nxopendata status:        1 
     1383 
     1384nxgetdataid status:        1 
     1385nxclosedata status:        1 
     1386debug 
     1387nxsamid status:        1 
     1388Data id: Link check succesfull 
     1389nxclosegroup status:        1 
     1390 
     1391nxopengroup status:       1 
     1392 
     1393nxopengroup status:       1 
     1394 
     1395nxgetgroupid status:        1 
     1396 
     1397Group Id: Link check succesfull 
     1398nxclosegroup status:        1 
     1399 
     1400nxopengroup status:       1 
     1401 
     1402nxgetgroupid status:        1 
     1403 
     1404Group Id Named: Link check succesfull 
     1405 
     1406nxclosegroup status:        1 
     1407 
     1408nxopendata status:        1 
     1409 
     1410nxgetdataid status:        1 
     1411Data Id Named: Link check succesfull 
     1412nxclosedata status:        1 
     1413Openpath succesfull (/entry/data/comp_data) 
     1414Openpath on a relative path  (../r8_data) succesfull 
     1415nxclose status:        1 
     1416finished napi test 
     1417]]) 
     1418AT_CLEANUP 
     1419AT_SETUP([Checking XML test file]) 
     1420AT_CHECK([$HAVE_XML && $HAVE_IDL && $SETUP_TEST && $SHELL $abs_srcdir/../bindings/idl/testidlnapi "'xml'" | sed -e 's/\r$//' ],[],  
     1421[['xml' 
     1422NeXus IDL Api Write test 
     1423Using XML 
     1424% Loaded DLM: NEXUSIDL-API. 
     1425nxopen status:        1 
     1426nxsetnumberformat status:        1 
     1427nxmakegroup status:        1 
     1428nxopengroup status:        1 
     1429nxputattr status:        1 
     1430nxputattr status:        1 
     1431nxmakedata status:        1 
     1432opendata status:        1 
     1433nxputdata status:       1 
     1434nxclosedata status:        1 
     1435nxmakedata status:        1 
     1436opendata status:        1 
     1437nxputdata status:       1 
     1438nxclosedata status:        1 
     1439nxmakedata status:        1 
     1440opendata status:        1 
     1441nxputdata status:       1 
     1442nxclosedata status:        1 
     1443nxmakedata status:        1 
     1444opendata status:        1 
     1445nxputdata status:       1 
     1446nxclosedata status:        1 
     1447nxmakedata status:        1 
     1448opendata status:        1 
     1449nxputslab status:       1 
     1450nxputattr status :        1 
     1451nxputattr status :        1 
     1452nxputattr status :        1 
     1453nxgetdataid status:        1 
     1454nxclosedata status:        1 
     1455nxmakegroup status:        1 
     1456nxopengroup status:        1 
     1457nxmakelink status:        1 
     1458nxmakecompdata status:       1 
     1459opendata status:        1 
     1460nxputdata status:       1 
     1461nxclosedata status:        1 
     1462nxflush status:        1 
     1463nxmakedata status:        1 
     1464opendata status:        1 
     1465nxputslab            1 status:       1 
     1466nxflush status:        1 
     1467opendata status:        1 
     1468nxputslab            2 status:       1 
     1469nxflush status:        1 
     1470opendata status:        1 
     1471nxputslab            3 status:       1 
     1472nxflush status:        1 
     1473opendata status:        1 
     1474nxputslab            4 status:       1 
     1475nxflush status:        1 
     1476opendata status:        1 
     1477nxputslab            5 status:       1 
     1478nxflush status:        1 
     1479opendata status:        1 
     1480nxputslab            6 status:       1 
     1481nxflush status:        1 
     1482opendata status:        1 
     1483nxputslab            7 status:       1 
     1484nxflush status:        1 
     1485nxclosegroup status:        1 
     1486nxmakegroup status:        1 
     1487nxopengroup status:        1 
     1488nxmakedata status:        1 
     1489opendata status:        1 
     1490nxputdata status:       1 
     1491nxclosedata status:        1 
     1492nxgetgroupid status:        1 
     1493groupid handle:        2 
     1494nxclosegroup status:        1 
     1495nxclosegroup status:        1 
     1496nxmakegroup status:        1 
     1497nxopengroup status:        1 
     1498nxmakelink status:        1 
     1499groupid handle       2 
     1500nxmakenamedlink status :        1 
     1501dataid handle       1 
     1502nxmakenamedlink status :        1 
     1503nxclosegroup status:        1 
     1504nxclose status:        1 
     1505 
     1506 ####################  Test external linking  ###################### 
     1507 
     1508nxopen status:        1 
     1509nxmakegroup status:        1 
     1510nxlinkexternal:        1 
     1511nxmakegroup status:        1 
     1512nxlinkexternal:        1 
     1513nxclose status:        1 
     1514nxopen status:        1 
     1515nxopenpath status       1 
     1516 
     1517nxget data status:        1 
     1518First file time : 
     15192005-05-27 05:44:13 
     1520 
     1521nxinquirefile status:        1 
     1522current file: data/dmc01.xml 
     1523nxopenpath status       1 
     1524nxget data status:        1 
     1525Second file sample : 
     1526Ga0.94Mn0.04Sb_8mm 
     1527 
     1528nxinquirefile status:        1 
     1529current file: data/dmc01.xml 
     1530nxopenpath status       1 
     1531nxget data status:        1 
     1532Second file time : 
     15332005-05-27 05:44:13 
     1534 
     1535nxisexternalgroup status       1 
     1536entry1 external URL = 
     1537nxclose status:        1 
     1538% Compiled module: READ_TEST. 
     1539Opening file: NXtest.xml 
     1540nxopen status:        1 
     1541nxinquirefile status:        1 
     1542nxinquirefile found: NXtest.xml 
     1543nxgetattrinfo status:       1 
     1544Number of global attributes:        7 
     1545 
     1546NXgetnextattr status:        1 
     1547 
     1548attribute name: NeXus_version 
     1549attribute value: 4.2.0 
     1550 
     1551NXgetnextattr status:        1 
     1552 
     1553attribute name: XML_version 
     1554attribute value: mxml 
     1555 
     1556NXgetnextattr status:        1 
     1557 
     1558attribute name: file_name 
     1559attribute value: NXtest.xml 
     1560 
     1561NXgetnextattr status:        1 
     1562 
     1563attribute name: xmlns 
     1564attribute value: http://definition.nexusformat.org/schema/3.0 
     1565 
     1566NXgetnextattr status:        1 
     1567 
     1568attribute name: xmlns:xsi 
     1569attribute value: http://www.w3.org/2001/XMLSchema-instance 
     1570 
     1571NXgetnextattr status:        1 
     1572 
     1573attribute name: xsi:schemaLocation 
     1574attribute value: http://definition.nexusformat.org/schema/3.0 http://definition.nexusformat.org/schema/3.0/BASE.xsd 
     1575 
     1576NXgetnextattr status:        1 
     1577 
     1578 
     1579NXgetnextattr status:       -1 
     1580 
     1581nxopengroup status:       1 
     1582nxgetattrinfo status:       1 
     1583Number of group attributes:        2 
     1584NXgetnextattr status:        1 
     1585nxgetattr status       1 
     1586attribute name: hugo 
     1587attrubute lenght:        8 
     1588attribute type:        4 
     1589attribute value: namenlos 
     1590 
     1591NXgetnextattr status:        1 
     1592nxgetattr status       1 
     1593attribute name: cucumber 
     1594attrubute lenght:        7 
     1595attribute type:        4 
     1596attribute value: passion 
     1597 
     1598NXgetnextattr status:       -1 
     1599nxgetgroupinfo status       1 
     1600current group name: entry 
     1601current group class: NXentry 
     1602number of items in group:        7 
     1603 
     1604nxgetnextentry status:        1 
     1605nxgetnextentry name: ch_data 
     1606nxgetnextentry class: SDS 
     1607nxgetnextentry data_type       4 
     1608 
     1609opening data: ch_data 
     1610nxopendata status:        1 
     1611 
     1612nxgetinfo Status:       1 
     1613Rank:       1 
     1614Dim [       0]:      10 
     1615Data Type:       4 
     1616 
     1617nxget data status:        1 
     1618data : 
     1619NeXus Data 
     1620 
     1621nxgetattrinfo status:       1 
     1622Number of group attributes:        0 
     1623nxgetnextattr status:       -1 
     1624nxclosedata status:        1 
     1625nxgetnextentry status:        1 
     1626nxgetnextentry name: i1_data 
     1627nxgetnextentry class: SDS 
     1628nxgetnextentry data_type      21 
     1629 
     1630opening data: i1_data 
     1631nxopendata status:        1 
     1632 
     1633nxgetinfo Status:       1 
     1634Rank:       2 
     1635Dim [       0]:       4 
     1636Dim [       1]:       4 
     1637Data Type:      21 
     1638 
     1639nxgetslab status:        1 
     1640data : 
     1641   0   4   8  12 
     1642 
     1643nxgetslab status:        1 
     1644data : 
     1645   1   5   9  13 
     1646 
     1647nxgetslab status:        1 
     1648data : 
     1649   2   6  10  14 
     1650 
     1651nxgetslab status:        1 
     1652data : 
     1653   4   7  11  15 
     1654 
     1655nxgetattrinfo status:       1 
     1656Number of group attributes:        0 
     1657nxgetnextattr status:       -1 
     1658nxclosedata status:        1 
     1659nxgetnextentry status:        1 
     1660nxgetnextentry name: i4_data 
     1661nxgetnextentry class: SDS 
     1662nxgetnextentry data_type      24 
     1663 
     1664opening data: i4_data 
     1665nxopendata status:        1 
     1666 
     1667nxgetinfo Status:       1 
     1668Rank:       2 
     1669Dim [       0]:       4 
     1670Dim [       1]:       4 
     1671Data Type:      24 
     1672 
     1673nxgetslab status:        1 
     1674data : 
     1675           0           4           8          12 
     1676 
     1677nxgetslab status:        1 
     1678data : 
     1679           1           5           9          13 
     1680 
     1681nxgetslab status:        1 
     1682data : 
     1683           2           6          10          14 
     1684 
     1685nxgetslab status:        1 
     1686data : 
     1687           3           7          11          15 
     1688 
     1689nxgetattrinfo status:       1 
     1690Number of group attributes:        0 
     1691nxgetnextattr status:       -1 
     1692nxclosedata status:        1 
     1693nxgetnextentry status:        1 
     1694nxgetnextentry name: r4_data 
     1695nxgetnextentry class: SDS 
     1696nxgetnextentry data_type       5 
     1697 
     1698opening data: r4_data 
     1699nxopendata status:        1 
     1700 
     1701nxgetinfo Status:       1 
     1702Rank:       2 
     1703Dim [       0]:       4 
     1704Dim [       1]:       4 
     1705Data Type:       5 
     1706 
     1707nxgetslab status:        1 
     1708data : 
     1709    0.0110000     0.344000     0.667000     -12.2000 
     1710 
     1711nxgetslab status:        1 
     1712data : 
     1713    0.0210000     0.556000      1.00000     -13.4440 
     1714 
     1715nxgetslab status:        1 
     1716data : 
     1717     0.233000     0.667000      10.1000     -14.2220 
     1718 
     1719nxgetslab status:        1 
     1720data : 
     1721     0.344000     0.778000      11.2220     -15.4440 
     1722 
     1723nxgetattrinfo status:       1 
     1724Number of group attributes:        0 
     1725nxgetnextattr status:       -1 
     1726nxclosedata status:        1 
     1727nxgetnextentry status:        1 
     1728nxgetnextentry name: r8_data 
     1729nxgetnextentry class: SDS 
     1730nxgetnextentry data_type       6 
     1731 
     1732opening data: r8_data 
     1733nxopendata status:        1 
     1734 
     1735nxgetinfo Status:       1 
     1736Rank:       2 
     1737Dim [       0]:       4 
     1738Dim [       1]:       4 
     1739Data Type:       6 
     1740 
     1741nxgetslab status:        1 
     1742data : 
     1743       0.0000000       0.0000000       0.0000000       0.0000000 
     1744 
     1745nxgetslab status:        1 
     1746data : 
     1747       0.0000000       0.0000000       0.0000000       0.0000000 
     1748 
     1749nxgetslab status:        1 
     1750data : 
     1751     0.011110000     0.021220000      0.23333000      0.34444000 
     1752 
     1753nxgetslab status:        1 
     1754data : 
     1755       0.0000000       0.0000000       0.0000000       0.0000000 
     1756 
     1757nxgetattrinfo status:       1 
     1758Number of group attributes:        4 
     1759Number of global attributes:        4 
     1760nxgetnextattr status:        1 
     1761nxgetattr status       1 
     1762attribute name: ch_attribute 
     1763attribute value: NeXus 
     1764 
     1765nxgetnextattr status:        1 
     1766nxgetattr status       1 
     1767attribute name: i4_attribute 
     1768attribute value:           42 
     1769 
     1770nxgetnextattr status:        1 
     1771nxgetattr status       1 
     1772attribute name: r4_attribute 
     1773attribute value:       3.14159 
     1774 
     1775nxgetnextattr status:        1 
     1776nxgetattr status       1 
     1777attribute name: target 
     1778attribute value: /entry/r8_data 
     1779 
     1780nxgetnextattr status:       -1 
     1781nxclosedata status:        1 
     1782nxgetnextentry status:        1 
     1783nxgetnextentry name: data 
     1784nxgetnextentry class: NXdata 
     1785nxgetnextentry data_type       0 
     1786 
     1787nxgetnextentry status:        1 
     1788nxgetnextentry name: sample 
     1789nxgetnextentry class: NXsample 
     1790nxgetnextentry data_type       0 
     1791 
     1792nxgetnextentry status:       -1 
     1793nxclosegroup status:        1 
     1794 
     1795#######################  Checking Links ########################### 
     1796 
     1797nxopengroup status:       1 
     1798 
     1799nxopengroup status:       1 
     1800 
     1801nxgetgroupid status:        1 
     1802groupid handle:        1 
     1803 
     1804nxclosegroup status:        1 
     1805 
     1806nxopengroup status:       1 
     1807 
     1808nxopendata status:        1 
     1809 
     1810nxgetdataid status:        1 
     1811nxclosedata status:        1 
     1812nxclosegroup status:        1 
     1813 
     1814nxopendata status:        1 
     1815 
     1816nxgetdataid status:        1 
     1817nxclosedata status:        1 
     1818debug 
     1819nxsamid status:        1 
     1820Data id: Link check succesfull 
     1821nxclosegroup status:        1 
     1822 
     1823nxopengroup status:       1 
     1824 
     1825nxopengroup status:       1 
     1826 
     1827nxgetgroupid status:        1 
     1828 
     1829Group Id: Link check succesfull 
     1830nxclosegroup status:        1 
     1831 
     1832nxopengroup status:       1 
     1833 
     1834nxgetgroupid status:        1 
     1835 
     1836Group Id Named: Link check succesfull 
     1837 
     1838nxclosegroup status:        1 
     1839 
     1840nxopendata status:        1 
     1841 
     1842nxgetdataid status:        1 
     1843Data Id Named: Link check succesfull 
     1844nxclosedata status:        1 
     1845Openpath succesfull (/entry/data/comp_data) 
     1846Openpath on a relative path  (../r8_data) succesfull 
     1847nxclose status:        1 
     1848finished napi test 
     1849]]) 
     1850AT_CLEANUP 
     1851 
    4141852AT_BANNER([[Testing the NeXus File Converter.]]) 
    4151853AT_SETUP([Checking HDF4 -> HDF4 ]) 
     
    4881926AT_SETUP([Checking HDF4 test file]) 
    4891927AT_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/[ ]*$//' ],[],  
    490 [[NXBrowse 4.1.0 Copyright (C) 2000 R. Osborn, M. Koennecke, P. Klosowski 
    491     NeXus_version = 4.1.0 
     1928[[NXBrowse 4.2.0 Copyright (C) 2000 R. Osborn, M. Koennecke, P. Klosowski 
     1929    NeXus_version = 4.2.0 
    4921930    file_name = NXtest.hdf 
    4931931NX>   NX Group : entry (NXentry) 
     
    5001938AT_SETUP([Checking HDF5 test file]) 
    5011939AT_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/[ ]*$//' ],[],  
    502 [[NXBrowse 4.1.0 Copyright (C) 2000 R. Osborn, M. Koennecke, P. Klosowski 
    503     NeXus_version = 4.1.0 
     1940[[NXBrowse 4.2.0 Copyright (C) 2000 R. Osborn, M. Koennecke, P. Klosowski 
     1941    NeXus_version = 4.2.0 
    5041942    file_name = NXtest.h5 
    5051943NX>   NX Group : entry (NXentry) 
     
    5121950AT_SETUP([Checking XML test file]) 
    5131951AT_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/[ ]*$//' ],[],  
    514 [[NXBrowse 4.1.0 Copyright (C) 2000 R. Osborn, M. Koennecke, P. Klosowski 
    515     NeXus_version = 4.1.0 
     1952[[NXBrowse 4.2.0 Copyright (C) 2000 R. Osborn, M. Koennecke, P. Klosowski 
     1953    NeXus_version = 4.2.0 
    5161954    file_name = NXtest.xml 
     1955    xmlns = http://definition.nexusformat.org/schema/3.0 
     1956    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.xsd 
    5171958NX>   NX Group : entry (NXentry) 
    5181959             entry attribute: hugo = namenlos 
     
    5421983]]) 
    5431984AT_CLEANUP 
     1985 
     1986 
     1987AT_BANNER([[Testing validating files with the nxvalidate tool.]]) 
     1988AT_SETUP([Checking HDF4 test file via web (wget)]) 
     1989AT_CHECK([$HAVE_HDF4 && $HAVE_WGET && $SETUP_TEST && napi_test-hdf4 -q && nxvalidate -q -w NXtest.hdf | sed -e 's/\r$//' ],[],  
     1990[[]]) 
     1991AT_CLEANUP 
     1992AT_SETUP([Checking HDF5 test file via web (wget)]) 
     1993AT_CHECK([$HAVE_HDF4 && $HAVE_WGET && $SETUP_TEST && napi_test-hdf5 -q && nxvalidate -q -w NXtest.h5 | sed -e 's/\r$//' ],[],  
     1994[[]]) 
     1995AT_CLEANUP 
     1996AT_SETUP([Checking XML test file via web (wget)]) 
     1997AT_CHECK([$HAVE_HDF4 && $HAVE_WGET && $SETUP_TEST && napi_test-xml -q && nxvalidate -q -w NXtest.xml | sed -e 's/\r$//' ],[],  
     1998[[]]) 
     1999AT_CLEANUP 
  • tags/4.2.0/test/leak_test2.cxx

    r1896 r1896  
    11#include <sstream> 
     2#include <cstdlib> 
    23#include <napi.h> 
    34#include <unistd.h> 
  • tags/4.2.0/test/napi_test.c

    r1896 r1896  
    3737int main (int argc, char *argv[]) 
    3838{ 
    39   int i, j, NXrank, NXdims[32], NXtype, NXlen, entry_status, attr_status; 
     39  int i, j, k, n, NXrank, NXdims[32], NXtype, NXlen, entry_status, attr_status; 
    4040  float r; 
    4141  void *data_buffer; 
     
    5353  char name[64], char_class[64], char_buffer[128]; 
    5454  char group_name[64], class_name[64]; 
     55  char c1_array[5][4] = {{'a', 'b', 'c' ,'d'}, {'e', 'f', 'g' ,'h'},  
     56     {'i', 'j', 'k', 'l'}, {'m', 'n', 'o', 'p'}, {'q', 'r', 's' , 't'}}; 
     57  int unlimited_cdims[2] = {NX_UNLIMITED, 4}; 
    5558  NXhandle fileid; 
    5659  NXlink glink, dlink, blink; 
     
    6265  char filename[256]; 
    6366  int64_t grossezahl[4]; 
     67  const char* ch_test_data = "NeXus ><}&{'\\&\" Data"; 
    6468 
    6569  grossezahl[0] = 12; 
     
    7680    nx_creation_code = NXACC_CREATE5; 
    7781    strcpy(nxFile,"NXtest.h5"); 
     82  }else if(strstr(argv[0],"napi_test-xml-table") != NULL){ 
     83    nx_creation_code = NXACC_CREATEXML | NXACC_TABLE; 
     84    strcpy(nxFile,"NXtest-table.xml"); 
    7885  }else if(strstr(argv[0],"napi_test-xml") != NULL){ 
    7986    nx_creation_code = NXACC_CREATEXML; 
     
    9198  if(NXputattr(fileid,"hugo","namenlos",strlen("namenlos"), NX_CHAR) != NX_OK) return 1; 
    9299  if(NXputattr(fileid,"cucumber","passion",strlen("passion"), NX_CHAR) != NX_OK) return 1; 
    93      NXlen = 10; 
     100     NXlen = strlen(ch_test_data); 
    94101     if (NXmakedata (fileid, "ch_data", NX_CHAR, 1, &NXlen) != NX_OK) return 1; 
    95102     if (NXopendata (fileid, "ch_data") != NX_OK) return 1; 
    96         if (NXputdata (fileid, "NeXus data") != NX_OK) return 1; 
     103        if (NXputdata (fileid, ch_test_data) != NX_OK) return 1; 
     104     if (NXclosedata (fileid) != NX_OK) return 1; 
     105     if (NXmakedata (fileid, "c1_data", NX_CHAR, 2, array_dims) != NX_OK) return 1; 
     106     if (NXopendata (fileid, "c1_data") != NX_OK) return 1; 
     107        if (NXputdata (fileid, c1_array) != NX_OK) return 1; 
    97108     if (NXclosedata (fileid) != NX_OK) return 1; 
    98109     if (NXmakedata (fileid, "i1_data", NX_INT8, 1, &array_dims[1]) != NX_OK) return 1; 
     
    118129        slab_start[0] = 0; slab_start[1] = 0; slab_size[0] = 4; slab_size[1] = 4; 
    119130        if (NXputslab (fileid, r8_array, slab_start, slab_size) != NX_OK) return 1; 
    120         if (NXputattr (fileid, "ch_attribute", "NeXus", strlen ("NeXus"), NX_CHAR) != NX_OK) return 1; 
     131        if (NXputattr (fileid, "ch_attribute", ch_test_data, strlen (ch_test_data), NX_CHAR) != NX_OK) return 1; 
    121132        i = 42; 
    122133        if (NXputattr (fileid, "i4_attribute", &i, 1, NX_INT32) != NX_OK) return 1; 
     
    171182        if (NXclosedata (fileid) != NX_OK) return 1; 
    172183        if (NXgetgroupID (fileid, &glink) != NX_OK) return 1; 
     184        if (nx_creation_code & NXACC_CREATEXML == 0) { 
     185            if (NXmakedata (fileid, "cdata_unlimited", NX_CHAR, 2, unlimited_cdims) != NX_OK) return 1; 
     186            if (NXopendata (fileid, "cdata_unlimited") != NX_OK) return 1; 
     187            slab_size[0] = 1; 
     188            slab_size[1] = 4; 
     189            slab_start[1] = 0; 
     190            for (i = 0; i < 5; i++) 
     191            { 
     192               slab_start[0] = i; 
     193               if (NXputslab (fileid, &(c1_array[i][0]), slab_start, slab_size) != NX_OK) return 1; 
     194            } 
     195            if (NXclosedata (fileid) != NX_OK) return 1; 
     196        } 
    173197     if (NXclosegroup (fileid) != NX_OK) return 1; 
    174198  if (NXclosegroup (fileid) != NX_OK) return 1; 
     
    249273                 printf ("   %s(%d)", name, NXtype); 
    250274              if (NXmalloc ((void **) &data_buffer, NXrank, NXdims, NXtype) != NX_OK) return 1; 
     275              n = 1; 
     276              for(k=0; k<NXrank; k++) 
     277              { 
     278                  n *= NXdims[k]; 
     279              } 
    251280              if (NXtype == NX_CHAR) { 
    252281                 if (NXgetdata (fileid, data_buffer) != NX_OK) return 1; 
    253                     print_data (" = ", data_buffer, NXtype, 10); 
     282                    print_data (" = ", data_buffer, NXtype, n); 
    254283              } else if (NXtype != NX_FLOAT32 && NXtype != NX_FLOAT64) { 
    255284                 if (NXgetdata (fileid, data_buffer) != NX_OK) return 1; 
    256                     print_data (" = ", data_buffer, NXtype, 4); 
     285                    print_data (" = ", data_buffer, NXtype, n); 
    257286              } else { 
    258287                 slab_start[0] = 0; 
  • tags/4.2.0/test/Makefile.am

    r1896 r1896  
    3434LIBNEXUS77=$(top_builddir)/bindings/f77/libNeXus77.la 
    3535LIBNEXUS90=$(top_builddir)/bindings/f90/libNeXus90.la 
    36  
    37 AM_CPPFLAGS=-I. -I$(top_srcdir)/include 
     36LIBNEXUSCPP=$(top_builddir)/bindings/cpp/libNeXusCPP.la 
     37 
     38AM_CPPFLAGS=-I. -I$(top_srcdir)/include -I$(top_srcdir)/bindings/cpp 
    3839AM_FFLAGS=-I$(top_srcdir)/bindings/f77 
    39 CLEANFILES=NXtest.nx4 NXtest.nx5 NXtest.nxs NXtest.xml \ 
     40AM_FCFLAGS=-I$(top_builddir)/bindings/f90 
     41CLEANFILES=NXtest.nx4 NXtest.nx5 NXtest.nxs NXtest.xml NXtest-table.xml \ 
    4042        leak_test.nxs leak_test1.nxs leak_test2_*.nxs \ 
    41         nxtranslate nxsummary nxconvert nxdir nxbrowse 
     43        nxtranslate nxsummary nxconvert nxvalidate nxdir nxbrowse \ 
     44        NXtest.h4 NXtest.h5 
    4245 
    4346 
    4447## testdir=$(prefix)/nexus/test