Help us improve by taking our short survey: https://www.hdfgroup.org/website-survey/

| HDF5 Last Updated on 2025-11-11 The HDF5 Field Guide

- Main Page
- Getting started
- User Guide
- Reference Manual
- Cookbook
- Technical Notes
- RFCs
- Specifications
- Glossary
- Full-Text Search
- About

Loading...
Searching...
No Matches
Functions
Opaque Datatypes
Datatypes (H5T)

## Detailed Description

## Functions
char * | H5Tget_tag (hid_t type)
| Gets the tag associated with an opaque datatype.
herr_t | H5Tset_tag (hid_t type, const char *tag)
| Tags an opaque datatype.

## Function Documentation

## ◆ H5Tget_tag()

char * H5Tget_tag | ( | hid_t | type | ) |

Gets the tag associated with an opaque datatype.

Parameters

  [in] | type | Datatype identifier of an opaque datatype

Returns
  Returns a pointer to an allocated string if successful; otherwise returns NULL.

H5Tget_tag() returns the tag associated with the opaque datatype `type`.

Attention
  The tag is returned via a pointer to an allocated string, which the caller must free.

Since
  1.2.0

## ◆ H5Tset_tag()

herr_t H5Tset_tag | ( | hid_t | type,
|  | const char * | tag )

Tags an opaque datatype.

Parameters

  [in] | type | Datatype identifier of an opaque datatype
  [in] | tag | Descriptive ASCII string with which the opaque datatype is to be tagged

Returns
  Returns a non-negative value if successful; otherwise, returns a negative value.

H5Tset_tag() tags an opaque datatype `type` with a descriptive ASCII identifier, `tag`.

`tag` is intended to provide a concise description; the maximum size is hard-coded in the HDF5 library as 256 bytes (H5T_OPAQUE_TAG_MAX).

Version
  1.6.5 The H5T_OPAQUE_TAG_MAX macro constant, specifying the maximum size of an opaque datatype tag, was added in H5Tpublic.h.

Since
  1.2.0