예제 #1
0
static long parse_terminator(Octstr *mime_content, long pos)
{
    if (is_cr(octstr_get_char(mime_content, pos)))
        ++pos;
    else 
        return -1;

    if (is_lf(octstr_get_char(mime_content, pos)))
        ++pos;
    else 
        return -1;

    return pos;
}
예제 #2
0
static long pass_field_value(Octstr **body_part, Octstr **header, 
                             long pos)
{
    int c;
    long start;
    Octstr *field = NULL;

    start = pos;
    while (!is_cr(c = octstr_get_char(*body_part, pos)) &&
             pos < octstr_len(*body_part)) {
        ++pos;
    }
 
    if (pos == octstr_len(*body_part)) {
        return -1;
    }

    field = octstr_copy(*body_part, start, pos - start);
    octstr_append(*header, field);

    octstr_destroy(field);
    return pos;
}
예제 #3
0
static long parse_field_value(Octstr *pap_content, long pos)
{
    int c;

    while (!is_cr(c = octstr_get_char(pap_content, pos)) &&
	     pos < octstr_len(pap_content)) {
         ++pos;
    }
 
    if (is_lf(c)) {
        if (is_lf(octstr_get_char(pap_content, pos))) {
	    ++pos;
        } else {
	    return -1;
        }
    }

    if (pos == octstr_len(pap_content)) {
        return -1;
    }

    return pos;
}
예제 #4
0
bool is_space()
{
 return is_cr()||is_lf()||is_blank();
}