Mercurial > hg > Applications > Grep
view c/regexParser/bitVectorNode.cc @ 130:7925e9abb078 pairPro
add or flag
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 02 Dec 2015 17:51:02 +0900 |
parents | 166136236891 |
children |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include <ctype.h> #include "bitVectorNode.h" BitVectorListPtr allocateBitVectorList() { BitVectorListPtr bvl = (BitVectorListPtr)malloc(sizeof(BitVectorList)); if (bvl == NULL) { fprintf(stderr, "Failed to allocate memory.\n"); exit(-1); } bvl->self = bvl; bvl->bi = (BitVectorPtr)malloc(sizeof(BitVector)); if (bvl->bi == NULL) { fprintf(stderr, "Failed to allocate memory.\n"); exit(-1); } return bvl; } BitVectorListPtr initBitVector() { BitVectorListPtr bvl = allocateBitVectorList(); bvl->initBvl = bvl; bvl->bi = bitSet(0); for (int i = 0; i < 256; i++) { bvl->next[i] = NULL; } return bvl; }