diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2013-04-04 20:57:59 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2013-04-04 20:57:59 (GMT) |
commit | 8277409a9b52049af6f18aa2a6688c85cebb7695 (patch) | |
tree | 74f743b0b6a3ccb5c7a2b97f26c8c4ff07310fd3 /test/dynlib3.c | |
parent | 70e0f8e200cec594ae5340a3210f349d5f2e63ed (diff) | |
download | hdf5-8277409a9b52049af6f18aa2a6688c85cebb7695.zip hdf5-8277409a9b52049af6f18aa2a6688c85cebb7695.tar.gz hdf5-8277409a9b52049af6f18aa2a6688c85cebb7695.tar.bz2 |
[svn-r23549] Description:
More misc. cleanups, but main change is to make an "extern" header file
for the plugin interface.
Tested on:
Mac OSX/64 10.8.3 (amazon)
Diffstat (limited to 'test/dynlib3.c')
-rw-r--r-- | test/dynlib3.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/test/dynlib3.c b/test/dynlib3.c index 276a5b7..9560b86 100644 --- a/test/dynlib3.c +++ b/test/dynlib3.c @@ -21,7 +21,7 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <hdf5.h> +#include "H5PLextern.h" #define H5Z_FILTER_DYNLIB3 259 #define SUFFIX_LEN 8 @@ -41,8 +41,8 @@ const H5Z_class2_t H5Z_DYNLIB3[1] = {{ (H5Z_func_t)H5Z_filter_dynlib3, /* The actual filter function */ }}; -H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} -H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB3;} +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB3;} /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib3 @@ -68,23 +68,24 @@ H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, size_t ret_value; /* Return value */ /* Check for the correct number of parameters */ - if(cd_nelmts>0) + if(cd_nelmts > 0) return(0); if(flags & H5Z_FLAG_REVERSE) { /*read*/ ret_value = *buf_size = nbytes - SUFFIX_LEN; - } else { /*write*/ + } /* end if */ + else { /*write*/ void *outbuf = NULL; /* Pointer to new buffer */ unsigned char *dst; /* Temporary pointer to destination buffer */ - dst=outbuf=malloc(nbytes+SUFFIX_LEN); + dst = (unsigned char *)(outbuf = malloc(nbytes + SUFFIX_LEN)); /* Copy raw data */ memcpy((void*)dst, (void*)(*buf), nbytes); /* Append suffix to raw data for storage */ dst += nbytes; - memcpy((void*)dst, (void*)GROUP_SUFFIX, SUFFIX_LEN); + memcpy(dst, (void*)GROUP_SUFFIX, SUFFIX_LEN); /* Free input buffer */ free(*buf); @@ -97,4 +98,5 @@ H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, } /* end else */ return ret_value; -} +} /* H5Z_filter_dynlib3() */ + |