summaryrefslogtreecommitdiffstats
path: root/src/H5Oname.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1998-01-16 22:23:43 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1998-01-16 22:23:43 (GMT)
commitc2c94c31878dc42926661c9cb7e71be620196fc1 (patch)
treeee9ce2ae309882348dc1eafc1d105b5e6646605e /src/H5Oname.c
parent903e677366a86ea385d5cfe1241f3f53132941de (diff)
downloadhdf5-c2c94c31878dc42926661c9cb7e71be620196fc1.zip
hdf5-c2c94c31878dc42926661c9cb7e71be620196fc1.tar.gz
hdf5-c2c94c31878dc42926661c9cb7e71be620196fc1.tar.bz2
[svn-r157] Reformatted code with indent...
Diffstat (limited to 'src/H5Oname.c')
-rw-r--r--src/H5Oname.c311
1 files changed, 154 insertions, 157 deletions
diff --git a/src/H5Oname.c b/src/H5Oname.c
index 58fc849..51fddc2 100644
--- a/src/H5Oname.c
+++ b/src/H5Oname.c
@@ -1,16 +1,16 @@
/*-------------------------------------------------------------------------
- * Copyright (C) 1997 National Center for Supercomputing Applications.
+ * Copyright (C) 1997 National Center for Supercomputing Applications.
* All rights reserved.
*
*-------------------------------------------------------------------------
*
- * Created: H5Oname.c
- * Aug 12 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Created: H5Oname.c
+ * Aug 12 1997
+ * Robb Matzke <matzke@llnl.gov>
*
- * Purpose: Object name message.
+ * Purpose: Object name message.
*
- * Modifications:
+ * Modifications:
*
*-------------------------------------------------------------------------
*/
@@ -19,263 +19,260 @@
#include <H5MMprivate.h>
#include <H5Oprivate.h>
-#define PABLO_MASK H5O_name_mask
+#define PABLO_MASK H5O_name_mask
/* PRIVATE PROTOTYPES */
-static void *H5O_name_decode (H5F_t *f, size_t raw_size, const uint8 *p);
-static herr_t H5O_name_encode (H5F_t *f, size_t raw_size, uint8 *p,
- const void *_mesg);
-static void *H5O_name_copy (const void *_mesg, void *_dest);
-static size_t H5O_name_size (H5F_t *f, const void *_mesg);
-static herr_t H5O_name_reset (void *_mesg);
-static herr_t H5O_name_debug (H5F_t *f, const void *_mesg, FILE *stream,
- intn indent, intn fwidth);
+static void *H5O_name_decode(H5F_t *f, size_t raw_size, const uint8 *p);
+static herr_t H5O_name_encode(H5F_t *f, size_t raw_size, uint8 *p,
+ const void *_mesg);
+static void *H5O_name_copy(const void *_mesg, void *_dest);
+static size_t H5O_name_size(H5F_t *f, const void *_mesg);
+static herr_t H5O_name_reset(void *_mesg);
+static herr_t H5O_name_debug(H5F_t *f, const void *_mesg, FILE * stream,
+ intn indent, intn fwidth);
/* This message derives from H5O */
-const H5O_class_t H5O_NAME[1] = {{
- H5O_NAME_ID, /*message id number */
- "name", /*message name for debugging */
- sizeof (H5O_name_t), /*native message size */
- H5O_name_decode, /*decode message */
- H5O_name_encode, /*encode message */
- H5O_name_copy, /*copy the native value */
- H5O_name_size, /*raw message size */
- H5O_name_reset, /*free internal memory */
- H5O_name_debug, /*debug the message */
-}};
+const H5O_class_t H5O_NAME[1] =
+{
+ {
+ H5O_NAME_ID, /*message id number */
+ "name", /*message name for debugging */
+ sizeof(H5O_name_t), /*native message size */
+ H5O_name_decode, /*decode message */
+ H5O_name_encode, /*encode message */
+ H5O_name_copy, /*copy the native value */
+ H5O_name_size, /*raw message size */
+ H5O_name_reset, /*free internal memory */
+ H5O_name_debug, /*debug the message */
+ }};
/* Interface initialization */
-static hbool_t interface_initialize_g = FALSE;
-#define INTERFACE_INIT NULL
-
+static hbool_t interface_initialize_g = FALSE;
+#define INTERFACE_INIT NULL
/*-------------------------------------------------------------------------
- * Function: H5O_name_decode
+ * Function: H5O_name_decode
*
- * Purpose: Decode a name message and return a pointer to a new
- * native message struct.
+ * Purpose: Decode a name message and return a pointer to a new
+ * native message struct.
*
- * Return: Success: Ptr to new message in native struct.
+ * Return: Success: Ptr to new message in native struct.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Aug 12 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Aug 12 1997
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
-static void *
-H5O_name_decode (H5F_t *f, size_t raw_size, const uint8 *p)
+static void *
+H5O_name_decode(H5F_t *f, size_t raw_size, const uint8 *p)
{
- H5O_name_t *mesg;
- char *s;
+ H5O_name_t *mesg;
+ char *s;
- FUNC_ENTER (H5O_name_decode, NULL);
+ FUNC_ENTER(H5O_name_decode, NULL);
- /* check args */
- assert (f);
- assert (p);
+ /* check args */
+ assert(f);
+ assert(p);
- /* decode */
- mesg = H5MM_xcalloc (1, sizeof(H5O_name_t));
- s = H5MM_xmalloc (raw_size);
- HDmemcpy (s, p, raw_size);
- mesg->s = s;
+ /* decode */
+ mesg = H5MM_xcalloc(1, sizeof(H5O_name_t));
+ s = H5MM_xmalloc(raw_size);
+ HDmemcpy(s, p, raw_size);
+ mesg->s = s;
- FUNC_LEAVE (mesg);
+ FUNC_LEAVE(mesg);
}
-
/*-------------------------------------------------------------------------
- * Function: H5O_name_encode
+ * Function: H5O_name_encode
*
- * Purpose: Encodes a name message.
+ * Purpose: Encodes a name message.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Aug 12 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Aug 12 1997
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_name_encode (H5F_t *f, size_t raw_size, uint8 *p, const void *_mesg)
+H5O_name_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *_mesg)
{
- const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
- size_t size;
+ const H5O_name_t *mesg = (const H5O_name_t *) _mesg;
+ size_t size;
- FUNC_ENTER (H5O_name_encode, FAIL);
+ FUNC_ENTER(H5O_name_encode, FAIL);
- /* check args */
- assert (f);
- assert (p);
- assert (mesg && mesg->s);
+ /* check args */
+ assert(f);
+ assert(p);
+ assert(mesg && mesg->s);
- /* message size */
- size = HDstrlen (mesg->s)+1;
- assert (size<=raw_size);
+ /* message size */
+ size = HDstrlen(mesg->s) + 1;
+ assert(size <= raw_size);
- /* encode */
- HDmemcpy (p, mesg->s, size);
- HDmemset (p+size, 0, raw_size-size);
+ /* encode */
+ HDmemcpy(p, mesg->s, size);
+ HDmemset(p + size, 0, raw_size - size);
- FUNC_LEAVE (SUCCEED);
+ FUNC_LEAVE(SUCCEED);
}
-
/*-------------------------------------------------------------------------
- * Function: H5O_name_copy
+ * Function: H5O_name_copy
*
- * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
- * necessary.
+ * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
+ * necessary.
*
- * Return: Success: Ptr to _DEST
+ * Return: Success: Ptr to _DEST
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Aug 12 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Aug 12 1997
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
-static void *
-H5O_name_copy (const void *_mesg, void *_dest)
+static void *
+H5O_name_copy(const void *_mesg, void *_dest)
{
- const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
- H5O_name_t *dest = (H5O_name_t *)_dest;
+ const H5O_name_t *mesg = (const H5O_name_t *) _mesg;
+ H5O_name_t *dest = (H5O_name_t *) _dest;
- FUNC_ENTER (H5O_name_copy, NULL);
+ FUNC_ENTER(H5O_name_copy, NULL);
- /* check args */
- assert (mesg);
- if (!dest) dest = H5MM_xcalloc (1, sizeof(H5O_name_t));
+ /* check args */
+ assert(mesg);
+ if (!dest)
+ dest = H5MM_xcalloc(1, sizeof(H5O_name_t));
- /* copy */
- *dest = *mesg;
- dest->s = H5MM_xstrdup (mesg->s);
+ /* copy */
+ *dest = *mesg;
+ dest->s = H5MM_xstrdup(mesg->s);
- FUNC_LEAVE ((void*)dest);
+ FUNC_LEAVE((void *) dest);
}
-
/*-------------------------------------------------------------------------
- * Function: H5O_name_size
+ * Function: H5O_name_size
*
- * Purpose: Returns the size of the raw message in bytes not
- * counting the message typ or size fields, but only the data
- * fields. This function doesn't take into account
- * alignment.
+ * Purpose: Returns the size of the raw message in bytes not
+ * counting the message typ or size fields, but only the data
+ * fields. This function doesn't take into account
+ * alignment.
*
- * Return: Success: Message data size in bytes w/o alignment.
+ * Return: Success: Message data size in bytes w/o alignment.
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Aug 12 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Aug 12 1997
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static size_t
-H5O_name_size (H5F_t *f, const void *_mesg)
+H5O_name_size(H5F_t *f, const void *_mesg)
{
- const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
- size_t size;
-
- FUNC_ENTER (H5O_name_size, FAIL);
+ const H5O_name_t *mesg = (const H5O_name_t *) _mesg;
+ size_t size;
- /* check args */
- assert (f);
- assert (mesg);
+ FUNC_ENTER(H5O_name_size, FAIL);
- size = mesg->s ? HDstrlen (mesg->s)+1 : 0;
- FUNC_LEAVE (size);
-}
+ /* check args */
+ assert(f);
+ assert(mesg);
+ size = mesg->s ? HDstrlen(mesg->s) + 1 : 0;
+ FUNC_LEAVE(size);
+}
/*-------------------------------------------------------------------------
- * Function: H5O_name_reset
+ * Function: H5O_name_reset
*
- * Purpose: Frees internal pointers and resets the message to an
- * initial state.
+ * Purpose: Frees internal pointers and resets the message to an
+ * initial state.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Aug 12 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Aug 12 1997
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_name_reset (void *_mesg)
+H5O_name_reset(void *_mesg)
{
- H5O_name_t *mesg = (H5O_name_t *)_mesg;
-
- FUNC_ENTER (H5O_name_reset, FAIL);
+ H5O_name_t *mesg = (H5O_name_t *) _mesg;
- /* check args */
- assert (mesg);
+ FUNC_ENTER(H5O_name_reset, FAIL);
- /* reset */
- mesg->s = H5MM_xfree (mesg->s);
-
- FUNC_LEAVE (SUCCEED);
-}
+ /* check args */
+ assert(mesg);
+ /* reset */
+ mesg->s = H5MM_xfree(mesg->s);
+
+ FUNC_LEAVE(SUCCEED);
+}
/*-------------------------------------------------------------------------
- * Function: H5O_name_debug
+ * Function: H5O_name_debug
*
- * Purpose: Prints debugging info for the message.
+ * Purpose: Prints debugging info for the message.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Aug 12 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Aug 12 1997
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_name_debug (H5F_t *f, const void *_mesg, FILE *stream,
- intn indent, intn fwidth)
+H5O_name_debug(H5F_t *f, const void *_mesg, FILE * stream,
+ intn indent, intn fwidth)
{
- const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
+ const H5O_name_t *mesg = (const H5O_name_t *) _mesg;
- FUNC_ENTER (H5O_name_debug, FAIL);
+ FUNC_ENTER(H5O_name_debug, FAIL);
- /* check args */
- assert (f);
- assert (mesg);
- assert (stream);
- assert (indent>=0);
- assert (fwidth>=0);
+ /* check args */
+ assert(f);
+ assert(mesg);
+ assert(stream);
+ assert(indent >= 0);
+ assert(fwidth >= 0);
- fprintf (stream, "%*s%-*s `%s'\n", indent, "", fwidth,
- "Name:",
- mesg->s);
+ fprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth,
+ "Name:",
+ mesg->s);
- FUNC_LEAVE (SUCCEED);
+ FUNC_LEAVE(SUCCEED);
}