/* Get a special character with its escape character. Examples: 'b' -> '\b', 'n' -> '\n', 't' -> '\t'  */
static char getEscape(char ch)
/* Get a special character with its escape character. Examples: 'b' -> '\b', 'n' -> '\n', 't' -> '\t'  */
static char getEscape(char ch)
{
    static struct
    {
        char ch;
        char code;
    } const pair[] = {
        {'\"', '\"'},
        {'\\', '\\'},
        {'/', '/'},
        {'b', '\b'},
        {'f', '\f'},
        {'n', '\n'},
        {'r', '\r'},
        {'t', '\t'},
    };
    unsigned int i;
    for (i = 0; i < sizeof pair / sizeof *pair; ++i)
        if (pair[i].ch == ch)
            return pair[i].code;
    return '\0';
}