more cosmetic fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3590 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2006-05-28 17:30:28 +00:00
parent a5b1ca2808
commit 7f1b1198a7
2 changed files with 19 additions and 19 deletions

View File

@ -729,8 +729,8 @@ int get_escape_seq_abcd(int kbinput);
int parse_escape_seq_kbinput(int kbinput); int parse_escape_seq_kbinput(int kbinput);
int get_byte_kbinput(int kbinput); int get_byte_kbinput(int kbinput);
#ifdef ENABLE_UTF8 #ifdef ENABLE_UTF8
long get_unicode_kbinput(int kbinput);
long add_unicode_digit(int kbinput, long factor, long *uni); long add_unicode_digit(int kbinput, long factor, long *uni);
long get_unicode_kbinput(int kbinput);
#endif #endif
int get_control_kbinput(int kbinput); int get_control_kbinput(int kbinput);
void unparse_kbinput(char *output, size_t output_len); void unparse_kbinput(char *output, size_t output_len);

View File

@ -1254,6 +1254,24 @@ int get_byte_kbinput(int kbinput)
} }
#ifdef ENABLE_UTF8 #ifdef ENABLE_UTF8
/* If the character in kbinput is a valid hexadecimal digit, multiply it
* by factor and add the result to uni. */
long add_unicode_digit(int kbinput, long factor, long *uni)
{
long retval = ERR;
if ('0' <= kbinput && kbinput <= '9')
*uni += (kbinput - '0') * factor;
else if ('a' <= tolower(kbinput) && tolower(kbinput) <= 'f')
*uni += (tolower(kbinput) - 'a' + 10) * factor;
else
/* If this character isn't a valid hexadecimal value, save it as
* the result. */
retval = kbinput;
return retval;
}
/* Translate a Unicode sequence: turn a six-digit hexadecimal number /* Translate a Unicode sequence: turn a six-digit hexadecimal number
* (from 000000 to 10FFFF, case-insensitive) into its corresponding * (from 000000 to 10FFFF, case-insensitive) into its corresponding
* multibyte value. */ * multibyte value. */
@ -1336,24 +1354,6 @@ long get_unicode_kbinput(int kbinput)
return retval; return retval;
} }
/* If the character in kbinput is a valid hexadecimal digit, multiply it
* by factor and add the result to uni. */
long add_unicode_digit(int kbinput, long factor, long *uni)
{
long retval = ERR;
if ('0' <= kbinput && kbinput <= '9')
*uni += (kbinput - '0') * factor;
else if ('a' <= tolower(kbinput) && tolower(kbinput) <= 'f')
*uni += (tolower(kbinput) - 'a' + 10) * factor;
else
/* If this character isn't a valid hexadecimal value, save it as
* the result. */
retval = kbinput;
return retval;
}
#endif /* ENABLE_UTF8 */ #endif /* ENABLE_UTF8 */
/* Translate a control character sequence: turn an ASCII non-control /* Translate a control character sequence: turn an ASCII non-control