Commit 7f1b1198 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

more cosmetic fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3590 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 19 additions and 19 deletions
+19 -19
......@@ -729,8 +729,8 @@ int get_escape_seq_abcd(int kbinput);
int parse_escape_seq_kbinput(int kbinput);
int get_byte_kbinput(int kbinput);
#ifdef ENABLE_UTF8
long get_unicode_kbinput(int kbinput);
long add_unicode_digit(int kbinput, long factor, long *uni);
long get_unicode_kbinput(int kbinput);
#endif
int get_control_kbinput(int kbinput);
void unparse_kbinput(char *output, size_t output_len);
......
......@@ -1254,6 +1254,24 @@ int get_byte_kbinput(int kbinput)
}
#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
* (from 000000 to 10FFFF, case-insensitive) into its corresponding
* multibyte value. */
......@@ -1336,24 +1354,6 @@ long get_unicode_kbinput(int kbinput)
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 */
/* Translate a control character sequence: turn an ASCII non-control
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment