ccl.c (99112) | ccl.c (179549) |
---|---|
1/* ccl - routines for character classes */ 2 3/*- 4 * Copyright (c) 1990 The Regents of the University of California. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Vern Paxson. --- 14 unchanged lines hidden (view full) --- 23 * specific prior written permission. 24 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 25 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 27 */ 28 29/* $Header: /home/daffy/u0/vern/flex/RCS/ccl.c,v 2.9 93/09/16 20:32:14 vern Exp $ */ 30#include <sys/cdefs.h> | 1/* ccl - routines for character classes */ 2 3/*- 4 * Copyright (c) 1990 The Regents of the University of California. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Vern Paxson. --- 14 unchanged lines hidden (view full) --- 23 * specific prior written permission. 24 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 25 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 27 */ 28 29/* $Header: /home/daffy/u0/vern/flex/RCS/ccl.c,v 2.9 93/09/16 20:32:14 vern Exp $ */ 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/usr.bin/lex/ccl.c 99112 2002-06-30 05:25:07Z obrien $"); | 31__FBSDID("$FreeBSD: head/usr.bin/lex/ccl.c 179549 2008-06-04 19:50:34Z dwmalone $"); |
32 33#include "flexdef.h" 34 35/* ccladd - add a single character to a ccl */ 36 37void ccladd( cclp, ch ) 38int cclp; 39int ch; --- 77 unchanged lines hidden (view full) --- 117 * characters present in the given CCL. A character is present if it 118 * has a non-zero value in the cset array. 119 */ 120 121void list_character_set( file, cset ) 122FILE *file; 123int cset[]; 124 { | 32 33#include "flexdef.h" 34 35/* ccladd - add a single character to a ccl */ 36 37void ccladd( cclp, ch ) 38int cclp; 39int ch; --- 77 unchanged lines hidden (view full) --- 117 * characters present in the given CCL. A character is present if it 118 * has a non-zero value in the cset array. 119 */ 120 121void list_character_set( file, cset ) 122FILE *file; 123int cset[]; 124 { |
125 register int i; | 125 int i; |
126 127 putc( '[', file ); 128 129 for ( i = 0; i < csize; ++i ) 130 { 131 if ( cset[i] ) 132 { | 126 127 putc( '[', file ); 128 129 for ( i = 0; i < csize; ++i ) 130 { 131 if ( cset[i] ) 132 { |
133 register int start_char = i; | 133 int start_char = i; |
134 135 putc( ' ', file ); 136 137 fputs( readable_form( i ), file ); 138 139 while ( ++i < csize && cset[i] ) 140 ; 141 142 if ( i - 1 > start_char ) 143 /* this was a run */ 144 fprintf( file, "-%s", readable_form( i - 1 ) ); 145 146 putc( ' ', file ); 147 } 148 } 149 150 putc( ']', file ); 151 } | 134 135 putc( ' ', file ); 136 137 fputs( readable_form( i ), file ); 138 139 while ( ++i < csize && cset[i] ) 140 ; 141 142 if ( i - 1 > start_char ) 143 /* this was a run */ 144 fprintf( file, "-%s", readable_form( i - 1 ) ); 145 146 putc( ' ', file ); 147 } 148 } 149 150 putc( ']', file ); 151 } |