* If you do not wish that, delete this exception notice.
*/
-/* Software engineering face-lift by Greg J. Badros, 11-Dec-1999,
- gjb@cs.washington.edu, http://www.cs.washington.edu/homes/gjb */
\f
#define REG_BASIC 0
#endif
-scm_bits_t scm_tc16_regex;
+scm_t_bits scm_tc16_regex;
-static scm_sizet
+static size_t
regex_free (SCM obj)
{
regfree (SCM_RGX (obj));
SCM_VALIDATE_STRING (1, pat);
SCM_VALIDATE_REST_ARGUMENT (flags);
- SCM_STRING_COERCE_0TERMINATION_X (pat);
/* Examine list of regexp flags. If REG_BASIC is supplied, then
turn off REG_EXTENDED flag (on by default). */
if (SCM_UNBNDP (flags))
flags = SCM_INUM0;
SCM_VALIDATE_INUM (4,flags);
- SCM_STRING_COERCE_0TERMINATION_X (str);
/* re_nsub doesn't account for the `subexpression' representing the
whole regexp, so add 1 to nmatches. */
SCM_VELTS(mvec)[i+1] = scm_cons (SCM_MAKINUM (-1), SCM_MAKINUM (-1));
else
SCM_VELTS(mvec)[i+1]
- = scm_cons(SCM_MAKINUM(matches[i].rm_so + offset),
- SCM_MAKINUM(matches[i].rm_eo + offset));
+ = scm_cons (scm_long2num (matches[i].rm_so + offset),
+ scm_long2num (matches[i].rm_eo + offset));
}
scm_must_free ((char *) matches);
SCM_ALLOW_INTS;
scm_set_smob_free (scm_tc16_regex, regex_free);
/* Compilation flags. */
- scm_sysintern ("regexp/basic", scm_long2num (REG_BASIC));
- scm_sysintern ("regexp/extended", scm_long2num (REG_EXTENDED));
- scm_sysintern ("regexp/icase", scm_long2num (REG_ICASE));
- scm_sysintern ("regexp/newline", scm_long2num (REG_NEWLINE));
+ scm_c_define ("regexp/basic", scm_long2num (REG_BASIC));
+ scm_c_define ("regexp/extended", scm_long2num (REG_EXTENDED));
+ scm_c_define ("regexp/icase", scm_long2num (REG_ICASE));
+ scm_c_define ("regexp/newline", scm_long2num (REG_NEWLINE));
/* Execution flags. */
- scm_sysintern ("regexp/notbol", scm_long2num (REG_NOTBOL));
- scm_sysintern ("regexp/noteol", scm_long2num (REG_NOTEOL));
+ scm_c_define ("regexp/notbol", scm_long2num (REG_NOTBOL));
+ scm_c_define ("regexp/noteol", scm_long2num (REG_NOTEOL));
#ifndef SCM_MAGIC_SNARFER
#include "libguile/regex-posix.x"