File renaming
This commit is contained in:
parent
3ad5735d29
commit
6b9c15febb
10 changed files with 21 additions and 23 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* node.h
|
* r3.h
|
||||||
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
||||||
*
|
*
|
||||||
* Distributed under terms of the MIT license.
|
* Distributed under terms of the MIT license.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <pcre.h>
|
#include <pcre.h>
|
||||||
|
|
||||||
#include "token.h"
|
#include "str_array.h"
|
||||||
|
|
||||||
#define node_edge_pattern(node,i) node->edges[i]->pattern
|
#define node_edge_pattern(node,i) node->edges[i]->pattern
|
||||||
#define node_edge_pattern_len(node,i) node->edges[i]->pattern_len
|
#define node_edge_pattern_len(node,i) node->edges[i]->pattern_len
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* define.h
|
* r3_define.h
|
||||||
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
||||||
*
|
*
|
||||||
* Distributed under terms of the MIT license.
|
* Distributed under terms of the MIT license.
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* list.h
|
* r3_list.h
|
||||||
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
||||||
*
|
*
|
||||||
* Distributed under terms of the MIT license.
|
* Distributed under terms of the MIT license.
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* str.h
|
* r3_str.h
|
||||||
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
||||||
*
|
*
|
||||||
* Distributed under terms of the MIT license.
|
* Distributed under terms of the MIT license.
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
#ifndef STR_H
|
#ifndef STR_H
|
||||||
#define STR_H
|
#define STR_H
|
||||||
|
|
||||||
#include "define.h"
|
#include "r3_define.h"
|
||||||
|
|
||||||
int strndiff(char * d1, char * d2, unsigned int n);
|
int strndiff(char * d1, char * d2, unsigned int n);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* token.h
|
* str_array.h
|
||||||
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
||||||
*
|
*
|
||||||
* Distributed under terms of the MIT license.
|
* Distributed under terms of the MIT license.
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
#ifndef TOKEN_H
|
#ifndef TOKEN_H
|
||||||
#define TOKEN_H
|
#define TOKEN_H
|
||||||
|
|
||||||
#include "define.h"
|
#include "r3_define.h"
|
||||||
|
|
||||||
typedef struct _str_array {
|
typedef struct _str_array {
|
||||||
char **tokens;
|
char **tokens;
|
|
@ -5,7 +5,7 @@
|
||||||
* Distributed under terms of the MIT license.
|
* Distributed under terms of the MIT license.
|
||||||
*/
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "list.h"
|
#include "r3_list.h"
|
||||||
|
|
||||||
/* Naive linked list implementation */
|
/* Naive linked list implementation */
|
||||||
|
|
||||||
|
|
12
src/node.c
12
src/node.c
|
@ -12,10 +12,10 @@
|
||||||
// Judy array
|
// Judy array
|
||||||
#include <Judy.h>
|
#include <Judy.h>
|
||||||
|
|
||||||
#include "define.h"
|
#include "r3_define.h"
|
||||||
#include "str.h"
|
#include "r3_str.h"
|
||||||
#include "node.h"
|
#include "r3.h"
|
||||||
#include "token.h"
|
#include "str_array.h"
|
||||||
|
|
||||||
|
|
||||||
// String value as the index http://judy.sourceforge.net/doc/JudySL_3x.htm
|
// String value as the index http://judy.sourceforge.net/doc/JudySL_3x.htm
|
||||||
|
@ -28,7 +28,7 @@ node * r3_tree_create(int cap) {
|
||||||
|
|
||||||
n->edges = (edge**) malloc( sizeof(edge*) * 10 );
|
n->edges = (edge**) malloc( sizeof(edge*) * 10 );
|
||||||
n->r3_edge_len = 0;
|
n->r3_edge_len = 0;
|
||||||
n->r3_edge_cap = 10;
|
n->r3_edge_cap = cap;
|
||||||
n->endpoint = 0;
|
n->endpoint = 0;
|
||||||
n->combined_pattern = NULL;
|
n->combined_pattern = NULL;
|
||||||
return n;
|
return n;
|
||||||
|
@ -477,8 +477,6 @@ void r3_edge_free(edge * e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void r3_tree_dump(node * n, int level) {
|
void r3_tree_dump(node * n, int level) {
|
||||||
if ( n->r3_edge_len ) {
|
if ( n->r3_edge_len ) {
|
||||||
if ( n->combined_pattern ) {
|
if ( n->combined_pattern ) {
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "str.h"
|
#include "r3_str.h"
|
||||||
#include "token.h"
|
#include "str_array.h"
|
||||||
#include "define.h"
|
#include "r3_define.h"
|
||||||
|
|
||||||
int strndiff(char * d1, char * d2, unsigned int n) {
|
int strndiff(char * d1, char * d2, unsigned int n) {
|
||||||
char * o = d1;
|
char * o = d1;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "token.h"
|
#include "str_array.h"
|
||||||
|
|
||||||
|
|
||||||
str_array * str_array_create(int cap) {
|
str_array * str_array_create(int cap) {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <check.h>
|
#include <check.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "str.h"
|
#include "r3_str.h"
|
||||||
#include "node.h"
|
#include "r3.h"
|
||||||
#include "token.h"
|
#include "str_array.h"
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue