Mercurial > hg > Members > masakoha > testcode
changeset 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 | f2454c17e410 |
children | d67649929e96 |
files | regexParser/generateSequentialSearch.cc regexParser/sequentialSearch.cc |
diffstat | 2 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/regexParser/generateSequentialSearch.cc Fri Jan 15 20:16:54 2016 +0900 +++ b/regexParser/generateSequentialSearch.cc Mon Jan 18 16:41:17 2016 +0900 @@ -7,11 +7,11 @@ StatePtr state = tg->stateList; FILE *fp = fopen("state.cc","w"); for (;state;state = state->next) { - fprintf(fp,"void state%lx(BufferList buff);\n",state->bitState.bitContainer); + fprintf(fp,"void state%lx(Buffer buff);\n",state->bitState.bitContainer); } fputs("\n",fp); for (state = tg->stateList;state;state = state->next) { - fprintf(fp,"void state%lx(BufferList buff) {\n",state->bitState.bitContainer); + fprintf(fp,"void state%lx(Buffer buff) {\n",state->bitState.bitContainer); if (state->bitState.bitContainer == 2) { // Accept fputs(" stateMatch(buff);\n",fp); } else { // not Accept
--- 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);