comparison regex/main.cc @ 40:c25b75f764a7

add Regex.h
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Mon, 02 Mar 2015 22:18:37 +0900
parents 120c8116e831
children e1c5ecbf8836
comparison
equal deleted inserted replaced
39:120c8116e831 40:c25b75f764a7
5 #include <string.h> 5 #include <string.h>
6 #include <sys/mman.h> 6 #include <sys/mman.h>
7 #include <sys/stat.h> 7 #include <sys/stat.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include "Regex.h"
10 11
11 const char *usr_help_str = "Usage: ./regex [-file filename] [-sw SearchWord]\n"; 12 const char *usr_help_str = "Usage: ./regex [-file filename] [-sw SearchWord]\n";
12
13 typedef struct result {
14 int matchNum;
15 int matchLineNum;
16 char* matchLine;
17 } Result, *ResultPtr;
18
19 typedef struct bmData {
20 int* skipTable;
21 char* readText;
22 int readTextLen;
23 char* searchWord;
24 int searchWordLen;
25 } BMData, *BMDataPtr;
26 13
27 //Boyer Moore法に使用するテーブルを作成 14 //Boyer Moore法に使用するテーブルを作成
28 int * 15 int *
29 createBMskiptable(BMDataPtr bmdata) 16 createBMskiptable(BMDataPtr bmdata)
30 { 17 {