Lines Matching refs:iterator
34 int app_manifest_iterator_reset(struct app_manifest_iterator* iterator, in app_manifest_iterator_reset() argument
37 assert(iterator); in app_manifest_iterator_reset()
39 iterator->manifest_data = manifest_data; in app_manifest_iterator_reset()
40 iterator->manifest_size = manifest_size; in app_manifest_iterator_reset()
41 iterator->index = 0; in app_manifest_iterator_reset()
42 iterator->app_name = "<unknown>"; in app_manifest_iterator_reset()
43 iterator->error = NO_ERROR; in app_manifest_iterator_reset()
53 struct app_manifest_iterator* iterator, in app_manifest_get_ptr() argument
55 const void* curr = &iterator->manifest_data[iterator->index]; in app_manifest_get_ptr()
56 if (size > iterator->manifest_size - iterator->index) { in app_manifest_get_ptr()
57 iterator->error = ERR_NOT_VALID; in app_manifest_get_ptr()
60 iterator->index += size; in app_manifest_get_ptr()
68 static inline void app_manifest_read_ptr(struct app_manifest_iterator* iterator, in app_manifest_read_ptr() argument
71 const void* src = app_manifest_get_ptr(iterator, size); in app_manifest_read_ptr()
79 struct app_manifest_iterator* iterator) { in app_manifest_read_entry() argument
81 app_manifest_read_ptr(iterator, &entry, sizeof(entry)); in app_manifest_read_entry()
86 struct app_manifest_iterator* iterator, in app_manifest_read_string() argument
101 string = app_manifest_get_ptr(iterator, string_entries); in app_manifest_read_string()
105 iterator->manifest_size, string_name, string_name, string_size, in app_manifest_read_string()
124 bool app_manifest_iterator_next(struct app_manifest_iterator* iterator, in app_manifest_iterator_next() argument
129 if (iterator->index >= iterator->manifest_size) { in app_manifest_iterator_next()
141 if (iterator->index == 0) { in app_manifest_iterator_next()
143 } else if (iterator->index == sizeof(uuid_t)) { in app_manifest_iterator_next()
146 manifest_key = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
153 entry->value.min_stack_size = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
154 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
156 iterator->app_name); in app_manifest_iterator_next()
161 entry->value.min_shadow_stack_size = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
162 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
164 iterator->app_name); in app_manifest_iterator_next()
170 entry->value.min_heap_size = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
171 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
173 iterator->app_name); in app_manifest_iterator_next()
179 entry->value.mem_map.id = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
186 entry->value.mem_map.offset = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
188 (uint64_t)app_manifest_read_entry(iterator) << 32; in app_manifest_iterator_next()
189 entry->value.mem_map.size = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
190 entry->value.mem_map.size |= (uint64_t)app_manifest_read_entry(iterator) in app_manifest_iterator_next()
192 entry->value.mem_map.arch_mmu_flags = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
193 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
195 iterator->app_name); in app_manifest_iterator_next()
201 entry->value.mgmt_flags = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
202 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
204 iterator->app_name); in app_manifest_iterator_next()
210 entry->value.start_port.flags = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
212 string_size = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
213 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
215 iterator->app_name); in app_manifest_iterator_next()
219 string = app_manifest_read_string(iterator, string_size, in app_manifest_iterator_next()
230 entry->value.pinned_cpu = (int)app_manifest_read_entry(iterator); in app_manifest_iterator_next()
231 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
233 iterator->app_name); in app_manifest_iterator_next()
239 entry->value.priority = (int)app_manifest_read_entry(iterator); in app_manifest_iterator_next()
240 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
242 iterator->app_name); in app_manifest_iterator_next()
248 entry->value.version = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
249 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
251 iterator->app_name); in app_manifest_iterator_next()
257 entry->value.min_version = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
258 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
260 iterator->app_name); in app_manifest_iterator_next()
266 entry->value.apploader_flags = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
267 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
269 iterator->app_name); in app_manifest_iterator_next()
275 app_manifest_read_ptr(iterator, &entry->value.uuid, in app_manifest_iterator_next()
277 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
279 iterator->manifest_size); in app_manifest_iterator_next()
285 string_size = app_manifest_read_entry(iterator); in app_manifest_iterator_next()
286 string = app_manifest_read_string(iterator, string_size, "app-name"); in app_manifest_iterator_next()
292 iterator->app_name = string; in app_manifest_iterator_next()
297 manifest_key, iterator->app_name); in app_manifest_iterator_next()
301 assert(iterator->error == NO_ERROR); in app_manifest_iterator_next()
310 if (iterator->error != NO_ERROR) { in app_manifest_iterator_next()
311 *out_error = iterator->error; in app_manifest_iterator_next()