H5Zprivate.h

00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00002  * Copyright by The HDF Group.                                               *
00003  * Copyright by the Board of Trustees of the University of Illinois.         *
00004  * All rights reserved.                                                      *
00005  *                                                                           *
00006  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00007  * terms governing use, modification, and redistribution, is contained in    *
00008  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00009  * of the source code distribution tree; Copyright.html can be found at the  *
00010  * root level of an installed copy of the electronic HDF5 document set and   *
00011  * is linked from the top-level documents page.  It can also be found at     *
00012  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00013  * access to either file, you may request a copy from help@hdfgroup.org.     *
00014  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00015 
00016 /* Programmer:  Robb Matzke <matzke@llnl.gov>
00017  *              Thursday, April 16, 1998
00018  */
00019 
00020 #ifndef _H5Zprivate_H
00021 #define _H5Zprivate_H
00022 
00023 /* Include package's public header */
00024 #include "H5Zpublic.h"
00025 
00026 /* Private headers needed by this file */
00027 #include "H5Tprivate.h"         /* Datatypes                            */
00028 
00029 /**************************/
00030 /* Library Private Macros */
00031 /**************************/
00032 
00033 /* Special parameters for szip compression */
00034 /* [These are aliases for the similar definitions in szlib.h, which we can't
00035  * include directly due to the duplication of various symbols with the zlib.h
00036  * header file] */
00037 #define H5_SZIP_LSB_OPTION_MASK         8
00038 #define H5_SZIP_MSB_OPTION_MASK         16
00039 #define H5_SZIP_RAW_OPTION_MASK         128
00040 
00041 /* Common # of 'client data values' for filters */
00042 /* (avoids dynamic memory allocation in most cases) */
00043 #define H5Z_COMMON_CD_VALUES    4
00044 
00045 /* Common size of filter name */
00046 /* (avoids dynamic memory allocation in most cases) */
00047 #define H5Z_COMMON_NAME_LEN    12
00048 
00049 /****************************/
00050 /* Library Private Typedefs */
00051 /****************************/
00052 
00053 /* Structure to store information about each filter's parameters */
00054 typedef struct {
00055     H5Z_filter_t        id;             /*filter identification number       */
00056     unsigned            flags;          /*defn and invocation flags          */
00057     char                _name[H5Z_COMMON_NAME_LEN];     /*internal filter name               */
00058     char                *name;          /*optional filter name               */
00059     size_t              cd_nelmts;      /*number of elements in cd_values[]  */
00060     unsigned            _cd_values[H5Z_COMMON_CD_VALUES];       /*internal client data values                */
00061     unsigned            *cd_values;     /*client data values                 */
00062 } H5Z_filter_info_t;
00063 
00064 /*****************************/
00065 /* Library-private Variables */
00066 /*****************************/
00067 
00068 
00069 /***************************************/
00070 /* Library-private Function Prototypes */
00071 /***************************************/
00072 struct H5O_pline_t; /*forward decl*/
00073 
00074 /* Internal API routines */
00075 H5_DLL herr_t H5Z_register(const H5Z_class_t *cls);
00076 H5_DLL herr_t H5Z_unregister(H5Z_filter_t id);
00077 H5_DLL herr_t H5Z_append(struct H5O_pline_t *pline, H5Z_filter_t filter,
00078         unsigned flags, size_t cd_nelmts, const unsigned int cd_values[]);
00079 H5_DLL herr_t H5Z_modify(const struct H5O_pline_t *pline, H5Z_filter_t filter,
00080         unsigned flags, size_t cd_nelmts, const unsigned int cd_values[]);
00081 H5_DLL herr_t H5Z_pipeline(const struct H5O_pline_t *pline,
00082                             unsigned flags, unsigned *filter_mask/*in,out*/,
00083                             H5Z_EDC_t edc_read, H5Z_cb_t cb_struct,
00084                             size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/,
00085                             void **buf/*in,out*/);
00086 H5_DLL H5Z_class_t *H5Z_find(H5Z_filter_t id);
00087 H5_DLL herr_t H5Z_can_apply(hid_t dcpl_id, hid_t type_id);
00088 H5_DLL herr_t H5Z_set_local(hid_t dcpl_id, hid_t type_id);
00089 H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline,
00090         H5Z_filter_t filter);
00091 H5_DLL htri_t H5Z_all_filters_avail(const struct H5O_pline_t *pline);
00092 H5_DLL herr_t H5Z_delete(struct H5O_pline_t *pline, H5Z_filter_t filter);
00093 H5_DLL herr_t H5Z_set_latest_version(struct H5O_pline_t *pline);
00094 
00095 /* Data Transform Functions */
00096 typedef struct H5Z_data_xform_t H5Z_data_xform_t; /* Defined in H5Ztrans.c */
00097 
00098 H5_DLL H5Z_data_xform_t *H5Z_xform_create(const char *expr);
00099 H5_DLL herr_t H5Z_xform_copy(H5Z_data_xform_t **data_xform_prop);
00100 H5_DLL herr_t H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop);
00101 H5_DLL herr_t H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void *array,
00102     size_t array_size, const H5T_t *buf_type);
00103 H5_DLL hbool_t H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop);
00104 H5_DLL char* H5Z_xform_extract_xform_str(const H5Z_data_xform_t *data_xform_prop);
00105 
00106 #endif