HDF5  1.12.0
H5UCprivate.h
Go to the documentation of this file.
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 COPYING file, which can be found at the root of the source code *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
10  * If you do not have access to either file, you may request a copy from *
11  * help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*
15  * This file contains private information about the H5UC module
16  * The module used to be H5RC, but changed to H5UC because of
17  * conflicting requirement for the use of H5RC.
18  */
19 
20 #ifndef _H5UCprivate_H
21 #define _H5UCprivate_H
22 
23 /**************************************/
24 /* Public headers needed by this file */
25 /**************************************/
26 #ifdef LATER
27 #include "H5UCpublic.h"
28 #endif /* LATER */
29 
30 /***************************************/
31 /* Private headers needed by this file */
32 /***************************************/
33 #include "H5private.h"
34 
35 /************/
36 /* Typedefs */
37 /************/
38 
39 /* Typedef for function to release object when reference count drops to zero */
40 typedef herr_t (*H5UC_free_func_t)(void *o);
41 
42 /* Typedef for reference counted objects */
43 typedef struct H5UC_t {
44  void *o; /* Object to be reference counted */
45  size_t n; /* Reference count of number of pointers sharing object */
46  H5UC_free_func_t free_func; /* Function to free object */
48 
49 /**********/
50 /* Macros */
51 /**********/
52 #define H5UC_INC(rc) ((rc)->n++)
53 #define H5UC_DEC(rc) (H5UC_decr(rc))
54 #define H5UC_GET_OBJ(rc) ((rc)->o)
55 
56 /********************/
57 /* Private routines */
58 /********************/
59 H5_DLL H5UC_t *H5UC_create(void *s, H5UC_free_func_t free_func);
61 
62 #endif /* _H5RSprivate_H */
63 
64 
H5UC_create
H5_DLL H5UC_t * H5UC_create(void *s, H5UC_free_func_t free_func)
Definition: H5UC.c:57
H5UC_t::o
void * o
Definition: H5UCprivate.h:44
H5UC_free_func_t
herr_t(* H5UC_free_func_t)(void *o)
Definition: H5UCprivate.h:40
H5UC_t::n
size_t n
Definition: H5UCprivate.h:45
H5UC_t
struct H5UC_t H5UC_t
H5UC_t
Definition: H5UCprivate.h:43
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5UC_t::free_func
H5UC_free_func_t free_func
Definition: H5UCprivate.h:46
herr_t
int herr_t
Definition: H5public.h:128
H5private.h
H5UC_decr
H5_DLL herr_t H5UC_decr(H5UC_t *rc)
Definition: H5UC.c:101