MISR Toolkit  1.5.1
H5Ppkg.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  * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
16  * Friday, November 16, 2001
17  *
18  * Purpose: This file contains declarations which are visible only within
19  * the H5P package. Source files outside the H5P package should
20  * include H5Pprivate.h instead.
21  */
22 #ifndef H5P_PACKAGE
23 #error "Do not include this file outside the H5P package!"
24 #endif
25 
26 #ifndef _H5Ppkg_H
27 #define _H5Ppkg_H
28 
29 /* Get package's private header */
30 #include "H5Pprivate.h"
31 
32 /* Other private headers needed by this file */
33 #include "H5SLprivate.h" /* Skip lists */
34 
35 /**************************/
36 /* Package Private Macros */
37 /**************************/
38 
39 
40 /****************************/
41 /* Package Private Typedefs */
42 /****************************/
43 
44 /* Define enum for type of object that property is within */
45 typedef enum {
46  H5P_PROP_WITHIN_UNKNOWN=0, /* Property container is unknown */
47  H5P_PROP_WITHIN_LIST, /* Property is within a list */
48  H5P_PROP_WITHIN_CLASS /* Property is within a class */
50 
51 /* Define enum for modifications to class */
52 typedef enum {
53  H5P_MOD_ERR=(-1), /* Indicate an error */
54  H5P_MOD_INC_CLS, /* Increment the dependant class count*/
55  H5P_MOD_DEC_CLS, /* Decrement the dependant class count*/
56  H5P_MOD_INC_LST, /* Increment the dependant list count*/
57  H5P_MOD_DEC_LST, /* Decrement the dependant list count*/
58  H5P_MOD_INC_REF, /* Increment the ID reference count*/
59  H5P_MOD_DEC_REF, /* Decrement the ID reference count*/
60  H5P_MOD_MAX /* Upper limit on class modifications */
62 
63 /* Define structure to hold property information */
64 typedef struct H5P_genprop_t {
65  /* Values for this property */
66  char *name; /* Name of property */
67  size_t size; /* Size of property value */
68  void *value; /* Pointer to property value */
69  H5P_prop_within_t type; /* Type of object the property is within */
70  hbool_t shared_name; /* Whether the name is shared or not */
71 
72  /* Callback function pointers & info */
73  H5P_prp_create_func_t create; /* Function to call when a property is created */
74  H5P_prp_set_func_t set; /* Function to call when a property value is set */
75  H5P_prp_get_func_t get; /* Function to call when a property value is retrieved */
76  H5P_prp_delete_func_t del; /* Function to call when a property is deleted */
77  H5P_prp_copy_func_t copy; /* Function to call when a property is copied */
78  H5P_prp_compare_func_t cmp; /* Function to call when a property is compared */
79  H5P_prp_close_func_t close; /* Function to call when a property is closed */
81 
82 /* Define structure to hold class information */
84  struct H5P_genclass_t *parent; /* Pointer to parent class */
85  char *name; /* Name of property list class */
86  H5P_plist_type_t type; /* Type of property */
87  size_t nprops; /* Number of properties in class */
88  unsigned plists; /* Number of property lists that have been created since the last modification to the class */
89  unsigned classes; /* Number of classes that have been derived since the last modification to the class */
90  unsigned ref_count; /* Number of oustanding ID's open on this class object */
91  hbool_t deleted; /* Whether this class has been deleted and is waiting for dependent classes & proplists to close */
92  unsigned revision; /* Revision number of a particular class (global) */
93  H5SL_t *props; /* Skip list containing properties */
94 
95  /* Callback function pointers & info */
96  H5P_cls_create_func_t create_func; /* Function to call when a property list is created */
97  void *create_data; /* Pointer to user data to pass along to create callback */
98  H5P_cls_copy_func_t copy_func; /* Function to call when a property list is copied */
99  void *copy_data; /* Pointer to user data to pass along to copy callback */
100  H5P_cls_close_func_t close_func; /* Function to call when a property list is closed */
101  void *close_data; /* Pointer to user data to pass along to close callback */
102 };
103 
104 /* Define structure to hold property list information */
106  H5P_genclass_t *pclass; /* Pointer to class info */
107  hid_t plist_id; /* Copy of the property list ID (for use in close callback) */
108  size_t nprops; /* Number of properties in class */
109  hbool_t class_init; /* Whether the class initialization callback finished successfully */
110  H5SL_t *del; /* Skip list containing names of deleted properties */
111  H5SL_t *props; /* Skip list containing properties */
112 };
113 
114 /* Function pointer for library classes with properties to register */
117 
118 /*
119  * Each library property list class has a variable of this type that contains
120  * class variables and methods used to initialize the class.
121  */
122 typedef struct H5P_libclass_t {
123  const char *name; /* Class name */
124  H5P_plist_type_t type; /* Class type */
125 
126  H5P_genclass_t * * par_pclass; /* Pointer to global parent class property list class */
127  H5P_genclass_t * * pclass; /* Pointer to global property list class */
128  hid_t * const class_id; /* Pointer to global property list class ID */
129  hid_t * const def_plist_id; /* Pointer to global default property list ID */
130  H5P_reg_prop_func_t reg_prop_func; /* Register class's properties */
131 
132  /* Class callback function pointers & info */
133  H5P_cls_create_func_t create_func; /* Function to call when a property list is created */
134  void *create_data; /* Pointer to user data to pass along to create callback */
135  H5P_cls_copy_func_t copy_func; /* Function to call when a property list is copied */
136  void *copy_data; /* Pointer to user data to pass along to copy callback */
137  H5P_cls_close_func_t close_func; /* Function to call when a property list is closed */
138  void *close_data; /* Pointer to user data to pass along to close callback */
140 
141 /* Property list/class iterator callback function pointer */
142 typedef int (*H5P_iterate_int_t)(H5P_genprop_t *prop, void *udata);
143 
144 /* Forward declarations (for prototypes & struct definitions) */
145 struct H5Z_filter_info_t;
146 
147 /*****************************/
148 /* Package Private Variables */
149 /*****************************/
150 
151 
152 /******************************/
153 /* Package Private Prototypes */
154 /******************************/
155 
156 /* Private functions, not part of the publicly documented API */
160  const char *name, H5P_plist_type_t type,
161  H5P_cls_create_func_t cls_create, void *create_data,
162  H5P_cls_copy_func_t cls_copy, void *copy_data,
163  H5P_cls_close_func_t cls_close, void *close_data);
165 H5_DLL herr_t H5P_register_real(H5P_genclass_t *pclass, const char *name, size_t size,
166  const void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set,
167  H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete,
169  H5P_prp_close_func_t prp_close);
170 H5_DLL herr_t H5P_register(H5P_genclass_t **pclass, const char *name, size_t size,
171  const void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set,
172  H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete,
174  H5P_prp_close_func_t prp_close);
175 H5_DLL herr_t H5P_add_prop(H5SL_t *props, H5P_genprop_t *prop);
177 H5_DLL htri_t H5P_exist_pclass(H5P_genclass_t *pclass, const char *name);
178 H5_DLL herr_t H5P_get_size_plist(const H5P_genplist_t *plist, const char *name,
179  size_t *size);
181  size_t *size);
182 H5_DLL herr_t H5P_get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops);
183 H5_DLL int H5P_cmp_class(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2);
184 H5_DLL herr_t H5P_cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2,
185  int *cmp_ret);
186 H5_DLL int H5P_iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop,
187  int *idx, H5P_iterate_int_t iter_func, void *iter_data);
188 H5_DLL int H5P_iterate_pclass(const H5P_genclass_t *pclass, int *idx,
189  H5P_iterate_int_t iter_func, void *iter_data);
190 H5_DLL herr_t H5P_copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name);
191 H5_DLL herr_t H5P_copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name);
192 H5_DLL herr_t H5P_unregister(H5P_genclass_t *pclass, const char *name);
194 H5_DLL H5P_genclass_t *H5P_open_class_path(const char *path);
196 H5_DLL herr_t H5P_close_class(void *_pclass);
197 H5_DLL H5P_genprop_t *H5P__find_prop_plist(const H5P_genplist_t *plist, const char *name);
198 
199 /* Private OCPL routines */
200 H5_DLL herr_t H5P_get_filter(const struct H5Z_filter_info_t *filter,
201  unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[],
202  size_t namelen, char name[], unsigned *filter_config);
203 
204 /* Testing functions */
205 #ifdef H5P_TESTING
206 H5_DLL char *H5P_get_class_path_test(hid_t pclass_id);
207 H5_DLL hid_t H5P_open_class_path_test(const char *path);
208 H5_DLL herr_t H5P_reset_external_file_test(hid_t dcpl_id);
209 #endif /* H5P_TESTING */
210 
211 #endif /* _H5Ppkg_H */
212 
unsigned revision
Definition: H5Ppkg.h:92
H5P_prp_create_func_t create
Definition: H5Ppkg.h:73
size_t size
Definition: H5Ppkg.h:67
H5P_cls_create_func_t create_func
Definition: H5Ppkg.h:96
void * create_data
Definition: H5Ppkg.h:134
unsigned int hbool_t
Definition: H5public.h:142
size_t nprops
Definition: H5Ppkg.h:87
HDFFCLIBAPI intf * idx
char * name
Definition: H5Ppkg.h:85
HDFFCLIBAPI intf intf intf * namelen
H5P_prp_close_func_t close
Definition: H5Ppkg.h:79
H5P_prp_cb2_t H5P_prp_get_func_t
Definition: H5Ppublic.h:116
void * close_data
Definition: H5Ppkg.h:138
H5_DLL int H5P_iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop, int *idx, H5P_iterate_int_t iter_func, void *iter_data)
hid_t plist_id
Definition: H5Ppkg.h:107
H5_DLL H5P_genclass_t * H5P_get_class_parent(const H5P_genclass_t *pclass)
H5_DLL herr_t H5P_copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name)
#define H5_DLL
Definition: H5api_adpt.h:256
hbool_t deleted
Definition: H5Ppkg.h:91
H5_DLL herr_t H5P_register_real(H5P_genclass_t *pclass, const char *name, size_t size, const void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close)
H5P_cls_close_func_t close_func
Definition: H5Ppkg.h:100
unsigned plists
Definition: H5Ppkg.h:88
H5_DLL herr_t H5P_cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, int *cmp_ret)
int herr_t
Definition: H5public.h:124
H5P_cls_copy_func_t copy_func
Definition: H5Ppkg.h:98
herr_t(* H5P_cls_create_func_t)(hid_t prop_id, void *create_data)
Definition: H5Ppublic.h:106
H5P_genclass_t ** pclass
Definition: H5Ppkg.h:127
hbool_t shared_name
Definition: H5Ppkg.h:70
struct H5P_genprop_t H5P_genprop_t
H5P_prp_cb1_t H5P_prp_copy_func_t
Definition: H5Ppublic.h:118
H5P_prop_within_t
Definition: H5Ppkg.h:45
H5_DLL int H5P_iterate_pclass(const H5P_genclass_t *pclass, int *idx, H5P_iterate_int_t iter_func, void *iter_data)
H5_DLL herr_t H5P_register(H5P_genclass_t **pclass, const char *name, size_t size, const void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close)
unsigned classes
Definition: H5Ppkg.h:89
void * create_data
Definition: H5Ppkg.h:97
char * name
Definition: H5Ppkg.h:66
H5P_prop_within_t type
Definition: H5Ppkg.h:69
int(* H5P_iterate_int_t)(H5P_genprop_t *prop, void *udata)
Definition: H5Ppkg.h:142
H5_DLL H5P_genclass_t * H5P_copy_pclass(H5P_genclass_t *pclass)
struct H5P_genclass_t * parent
Definition: H5Ppkg.h:84
H5P_cls_copy_func_t copy_func
Definition: H5Ppkg.h:135
H5SL_t * props
Definition: H5Ppkg.h:111
H5P_cls_create_func_t create_func
Definition: H5Ppkg.h:133
H5_DLL herr_t H5P_copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name)
static double mod(double a, double b)
herr_t(* H5P_reg_prop_func_t)(H5P_genclass_t *pclass)
Definition: H5Ppkg.h:116
size_t nprops
Definition: H5Ppkg.h:108
void * close_data
Definition: H5Ppkg.h:101
H5P_plist_type_t type
Definition: H5Ppkg.h:86
H5_DLL herr_t H5P_close_class(void *_pclass)
H5P_genclass_t * pclass
Definition: H5Ppkg.h:106
H5P_prp_compare_func_t cmp
Definition: H5Ppkg.h:78
H5_DLL herr_t H5P_get_size_plist(const H5P_genplist_t *plist, const char *name, size_t *size)
int hid_t
Definition: H5Ipublic.h:54
H5_DLL herr_t H5P__term_pub_interface(void)
H5P_plist_type_t type
Definition: H5Ppkg.h:124
H5P_prp_cb2_t H5P_prp_set_func_t
Definition: H5Ppublic.h:115
H5_DLL char * H5P_get_class_path(H5P_genclass_t *pclass)
H5_DLL herr_t H5P_get_filter(const struct H5Z_filter_info_t *filter, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config)
hid_t *const def_plist_id
Definition: H5Ppkg.h:129
H5_DLL herr_t H5P__term_deprec_interface(void)
H5P_prp_delete_func_t del
Definition: H5Ppkg.h:76
hid_t *const class_id
Definition: H5Ppkg.h:128
void * copy_data
Definition: H5Ppkg.h:99
struct H5P_libclass_t H5P_libclass_t
H5_DLL herr_t H5P_get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops)
H5_DLL int H5P_cmp_class(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2)
H5_DLL H5P_genprop_t * H5P__find_prop_plist(const H5P_genplist_t *plist, const char *name)
H5P_genclass_t ** par_pclass
Definition: H5Ppkg.h:126
herr_t(* H5P_cls_copy_func_t)(hid_t new_prop_id, hid_t old_prop_id, void *copy_data)
Definition: H5Ppublic.h:107
H5_DLL herr_t H5P_get_size_pclass(H5P_genclass_t *pclass, const char *name, size_t *size)
void * copy_data
Definition: H5Ppkg.h:136
hbool_t class_init
Definition: H5Ppkg.h:109
H5P_prp_cb1_t H5P_prp_close_func_t
Definition: H5Ppublic.h:120
H5P_prp_cb2_t H5P_prp_delete_func_t
Definition: H5Ppublic.h:117
H5SL_t * props
Definition: H5Ppkg.h:93
herr_t(* H5P_cls_close_func_t)(hid_t prop_id, void *close_data)
Definition: H5Ppublic.h:109
HDFFCLIBAPI intf intf * flags
H5P_cls_close_func_t close_func
Definition: H5Ppkg.h:137
int(* H5P_prp_compare_func_t)(const void *value1, const void *value2, size_t size)
Definition: H5Ppublic.h:119
herr_t(* H5P_init_class_op_t)(H5P_genclass_t *pclass)
Definition: H5Ppkg.h:115
H5_DLL herr_t H5P_add_prop(H5SL_t *props, H5P_genprop_t *prop)
H5_DLL H5P_genclass_t * H5P_create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t type, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data)
H5_DLL H5P_genclass_t * H5P_open_class_path(const char *path)
H5P_class_mod_t
Definition: H5Ppkg.h:52
H5P_prp_cb1_t H5P_prp_create_func_t
Definition: H5Ppublic.h:114
int htri_t
Definition: H5public.h:143
H5_DLL herr_t H5P_access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod)
H5SL_t * del
Definition: H5Ppkg.h:110
H5P_reg_prop_func_t reg_prop_func
Definition: H5Ppkg.h:130
unsigned ref_count
Definition: H5Ppkg.h:90
H5_DLL herr_t H5P_unregister(H5P_genclass_t *pclass, const char *name)
H5P_prp_copy_func_t copy
Definition: H5Ppkg.h:77
void * value
Definition: H5Ppkg.h:68
H5_DLL htri_t H5P_exist_pclass(H5P_genclass_t *pclass, const char *name)
const char * name
Definition: H5Ppkg.h:123

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:53