Ejemplo n.º 1
0
// OpenDatatype opens a named datatype.
func OpenDatatype(c CommonFG, name string, tapl_id int) (*Datatype, error) {
	c_name := C.CString(name)
	defer C.free(unsafe.Pointer(c_name))

	id := C.H5Topen2(C.hid_t(c.id), c_name, C.hid_t(tapl_id))
	if err := checkID(id); err != nil {
		return nil, err
	}
	return NewDatatype(id), nil
}
Ejemplo n.º 2
0
// Opens a named datatype.
// hid_t H5Topen2( hid_t loc_id, const char * name, hid_t tapl_id )
func (f *File) OpenDataType(name string, tapl_id int) (*DataType, error) {
	c_name := C.CString(name)
	defer C.free(unsafe.Pointer(c_name))

	hid := C.H5Topen2(f.id, c_name, C.hid_t(tapl_id))
	err := togo_err(C.herr_t(hid))
	if err != nil {
		return nil, err
	}
	dt := &DataType{id: hid}
	runtime.SetFinalizer(dt, (*DataType).h5t_finalizer)
	return dt, err
}
Ejemplo n.º 3
0
func OpenDatatype(c CommonFG, name string, tapl_id int) (*Datatype, error) {
	c_name := C.CString(name)
	defer C.free(unsafe.Pointer(c_name))

	id := C.H5Topen2(C.hid_t(c.id), c_name, C.hid_t(tapl_id))
	err := h5err(C.herr_t(id))
	if err != nil {
		return nil, err
	}
	dt := &Datatype{Location{Identifier{id}}}
	runtime.SetFinalizer(dt, (*Datatype).finalizer)
	return dt, err
}
Ejemplo n.º 4
0
Archivo: h5t.go Proyecto: pauh/go-hdf5
func openDatatype(loc_id C.hid_t, name string, tapl_id int) (*Datatype, error) {
	c_name := C.CString(name)
	defer C.free(unsafe.Pointer(c_name))

	hid := C.H5Topen2(C.hid_t(loc_id), c_name, C.hid_t(tapl_id))
	err := h5err(C.herr_t(hid))
	if err != nil {
		return nil, err
	}
	dt := &Datatype{id: hid}
	runtime.SetFinalizer(dt, (*Datatype).finalizer)
	return dt, err
}