comparison example/regex_mas/ppe/Exec.cc @ 1630:d2581892b8ad draft

fix regex_mas
author Masa <e085726@ie.u-ryukyu.ac.jp>
date Tue, 04 Jun 2013 17:17:16 +0900
parents f82467ce38f3
children c0841aa109a8
comparison
equal deleted inserted replaced
1629:da928c43c6be 1630:d2581892b8ad
1 #include <stdio.h> 1 #include <stdio.h>
2 #include <string.h> 2 #include <string.h>
3 #include "Exec.h" 3 #include "Exec.h"
4 #include "Func.h" 4 #include "Func.h"
5 #define max(a,b)((a)>(b)?a:b) 5 #define max(a,b)((a)>(b)?a:b)
6
6 /* これは必須 */ 7 /* これは必須 */
7 SchedDefineTask(Exec); 8 SchedDefineTask(Exec);
9
8 //ボイヤームーア法による文字列検索アルゴリズム 10 //ボイヤームーア法による文字列検索アルゴリズム
9 int BM_method(unsigned char *text,int text_length,unsigned char *pattern,unsigned long long *match_string) 11 int BM_method(unsigned char *text,int text_length,unsigned char *pattern,unsigned long long *match_string)
10 { 12 {
11 int skip[256]; 13 int skip[256];
12 int text_len = text_length; 14 int text_len = text_length;
43 run(SchedTask *s, void *rbuf, void *wbuf) 45 run(SchedTask *s, void *rbuf, void *wbuf)
44 { 46 {
45 unsigned char *i_data = (unsigned char *)rbuf; 47 unsigned char *i_data = (unsigned char *)rbuf;
46 unsigned long long *o_data = (unsigned long long*)wbuf; 48 unsigned long long *o_data = (unsigned long long*)wbuf;
47 int length = (int)s->get_inputSize(0); 49 int length = (int)s->get_inputSize(0);
48 // int *offset = (int*)s->get_param(1); 50 // int *offset = (int*)s->get_param(1);
49 unsigned char search_word[] = "abcd"; 51 unsigned char search_word[] = "abcd";
50 // printf("offset = %d\n",offset); 52 // printf("offset = %d\n",offset);
51 53
52 BM_method(i_data,length,search_word,o_data); 54 BM_method(i_data,length,search_word,o_data);
55 s->printf("in Exec.cc\n");
53 56
54 57
55 return 0; 58 return 0;
56 } 59 }