diff options
author | Frank Baker <fbaker@hdfgroup.org> | 1998-12-21 22:52:56 (GMT) |
---|---|---|
committer | Frank Baker <fbaker@hdfgroup.org> | 1998-12-21 22:52:56 (GMT) |
commit | 82fb21b613326522eb0a51f507fd836fb5879c9a (patch) | |
tree | 7a115f14a272d6264b2fb6caafcb97bd13f8de08 /doc/html/Datatypes.html | |
parent | 4952ed4a3691e8e873fc13dd52a38feb0e0935c0 (diff) | |
download | hdf5-82fb21b613326522eb0a51f507fd836fb5879c9a.zip hdf5-82fb21b613326522eb0a51f507fd836fb5879c9a.tar.gz hdf5-82fb21b613326522eb0a51f507fd836fb5879c9a.tar.bz2 |
[svn-r985] Checking in changes from "HDF5 Release 1.0" CVS branch that have not yet
been checked into "HDF5 Development" branch.
General
=======
Various "copy edit" types of repairs.
Revisions to document cross-linking.
Added structural links tying all docs together (banners
at top and bottom of documents, similar to Reference Manual
banners of the Beta release).
Set background color to white in all documents.
NCSAfooterlogo.gif
hdf2.jpg
New image files to make the documents more self-contained
(i.e., to prevent loading images from NCSA and HDF home servers).
index.html
Redesigned to isolate links external to the installation
in a single location.
Intro to HDF5
=============
H5.intro.html
Fixed banner linking Intro to other docs.
Set all URLs to be relative within the distribution; nothing
points back to the HDF server.
Updates to "Limits of the Current Release" and "Changes in
the Current Release."
HDF5 User's Guide
=================
Changed several User Guide section titles such that all
sections that are primarily about a particular interface
are now titled in the format "The xxxxx Interface (H5x)".
H5.user.html
Commented out links to developer docs since they are marked
in MANIFEST as not being for distribution in the release.
Removed 2nd and 3rd indices from page.
Changed "freeform" lists of sections (TOCs) to aligned tables.
Datatypes.html
Removed the sentence "I'm deferring definition until later
since they're probably not as important as the other data
types." from Section 3.3, "Properties of Date and Time
Atomic Types."
Added info regarding 'char' versus 'string' datatypes. Added
as Section 3.7, "Character and String Datatype Issues."
References.html
Commented out substantial material (at end of document) from
References planning document that is not appropriate for
the User Guide but that is worth keeping around.
Groups.html
Final edits from elimination of "current working group."
HDF5 Reference Manual
=====================
Removed "Draft" from the <title>__</title> lines.
RM_H5Front.html
Removed 2nd and 3rd indices from page.
Changed "freeform" lists of sections (TOCs) to aligned tables.
RM_H5F.html
RM_H5P.html
Add file mounting information.
Diffstat (limited to 'doc/html/Datatypes.html')
-rw-r--r-- | doc/html/Datatypes.html | 225 |
1 files changed, 214 insertions, 11 deletions
diff --git a/doc/html/Datatypes.html b/doc/html/Datatypes.html index e02a7f7..604b480 100644 --- a/doc/html/Datatypes.html +++ b/doc/html/Datatypes.html @@ -4,7 +4,69 @@ <title>The Data Type Interface (H5T)</title> </head> - <body> + <body bgcolor="#FFFFFF"> + + +<hr> +<center> +<table border=0 width=98%> +<tr><td valign=top align=left> + <a href="H5.intro.html">Introduction to HDF5</a> <br> + <a href="RM_H5Front.html">HDF5 Reference Manual</a> <br> + <a href="index.html">Other HDF5 documents and links</a> <br> + <!-- + <a href="Glossary.html">Glossary</a><br> + --> +</td> +<td valign=top align=right> + And in this document, the + <a href="H5.user.html">HDF5 User's Guide</a>: + <a href="Files.html">Files</a> + <br> + <a href="Datasets.html">Datasets</a> + Data Types + <a href="Dataspaces.html">Dataspaces</a> + <a href="Groups.html">Groups</a> + <a href="References.html">References</a> + <br> + <a href="Attributes.html">Attributes</a> + <a href="Properties.html">Property Lists</a> + <a href="Errors.html">Error Handling</a> + <a href="Filters.html">Filters</a> + <a href="Caching.html">Caching</a> + <br> + <a href="Chunking.html">Chunking</a> + <a href="Debugging.html">Debugging</a> + <a href="Environment.html">Environment</a> + <a href="ddl.html">DDL</a> + <a href="Ragged.html">Ragged Arrays</a> +<!-- +<hr> +And in this document, the +<a href="H5.user.html">HDF5 User's Guide</a>: + <a href="Attributes.html">H5A</a> + <a href="Datasets.html">H5D</a> + <a href="Errors.html">H5E</a> + <a href="Files.html">H5F</a> + <a href="Groups.html">H5G</a> + <a href="Properties.html">H5P</a> + <a href="References.html">H5R & H5I</a> + <a href="Ragged.html">H5RA</a> + <a href="Dataspaces.html">H5S</a> + <a href="Datatypes.html">H5T</a> + <a href="Filters.html">H5Z</a> + <a href="Caching.html">Caching</a> + <a href="Chunking.html">Chunking</a> + <a href="Debugging.html">Debugging</a> + <a href="Environment.html">Environment</a> + <a href="ddl.html">DDL</a> +--> +</td></tr> +</table> +</center> +<hr> + + <h1>The Data Type Interface (H5T)</h1> <h2>1. Introduction</h2> @@ -358,9 +420,6 @@ <em>19971205162530</em>; as an integer value in Unix time(2) format; or other variations. - <p>I'm deferring definition until later since they're probably not - as important as the other data types. - <h3>3.4. Properties of Character String Atomic Types</h3> <p>Fixed-length character string types are used to store textual @@ -437,6 +496,88 @@ but the application is responsible for data conversion of these types. + <h3>3.7 Character and String Datatype Issues</h3> + + The <code>H5T_NATIVE_CHAR</code> and <code>H5T_NATIVE_UCHAR</code> + data types are actually numeric data (1-byte integers). If the + application wishes to store character data, then an HDF5 + <em>string</em> data type should be derived from + <code>H5T_C_S1</code> instead. + + <h4>Motivation</h4> + + HDF5 defines at least three classes of data types: + integer data, floating point data, and character data. + However, the C language defines only integer and + floating point data types; character data in C is + overloaded on the 8- or 16-bit integer types and + character strings are overloaded on arrays of those + integer types which, by convention, are terminated with + a zero element. + + In C, the variable <code>unsigned char s[256]</code> is + either an array of numeric data, a single character string + with at most 255 characters, or an array of 256 characters, + depending entirely on usage. For uniformity with the + other <code>H5T_NATIVE_</code> types, HDF5 uses the + numeric interpretation of <code>H5T_NATIVE_CHAR</code> + and <code>H5T_NATIVE_UCHAR</code>. + + + <h4>Usage</h4> + + To store <code>unsigned char s[256]</code> data as an + array of integer values, use the HDF5 data type + <code>H5T_NATIVE_UCHAR</code> and a data space that + describes the 256-element array. Some other application + that reads the data will then be able to read, say, a + 256-element array of 2-byte integers and HDF5 will + perform the numeric translation. + + To store <code>unsigned char s[256]</code> data as a + character string, derive a fixed length string data type + from <code>H5T_C_S1</code> by increasing its size to + 256 characters. Some other application that reads the + data will be able to read, say, a space padded string + of 16-bit characters and HDF5 will perform the character + and padding translations. + + <pre> + hid_t s256 = H5Tcopy(H5T_C_S1); + H5Tset_size(s256, 256); + </pre> + + To store <code>unsigned char s[256]</code> data as + an array of 256 ASCII characters, use an + HDF5 data space to describe the array and derive a + one-character string type from <code>H5T_C_S1</code>. + Some other application will be able to read a subset + of the array as 16-bit characters and HDF5 will + perform the character translations. + The <code>H5T_STR_NULLPAD</code> is necessary because + if <code>H5T_STR_NULLTERM</code> were used + (the default) then the single character of storage + would be for the null terminator and no useful data + would actually be stored (unless the length were + incremented to more than one character). + + <pre> + hid_t s1 = H5Tcopy(H5T_C_S1); + H5Tset_strpad(s1, H5T_STR_NULLPAD); + </pre> + + <h4>Summary</h4> + + The C language uses the term <code>char</code> to + represent one-byte numeric data and does not make + character strings a first-class data type. + HDF5 makes a distinction between integer and + character data and maps the C <code>signed char</code> + (<code>H5T_NATIVE_CHAR</code>) and + <code>unsigned char</code> (<code>H5T_NATIVE_UCHAR</code>) + data types to the HDF5 integer type class. + + <h2>4. Properties of Compound Types</h2> <p>A compound data type is similar to a <code>struct</code> in C @@ -1412,15 +1553,77 @@ H5Tregister(H5T_PERS_SOFT, "cus2be", conversion path whether that conversion path was actually used or not. - - <hr> - <address> - <a href="mailto:hdfhelp@ncsa.uiuc.edu">HDF Help Desk</a> - </address> +<<<<<<< Datatypes.html + + +<hr> +<center> +<table border=0 width=98%> +<tr><td valign=top align=left> + <a href="H5.intro.html">Introduction to HDF5</a> <br> + <a href="RM_H5Front.html">HDF5 Reference Manual</a> <br> + <a href="index.html">Other HDF5 documents and links</a> <br> + <!-- + <a href="Glossary.html">Glossary</a><br> + --> +</td> +<td valign=top align=right> + And in this document, the + <a href="H5.user.html">HDF5 User's Guide</a>: + <a href="Files.html">Files</a> + <br> + <a href="Datasets.html">Datasets</a> + Data Types + <a href="Dataspaces.html">Dataspaces</a> + <a href="Groups.html">Groups</a> + <a href="References.html">References</a> + <br> + <a href="Attributes.html">Attributes</a> + <a href="Properties.html">Property Lists</a> + <a href="Errors.html">Error Handling</a> + <a href="Filters.html">Filters</a> + <a href="Caching.html">Caching</a> + <br> + <a href="Chunking.html">Chunking</a> + <a href="Debugging.html">Debugging</a> + <a href="Environment.html">Environment</a> + <a href="ddl.html">DDL</a> + <a href="Ragged.html">Ragged Arrays</a> +<!-- +<hr> +And in this document, the +<a href="H5.user.html">HDF5 User's Guide</a>: + <a href="Attributes.html">H5A</a> + <a href="Datasets.html">H5D</a> + <a href="Errors.html">H5E</a> + <a href="Files.html">H5F</a> + <a href="Groups.html">H5G</a> + <a href="Properties.html">H5P</a> + <a href="References.html">H5R & H5I</a> + <a href="Ragged.html">H5RA</a> + <a href="Dataspaces.html">H5S</a> + <a href="Datatypes.html">H5T</a> + <a href="Filters.html">H5Z</a> + <a href="Caching.html">Caching</a> + <a href="Chunking.html">Chunking</a> + <a href="Debugging.html">Debugging</a> + <a href="Environment.html">Environment</a> + <a href="ddl.html">DDL</a> +--> +</td></tr> +</table> +</center> + + +<hr> +<address> +<a href="mailto:hdfhelp@ncsa.uiuc.edu">HDF Help Desk</a> +</address> <!-- Created: Thu Dec 4 14:57:32 EST 1997 --> <!-- hhmts start --> Last modified: Wed Dec 16 13:04:58 EST 1998 <!-- hhmts end --> - - </body> + + +</body> </html> |