Mercurial > hg > xemacs-beta
comparison src/mule-charset.c @ 446:1ccc32a20af4 r21-2-38
Import from CVS: tag r21-2-38
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:37:21 +0200 |
parents | 576fb035e263 |
children | 3d3049ae1304 |
comparison
equal
deleted
inserted
replaced
445:34f3776fcf0e | 446:1ccc32a20af4 |
---|---|
443 }; | 443 }; |
444 | 444 |
445 DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, | 445 DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, |
446 mark_charset, print_charset, 0, 0, 0, charset_description, | 446 mark_charset, print_charset, 0, 0, 0, charset_description, |
447 Lisp_Charset); | 447 Lisp_Charset); |
448 | |
448 /* Make a new charset. */ | 449 /* Make a new charset. */ |
449 | 450 /* #### SJT Should generic properties be allowed? */ |
450 static Lisp_Object | 451 static Lisp_Object |
451 make_charset (int id, Lisp_Object name, unsigned char rep_bytes, | 452 make_charset (int id, Lisp_Object name, unsigned char rep_bytes, |
452 unsigned char type, unsigned char columns, unsigned char graphic, | 453 unsigned char type, unsigned char columns, unsigned char graphic, |
453 Bufbyte final, unsigned char direction, Lisp_Object short_name, | 454 Bufbyte final, unsigned char direction, Lisp_Object short_name, |
454 Lisp_Object long_name, Lisp_Object doc, | 455 Lisp_Object long_name, Lisp_Object doc, |
615 (charset)) | 616 (charset)) |
616 { | 617 { |
617 return XCHARSET_NAME (Fget_charset (charset)); | 618 return XCHARSET_NAME (Fget_charset (charset)); |
618 } | 619 } |
619 | 620 |
621 /* #### SJT Should generic properties be allowed? */ | |
620 DEFUN ("make-charset", Fmake_charset, 3, 3, 0, /* | 622 DEFUN ("make-charset", Fmake_charset, 3, 3, 0, /* |
621 Define a new character set. | 623 Define a new character set. |
622 This function is for use with Mule support. | 624 This function is for use with Mule support. |
623 NAME is a symbol, the name by which the character set is normally referred. | 625 NAME is a symbol, the name by which the character set is normally referred. |
624 DOC-STRING is a string describing the character set. | 626 DOC-STRING is a string describing the character set. |
959 { | 961 { |
960 return make_int (XCHARSET_DIMENSION (Fget_charset (charset))); | 962 return make_int (XCHARSET_DIMENSION (Fget_charset (charset))); |
961 } | 963 } |
962 | 964 |
963 DEFUN ("charset-property", Fcharset_property, 2, 2, 0, /* | 965 DEFUN ("charset-property", Fcharset_property, 2, 2, 0, /* |
964 Return property PROP of CHARSET. | 966 Return property PROP of CHARSET, a charset object or symbol naming a charset. |
965 Recognized properties are those listed in `make-charset', as well as | 967 Recognized properties are those listed in `make-charset', as well as |
966 'name and 'doc-string. | 968 'name and 'doc-string. |
967 */ | 969 */ |
968 (charset, prop)) | 970 (charset, prop)) |
969 { | 971 { |
987 if (EQ (prop, Qdirection)) | 989 if (EQ (prop, Qdirection)) |
988 return CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? Ql2r : Qr2l; | 990 return CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? Ql2r : Qr2l; |
989 if (EQ (prop, Qreverse_direction_charset)) | 991 if (EQ (prop, Qreverse_direction_charset)) |
990 { | 992 { |
991 Lisp_Object obj = CHARSET_REVERSE_DIRECTION_CHARSET (cs); | 993 Lisp_Object obj = CHARSET_REVERSE_DIRECTION_CHARSET (cs); |
992 if (NILP (obj)) | 994 /* #### Is this translation OK? If so, error checking sufficient? */ |
993 return Qnil; | 995 return CHARSETP (obj) ? XCHARSET_NAME (obj) : obj; |
994 else | |
995 return XCHARSET_NAME (obj); | |
996 } | 996 } |
997 signal_simple_error ("Unrecognized charset property name", prop); | 997 signal_simple_error ("Unrecognized charset property name", prop); |
998 return Qnil; /* not reached */ | 998 return Qnil; /* not reached */ |
999 } | 999 } |
1000 | 1000 |