diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-05-01 21:00:52 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-05-01 21:00:52 (GMT) |
commit | 2757f75317a07422c9a1d0378f969c3eb802c3a0 (patch) | |
tree | 6374d38220529efef51cbeead15f906e1782ebbd /src/H5Ounknown.c | |
parent | 4e243fd5e741fbdeaf92a484d52dbae4b0008268 (diff) | |
download | hdf5-2757f75317a07422c9a1d0378f969c3eb802c3a0.zip hdf5-2757f75317a07422c9a1d0378f969c3eb802c3a0.tar.gz hdf5-2757f75317a07422c9a1d0378f969c3eb802c3a0.tar.bz2 |
[svn-r13721] Description:
Add "fail if unknown" and "mark if unknown" flags to object header messages.
This gives the library a clean way to tell older libraries that a message should
not be just ignored if it's unknown, but that other actions should occur.
Tested on:
Mac OS X/32 10.4.9 (amazon)
FreeBSD/32 6.2 (duty)
FreeBSD/64 6.2 (liberty)
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5Ounknown.c')
-rw-r--r-- | src/H5Ounknown.c | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c new file mode 100644 index 0000000..cd805a9 --- /dev/null +++ b/src/H5Ounknown.c @@ -0,0 +1,89 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*------------------------------------------------------------------------- + * + * Created: H5Ounknown.c + * Apr 19 2007 + * Quincey Koziol <koziol@hdfgroup.org> + * + * Purpose: Handle unknown message classes in a minimal way. + * + *------------------------------------------------------------------------- + */ + +#define H5O_PACKAGE /*suppress error about including H5Opkg */ + +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5Opkg.h" /* Object headers */ + + +/* PRIVATE PROTOTYPES */ +static herr_t H5O_unknown_free(void *_mesg); + +/* This message derives from H5O message class */ +const H5O_msg_class_t H5O_MSG_UNKNOWN[1] = {{ + H5O_UNKNOWN_ID, /*message id number */ + "unknown", /*message name for debugging */ + 0, /*native message size */ + FALSE, /* messages are sharable? */ + NULL, /*decode message */ + NULL, /*encode message */ + NULL, /*copy the native value */ + NULL, /*size of symbol table entry */ + NULL, /*default reset method */ + H5O_unknown_free, /* free method */ + NULL, /* file delete method */ + NULL, /* link method */ + NULL, /*set share method */ + NULL, /*can share method */ + NULL, /* pre copy native value to file */ + NULL, /* copy native value to file */ + NULL, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + NULL /*debug the message */ +}}; + +/* Declare a free list to manage the H5O_unknown_t struct */ +H5FL_DEFINE_STATIC(H5O_unknown_t); + + +/*------------------------------------------------------------------------- + * Function: H5O_unknown_free + * + * Purpose: Free's the message + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Tuesday, May 1, 2007 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_unknown_free(void *mesg) +{ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_unknown_free) + + HDassert(mesg); + + H5FL_FREE(H5O_unknown_t, mesg); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_unknown_free() */ + |