(U-0002195D): Add `ideographic-structure'; add `sound@ja/on'; add
[chise/xemacs-chise.git.1] / src / data.c
index a0f2445..197842e 100644 (file)
@@ -39,6 +39,9 @@ Boston, MA 02111-1307, USA.  */
 #endif /* LISP_FLOAT_TYPE */
 
 Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
+#ifdef UTF2000
+Lisp_Object Qunloaded;
+#endif
 Lisp_Object Qerror_conditions, Qerror_message;
 Lisp_Object Qerror, Qquit, Qsyntax_error, Qinvalid_read_syntax;
 Lisp_Object Qlist_formation_error;
@@ -71,7 +74,7 @@ Lisp_Object Qfloatp;
 
 int debug_issue_ebola_notices;
 
-int debug_ebola_backtrace_length;
+Fixnum debug_ebola_backtrace_length;
 
 int
 eq_with_ebola_notice (Lisp_Object obj1, Lisp_Object obj2)
@@ -80,7 +83,7 @@ eq_with_ebola_notice (Lisp_Object obj1, Lisp_Object obj2)
       && ((CHARP (obj1) && INTP (obj2)) || (CHARP (obj2) && INTP (obj1))))
     {
       /* #### It would be really nice if this were a proper warning
-         instead of brain-dead print ro Qexternal_debugging_output.  */
+         instead of brain-dead print to Qexternal_debugging_output.  */
       write_c_string ("Comparison between integer and character is constant nil (",
                      Qexternal_debugging_output);
       Fprinc (obj1, Qexternal_debugging_output);
@@ -170,10 +173,10 @@ EMACS_INT sign_extend_lisp_int (EMACS_INT num);
 EMACS_INT
 sign_extend_lisp_int (EMACS_INT num)
 {
-  if (num & (1L << (VALBITS - 1)))
-    return num | ((-1L) << VALBITS);
+  if (num & (1L << (INT_VALBITS - 1)))
+    return num | ((-1L) << INT_VALBITS);
   else
-    return num & ((1L << VALBITS) - 1);
+    return num & (EMACS_INT) ((1UL << INT_VALBITS) - 1);
 }
 
 \f
@@ -182,9 +185,9 @@ sign_extend_lisp_int (EMACS_INT num)
 DEFUN ("eq", Feq, 2, 2, 0, /*
 Return t if the two args are the same Lisp object.
 */
-       (obj1, obj2))
+       (object1, object2))
 {
-  return EQ_WITH_EBOLA_NOTICE (obj1, obj2) ? Qt : Qnil;
+  return EQ_WITH_EBOLA_NOTICE (object1, object2) ? Qt : Qnil;
 }
 
 DEFUN ("old-eq", Fold_eq, 2, 2, 0, /*
@@ -199,10 +202,10 @@ functions with `old-foo' equivalents.
 
 Do not use this function!
 */
-       (obj1, obj2))
+       (object1, object2))
 {
   /* #### blasphemy */
-  return HACKEQ_UNSAFE (obj1, obj2) ? Qt : Qnil;
+  return HACKEQ_UNSAFE (object1, object2) ? Qt : Qnil;
 }
 
 DEFUN ("null", Fnull, 1, 1, 0, /*
@@ -246,7 +249,7 @@ Return t if OBJECT is not a list.  `nil' is a list.
 }
 
 DEFUN ("true-list-p", Ftrue_list_p, 1, 1, 0, /*
-Return t if OBJECT is a non-dotted, i.e. nil-terminated, list.
+Return t if OBJECT is an acyclic, nil-terminated (ie, not dotted), list.
 */
        (object))
 {
@@ -357,7 +360,7 @@ or nil if it takes an arbitrary number of arguments or is a special form.
 }
 
 DEFUN ("subr-interactive", Fsubr_interactive, 1, 1, 0, /*
-Return the interactive spec of the subr object, or nil.
+Return the interactive spec of the subr object SUBR, or nil.
 If non-nil, the return value will be a list whose first element is
 `interactive' and whose second element is the interactive spec.
 */
@@ -395,7 +398,7 @@ as `char='.
 }
 
 DEFUN ("char-to-int", Fchar_to_int, 1, 1, 0, /*
-Convert a character into an equivalent integer.
+Convert CHARACTER into an equivalent integer.
 The resulting integer will always be non-negative.  The integers in
 the range 0 - 255 map to characters as follows:
 
@@ -409,14 +412,14 @@ values.  When Mule support exists, the values assigned to other characters
 may vary depending on the particular version of XEmacs, the order in which
 character sets were loaded, etc., and you should not depend on them.
 */
-       (ch))
+       (character))
 {
-  CHECK_CHAR (ch);
-  return make_int (XCHAR (ch));
+  CHECK_CHAR (character);
+  return make_int (XCHAR (character));
 }
 
 DEFUN ("int-to-char", Fint_to_char, 1, 1, 0, /*
-Convert an integer into the equivalent character.
+Convert integer INTEGER into the equivalent character.
 Not all integers correspond to valid characters; use `char-int-p' to
 determine whether this is the case.  If the integer cannot be converted,
 nil is returned.
@@ -458,6 +461,14 @@ confoundedness in older versions of E-Lisp.
 {
   return CHAR_OR_CHAR_INTP (object) || STRINGP (object) ? Qt : Qnil;
 }
+
+DEFUN ("char-ref-p", Fchar_ref_p, 1, 1, 0, /*
+Return t if OBJECT is a character-reference.
+*/
+       (object))
+{
+  return CONSP (object) && KEYWORDP (XCAR (object)) ? Qt : Qnil;
+}
 \f
 DEFUN ("integerp", Fintegerp, 1, 1, 0, /*
 Return t if OBJECT is an integer.
@@ -614,26 +625,26 @@ Return the cdr of OBJECT if it is a cons cell, else nil.
 }
 
 DEFUN ("setcar", Fsetcar, 2, 2, 0, /*
-Set the car of CONSCELL to be NEWCAR.  Return NEWCAR.
+Set the car of CONS-CELL to be NEWCAR.  Return NEWCAR.
 */
-       (conscell, newcar))
+       (cons_cell, newcar))
 {
-  if (!CONSP (conscell))
-    conscell = wrong_type_argument (Qconsp, conscell);
+  if (!CONSP (cons_cell))
+    cons_cell = wrong_type_argument (Qconsp, cons_cell);
 
-  XCAR (conscell) = newcar;
+  XCAR (cons_cell) = newcar;
   return newcar;
 }
 
 DEFUN ("setcdr", Fsetcdr, 2, 2, 0, /*
-Set the cdr of CONSCELL to be NEWCDR.  Return NEWCDR.
+Set the cdr of CONS-CELL to be NEWCDR.  Return NEWCDR.
 */
-       (conscell, newcdr))
+       (cons_cell, newcdr))
 {
-  if (!CONSP (conscell))
-    conscell = wrong_type_argument (Qconsp, conscell);
+  if (!CONSP (cons_cell))
+    cons_cell = wrong_type_argument (Qconsp, cons_cell);
 
-  XCDR (conscell) = newcdr;
+  XCDR (cons_cell) = newcdr;
   return newcdr;
 }
 \f
@@ -1002,27 +1013,27 @@ lisp_to_word (Lisp_Object item)
 
 \f
 DEFUN ("number-to-string", Fnumber_to_string, 1, 1, 0, /*
-Convert NUM to a string by printing it in decimal.
+Convert NUMBER to a string by printing it in decimal.
 Uses a minus sign if negative.
-NUM may be an integer or a floating point number.
+NUMBER may be an integer or a floating point number.
 */
-       (num))
+       (number))
 {
   char buffer[VALBITS];
 
-  CHECK_INT_OR_FLOAT (num);
+  CHECK_INT_OR_FLOAT (number);
 
 #ifdef LISP_FLOAT_TYPE
-  if (FLOATP (num))
+  if (FLOATP (number))
     {
       char pigbuf[350];        /* see comments in float_to_string */
 
-      float_to_string (pigbuf, XFLOAT_DATA (num));
+      float_to_string (pigbuf, XFLOAT_DATA (number));
       return build_string (pigbuf);
     }
 #endif /* LISP_FLOAT_TYPE */
 
-  long_to_string (buffer, XINT (num));
+  long_to_string (buffer, XINT (number));
   return build_string (buffer);
 }
 
@@ -1039,12 +1050,12 @@ digit_to_number (int character, int base)
 }
 
 DEFUN ("string-to-number", Fstring_to_number, 1, 2, 0, /*
-Convert STRING to a number by parsing it as a decimal number.
+Convert STRING to a number by parsing it as a number in base BASE.
 This parses both integers and floating point numbers.
 It ignores leading spaces and tabs.
 
-If BASE, interpret STRING as a number in that base.  If BASE isn't
-present, base 10 is used.  BASE must be between 2 and 16 (inclusive).
+If BASE is nil or omitted, base 10 is used.
+BASE must be an integer between 2 and 16 (inclusive).
 Floating point numbers always use base 10.
 */
        (string, base))
@@ -1088,7 +1099,7 @@ Floating point numbers always use base 10.
     }
   else
     {
-      int digit, negative = 1;
+      int negative = 1;
       EMACS_INT v = 0;
 
       if (*p == '-')
@@ -1100,7 +1111,7 @@ Floating point numbers always use base 10.
        p++;
       while (1)
        {
-         digit = digit_to_number (*p++, b);
+         int digit = digit_to_number (*p++, b);
          if (digit < 0)
            break;
          v = v * b + digit;
@@ -1417,10 +1428,10 @@ DEFUN ("%", Frem, 2, 2, 0, /*
 Return remainder of first arg divided by second.
 Both must be integers, characters or markers.
 */
-       (num1, num2))
+       (number1, number2))
 {
-  EMACS_INT ival1 = integer_char_or_marker_to_int (num1);
-  EMACS_INT ival2 = integer_char_or_marker_to_int (num2);
+  EMACS_INT ival1 = integer_char_or_marker_to_int (number1);
+  EMACS_INT ival2 = integer_char_or_marker_to_int (number2);
 
   if (ival2 == 0)
     Fsignal (Qarith_error, Qnil);
@@ -1769,7 +1780,7 @@ finish_marking_weak_lists (void)
              break;
 
            default:
-             abort ();
+             ABORT ();
            }
 
          if (need_to_mark_elem && ! marked_p (elem))
@@ -1925,7 +1936,7 @@ encode_weak_list_type (enum weak_list_type type)
     case WEAK_LIST_VALUE_ASSOC: return Qvalue_assoc;
     case WEAK_LIST_FULL_ASSOC:  return Qfull_assoc;
     default:
-      abort ();
+      ABORT ();
     }
 
   return Qnil; /* not reached */
@@ -1943,7 +1954,7 @@ DEFUN ("make-weak-list", Fmake_weak_list, 0, 1, 0, /*
 Return a new weak list object of type TYPE.
 A weak list object is an object that contains a list.  This list behaves
 like any other list except that its elements do not count towards
-garbage collection -- if the only pointer to an object in inside a weak
+garbage collection -- if the only pointer to an object is inside a weak
 list (other than pointers in similar objects such as weak hash tables),
 the object is garbage collected and automatically removed from the list.
 This is used internally, for example, to manage the list holding the
@@ -2156,6 +2167,7 @@ syms_of_data (void)
   DEFSUBR (Fchar_to_int);
   DEFSUBR (Fint_to_char);
   DEFSUBR (Fchar_or_char_int_p);
+  DEFSUBR (Fchar_ref_p);
   DEFSUBR (Fintegerp);
   DEFSUBR (Finteger_or_marker_p);
   DEFSUBR (Finteger_or_char_p);
@@ -2229,7 +2241,7 @@ vars_of_data (void)
 {
   /* This must not be staticpro'd */
   Vall_weak_lists = Qnil;
-  pdump_wire_list (&Vall_weak_lists);
+  dump_add_weak_object_chain (&Vall_weak_lists);
 
 #ifdef DEBUG_XEMACS
   DEFVAR_BOOL ("debug-issue-ebola-notices", &debug_issue_ebola_notices /*