Lines Matching refs:iter
8 bool pb_field_iter_begin(pb_field_iter_t *iter, const pb_field_t *fields, void *dest_struct) in pb_field_iter_begin() argument
10 iter->start = fields; in pb_field_iter_begin()
11 iter->pos = fields; in pb_field_iter_begin()
12 iter->required_field_index = 0; in pb_field_iter_begin()
13 iter->dest_struct = dest_struct; in pb_field_iter_begin()
14 iter->pData = (char*)dest_struct + iter->pos->data_offset; in pb_field_iter_begin()
15 iter->pSize = (char*)iter->pData + iter->pos->size_offset; in pb_field_iter_begin()
17 return (iter->pos->tag != 0); in pb_field_iter_begin()
20 bool pb_field_iter_next(pb_field_iter_t *iter) in pb_field_iter_next() argument
22 const pb_field_t *prev_field = iter->pos; in pb_field_iter_next()
31 iter->pos++; in pb_field_iter_next()
33 if (iter->pos->tag == 0) in pb_field_iter_next()
36 (void)pb_field_iter_begin(iter, iter->start, iter->dest_struct); in pb_field_iter_next()
45 PB_HTYPE(iter->pos->type) == PB_HTYPE_ONEOF && in pb_field_iter_next()
46 iter->pos->data_offset == PB_SIZE_MAX) in pb_field_iter_next()
69 iter->required_field_index++; in pb_field_iter_next()
72 iter->pData = (char*)iter->pData + prev_size + iter->pos->data_offset; in pb_field_iter_next()
73 iter->pSize = (char*)iter->pData + iter->pos->size_offset; in pb_field_iter_next()
78 bool pb_field_iter_find(pb_field_iter_t *iter, uint32_t tag) in pb_field_iter_find() argument
80 const pb_field_t *start = iter->pos; in pb_field_iter_find()
83 if (iter->pos->tag == tag && in pb_field_iter_find()
84 PB_LTYPE(iter->pos->type) != PB_LTYPE_EXTENSION) in pb_field_iter_find()
90 (void)pb_field_iter_next(iter); in pb_field_iter_find()
91 } while (iter->pos != start); in pb_field_iter_find()