tptypes - routine to determine information about a typed buffer
#include <atmi.h> long tptypes(char *ptr, char *type, char *subtype)
tptypes() takes as its first argument a pointer to a data buffer and returns the type and subtype of that buffer in its second and third arguments, respectively. ptr must point to a buffer gotten from tpalloc(3c). If type and subtype are non-NULL, then the function populates the character arrays to which they point with the names of the buffer's type and subtype, respectively. If the names are of their maximum length (8 for type, 16 for subtype), the character array is not null-terminated. If no subtype exists, then the array pointed to by subtype will contain a NULL string.
Note that only the first eight bytes of type and the first 16 bytes of subtype are populated.
Upon success, tptypes() returns the size of the buffer; otherwise it returns -1 upon failure and sets tperrno to indicate the error condition.
Under the following conditions, tptypes() fails and sets tperrno to: