lex.reg.c
/*
 *
 * _regNew -- finish last start and set up new filter segment
 *
 */
- finish last start and set up new filter segment
- finish last start and set up new filter segment
static void _regNew(void) {
  int i;
  int last;
  if( nseg >= maxseg ){
    last = maxseg;
    if( maxseg == 0 ){
      maxseg = SEGINC;
      seg = (Segment *)xmalloc(maxseg * sizeof(Segment));
    } else {
      maxseg += SEGINC;
      seg = (Segment *)xrealloc(seg, maxseg * sizeof(Segment));
    }
    for(i=last; i<maxseg; i++){
      seg[i] = NULL;
    }
  }
  if( !nseg || (seg[nseg-1] && seg[nseg-1]->s) ){
    seg[nseg] = (Segment)xcalloc(1, sizeof(SegmentRec));
    nseg++;
  }
  seg[nseg-1]->n = nseg-1;
  seg[nseg-1]->nregion = 0;
}
static void _regNew ( void ) { int i ; int last ; if ( nseg >= maxseg ) { last = maxseg ; if ( maxseg == 0 ) { maxseg = SEGINC ; seg = ( Segment * ) xmalloc ( maxseg * sizeof ( Segment ) ) ; } else { maxseg += SEGINC ; seg = ( Segment * ) xrealloc ( seg , maxseg * sizeof ( Segment ) ) ; } for ( i = last ; i < maxseg ; i ++ ) { seg [ i ] = NULL ; } } if ( ! nseg || ( seg [ nseg - 1 ] && seg [ nseg - 1 ] -> s ) ) { seg [ nseg ] = ( Segment ) xcalloc ( 1 , sizeof ( SegmentRec ) ) ; nseg ++ ; } seg [ nseg - 1 ] -> n = nseg - 1 ; seg [ nseg - 1 ] -> nregion = 0 ; }
_regNew -- finish last start and set up new filter segment
_regNew -- finish last start and set up new filter segment
/* clear the unused records  */