Esempio n. 1
0
void r3_edge_initl(R3Edge *e, const char * pattern, int pattern_len, R3Node * child)
{
    e->pattern.base = (char*) pattern;
    e->pattern.len = (unsigned int)pattern_len;
    // e->opcode = 0;
    e->child = child;
    e->has_slug = r3_path_contains_slug_char(e->pattern.base, e->pattern.len);
}
Esempio n. 2
0
File: node.c Progetto: RickySu/r3
bool r3_node_has_slug_edges(const node *n) {
    bool found = FALSE;
    edge *e;
    for ( int i = 0 ; i < n->edge_len ; i++ ) {
        e = n->edges[i];
        e->has_slug = r3_path_contains_slug_char(e->pattern);
        if (e->has_slug)
            found = TRUE;
    }
    return found;
}
Esempio n. 3
0
File: edge.c Progetto: Ronmi/r3
edge * r3_edge_createl(const char * pattern, int pattern_len, node * child) {
    edge * e = (edge*) zmalloc( sizeof(edge) );

    CHECK_PTR(e);

    e->pattern = (char*) pattern;
    e->pattern_len = pattern_len;
    e->opcode = 0;
    e->child = child;
    e->has_slug = r3_path_contains_slug_char(e->pattern);
    return e;
}