diff regexParser/sequentialSearch.cc @ 298:63213964502a

refactoring ....
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 03 Feb 2016 12:24:34 +0900
parents ef95a7f1bc03
children c9ac6f06e706
line wrap: on
line diff
--- a/regexParser/sequentialSearch.cc	Tue Feb 02 11:58:59 2016 +0900
+++ b/regexParser/sequentialSearch.cc	Wed Feb 03 12:24:34 2016 +0900
@@ -6,20 +6,9 @@
 #include <sys/mman.h>
 
 #include "fileread.h"
-
-void state1(Buffer buff);
+#include "threadedSearch.h"
 
-void stateSkip(Buffer buff) {
-    buff.matchBegin = buff.buffptr;
-    state1(buff);
-}
-
-void stateMatch(Buffer buff) {
-    fwrite(buff.matchBegin,buff.buffptr-buff.matchBegin-1,1,stdout);
-    puts("");
-    buff.buffptr--;
-    stateSkip(buff);
-}
+TSValue state0(TSValue ts);
 
 #include "state.cc"
 int main(int argc, char **argv) {
@@ -33,7 +22,10 @@
     int fd = 0;
     st_mmap_t st_mmap = createSt_mmap(filename,fd);
     Buffer buff = createBuffer(st_mmap);
-    stateSkip(buff);
+    TSValue tsv = createTSValue(NULL,buff);
+    tsv = state0(tsv);
     close(fd);
     return 0;
 }
+
+/* end */