Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-18 09:16:04

0001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
0002  * Copyright by The HDF Group.                                               *
0003  * All rights reserved.                                                      *
0004  *                                                                           *
0005  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
0006  * terms governing use, modification, and redistribution, is contained in    *
0007  * the COPYING file, which can be found at the root of the source code       *
0008  * distribution tree, or in https://www.hdfgroup.org/licenses.               *
0009  * If you do not have access to either file, you may request a copy from     *
0010  * help@hdfgroup.org.                                                        *
0011  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
0012 
0013 /*
0014  * This file contains public declarations for the H5PL module.
0015  */
0016 
0017 #ifndef H5PLpublic_H
0018 #define H5PLpublic_H
0019 
0020 #include "H5public.h" /* Generic Functions                        */
0021 
0022 /*******************/
0023 /* Public Typedefs */
0024 /*******************/
0025 
0026 /* Special string to indicate no plugin loading.
0027  */
0028 #define H5PL_NO_PLUGIN "::"
0029 
0030 //! <!-- [H5PL_type_t_snip] -->
0031 /**
0032  * Plugin type (bit-position) used by the plugin library
0033  */
0034 typedef enum H5PL_type_t {
0035     H5PL_TYPE_ERROR  = -1, /**< Error                */
0036     H5PL_TYPE_FILTER = 0,  /**< Filter               */
0037     H5PL_TYPE_VOL    = 1,  /**< VOL connector        */
0038     H5PL_TYPE_VFD    = 2,  /**< VFD                  */
0039     H5PL_TYPE_NONE   = 3   /**< Sentinel: This must be last!   */
0040 } H5PL_type_t;
0041 //! <!-- [H5PL_type_t_snip] -->
0042 
0043 /* Common dynamic plugin type flags used by the set/get_loading_state functions */
0044 #define H5PL_FILTER_PLUGIN 0x0001
0045 #define H5PL_VOL_PLUGIN    0x0002
0046 #define H5PL_VFD_PLUGIN    0x0004
0047 #define H5PL_ALL_PLUGIN    0xFFFF
0048 
0049 #ifdef __cplusplus
0050 extern "C" {
0051 #endif
0052 
0053 /* plugin state */
0054 /**
0055  * \ingroup H5PL
0056  * \brief Controls the loadability of dynamic plugin types
0057  *
0058  * \param[in] plugin_control_mask The list of dynamic plugin types to enable or disable.\n
0059  *                                A plugin bit set to 0 (zero) prevents use of that dynamic plugin.\n
0060  *                                A plugin bit set to 1 (one) enables use of that dynamic plugin.\n
0061  *                                Setting \p plugin_control_mask to a negative value enables all dynamic
0062  *                                plugin types.\n
0063  *                                Setting \p plugin_control_mask to 0 (zero) disables all dynamic plugin\n
0064  *                                types.
0065  * \return \herr_t
0066  *
0067  * \details H5PLset_loading_state() uses one argument to enable or disable individual plugin types.
0068  *
0069  * \details The \p plugin_control_mask parameter is an encoded integer in which each bit controls a specific
0070  *          plugin type. Bit positions allocated to date are specified in \ref H5PL_type_t as follows:
0071  *          \snippet this H5PL_type_t_snip
0072  *
0073  *          A plugin bit set to 0 (zero) prevents the use of the dynamic plugin type corresponding to that bit
0074  *          position. A plugin bit set to 1 (one) allows the use of that dynamic plugin type.
0075  *
0076  *          All dynamic plugin types can be enabled by setting \p plugin_control_mask to a negative value. A
0077  *          value of 0 (zero) will disable all dynamic plugin types.
0078  *
0079  *          The loading of external dynamic plugins can be controlled during runtime with an environment
0080  *          variable, \c HDF5_PLUGIN_PRELOAD. H5PLset_loading_state() inspects the \c HDF5_PLUGIN_PRELOAD
0081  *          environment variable every time it is called. If the environment variable is set to the special
0082  *          \c :: string, all dynamic plugins are disabled.
0083  *
0084  * \warning The environment variable \c HDF5_PLUGIN_PRELOAD controls the loading of dynamic plugin types at
0085  *          runtime. If it is set to disable all plugin types, then it will disable them for \Emph{all}
0086  *          running programs that access the same variable instance.
0087  *
0088  * \since 1.8.15
0089  *
0090  */
0091 H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_control_mask);
0092 /**
0093  * \ingroup H5PL
0094  * \brief Queries the loadability of dynamic plugin types
0095  *
0096  * \param[out] plugin_control_mask List of dynamic plugin types that are enabled or disabled.\n
0097  *                                 A plugin bit set to 0 (zero) indicates that the dynamic plugin type is
0098  *                                 disabled.\n
0099  *                                 A plugin bit set to 1 (one) indicates that the dynamic plugin type is
0100  *                                 enabled.\n
0101  *                                 If the value of \p plugin_control_mask is negative, all dynamic plugin
0102  *                                 types are enabled.\n
0103  *                                 If the value of \p plugin_control_mask is 0 (zero), all dynamic plugins
0104  *                                 are disabled.
0105  * \return \herr_t
0106  *
0107  * \details H5PLget_loading_state() retrieves the bitmask that controls whether a certain type of plugin
0108  *          (e.g.: filters, VOL drivers) will be loaded by the HDF5 library.
0109  *
0110  *          Bit positions allocated to date are specified in \ref H5PL_type_t as follows:
0111  *          \snippet this H5PL_type_t_snip
0112  *
0113  * \since 1.8.15
0114  *
0115  */
0116 H5_DLL herr_t H5PLget_loading_state(unsigned int *plugin_control_mask /*out*/);
0117 /**
0118  * \ingroup H5PL
0119  * \brief Inserts a plugin path at the end of the plugin search path list
0120  *
0121  * \param[in] search_path A plugin path
0122  * \return \herr_t
0123  *
0124  * \details H5PLappend() inserts a plugin path at the end of the plugin search path list.
0125  *
0126  * \since 1.10.1
0127  *
0128  */
0129 H5_DLL herr_t H5PLappend(const char *search_path);
0130 /**
0131  * \ingroup H5PL
0132  * \brief Inserts a plugin path at the beginning of the plugin search path list
0133  *
0134  * \param[in] search_path A plugin path
0135  * \return \herr_t
0136  *
0137  * \details H5PLprepend() inserts a plugin path at the end of the plugin search path list.
0138  *
0139  * \since 1.10.1
0140  *
0141  */
0142 H5_DLL herr_t H5PLprepend(const char *search_path);
0143 /**
0144  * \ingroup H5PL
0145  * \brief Replaces the path at the specified index in the plugin search path list
0146  *
0147  * \param[in] search_path A plugin path
0148  * \param[in] index Index
0149  * \return \herr_t
0150  *
0151  * \details H5PLreplace() replaces a plugin path at the specified index in the plugin search path list.
0152  *
0153  * \since 1.10.1
0154  *
0155  */
0156 H5_DLL herr_t H5PLreplace(const char *search_path, unsigned int index);
0157 /**
0158  * \ingroup H5PL
0159  * \brief Inserts a path at the specified index in the plugin search path list
0160  *
0161  * \param[in] search_path A plugin path
0162  * \param[in] index Index
0163  * \return \herr_t
0164  *
0165  * \details H5PLinsert() inserts a plugin path at the specified index in the plugin search path list,
0166  *          moving other paths after \p index.
0167  *
0168  * \since 1.10.1
0169  *
0170  */
0171 H5_DLL herr_t H5PLinsert(const char *search_path, unsigned int index);
0172 /**
0173  * \ingroup H5PL
0174  * \brief Removes a plugin path at a specified index from the plugin search path list
0175  *
0176  * \param[in] index Index
0177  * \return \herr_t
0178  *
0179  * \details H5PLremove() removes a plugin path at the specified \p index and compacts the plugin search path
0180  *          list.
0181  *
0182  * \since 1.10.1
0183  *
0184  */
0185 H5_DLL herr_t H5PLremove(unsigned int index);
0186 /**
0187  * \ingroup H5PL
0188  * \brief Queries the plugin search path list at the specified index
0189  *
0190  * \param[in] index Index
0191  * \param[out] path_buf Pathname
0192  * \param[in] buf_size Size of \p path_buf
0193  * \return Returns the length of the path, a non-negative value, if successful; otherwise returns a negative
0194  *         value.
0195  *
0196  * \details H5PLget() queries the plugin path at a specified index. If \p path_buf is non-NULL then it writes
0197  *          up to \p buf_size bytes into that buffer and always returns the length of the path name.
0198  *
0199  *          If \p path_buf is NULL, this function will simply return the number of characters required to
0200  *          store the path name, ignoring \p path_buf and \p buf_size.
0201  *
0202  *          If an error occurs then the buffer pointed to by \p path_buf (NULL or non-NULL) is unchanged and
0203  *          the function returns a negative value. If a zero is returned for the name's length, then there is
0204  *          no path name associated with the index. and the \p path_buf buffer will be unchanged.
0205  *
0206  * \since 1.10.1
0207  *
0208  */
0209 H5_DLL ssize_t H5PLget(unsigned int index, char *path_buf /*out*/, size_t buf_size);
0210 /**
0211  * \ingroup H5PL
0212  * \brief Retrieves the number of stored plugin paths
0213  *
0214  * \param[out] num_paths Current length of the plugin search path list
0215  * \return \herr_t
0216  *
0217  * \details H5PLsize() retrieves the number of paths stored in the plugin search path list.
0218  *
0219  * \since 1.10.1
0220  *
0221  */
0222 H5_DLL herr_t H5PLsize(unsigned int *num_paths /*out*/);
0223 
0224 #ifdef __cplusplus
0225 }
0226 #endif
0227 
0228 #endif /* H5PLpublic_H */