Mercurial > hg > Applications > Grep
diff regexParser/sequentialSearch.cc @ 230:2081b9d6a179
change var name BufferList to Buffer.
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 18 Jan 2016 16:41:17 +0900 |
parents | 8be58af605da |
children | d67649929e96 |
line wrap: on
line diff
--- a/regexParser/sequentialSearch.cc Fri Jan 15 20:16:54 2016 +0900 +++ b/regexParser/sequentialSearch.cc Mon Jan 18 16:41:17 2016 +0900 @@ -6,26 +6,26 @@ #include <sys/mman.h> #include <sys/types.h> -typedef struct bufferList { +typedef struct buffer { unsigned char *buff; unsigned char *buffptr; unsigned char *buffend; unsigned char *matchBegin; -} BufferList, *BufferListPtr; +} Buffer, *BufferPtr; typedef struct { caddr_t file_mmap; off_t size; } st_mmap_t; -void state1(BufferList buff); +void state1(Buffer buff); -void stateSkip(BufferList buff) { +void stateSkip(Buffer buff) { buff.matchBegin = buff.buffptr; state1(buff); } -void stateMatch(BufferList buff) { +void stateMatch(Buffer buff) { fwrite(buff.matchBegin,buff.buffptr-buff.matchBegin,1,stdout); puts("\n"); stateSkip(buff); @@ -60,7 +60,7 @@ fprintf(stderr,"cannot mmap %s\n",filename); } - BufferList buff; + Buffer buff; buff.buff = buff.buffptr = buff.matchBegin = file_mmap; buff.buffend = buff.buff + st_mmap.size; stateSkip(buff);