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

Diff of /emacs/src/character.c

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

revision 1.1.2.11 by handa, Wed Jul 31 07:06:36 2002 UTC revision 1.1.2.12 by handa, Thu Aug 15 02:28:08 2002 UTC
# Line 181  translate_char (table, c) Line 181  translate_char (table, c)
181  }  }
182    
183  /* Convert the unibyte character C to the corresponding multibyte  /* Convert the unibyte character C to the corresponding multibyte
184     character based on the current value of charset_primary.  If C     character based on the current value of charset_unibyte.  If C
185     can't be converted, return C.  */     can't be converted, return C.  */
186    
187  int  int
188  unibyte_char_to_multibyte (c)  unibyte_char_to_multibyte (c)
189       int c;       int c;
190  {  {
191    struct charset *charset = CHARSET_FROM_ID (charset_primary);    struct charset *charset = CHARSET_FROM_ID (charset_unibyte);
192    int c1 = DECODE_CHAR (charset, c);    int c1 = DECODE_CHAR (charset, c);
193    
194    return ((c1 >= 0) ? c1 : c);    return ((c1 >= 0) ? c1 : c);
# Line 196  unibyte_char_to_multibyte (c) Line 196  unibyte_char_to_multibyte (c)
196    
197    
198  /* Convert the multibyte character C to unibyte 8-bit character based  /* Convert the multibyte character C to unibyte 8-bit character based
199     on the current value of charset_primary.  If dimension of     on the current value of charset_unibyte.  If dimension of
200     charset_primary is more than one, return (C & 0xFF).     charset_unibyte is more than one, return (C & 0xFF).
201    
202     The argument REV_TBL is now ignored.  It will be removed in the     The argument REV_TBL is now ignored.  It will be removed in the
203     future.  */     future.  */
# Line 207  multibyte_char_to_unibyte (c, rev_tbl) Line 207  multibyte_char_to_unibyte (c, rev_tbl)
207       int c;       int c;
208       Lisp_Object rev_tbl;       Lisp_Object rev_tbl;
209  {  {
210    struct charset *charset = CHARSET_FROM_ID (charset_primary);    struct charset *charset = CHARSET_FROM_ID (charset_unibyte);
211    unsigned c1 = ENCODE_CHAR (charset, c);    unsigned c1 = ENCODE_CHAR (charset, c);
212    
213    return ((c1 != CHARSET_INVALID_CODE (charset)) ? c1 : c & 0xFF);    return ((c1 != CHARSET_INVALID_CODE (charset)) ? c1 : c & 0xFF);
# Line 244  the current primary charset (value of `c Line 244  the current primary charset (value of `c
244    c = XFASTINT (ch);    c = XFASTINT (ch);
245    if (c >= 0400)    if (c >= 0400)
246      error ("Invalid unibyte character: %d", c);      error ("Invalid unibyte character: %d", c);
247    charset = CHARSET_FROM_ID (charset_primary);    charset = CHARSET_FROM_ID (charset_unibyte);
248    c = DECODE_CHAR (charset, c);    c = DECODE_CHAR (charset, c);
249    if (c < 0)    if (c < 0)
250      c = BYTE8_TO_CHAR (XFASTINT (ch));      c = BYTE8_TO_CHAR (XFASTINT (ch));
# Line 260  the current primary charset (value of `c Line 260  the current primary charset (value of `c
260       Lisp_Object ch;       Lisp_Object ch;
261  {  {
262    int c;    int c;
   struct charset *charset;  
263    
264    CHECK_CHARACTER (ch);    CHECK_CHARACTER (ch);
265    c = XFASTINT (ch);    c = XFASTINT (ch);

Legend:
Removed from v.1.1.2.11  
changed lines
  Added in v.1.1.2.12

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