/[emacs]/emacs/src/charset.c
ViewVC logotype

Diff of /emacs/src/charset.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.121 by miles, Sun Oct 21 09:59:56 2001 UTC revision 1.122 by pj, Fri Nov 2 20:19:40 2001 UTC
# Line 667  DESCRIPTION (string) is the description Line 667  DESCRIPTION (string) is the description
667    Lisp_Object *vec;    Lisp_Object *vec;
668    
669    if (!NILP (charset_id))    if (!NILP (charset_id))
670      CHECK_NUMBER (charset_id, 0);      CHECK_NUMBER (charset_id);
671    CHECK_SYMBOL (charset_symbol, 1);    CHECK_SYMBOL (charset_symbol);
672    CHECK_VECTOR (info_vector, 2);    CHECK_VECTOR (info_vector);
673    
674    if (! NILP (charset_id))    if (! NILP (charset_id))
675      {      {
# Line 734  return nil.  */) Line 734  return nil.  */)
734  {  {
735    int final_char;    int final_char;
736    
737    CHECK_NUMBER (dimension, 0);    CHECK_NUMBER (dimension);
738    CHECK_NUMBER (chars, 1);    CHECK_NUMBER (chars);
739    if (XINT (dimension) != 1 && XINT (dimension) != 2)    if (XINT (dimension) != 1 && XINT (dimension) != 2)
740      error ("Invalid charset dimension %d, it should be 1 or 2",      error ("Invalid charset dimension %d, it should be 1 or 2",
741             XINT (dimension));             XINT (dimension));
# Line 759  CHARSET should be defined by `defined-ch Line 759  CHARSET should be defined by `defined-ch
759  {  {
760    int charset;    int charset;
761    
762    CHECK_NUMBER (dimension, 0);    CHECK_NUMBER (dimension);
763    CHECK_NUMBER (chars, 1);    CHECK_NUMBER (chars);
764    CHECK_NUMBER (final_char, 2);    CHECK_NUMBER (final_char);
765    CHECK_SYMBOL (charset_symbol, 3);    CHECK_SYMBOL (charset_symbol);
766    
767    if (XINT (dimension) != 1 && XINT (dimension) != 2)    if (XINT (dimension) != 1 && XINT (dimension) != 2)
768      error ("Invalid DIMENSION %d, it should be 1 or 2", XINT (dimension));      error ("Invalid DIMENSION %d, it should be 1 or 2", XINT (dimension));
# Line 932  only `ascii', `eight-bit-control', and ` Line 932  only `ascii', `eight-bit-control', and `
932    int i;    int i;
933    Lisp_Object val;    Lisp_Object val;
934    
935    CHECK_STRING (str, 0);    CHECK_STRING (str);
936    
937    bzero (charsets, (MAX_CHARSET + 1) * sizeof (int));    bzero (charsets, (MAX_CHARSET + 1) * sizeof (int));
938    find_charset_in_text (XSTRING (str)->data, XSTRING (str)->size,    find_charset_in_text (XSTRING (str)->data, XSTRING (str)->size,
# Line 958  Internal use only.  */) Line 958  Internal use only.  */)
958  {  {
959    int charset_id, c1, c2;    int charset_id, c1, c2;
960    
961    CHECK_NUMBER (charset, 0);    CHECK_NUMBER (charset);
962    charset_id = XINT (charset);    charset_id = XINT (charset);
963    if (!CHARSET_DEFINED_P (charset_id))    if (!CHARSET_DEFINED_P (charset_id))
964      error ("Invalid charset ID: %d", XINT (charset));      error ("Invalid charset ID: %d", XINT (charset));
# Line 967  Internal use only.  */) Line 967  Internal use only.  */)
967      c1 = 0;      c1 = 0;
968    else    else
969      {      {
970        CHECK_NUMBER (code1, 1);        CHECK_NUMBER (code1);
971        c1 = XINT (code1);        c1 = XINT (code1);
972      }      }
973    if (NILP (code2))    if (NILP (code2))
974      c2 = 0;      c2 = 0;
975    else    else
976      {      {
977        CHECK_NUMBER (code2, 2);        CHECK_NUMBER (code2);
978        c2 = XINT (code2);        c2 = XINT (code2);
979      }      }
980    
# Line 1025  return a list of symbol `unknown' and CH Line 1025  return a list of symbol `unknown' and CH
1025  {  {
1026    int c, charset, c1, c2;    int c, charset, c1, c2;
1027    
1028    CHECK_NUMBER (ch, 0);    CHECK_NUMBER (ch);
1029    c = XFASTINT (ch);    c = XFASTINT (ch);
1030    if (!CHAR_VALID_P (c, 1))    if (!CHAR_VALID_P (c, 1))
1031      return Fcons (Qunknown, Fcons (ch, Qnil));      return Fcons (Qunknown, Fcons (ch, Qnil));
# Line 1041  DEFUN ("char-charset", Fchar_charset, Sc Line 1041  DEFUN ("char-charset", Fchar_charset, Sc
1041       (ch)       (ch)
1042       Lisp_Object ch;       Lisp_Object ch;
1043  {  {
1044    CHECK_NUMBER (ch, 0);    CHECK_NUMBER (ch);
1045    
1046    return CHARSET_SYMBOL (CHAR_CHARSET (XINT (ch)));    return CHARSET_SYMBOL (CHAR_CHARSET (XINT (ch)));
1047  }  }
# Line 1076  DIMENSION, CHARS, and FINAL-CHAR.  */) Line 1076  DIMENSION, CHARS, and FINAL-CHAR.  */)
1076  {  {
1077    int charset;    int charset;
1078    
1079    CHECK_NUMBER (dimension, 0);    CHECK_NUMBER (dimension);
1080    CHECK_NUMBER (chars, 1);    CHECK_NUMBER (chars);
1081    CHECK_NUMBER (final_char, 2);    CHECK_NUMBER (final_char);
1082    
1083    if ((charset = ISO_CHARSET_TABLE (dimension, chars, final_char)) < 0)    if ((charset = ISO_CHARSET_TABLE (dimension, chars, final_char)) < 0)
1084      return Qnil;      return Qnil;
# Line 1137  The conversion is done based on `nonasci Line 1137  The conversion is done based on `nonasci
1137  {  {
1138    int c;    int c;
1139    
1140    CHECK_NUMBER (ch, 0);    CHECK_NUMBER (ch);
1141    c = XINT (ch);    c = XINT (ch);
1142    if (c < 0 || c >= 0400)    if (c < 0 || c >= 0400)
1143      error ("Invalid unibyte character: %d", c);      error ("Invalid unibyte character: %d", c);
# Line 1157  The conversion is done based on `nonasci Line 1157  The conversion is done based on `nonasci
1157  {  {
1158    int c;    int c;
1159    
1160    CHECK_NUMBER (ch, 0);    CHECK_NUMBER (ch);
1161    c = XINT (ch);    c = XINT (ch);
1162    if (! CHAR_VALID_P (c, 0))    if (! CHAR_VALID_P (c, 0))
1163      error ("Invalid multibyte character: %d", c);      error ("Invalid multibyte character: %d", c);
# Line 1173  This is now an obsolete function.  We ke Line 1173  This is now an obsolete function.  We ke
1173       (ch)       (ch)
1174       Lisp_Object ch;       Lisp_Object ch;
1175  {  {
1176    CHECK_NUMBER (ch, 0);    CHECK_NUMBER (ch);
1177    return make_number (1);    return make_number (1);
1178  }  }
1179    
# Line 1223  Tab is taken to occupy `tab-width' colum Line 1223  Tab is taken to occupy `tab-width' colum
1223    int c;    int c;
1224    struct Lisp_Char_Table *dp = buffer_display_table ();    struct Lisp_Char_Table *dp = buffer_display_table ();
1225    
1226    CHECK_NUMBER (ch, 0);    CHECK_NUMBER (ch);
1227    
1228    c = XINT (ch);    c = XINT (ch);
1229    
# Line 1401  taken to occupy `tab-width' columns.  */ Line 1401  taken to occupy `tab-width' columns.  */
1401  {  {
1402    Lisp_Object val;    Lisp_Object val;
1403    
1404    CHECK_STRING (str, 0);    CHECK_STRING (str);
1405    XSETFASTINT (val, lisp_string_width (str, -1, NULL, NULL));    XSETFASTINT (val, lisp_string_width (str, -1, NULL, NULL));
1406    return val;    return val;
1407  }  }
# Line 1414  The returned value is 0 for left-to-righ Line 1414  The returned value is 0 for left-to-righ
1414  {  {
1415    int charset;    int charset;
1416    
1417    CHECK_NUMBER (ch, 0);    CHECK_NUMBER (ch);
1418    charset = CHAR_CHARSET (XFASTINT (ch));    charset = CHAR_CHARSET (XFASTINT (ch));
1419    if (!CHARSET_DEFINED_P (charset))    if (!CHARSET_DEFINED_P (charset))
1420      invalid_character (XINT (ch));      invalid_character (XINT (ch));
# Line 1428  DEFUN ("chars-in-region", Fchars_in_regi Line 1428  DEFUN ("chars-in-region", Fchars_in_regi
1428  {  {
1429    int from, to;    int from, to;
1430    
1431    CHECK_NUMBER_COERCE_MARKER (beg, 0);    CHECK_NUMBER_COERCE_MARKER (beg);
1432    CHECK_NUMBER_COERCE_MARKER (end, 1);    CHECK_NUMBER_COERCE_MARKER (end);
1433    
1434    from = min (XFASTINT (beg), XFASTINT (end));    from = min (XFASTINT (beg), XFASTINT (end));
1435    to = max (XFASTINT (beg), XFASTINT (end));    to = max (XFASTINT (beg), XFASTINT (end));
# Line 1643  usage: (string &rest CHARACTERS)  */) Line 1643  usage: (string &rest CHARACTERS)  */)
1643    
1644    for (i = 0; i < n; i++)    for (i = 0; i < n; i++)
1645      {      {
1646        CHECK_NUMBER (args[i], 0);        CHECK_NUMBER (args[i]);
1647        if (!multibyte && !SINGLE_BYTE_CHAR_P (XFASTINT (args[i])))        if (!multibyte && !SINGLE_BYTE_CHAR_P (XFASTINT (args[i])))
1648          multibyte = 1;          multibyte = 1;
1649      }      }

Legend:
Removed from v.1.121  
changed lines
  Added in v.1.122

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26