summaryrefslogtreecommitdiffstats
path: root/src/H5CS.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-05-02 03:17:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-05-02 03:17:49 (GMT)
commitc6e532afb936a4a7cd8d2cb97029e55cd5b9e435 (patch)
tree8956e938a9157070d75e2f29f8f5ce8602b60ac3 /src/H5CS.c
parent714d90171466c84dfafad771b0b26a87a4b4ebff (diff)
downloadhdf5-c6e532afb936a4a7cd8d2cb97029e55cd5b9e435.zip
hdf5-c6e532afb936a4a7cd8d2cb97029e55cd5b9e435.tar.gz
hdf5-c6e532afb936a4a7cd8d2cb97029e55cd5b9e435.tar.bz2
[svn-r12320] Purpose:
code cleanup Description: Finish H5FS->H5CS internal API name changes... Platforms tested: FreeBSD 4.11 (sleipnir) w/ & w/o --enable-codestack
Diffstat (limited to 'src/H5CS.c')
-rw-r--r--src/H5CS.c99
1 files changed, 50 insertions, 49 deletions
diff --git a/src/H5CS.c b/src/H5CS.c
index ed7f8b6..3de842b 100644
--- a/src/H5CS.c
+++ b/src/H5CS.c
@@ -28,10 +28,10 @@
#include "H5private.h" /* Generic Functions */
-#include "H5FSprivate.h" /* Function stack */
+#include "H5CSprivate.h" /* Function stack */
#include "H5MMprivate.h" /* Memory management */
-#ifdef H5_HAVE_FUNCSTACK
+#ifdef H5_HAVE_CODESTACK
#ifdef H5_HAVE_THREADSAFE
/*
@@ -40,29 +40,29 @@
* each thread individually. The association of stacks to threads will
* be handled by the pthread library.
*
- * In order for this macro to work, H5FS_get_my_stack() must be preceeded
- * by "H5FS_t *fstack =".
+ * In order for this macro to work, H5CS_get_my_stack() must be preceeded
+ * by "H5CS_t *fstack =".
*/
-static H5FS_t *H5FS_get_stack(void);
-#define H5FS_get_my_stack() H5FS_get_stack()
+static H5CS_t *H5CS_get_stack(void);
+#define H5CS_get_my_stack() H5CS_get_stack()
#else /* H5_HAVE_THREADSAFE */
/*
* The function stack. Eventually we'll have some sort of global table so each
* thread has it's own stack. The stacks will be created on demand when the
- * thread first calls H5FS_push(). */
-H5FS_t H5FS_stack_g[1];
-#define H5FS_get_my_stack() (H5FS_stack_g+0)
+ * thread first calls H5CS_push(). */
+H5CS_t H5CS_stack_g[1];
+#define H5CS_get_my_stack() (H5CS_stack_g+0)
#endif /* H5_HAVE_THREADSAFE */
#ifdef H5_HAVE_THREADSAFE
/*-------------------------------------------------------------------------
- * Function: H5FS_get_stack
+ * Function: H5CS_get_stack
*
- * Purpose: Support function for H5FS_get_my_stack() to initialize and
+ * Purpose: Support function for H5CS_get_my_stack() to initialize and
* acquire per-thread function stack.
*
- * Return: Success: function stack (H5FS_t *)
+ * Return: Success: function stack (H5CS_t *)
*
* Failure: NULL
*
@@ -73,17 +73,17 @@ H5FS_t H5FS_stack_g[1];
*
*-------------------------------------------------------------------------
*/
-static H5FS_t *
-H5FS_get_stack(void)
+static H5CS_t *
+H5CS_get_stack(void)
{
- H5FS_t *fstack;
+ H5CS_t *fstack;
- FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_get_stack);
+ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_get_stack);
fstack = pthread_getspecific(H5TS_funcstk_key_g);
if (!fstack) {
/* no associated value with current thread - create one */
- fstack = (H5FS_t *)HDmalloc(sizeof(H5FS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */
+ fstack = (H5CS_t *)HDmalloc(sizeof(H5CS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */
HDassert(fstack);
/* Set the thread-specific info */
@@ -97,12 +97,12 @@ H5FS_get_stack(void)
}
FUNC_LEAVE_NOAPI_NOFS(fstack);
-} /* end H5FS_get_stack() */
+} /* end H5CS_get_stack() */
#endif /* H5_HAVE_THREADSAFE */
/*-------------------------------------------------------------------------
- * Function: H5FS_print_stack
+ * Function: H5CS_print_stack
*
* Purpose: Prints a function stack.
*
@@ -116,13 +116,13 @@ H5FS_get_stack(void)
*-------------------------------------------------------------------------
*/
herr_t
-H5FS_print_stack(const H5FS_t *fstack, FILE *stream)
+H5CS_print_stack(const H5CS_t *fstack, FILE *stream)
{
const int indent = 2; /* Indention level */
int i; /* Local index ariable */
/* Don't push this function on the function stack... :-) */
- FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_print_stack);
+ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_print_stack);
/* Sanity check */
HDassert(fstack);
@@ -146,11 +146,11 @@ H5FS_print_stack(const H5FS_t *fstack, FILE *stream)
HDfprintf(stream, "%*s#%03d: Routine: %s\n", indent, "", i, fstack->slot[i]);
FUNC_LEAVE_NOAPI_NOFS(SUCCEED);
-} /* end H5FS_print_stack() */
+} /* end H5CS_print_stack() */
/*-------------------------------------------------------------------------
- * Function: H5FS_print
+ * Function: H5CS_print
*
* Purpose: Prints the default function stack in some default way.
*
@@ -164,24 +164,24 @@ H5FS_print_stack(const H5FS_t *fstack, FILE *stream)
*-------------------------------------------------------------------------
*/
herr_t
-H5FS_print(FILE *stream)
+H5CS_print(FILE *stream)
{
- H5FS_t *fstack = H5FS_get_my_stack (); /* Get the correct function stack */
+ H5CS_t *fstack = H5CS_get_my_stack (); /* Get the correct function stack */
/* Don't push this function on the function stack... :-) */
- FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_print);
+ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_print);
/* Sanity check */
assert(fstack);
- H5FS_print_stack(fstack, stream);
+ H5CS_print_stack(fstack, stream);
FUNC_LEAVE_NOAPI_NOFS(SUCCEED);
-} /* end H5FS_print() */
+} /* end H5CS_print() */
/*-------------------------------------------------------------------------
- * Function: H5FS_push
+ * Function: H5CS_push
*
* Purpose: Pushes a new record onto function stack for the current
* thread.
@@ -196,12 +196,12 @@ H5FS_print(FILE *stream)
*-------------------------------------------------------------------------
*/
herr_t
-H5FS_push(const char *func_name)
+H5CS_push(const char *func_name)
{
- H5FS_t *fstack = H5FS_get_my_stack ();
+ H5CS_t *fstack = H5CS_get_my_stack ();
/* Don't push this function on the function stack... :-) */
- FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_push);
+ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_push);
/* Sanity check */
assert (fstack);
@@ -210,16 +210,16 @@ H5FS_push(const char *func_name)
/*
* Push the function if there's room. Otherwise just increment count
*/
- if (fstack->nused<H5FS_NSLOTS)
+ if (fstack->nused<H5CS_NSLOTS)
fstack->slot[fstack->nused] = func_name;
fstack->nused++;
FUNC_LEAVE_NOAPI_NOFS(SUCCEED);
-} /* end H5FS_push() */
+} /* end H5CS_push() */
/*-------------------------------------------------------------------------
- * Function: H5FS_pop
+ * Function: H5CS_pop
*
* Purpose: Pops a record off function stack for the current thread.
*
@@ -233,12 +233,12 @@ H5FS_push(const char *func_name)
*-------------------------------------------------------------------------
*/
herr_t
-H5FS_pop(void)
+H5CS_pop(void)
{
- H5FS_t *fstack = H5FS_get_my_stack ();
+ H5CS_t *fstack = H5CS_get_my_stack ();
/* Don't push this function on the function stack... :-) */
- FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_pop);
+ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_pop);
/* Sanity check */
assert (fstack);
@@ -248,11 +248,11 @@ H5FS_pop(void)
fstack->nused--;
FUNC_LEAVE_NOAPI_NOFS(SUCCEED);
-} /* end H5FS_pop() */
+} /* end H5CS_pop() */
/*-------------------------------------------------------------------------
- * Function: H5FS_copy_stack
+ * Function: H5CS_copy_stack
*
* Purpose: Makes a copy of the current stack
*
@@ -266,13 +266,13 @@ H5FS_pop(void)
*-------------------------------------------------------------------------
*/
herr_t
-H5FS_copy_stack(H5FS_t *new_stack)
+H5CS_copy_stack(H5CS_t *new_stack)
{
- H5FS_t *old_stack = H5FS_get_my_stack ();
+ H5CS_t *old_stack = H5CS_get_my_stack ();
unsigned u; /* Local index variable */
/* Don't push this function on the function stack... :-) */
- FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_copy_stack);
+ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_copy_stack);
/* Sanity check */
HDassert (old_stack);
@@ -283,11 +283,11 @@ H5FS_copy_stack(H5FS_t *new_stack)
new_stack->nused = old_stack->nused;
FUNC_LEAVE_NOAPI_NOFS(SUCCEED);
-} /* end H5FS_copy_stack() */
+} /* end H5CS_copy_stack() */
/*-------------------------------------------------------------------------
- * Function: H5FS_close_stack
+ * Function: H5CS_close_stack
*
* Purpose: Closes a copy of a stack
*
@@ -301,12 +301,12 @@ H5FS_copy_stack(H5FS_t *new_stack)
*-------------------------------------------------------------------------
*/
herr_t
-H5FS_close_stack(H5FS_t *stack)
+H5CS_close_stack(H5CS_t *stack)
{
unsigned u; /* Local index variable */
/* Don't push this function on the function stack... :-) */
- FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_close_stack);
+ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_close_stack);
/* Sanity check */
HDassert (stack);
@@ -316,6 +316,7 @@ H5FS_close_stack(H5FS_t *stack)
stack->slot[u] = H5MM_xfree((void *)stack->slot[u]);
FUNC_LEAVE_NOAPI_NOFS(SUCCEED);
-} /* end H5FS_close_stack() */
+} /* end H5CS_close_stack() */
+
+#endif /* H5_HAVE_CODESTACK */
-#endif /* H5_HAVE_FUNCSTACK */