Adds an scalar attribute to a compound type.
Arguments:
loc_id: The type the attribute should be appended to.
name: The name of the attribute.
offset: At what offset in the data does this attribute begin.
fmt: A string describing the format of the datatype, e.g. char, short, ...
Returns a negative value upon failure, otherwise the operation was successful.