Lines Matching refs:state
43 #define RAND() (state.seed=(state.seed*0x63c63cd9L+1)&0xffffffff)
59 } state;
66 if (state.part >= state.range['d'].min)
68 state.part = 0;
71 c = data[(state.seed >> state.part) % m];
72 state.part += CHAR_BIT;
86 state.range['d'].min = sizeof(state.seed) * CHAR_BIT;
87 state.range['r'].min = 0x00001000;
88 state.range['s'].min = 0x00100000;
89 state.seed = 0x12345678;
90 state.charset = ALPHA;
125 state.charset = BINARY;
136 state.range[c].min = strton(opt_info.arg, &e, NiL, 0);
138 state.range[c].max = strton(e + 1, NiL, NiL, 0);
147 if (state.range['l'].min)
148 ROUND(state.range['s'].min, state.range['l'].min);
149 if (state.range['r'].max)
152 state.range['r'].min--;
153 if (state.range['r'].max < state.range['r'].min)
154 state.range['r'].max = state.range['r'].min;
155 if (state.range['r'].max <= (state.range['r'].min + 1))
156 state.range['r'].max = 1;
158 state.range['r'].max -= state.range['r'].min + 1;
161 state.range['r'].max = 1;
162 if (state.range['p'].min)
164 if (state.range['p'].min > state.range['r'].min)
165 state.range['p'].min = state.range['r'].min;
166 if (state.range['p'].max < state.range['p'].min)
167 state.range['p'].max = state.range['p'].min;
168 if (state.range['p'].max > state.range['r'].min + state.range['r'].max)
169 state.range['p'].max = state.range['r'].min + state.range['r'].max;
170 if (state.range['p'].max <= (state.range['p'].min + 1))
171 state.range['p'].max = 1;
173 state.range['p'].max -= state.range['p'].min + 1;
175 if (state.range['f'].min)
177 if (state.range['f'].min >= state.range['r'].min)
178 state.range['f'].min = state.range['r'].min - 1;
179 if (state.range['f'].max < state.range['f'].min)
180 state.range['f'].max = state.range['f'].min;
181 if (state.range['f'].max > state.range['r'].min + state.range['r'].max)
182 state.range['f'].max = state.range['r'].min + state.range['r'].max;
183 if (state.range['f'].max <= (state.range['f'].min + 1))
184 state.range['f'].max = 1;
186 state.range['f'].max -= state.range['f'].min + 1;
188 if (state.range['i'].min)
190 if (state.range['i'].min >= state.range['r'].min)
191 state.range['i'].min = state.range['r'].min - 1;
192 if (state.range['i'].max < state.range['i'].min)
193 state.range['i'].max = state.range['i'].min;
194 if (state.range['i'].max > state.range['r'].min + state.range['r'].max)
195 state.range['i'].max = state.range['r'].min + state.range['r'].max;
196 if (state.range['i'].max <= (state.range['i'].min + 1))
197 state.range['i'].max = 1;
199 state.range['i'].max -= state.range['i'].min + 1;
201 if (!(state.buf = newof(0, unsigned char,
202 state.range['f'].min + state.range['f'].max + 1 +
203 state.range['i'].min + state.range['i'].max + 1 +
204 state.range['k'].min + state.range['k'].max +
205 state.range['p'].min + state.range['p'].max +
206 2 * (state.range['r'].min + state.range['r'].max),
209 n = state.range['s'].min;
213 if (state.range['f'].min)
215 k = state.range['f'].min + (RAND() % state.range['f'].max) - 6;
216 state.buf[i++] = '.';
218 state.buf[i++] = gen(NUMERIC);
219 state.buf[i++] = 'e';
220 state.buf[i++] = "-+"[RAND() % 2];
221 state.buf[i++] = gen(NUMERIC);
222 state.buf[i++] = gen(NUMERIC);
223 state.buf[i++] = ':';
225 if (state.range['i'].min)
227 k = state.range['i'].min + (RAND() % state.range['i'].max);
229 state.buf[i++] = gen(NUMERIC);
230 state.buf[i++] = ':';
232 if (state.range['p'].min)
234 k = state.range['p'].min + (RAND() % state.range['p'].max);
235 c = gen(state.charset);
237 state.buf[i++] = c;
239 k = state.range['k'].min ? state.range['k'].min : state.range['r'].min + (RAND() % state.range['r'].max);
241 state.buf[i++] = gen(state.charset);
242 if (state.range['k'].min)
244 k = state.range['r'].min + (RAND() % state.range['r'].max);
246 state.buf[i++] = ' ';
249 state.buf[i++] = '\n';
254 state.buf[n - 1] = '\n';
256 sfwrite(sfstdout, state.buf, i);