Lines Matching refs:buf

134 int random_r(struct random_data *buf, int32_t *result)  in random_r()  argument
138 if (buf == NULL || result == NULL) in random_r()
141 state = buf->state; in random_r()
143 if (buf->rand_type == TYPE_0) in random_r()
152 int32_t *fptr = buf->fptr; in random_r()
153 int32_t *rptr = buf->rptr; in random_r()
154 int32_t *end_ptr = buf->end_ptr; in random_r()
172 buf->fptr = fptr; in random_r()
173 buf->rptr = rptr; in random_r()
191 int srandom_r (unsigned int seed, struct random_data *buf) in libc_hidden_def()
200 if (buf == NULL) in libc_hidden_def()
202 type = buf->rand_type; in libc_hidden_def()
206 state = buf->state; in libc_hidden_def()
216 kc = buf->rand_deg; in libc_hidden_def()
230 buf->fptr = &state[buf->rand_sep]; in libc_hidden_def()
231 buf->rptr = &state[0]; in libc_hidden_def()
236 (void) random_r (buf, &discard); in libc_hidden_def()
258 int initstate_r (unsigned int seed, char *arg_state, size_t n, struct random_data *buf) in libc_hidden_def()
265 if (buf == NULL) in libc_hidden_def()
285 buf->rand_type = type; in libc_hidden_def()
286 buf->rand_sep = separation; in libc_hidden_def()
287 buf->rand_deg = degree; in libc_hidden_def()
290 buf->end_ptr = &state[degree]; in libc_hidden_def()
292 buf->state = state; in libc_hidden_def()
294 srandom_r (seed, buf); in libc_hidden_def()
298 state[-1] = (buf->rptr - state) * MAX_TYPES + type; in libc_hidden_def()
316 int setstate_r (char *arg_state, struct random_data *buf) in libc_hidden_def()
325 if (arg_state == NULL || buf == NULL) in libc_hidden_def()
328 old_type = buf->rand_type; in libc_hidden_def()
329 old_state = buf->state; in libc_hidden_def()
333 old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type; in libc_hidden_def()
339 buf->rand_deg = degree = random_poly_info.degrees[type]; in libc_hidden_def()
340 buf->rand_sep = separation = random_poly_info.seps[type]; in libc_hidden_def()
341 buf->rand_type = type; in libc_hidden_def()
346 buf->rptr = &new_state[rear]; in libc_hidden_def()
347 buf->fptr = &new_state[(rear + separation) % degree]; in libc_hidden_def()
349 buf->state = new_state; in libc_hidden_def()
351 buf->end_ptr = &new_state[degree]; in libc_hidden_def()