#include <libguile.h>
+#include "srfi-13.h"
#include "srfi-14.h"
SCM_DEFINE (scm_string_any, "string-any", 2, 2, 0,
"Check if the predicate @var{pred} is true for any character in\n"
"the string @var{s}, proceeding from left (index @var{start}) to\n"
"right (index @var{end}). If @code{string-any} returns true,\n"
- "the returned true value is the one produced by the application\n"
- "of @var{pred}.")
+ "the returned true value is the one produced by the first\n"
+ "successful application of @var{pred}.")
#define FUNC_NAME s_scm_string_any
{
char * cstr;
#undef FUNC_NAME
-SCM_DEFINE (scm_reverse_string_concatenate, "reverse-string-concatenate", 1, 2, 0,
+SCM_DEFINE (scm_string_concatenate_reverse, "string-concatenate-reverse", 1, 2, 0,
(SCM ls, SCM final_string, SCM end),
"Without optional arguments, this procedure is equivalent to\n"
"\n"
"\n"
"If the optional argument @var{final_string} is specified, it is\n"
"consed onto the beginning to @var{ls} before performing the\n"
- "list-reverse and string-concatenate operations.\n"
+ "list-reverse and string-concatenate operations. If @var{end}\n"
+ "is given, only the characters of @var{final_string} up to index\n"
+ "@var{end} are used.\n"
"\n"
"Guaranteed to return a freshly allocated string.")
-#define FUNC_NAME s_scm_reverse_string_concatenate
+#define FUNC_NAME s_scm_string_concatenate_reverse
{
long strings;
SCM tmp, result;
#undef FUNC_NAME
-SCM_DEFINE (scm_reverse_string_concatenate_shared, "reverse-string-concatenate/shared", 1, 2, 0,
+SCM_DEFINE (scm_string_concatenate_reverse_shared, "string-concatenate-reverse/shared", 1, 2, 0,
(SCM ls, SCM final_string, SCM end),
- "Like @code{reverse-string-concatenate}, but the result may\n"
+ "Like @code{string-concatenate-reverse}, but the result may\n"
"share memory with the the strings in the @var{ls} arguments.")
-#define FUNC_NAME s_scm_reverse_string_concatenate_shared
+#define FUNC_NAME s_scm_string_concatenate_reverse_shared
{
/* Just call the non-sharing version. */
- return scm_reverse_string_concatenate (ls, final_string, end);
+ return scm_string_concatenate_reverse (ls, final_string, end);
}
#undef FUNC_NAME
result = scm_allocate_string (cstart1 + (cend2 - cstart2) +
SCM_STRING_LENGTH (s1) - cend1);
p = SCM_STRING_CHARS (result);
- memmove (p, cstr1, cstart1);
- memmove (p + cstart1, cstr2 + cstart2, (cend2 - cstart2));
+ memmove (p, cstr1, cstart1 * sizeof (char));
+ memmove (p + cstart1, cstr2 + cstart2, (cend2 - cstart2) * sizeof (char));
memmove (p + cstart1 + (cend2 - cstart2),
cstr1 + cend1,
- SCM_STRING_LENGTH (s1) - cend1);
+ (SCM_STRING_LENGTH (s1) - cend1) * sizeof (char));
return result;
}
#undef FUNC_NAME
void
-scm_init_srfi_13 ()
+scm_init_srfi_13 (void)
{
#ifndef SCM_MAGIC_SNARFER
-#include "srfi-13.x"
+#include "srfi/srfi-13.x"
#endif
}
void
-scm_init_srfi_13_14 ()
+scm_init_srfi_13_14 (void)
{
static int initialized = 0;