1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * Copyright by The HDF Group. * 3 * Copyright by the Board of Trustees of the University of Illinois. * 4 * All rights reserved. * 5 * * 6 * This file is part of HDF5. The full HDF5 copyright notice, including * 7 * terms governing use, modification, and redistribution, is contained in * 8 * the files COPYING and Copyright.html. COPYING can be found at the root * 9 * of the source code distribution tree; Copyright.html can be found at the * 10 * root level of an installed copy of the electronic HDF5 document set and * 11 * is linked from the top-level documents page. It can also be found at * 12 * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * 13 * access to either file, you may request a copy from help@hdfgroup.org. * 14 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 15 16 module hdf5.H5Ipublic; 17 18 /* 19 * This file contains function prototypes for each exported function in 20 * the H5I module. 21 */ 22 23 /* Public headers needed by this file */ 24 import hdf5.H5public; 25 26 extern(C): 27 28 /* 29 * Library type values. Start with `1' instead of `0' because it makes the 30 * tracing output look better when hid_t values are large numbers. Change the 31 * TYPE_BITS in H5I.c if the MAXID gets larger than 32 (an assertion will 32 * fail otherwise). 33 * 34 * When adding types here, add a section to the 'misc19' test in test/tmisc.c 35 * to verify that the H5I{inc|dec|get}_ref() routines work correctly with in. 36 * 37 */ 38 39 enum H5I_type_t { 40 H5I_UNINIT = (-2), /*uninitialized type */ 41 H5I_BADID = (-1), /*invalid Type */ 42 H5I_FILE = 1, /*type ID for File objects */ 43 H5I_GROUP, /*type ID for Group objects */ 44 H5I_DATATYPE, /*type ID for Datatype objects */ 45 H5I_DATASPACE, /*type ID for Dataspace objects */ 46 H5I_DATASET, /*type ID for Dataset objects */ 47 H5I_ATTR, /*type ID for Attribute objects */ 48 H5I_REFERENCE, /*type ID for Reference objects */ 49 H5I_VFL, /*type ID for virtual file layer */ 50 H5I_GENPROP_CLS, /*type ID for generic property list classes */ 51 H5I_GENPROP_LST, /*type ID for generic property lists */ 52 H5I_ERROR_CLASS, /*type ID for error classes */ 53 H5I_ERROR_MSG, /*type ID for error messages */ 54 H5I_ERROR_STACK, /*type ID for error stacks */ 55 H5I_NTYPES /*number of library types, MUST BE LAST! */ 56 } 57 58 /* Type of atoms to return to users */ 59 alias hid_t = int; 60 enum H5_SIZEOF_HID_T = H5_SIZEOF_INT; 61 62 /* An invalid object ID. This is also negative for error return. */ 63 enum H5I_INVALID_HID = (-1); 64 65 /* 66 * Function for freeing objects. This function will be called with an object 67 * ID type number and a pointer to the object. The function should free the 68 * object and return non-negative to indicate that the object 69 * can be removed from the ID type. If the function returns negative 70 * (failure) then the object will remain in the ID type. 71 */ 72 alias H5I_free_t = herr_t function(void*); 73 74 /* Type of the function to compare objects & keys */ 75 alias H5I_search_func_t = int function(void *obj, hid_t id, void *key); 76 77 /* Public API functions */ 78 79 version(Posix) { 80 hid_t H5Iregister(H5I_type_t type, const void *object); 81 void *H5Iobject_verify(hid_t id, H5I_type_t id_type); 82 void *H5Iremove_verify(hid_t id, H5I_type_t id_type); 83 H5I_type_t H5Iget_type(hid_t id); 84 hid_t H5Iget_file_id(hid_t id); 85 ssize_t H5Iget_name(hid_t id, char *name/*out*/, size_t size); 86 int H5Iinc_ref(hid_t id); 87 int H5Idec_ref(hid_t id); 88 int H5Iget_ref(hid_t id); 89 H5I_type_t H5Iregister_type(size_t hash_size, uint reserved, H5I_free_t free_func); 90 herr_t H5Iclear_type(H5I_type_t type, hbool_t force); 91 herr_t H5Idestroy_type(H5I_type_t type); 92 int H5Iinc_type_ref(H5I_type_t type); 93 int H5Idec_type_ref(H5I_type_t type); 94 int H5Iget_type_ref(H5I_type_t type); 95 void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key); 96 herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members); 97 htri_t H5Itype_exists(H5I_type_t type); 98 htri_t H5Iis_valid(hid_t id); 99 } 100