aboutsummaryrefslogtreecommitdiff
path: root/src/GeneralizedPolynomial-Uniform/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/GeneralizedPolynomial-Uniform/util.c')
-rw-r--r--src/GeneralizedPolynomial-Uniform/util.c63
1 files changed, 1 insertions, 62 deletions
diff --git a/src/GeneralizedPolynomial-Uniform/util.c b/src/GeneralizedPolynomial-Uniform/util.c
index 03186f0..d17f29b 100644
--- a/src/GeneralizedPolynomial-Uniform/util.c
+++ b/src/GeneralizedPolynomial-Uniform/util.c
@@ -16,13 +16,8 @@
#include <stdio.h>
#include <string.h>
-#ifdef LOCALINTERP_STANDALONE_BUILD
- #define WANT_STRLCPY
-#else
+#ifndef LOCALINTERP_STANDALONE_BUILD
#include "cctk.h"
- #define WANT_ZERO_INT_ARRAY
- #define WANT_DECODE_N_PARTS
- #define WANT_STRLCPY
#endif
#include "InterpLocalUniform.h"
@@ -35,7 +30,6 @@ static const char *rcsid = "$Header$";
/******************************************************************************/
-#ifdef WANT_DECODE_N_PARTS
/*@@
@routine LocalInterp_decode_N_parts
@date 22 Jan 2002
@@ -84,58 +78,3 @@ case CCTK_VARIABLE_FPOINTER: return 0;
default: return -1;
}
}
-#endif /* WANT_DECODE_N_PARTS */
-
-/******************************************************************************/
-
-#ifdef WANT_STRLCPY
-/*@@
- @routine LocalInterp_Strlcpy
- @date 1.Feb.2003
- @author Jonathan Thornburg <jthorn@aei.mpg.de>
- @desc This function implements the strlcpy() function
- described in
- http://www.openbsd.org/papers/strlcpy-paper.ps
-
- The strlcpy(3) function copies up to size-1 characters
- from the null-terminated string src to dst , followed
- by a null character (so dst is always null-terminated).
-
- strlcpy(3) is a replacement for strncpy(3). In comparison
- to strncpy(3), strlcpy(3) is safer and easier to use (it
- guarantees null termination of the destination buffer),
- and faster (it doesn't have to fill the entire buffer with
- null characters).
- @enddesc
-
- @var dst
- @vdesc A non-null pointer to the destination buffer.
- @vtype char* dst
- @endvar
-
- @var src
- @vdesc A non-null pointer to the source string.
- @vtype const char* dst
- @endvar
-
- @var dst_size
- @vdesc The size of the destination buffer.
- @vtype size_t dst_size
- @endvar
-
- @returntype size_t
- @returndesc This function returns strlen(src).
- @endreturndesc
- @@*/
-size_t LocalInterp_Strlcpy(char* dst, const char* src, size_t dst_size)
-{
-const size_t src_size = strlen(src);
-if (src_size < dst_size)
- then strcpy(dst, src);
- else {
- strncpy(dst, src, dst_size-1);
- dst[dst_size-1] = '\0';
- }
-return src_size;
-}
-#endif /* WANT_STRLCPY */