(scm_ash): Revise docstring as per recent update to manual.
[bpt/guile.git] / srfi / srfi-14.c
index c5a4917..aeae52a 100644 (file)
@@ -1,47 +1,21 @@
 /* srfi-14.c --- SRFI-14 procedures for Guile
  *
  * Copyright (C) 2001 Free Software Foundation, Inc.
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2, or (at
- * your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this software; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- *
- * As a special exception, the Free Software Foundation gives
- * permission for additional uses of the text contained in its release
- * of GUILE.
- *
- * The exception is that, if you link the GUILE library with other
- * files to produce an executable, this does not by itself cause the
- * resulting executable to be covered by the GNU General Public
- * License.  Your use of that executable is in no way restricted on
- * account of linking the GUILE library code into it.
  *
- * This exception does not however invalidate any other reasons why
- * the executable file might be covered by the GNU General Public
- * License.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This exception applies only to the code released by the Free
- * Software Foundation under the name GUILE.  If you copy code from
- * other Free Software Foundation releases into a copy of GUILE, as
- * the General Public License permits, the exception does not apply to
- * the code that you add in this way.  To avoid misleading anyone as
- * to the status of such modified files, you must delete this
- * exception notice from them.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * If you write modifications of your own for GUILE, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.  */
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
 
 
 #include <string.h>
@@ -98,14 +72,14 @@ static SCM
 make_char_set (const char * func_name)
 {
   long * p;
-  
-  p = scm_must_malloc (BYTES_PER_CHARSET, func_name);
+
+  p = scm_gc_malloc (BYTES_PER_CHARSET, "character-set");
   memset (p, 0, BYTES_PER_CHARSET);
   SCM_RETURN_NEWSMOB (scm_tc16_charset, p);
 }
 
 
-SCM_DEFINE (scm_char_set_p, "char-set?", 1, 0, 0, 
+SCM_DEFINE (scm_char_set_p, "char-set?", 1, 0, 0,
             (SCM obj),
            "Return @code{#t} if @var{obj} is a character set, @code{#f}\n"
            "otherwise.")
@@ -167,7 +141,7 @@ SCM_DEFINE (scm_char_set_leq, "char-set<=", 0, 0, 1,
       if (prev_data)
        {
          int k;
-         
+
          for (k = 0; k < LONGS_PER_CHARSET; k++)
            {
              if ((prev_data[k] & csi_data[k]) != prev_data[k])
@@ -196,7 +170,7 @@ SCM_DEFINE (scm_char_set_hash, "char-set-hash", 1, 1, 0,
   int k;
 
   SCM_VALIDATE_SMOB (1, cs, charset);
-  
+
   if (SCM_UNBNDP (bound))
     bnd = default_bnd;
   else
@@ -317,11 +291,11 @@ SCM_DEFINE (scm_char_set_unfold, "char-set-unfold", 4, 1, 0,
            (SCM p, SCM f, SCM g, SCM seed, SCM base_cs),
            "This is a fundamental constructor for character sets.\n"
            "@itemize @bullet\n"
-           "@item @var{g} is used to generate a series of ``seed'' values \n"
+           "@item @var{g} is used to generate a series of ``seed'' values\n"
            "from the initial seed: @var{seed}, (@var{g} @var{seed}),\n"
            "(@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}), @dots{}\n"
            "@item @var{p} tells us when to stop -- when it returns true\n"
-           "when applied to one of the seed values. \n"
+           "when applied to one of the seed values.\n"
            "@item @var{f} maps each seed value to a character. These\n"
            "characters are added to the base character set @var{base_cs} to\n"
            "form the result; @var{base_cs} defaults to the empty set.\n"
@@ -362,10 +336,10 @@ SCM_DEFINE (scm_char_set_unfold_x, "char-set-unfold!", 5, 0, 0,
            "This is a fundamental constructor for character sets.\n"
            "@itemize @bullet\n"
            "@item @var{g} is used to generate a series of ``seed'' values\n"
-           "from the initial seed: @var{seed}, (@var{g} @var{seed}), \n"
+           "from the initial seed: @var{seed}, (@var{g} @var{seed}),\n"
            "(@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}), @dots{}\n"
            "@item @var{p} tells us when to stop -- when it returns true\n"
-           "when applied to one of the seed values. \n"
+           "when applied to one of the seed values.\n"
            "@item @var{f} maps each seed value to a character. These\n"
            "characters are added to the base character set @var{base_cs} to\n"
            "form the result; @var{base_cs} defaults to the empty set.\n"
@@ -1447,9 +1421,7 @@ scm_init_srfi_14 (void)
   scm_c_init_srfi_14 ();
 
   /* Install the charset primitives.  */
-#ifndef SCM_MAGIC_SNARFER
 #include "srfi/srfi-14.x"
-#endif
 }
 
 /* End of srfi-14.c.  */