| * Copyright (C) Manuel Novoa III <mjn3@codepoet.org> |
| * and Vladimir Oleynik <dzo@simtreas.ru> |
| * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
| #define WANT_HEX_ESCAPES 1 |
| /* Usual "this only works for ascii compatible encodings" disclaimer. */ |
| #define _tolower(X) ((X)|((char) 0x20)) |
| char bb_process_escape_sequence(const char **ptr) |
| static const char charmap[] = { |
| 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', 0, |
| '\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\', '\\' }; |
| d = (unsigned int)(*q - '0'); |
| d = ((unsigned int)(_tolower(*q) - 'a')) + 10; |
| if ((base == 16) && (!--num_digits)) { |
| } while (++num_digits < 3); |
| if (num_digits == 0) { /* mnemonic escape sequence? */ |
| n = *(p+(sizeof(charmap)/2)); |