summaryrefslogtreecommitdiffstats
path: root/src/H5Tpkg.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-09-02 15:04:36 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-09-02 15:04:36 (GMT)
commit32a666f65243a0583be867935b892dd4ae13d1f4 (patch)
tree0378b28295a0eb21d6199ae84d4d023646d44fa2 /src/H5Tpkg.h
parent38d6179b319519ece95e6af9da1720cd63b0e4ac (diff)
downloadhdf5-32a666f65243a0583be867935b892dd4ae13d1f4.zip
hdf5-32a666f65243a0583be867935b892dd4ae13d1f4.tar.gz
hdf5-32a666f65243a0583be867935b892dd4ae13d1f4.tar.bz2
[svn-r7438] Purpose:
Code cleanup Description: More de-linting... Platforms tested: FreeBSD 4.9 (sleipnir) too small to need h5committest
Diffstat (limited to 'src/H5Tpkg.h')
-rw-r--r--src/H5Tpkg.h43
1 files changed, 25 insertions, 18 deletions
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index fab832b..49a1ca8 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -50,10 +50,19 @@
#define H5T_NAMELEN 32
/* Macro to ease detecting "complex" datatypes (i.e. those with base types or fields) */
-#define H5T_IS_COMPLEX(t) ((t)==H5T_COMPOUND || (t)==H5T_ENUM || (t)==H5T_VLEN || (t)==H5T_ARRAY)
+#define H5T_IS_COMPLEX(t) ((t)==H5T_COMPOUND || (t)==H5T_ENUM || (t)==H5T_VLEN || (t)==H5T_ARRAY)
+
+/* Macro to ease detecting fixed "string" datatypes */
+#define H5T_IS_FIXED_STRING(dt) (H5T_STRING == (dt)->type)
+
+/* Macro to ease detecting variable-length "string" datatypes */
+#define H5T_IS_VL_STRING(dt) (H5T_VLEN == (dt)->type && H5T_VLEN_STRING == (dt)->u.vlen.type)
/* Macro to ease detecting fixed or variable-length "string" datatypes */
-#define H5T_IS_STRING(dt) (H5T_STRING == (dt)->type || (H5T_VLEN == (dt)->type && H5T_VLEN_STRING == (dt)->u.vlen.type))
+#define H5T_IS_STRING(dt) (H5T_IS_FIXED_STRING(dt) || H5T_IS_VL_STRING(dt))
+
+/* Macro to ease detecting atomic datatypes */
+#define H5T_IS_ATOMIC(dt) (!(H5T_IS_COMPLEX((dt)->type) || (dt)->type==H5T_OPAQUE))
/* Statistics about a conversion function */
struct H5T_stats_t {
@@ -62,11 +71,11 @@ struct H5T_stats_t {
H5_timer_t timer; /*total time for conversion */
};
-/* The data type conversion database */
+/* The datatype conversion database */
struct H5T_path_t {
char name[H5T_NAMELEN]; /*name for debugging only */
- H5T_t *src; /*source data type ID */
- H5T_t *dst; /*destination data type ID */
+ H5T_t *src; /*source datatype ID */
+ H5T_t *dst; /*destination datatype ID */
H5T_conv_t func; /*data conversion function */
hbool_t is_hard; /*is it a hard function? */
H5T_stats_t stats; /*statistics for the conversion */
@@ -107,14 +116,14 @@ typedef struct H5T_atomic_t {
} u;
} H5T_atomic_t;
-/* How members are sorted for compound or enum data types */
+/* How members are sorted for compound or enum datatypes */
typedef enum H5T_sort_t {
H5T_SORT_NONE = 0, /*not sorted */
H5T_SORT_NAME = 1, /*sorted by member name */
H5T_SORT_VALUE = 2 /*sorted by memb offset or enum value*/
} H5T_sort_t;
-/* A compound data type */
+/* A compound datatype */
typedef struct H5T_compnd_t {
int nalloc; /*num entries allocated in MEMB array*/
int nmembs; /*number of members defined in struct*/
@@ -122,7 +131,7 @@ typedef struct H5T_compnd_t {
struct H5T_cmemb_t *memb; /*array of struct members */
} H5T_compnd_t;
-/* An enumeration data type */
+/* An enumeration datatype */
typedef struct H5T_enum_t {
int nalloc; /*num entries allocated */
int nmembs; /*number of members defined in enum */
@@ -157,7 +166,7 @@ typedef struct H5T_vlen_t {
H5T_vlen_writefunc_t write; /* Function to write VL sequence from buffer */
} H5T_vlen_t;
-/* An opaque data type */
+/* An opaque datatype */
typedef struct H5T_opaque_t {
char *tag; /*short type description string */
} H5T_opaque_t;
@@ -185,18 +194,18 @@ struct H5T_t {
H5T_class_t type; /*which class of type is this? */
size_t size; /*total size of an instance of this type */
hbool_t force_conv;/* Set if this type always needs to be converted and H5T_conv_noop cannot be called */
- struct H5T_t *parent;/*parent type for derived data types */
+ struct H5T_t *parent;/*parent type for derived datatypes */
union {
- H5T_atomic_t atomic; /* an atomic data type */
- H5T_compnd_t compnd; /* a compound data type (struct) */
+ H5T_atomic_t atomic; /* an atomic datatype */
+ H5T_compnd_t compnd; /* a compound datatype (struct) */
H5T_enum_t enumer; /* an enumeration type (enum) */
H5T_vlen_t vlen; /* a variable-length datatype */
- H5T_opaque_t opaque; /* an opaque data type */
+ H5T_opaque_t opaque; /* an opaque datatype */
H5T_array_t array; /* an array datatype */
} u;
};
-/* A compound data type member */
+/* A compound datatype member */
typedef struct H5T_cmemb_t {
char *name; /*name of this member */
size_t offset; /*offset from beginning of struct */
@@ -207,8 +216,8 @@ typedef struct H5T_cmemb_t {
/* The master list of soft conversion functions */
typedef struct H5T_soft_t {
char name[H5T_NAMELEN]; /*name for debugging only */
- H5T_class_t src; /*source data type class */
- H5T_class_t dst; /*destination data type class */
+ H5T_class_t src; /*source datatype class */
+ H5T_class_t dst; /*destination datatype class */
H5T_conv_t func; /*the conversion function */
} H5T_soft_t;
@@ -301,8 +310,6 @@ H5_DLL char *H5T_get_member_name(H5T_t *dt, int membno);
H5_DLL herr_t H5T_get_member_value(H5T_t *dt, int membno, void *value);
H5_DLL H5T_t *H5T_get_member_type(H5T_t *dt, int membno);
H5_DLL int H5T_get_nmembers(const H5T_t *dt);
-H5_DLL htri_t H5T_is_variable_str(H5T_t *dt);
-H5_DLL htri_t H5T_is_atomic(const H5T_t *dt);
H5_DLL herr_t H5T_insert(H5T_t *parent, const char *name, size_t offset,
const H5T_t *member);
H5_DLL H5T_t *H5T_enum_create(H5T_t *parent);