#include "srfi-13.h"
#include "srfi-14.h"
+/* SCM_VALIDATE_SUBSTRING_SPEC_COPY is deprecated since it encourages
+ messing with the internal representation of strings. We define our
+ own version since we use it so much and are messing with Guile
+ internals anyway.
+*/
+
+#define MY_VALIDATE_SUBSTRING_SPEC_COPY(pos_str, str, c_str, \
+ pos_start, start, c_start, \
+ pos_end, end, c_end) \
+ do { \
+ SCM_VALIDATE_STRING (pos_str, str); \
+ c_str = SCM_I_STRING_CHARS (str); \
+ scm_i_get_substring_spec (SCM_I_STRING_LENGTH (str), \
+ start, &c_start, end, &c_end); \
+ } while (0)
+
+
+/* Likewise for SCM_VALIDATE_STRING_COPY. */
+
+#define MY_VALIDATE_STRING_COPY(pos, str, cvar) \
+ do { \
+ SCM_VALIDATE_STRING (pos, str); \
+ cvar = SCM_I_STRING_CHARS(str); \
+ } while (0)
+
+
SCM_DEFINE (scm_string_any, "string-any", 2, 2, 0,
(SCM pred, SCM s, SCM start, SCM end),
"Check if the predicate @var{pred} is true for any character in\n"
SCM res;
SCM_VALIDATE_PROC (1, pred);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
cstr += cstart;
while (cstart < cend)
{
SCM res;
SCM_VALIDATE_PROC (1, pred);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
res = SCM_BOOL_T;
cstr += cstart;
while (cstart < cend)
int cstart, cend;
SCM result = SCM_EOL;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
+ 2, start, cstart,
+ 3, end, cend);
while (cstart < cend)
{
cend--;
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
+ 2, start, cstart,
+ 3, end, cend);
return scm_mem2string (cstr + cstart, cend - cstart);
}
int len;
SCM sdummy = SCM_UNDEFINED;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, target, ctarget,
- 2, tstart, ctstart,
- 2, sdummy, dummy);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cstr,
- 4, start, cstart,
- 5, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, target, ctarget,
+ 2, tstart, ctstart,
+ 2, sdummy, dummy);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cstr,
+ 4, start, cstart,
+ 5, end, cend);
len = cend - cstart;
SCM_ASSERT_RANGE (3, s, len <= SCM_STRING_LENGTH (target) - ctstart);
char * cstr;
size_t cn;
- SCM_VALIDATE_STRING_COPY (1, s, cstr);
+ MY_VALIDATE_STRING_COPY (1, s, cstr);
cn = scm_to_unsigned_integer (n, 0, SCM_STRING_LENGTH (s));
return scm_mem2string (cstr, cn);
char * cstr;
size_t cn;
- SCM_VALIDATE_STRING_COPY (1, s, cstr);
+ MY_VALIDATE_STRING_COPY (1, s, cstr);
cn = scm_to_unsigned_integer (n, 0, SCM_STRING_LENGTH (s));
return scm_mem2string (cstr + cn, SCM_STRING_LENGTH (s) - cn);
char * cstr;
size_t cn;
- SCM_VALIDATE_STRING_COPY (1, s, cstr);
+ MY_VALIDATE_STRING_COPY (1, s, cstr);
cn = scm_to_unsigned_integer (n, 0, SCM_STRING_LENGTH (s));
return scm_mem2string (cstr + SCM_STRING_LENGTH (s) - cn, cn);
char * cstr;
size_t cn;
- SCM_VALIDATE_STRING_COPY (1, s, cstr);
+ MY_VALIDATE_STRING_COPY (1, s, cstr);
cn = scm_to_unsigned_integer (n, 0, SCM_STRING_LENGTH (s));
return scm_mem2string (cstr, SCM_STRING_LENGTH (s) - cn);
size_t cstart, cend, clen;
SCM result;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 4, start, cstart,
- 5, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 4, start, cstart,
+ 5, end, cend);
clen = scm_to_size_t (len);
if (SCM_UNBNDP (chr))
size_t cstart, cend, clen;
SCM result;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 4, start, cstart,
- 5, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 4, start, cstart,
+ 5, end, cend);
clen = scm_to_size_t (len);
if (SCM_UNBNDP (chr))
char * cstr;
size_t cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
if (SCM_UNBNDP (char_pred))
{
while (cstart < cend)
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
if (SCM_UNBNDP (char_pred))
{
while (cstart < cend)
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
if (SCM_UNBNDP (char_pred))
{
while (cstart < cend)
int c;
long k;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
+ 3, start, cstart,
+ 4, end, cend);
SCM_VALIDATE_CHAR_COPY (2, chr, c);
for (k = cstart; k < cend; k++)
cstr[k] = c;
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 6, start1, cstart1,
- 7, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 8, start2, cstart2,
- 9, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 6, start1, cstart1,
+ 7, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 8, start2, cstart2,
+ 9, end2, cend2);
SCM_VALIDATE_PROC (3, proc_lt);
SCM_VALIDATE_PROC (4, proc_eq);
SCM_VALIDATE_PROC (5, proc_gt);
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 6, start1, cstart1,
- 7, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 8, start2, cstart2,
- 9, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 6, start1, cstart1,
+ 7, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 8, start2, cstart2,
+ 9, end2, cend2);
SCM_VALIDATE_PROC (3, proc_lt);
SCM_VALIDATE_PROC (4, proc_eq);
SCM_VALIDATE_PROC (5, proc_gt);
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr1, * cstr2;
int cstart1, cend1, cstart2, cend2;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
int cstart1, cend1, cstart2, cend2;
int len = 0;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
if (cstr1[cstart1] != cstr2[cstart2])
int cstart1, cend1, cstart2, cend2;
int len = 0;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
if (scm_c_downcase (cstr1[cstart1]) != scm_c_downcase (cstr2[cstart2]))
int cstart1, cend1, cstart2, cend2;
int len = 0;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
cend1--;
int cstart1, cend1, cstart2, cend2;
int len = 0;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
while (cstart1 < cend1 && cstart2 < cend2)
{
cend1--;
int cstart1, cend1, cstart2, cend2;
int len = 0, len1;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
len1 = cend1 - cstart1;
while (cstart1 < cend1 && cstart2 < cend2)
{
int cstart1, cend1, cstart2, cend2;
int len = 0, len1;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
len1 = cend1 - cstart1;
while (cstart1 < cend1 && cstart2 < cend2)
{
int cstart1, cend1, cstart2, cend2;
int len = 0, len1;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
len1 = cend1 - cstart1;
while (cstart1 < cend1 && cstart2 < cend2)
{
int cstart1, cend1, cstart2, cend2;
int len = 0, len1;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
len1 = cend1 - cstart1;
while (cstart1 < cend1 && cstart2 < cend2)
{
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
if (SCM_CHARP (char_pred))
{
char cchr = SCM_CHAR (char_pred);
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
if (SCM_CHARP (char_pred))
{
char cchr = SCM_CHAR (char_pred);
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
if (SCM_CHARP (char_pred))
{
char cchr = SCM_CHAR (char_pred);
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
if (SCM_CHARP (char_pred))
{
char cchr = SCM_CHAR (char_pred);
int cstart, cend;
int count = 0;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
if (SCM_CHARP (char_pred))
{
char cchr = SCM_CHAR (char_pred);
int cstart1, cend1, cstart2, cend2;
int len2, i, j;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cs1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cs2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cs1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cs2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
len2 = cend2 - cstart2;
while (cstart1 <= cend1 - len2)
{
int cstart1, cend1, cstart2, cend2;
int len2, i, j;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cs1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cs2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cs1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cs2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
len2 = cend2 - cstart2;
while (cstart1 <= cend1 - len2)
{
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
+ 2, start, cstart,
+ 3, end, cend);
return string_upcase_x (str, cstart, cend);
}
#undef FUNC_NAME
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
+ 2, start, cstart,
+ 3, end, cend);
return string_upcase_x (scm_string_copy (str), cstart, cend);
}
#undef FUNC_NAME
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
+ 2, start, cstart,
+ 3, end, cend);
return string_downcase_x (str, cstart, cend);
}
#undef FUNC_NAME
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
+ 2, start, cstart,
+ 3, end, cend);
return string_downcase_x (scm_string_copy (str), cstart, cend);
}
#undef FUNC_NAME
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
+ 2, start, cstart,
+ 3, end, cend);
return string_titlecase_x (str, cstart, cend);
}
#undef FUNC_NAME
char * cstr;
int cstart, cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
+ 2, start, cstart,
+ 3, end, cend);
return string_titlecase_x (scm_string_copy (str), cstart, cend);
}
#undef FUNC_NAME
int cend;
SCM result;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
+ 2, start, cstart,
+ 3, end, cend);
result = scm_string_copy (str);
string_reverse_x (SCM_STRING_CHARS (result), cstart, cend);
return result;
int cstart;
int cend;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
+ 2, start, cstart,
+ 3, end, cend);
string_reverse_x (SCM_STRING_CHARS (str), cstart, cend);
return SCM_UNSPECIFIED;
}
SCM result;
SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
result = scm_allocate_string (cend - cstart);
p = SCM_STRING_CHARS (result);
while (cstart < cend)
int cstart, cend;
SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
p = SCM_STRING_CHARS (s) + cstart;
while (cstart < cend)
{
SCM result;
SCM_VALIDATE_PROC (1, kons);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cstr,
- 4, start, cstart,
- 5, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cstr,
+ 4, start, cstart,
+ 5, end, cend);
result = knil;
while (cstart < cend)
{
SCM result;
SCM_VALIDATE_PROC (1, kons);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cstr,
- 4, start, cstart,
- 5, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cstr,
+ 4, start, cstart,
+ 5, end, cend);
result = knil;
while (cstart < cend)
{
int cstart, cend;
SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
while (cstart < cend)
{
unsigned int c = (unsigned char) cstr[cstart];
int cstart, cend;
SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
while (cstart < cend)
{
scm_call_1 (proc, SCM_I_MAKINUM (cstart));
size_t cstart, cend, cfrom, cto;
SCM result;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cs,
- 4, start, cstart,
- 5, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cs,
+ 4, start, cstart,
+ 5, end, cend);
cfrom = scm_to_size_t (from);
if (SCM_UNBNDP (to))
cto = cfrom + (cend - cstart);
SCM dummy = SCM_UNDEFINED;
int cdummy;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, target, ctarget,
- 2, tstart, ctstart,
- 2, dummy, cdummy);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cs,
- 6, start, cstart,
- 7, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, target, ctarget,
+ 2, tstart, ctstart,
+ 2, dummy, cdummy);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cs,
+ 6, start, cstart,
+ 7, end, cend);
csfrom = scm_to_size_t (sfrom);
if (SCM_UNBNDP (sto))
csto = csfrom + (cend - cstart);
size_t cstart1, cend1, cstart2, cend2;
SCM result;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
+ 3, start1, cstart1,
+ 4, end1, cend1);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
+ 5, start2, cstart2,
+ 6, end2, cend2);
result = scm_allocate_string (cstart1 + (cend2 - cstart2) +
SCM_STRING_LENGTH (s1) - cend1);
p = SCM_STRING_CHARS (result);
static SCM charset_graphic = SCM_BOOL_F;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
if (SCM_UNBNDP (token_set))
{
SCM result;
int idx;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
if (SCM_CHARP (char_pred))
{
SCM ls = SCM_EOL;
SCM result;
int idx;
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
+ MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
+ 3, start, cstart,
+ 4, end, cend);
if (SCM_CHARP (char_pred))
{
SCM ls = SCM_EOL;