diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-04-19 15:23:01 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-04-19 15:23:01 (GMT) |
commit | 14d8e1c2b5ecaf2e298984f269094dd5f2bd735f (patch) | |
tree | cc250461294a2c9118b10a95d0459d7314fa5e50 /hl/examples | |
parent | 6ee0e05fb94445551840fcb80b9b1c254c736799 (diff) | |
download | hdf5-14d8e1c2b5ecaf2e298984f269094dd5f2bd735f.zip hdf5-14d8e1c2b5ecaf2e298984f269094dd5f2bd735f.tar.gz hdf5-14d8e1c2b5ecaf2e298984f269094dd5f2bd735f.tar.bz2 |
[svn-r23600] Bring revisions #23085 - #23341 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'hl/examples')
-rw-r--r-- | hl/examples/CMakeLists.txt | 3 | ||||
-rw-r--r-- | hl/examples/Makefile.am | 5 | ||||
-rw-r--r-- | hl/examples/Makefile.in | 7 | ||||
-rw-r--r-- | hl/examples/ptExampleVL.c | 126 | ||||
-rw-r--r-- | hl/examples/run-hlc-ex.sh.in | 2 |
5 files changed, 6 insertions, 137 deletions
diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index c95322c..1f4807a 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.6) +cmake_minimum_required (VERSION 2.8.10) PROJECT (HDF5_HL_EXAMPLES ) SET (HDF5_TEST_FILES @@ -23,7 +23,6 @@ SET (examples ex_lite2 ex_lite3 ptExampleFL - ptExampleVL ex_image1 ex_image2 ex_table_01 diff --git a/hl/examples/Makefile.am b/hl/examples/Makefile.am index 1c51f05..5108c5e 100644 --- a/hl/examples/Makefile.am +++ b/hl/examples/Makefile.am @@ -34,7 +34,7 @@ EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl # Don't tell automake about them, because if it knew they were programs, # it would try to compile them instead of using the h5cc script. # Use the boilerplate in config/examples.am instead. -EXAMPLE_PROG = ex_lite1 ex_lite2 ex_lite3 ptExampleFL ptExampleVL \ +EXAMPLE_PROG = ex_lite1 ex_lite2 ex_lite3 ptExampleFL \ ex_image1 ex_image2 \ ex_table_01 ex_table_02 ex_table_03 ex_table_04 \ ex_table_05 ex_table_06 ex_table_07 ex_table_08 \ @@ -43,7 +43,7 @@ EXAMPLE_PROG = ex_lite1 ex_lite2 ex_lite3 ptExampleFL ptExampleVL \ # Install files # List all file that should be installed in examples directory -INSTALL_FILES = ex_lite1.c ex_lite2.c ex_lite3.c ptExampleFL.c ptExampleVL.c \ +INSTALL_FILES = ex_lite1.c ex_lite2.c ex_lite3.c ptExampleFL.c \ ex_image1.c ex_image2.c \ ex_table_01.c ex_table_02.c ex_table_03.c ex_table_04.c \ ex_table_05.c ex_table_06.c ex_table_07.c ex_table_08.c \ @@ -75,7 +75,6 @@ ex_lite1: $(srcdir)/ex_lite1.c ex_lite2: $(srcdir)/ex_lite2.c ex_lite3: $(srcdir)/ex_lite3.c ptExampleFL: $(srcdir)/ptExampleFL.c -ptExampleVL: $(srcdir)/ptExampleVL.c ex_image1: $(srcdir)/ex_image1.c ex_image2: $(srcdir)/ex_image2.c ex_table01: $(srcdir)/ex_table01.c diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 1794e38..2713377 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -193,6 +193,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -244,7 +245,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ @@ -398,7 +398,7 @@ EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl # Don't tell automake about them, because if it knew they were programs, # it would try to compile them instead of using the h5cc script. # Use the boilerplate in config/examples.am instead. -EXAMPLE_PROG = ex_lite1 ex_lite2 ex_lite3 ptExampleFL ptExampleVL \ +EXAMPLE_PROG = ex_lite1 ex_lite2 ex_lite3 ptExampleFL \ ex_image1 ex_image2 \ ex_table_01 ex_table_02 ex_table_03 ex_table_04 \ ex_table_05 ex_table_06 ex_table_07 ex_table_08 \ @@ -408,7 +408,7 @@ EXAMPLE_PROG = ex_lite1 ex_lite2 ex_lite3 ptExampleFL ptExampleVL \ # Install files # List all file that should be installed in examples directory -INSTALL_FILES = ex_lite1.c ex_lite2.c ex_lite3.c ptExampleFL.c ptExampleVL.c \ +INSTALL_FILES = ex_lite1.c ex_lite2.c ex_lite3.c ptExampleFL.c \ ex_image1.c ex_image2.c \ ex_table_01.c ex_table_02.c ex_table_03.c ex_table_04.c \ ex_table_05.c ex_table_06.c ex_table_07.c ex_table_08.c \ @@ -677,7 +677,6 @@ ex_lite1: $(srcdir)/ex_lite1.c ex_lite2: $(srcdir)/ex_lite2.c ex_lite3: $(srcdir)/ex_lite3.c ptExampleFL: $(srcdir)/ptExampleFL.c -ptExampleVL: $(srcdir)/ptExampleVL.c ex_image1: $(srcdir)/ex_image1.c ex_image2: $(srcdir)/ex_image2.c ex_table01: $(srcdir)/ex_table01.c diff --git a/hl/examples/ptExampleVL.c b/hl/examples/ptExampleVL.c deleted file mode 100644 index 310aa07..0000000 --- a/hl/examples/ptExampleVL.c +++ /dev/null @@ -1,126 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include "hdf5.h" -#include "hdf5_hl.h" -#include <stdlib.h> - -/*------------------------------------------------------------------------- - * Packet Table Variable-Length Example - * - * Example program that creates a variable-length packet table and performs - * writes and reads. - * - *------------------------------------------------------------------------- - */ - -int main(void) -{ -#ifdef VLPT_REMOVED - hid_t fid; /* File identifier */ - hid_t ptable; /* Packet table identifier */ - - herr_t err; /* Function return status */ - hsize_t count; /* Number of records in the table */ - int x; /* Loop variable */ - - /* Buffers to hold data */ - hvl_t writeBuffer[5]; - hvl_t readBuffer[5]; - - /* This example has two different sizes of "record": longs and shorts */ - long longBuffer[5]; - short shortBuffer[5]; - - /* Initialize buffers */ - for(x=0; x<5; x++) - { - longBuffer[x] = -x; - shortBuffer[x] = x; - } - - /* Fill the write buffer with a mix of longs and shorts */ - /* We need to supply the length of each record and a pointer to */ - /* the beginning of each record. */ - writeBuffer[0].len = sizeof(long); - writeBuffer[0].p = &(longBuffer[0]); - writeBuffer[1].len = sizeof(short); - writeBuffer[1].p = &(shortBuffer[1]); - writeBuffer[2].len = sizeof(long); - writeBuffer[2].p = &(longBuffer[2]); - writeBuffer[3].len = sizeof(long); - writeBuffer[3].p = &(longBuffer[3]); - writeBuffer[4].len = sizeof(short); - writeBuffer[4].p = &(shortBuffer[4]); - - /* Create a file using default properties */ - fid=H5Fcreate("packet_table_VLexample.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT); - - /* Create a variable-length packet table within the file */ - ptable = H5PTcreate_vl(fid, "Packet Test Dataset", (hsize_t)1); - if(ptable == H5I_INVALID_HID) - goto out; - - /* Write the entire buffer to the packet table */ - err = H5PTappend(ptable, (hsize_t)5, writeBuffer ); - if(err < 0) - goto out; - - /* Get the number of packets in the packet table. This should be five. */ - err = H5PTget_num_packets(ptable, &count); - if(err < 0) - goto out; - - printf("Number of packets in packet table after five appends: %d\n", count); - - /* Read all five packets back */ - err = H5PTread_packets(ptable, (hsize_t)0, (hsize_t)5, readBuffer ); - if(err < 0) - goto out; - - for(x=0; x<5; x++) - { - printf("Packet %d's length is %d\n", x, readBuffer[x].len); - if(readBuffer[x].len == sizeof(long)) - printf("Packet %d's value is %d\n", x, *( (long *) readBuffer[x].p) ); - else - printf("Packet %d's value is %d\n", x, *( (short *) readBuffer[x].p) ); - } - - /* Before we close the packet table, we must free the memory that */ - /* the pointers in readBuffer point to. */ - err = H5PTfree_vlen_readbuff(ptable, (hsize_t)5, readBuffer); - if(err < 0) - goto out; - - /* Close the packet table */ - err = H5PTclose(ptable); - if(err < 0) - goto out; - - /* Close the file */ - H5Fclose(fid); -#endif /* VLPT_REMOVED */ - - return 0; - -#ifdef VLPT_REMOVED - out: /* An error has occurred. Clean up and exit. */ - fprintf(stderr, "An error has occurred!\n"); - H5PTclose(ptable); - H5Fclose(fid); - return -1; -#endif /* VLPT_REMOVED */ -} diff --git a/hl/examples/run-hlc-ex.sh.in b/hl/examples/run-hlc-ex.sh.in index a82e591..a79f67a 100644 --- a/hl/examples/run-hlc-ex.sh.in +++ b/hl/examples/run-hlc-ex.sh.in @@ -76,8 +76,6 @@ then rm ex_lite3 &&\ RunTest ptExampleFL &&\ rm ptExampleFL &&\ - RunTest ptExampleVL &&\ - rm ptExampleVL &&\ RunTest ex_image1 &&\ rm ex_image1 &&\ RunTest ex_image2 &&\ |