Exemple #1
0
static const char *
move_backward2 (const char *c, int lines)
{
    const char *p;
    int line;

    currentpoint = c;
    for (line = 0, p = currentpoint; (*p != '\0') && ((int) (p - fdata) >= 0); str_cprev_char (&p))
    {
        if (*p == CHAR_NODE_END)
        {
            /* We reached the beginning of the node */
            /* Skip the node headers */
            while (*p != ']')
                str_cnext_char (&p);
            return currentpoint = p + 2;        /* Skip the newline following the start of the node */
        }

        if (*(p - 1) == '\n')
            line++;
        if (line == lines)
            return currentpoint = p;
    }
    return currentpoint = c;
}
Exemple #2
0
const char *
skip_numbers (const char *s)
{
    const char *su = s;

    for (; *su; str_cnext_char (&su))
        if (!str_isdigit (su))
            break;

    return su;
}
Exemple #3
0
const char *
skip_separators (const char *s)
{
    const char *su = s;

    for (; *su; str_cnext_char (&su))
        if (*su != ' ' && *su != '\t' && *su != ',')
            break;

    return su;
}
Exemple #4
0
static const char *
move_forward2 (const char *c, int lines)
{
    const char *p;
    int line;

    currentpoint = c;
    for (line = 0, p = currentpoint; (*p != '\0') && (*p != CHAR_NODE_END); str_cnext_char (&p))
    {
        if (line == lines)
            return currentpoint = p;

        if (*p == '\n')
            line++;
    }
    return currentpoint = c;
}