Ret dlist_foreach(DList* thiz, DListDataVisitFunc visit, void* ctx) { Ret ret = RET_OK; DListNode* iter = NULL; return_val_if_fail(thiz != NULL && visit != NULL, RET_INVALID_PARAMS); dlist_rdlock(thiz); iter = thiz->first; while(iter != NULL && ret != RET_STOP) { ret = visit(ctx, iter->data); iter = iter->next; } dlist_unlock(thiz); return ret; }
static DListNode* dlist_get_node(DList* thiz, size_t index, int fail_return_last) { DListNode* iter = NULL; return_val_if_fail(thiz != NULL, NULL); iter = thiz->first; while(iter != NULL && iter->next != NULL && index > 0) { iter = iter->next; index--; } if(!fail_return_last) { iter = index > 0 ? NULL : iter; } return iter; }
int mm_player_sound_filter_custom_get_eq_bands_number(MMHandleType hplayer, int *bands) { mm_player_t* player = (mm_player_t*)hplayer; int result = MM_ERROR_NONE; debug_fenter(); return_val_if_fail( player, MM_ERROR_PLAYER_NOT_INITIALIZED ); /* check if EQ is supported */ if ( !_mmplayer_is_supported_filter_type( MM_AUDIO_FILTER_TYPE_CUSTOM, MM_AUDIO_FILTER_CUSTOM_EQ ) ) { return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER; } *bands = PLAYER_INI()->audio_filter_custom_eq_num; debug_log("number of custom eq band = %d\n", *bands); debug_fleave(); return result; }
static Ret ftk_display_android_update(FtkDisplay* thiz, FtkBitmap* bitmap, FtkRect* rect, int xoffset, int yoffset) { int i = 0; Ret ret = RET_OK; DECL_PRIV(thiz, priv); int width = rect->width; int height = rect->height; int src_width = ftk_bitmap_width(bitmap); int src_height = ftk_bitmap_height(bitmap); int dst_width = ftk_bitmap_width(priv->bitmap); int dst_height = ftk_bitmap_height(priv->bitmap); FtkColor* src = ftk_bitmap_lock(bitmap); FtkColor* dst = ftk_bitmap_lock(priv->bitmap); return_val_if_fail(rect->x < src_width && rect->y < src_height && xoffset < dst_width && yoffset < dst_height, RET_FAIL); width = (xoffset + width) >= dst_width ? dst_width - xoffset : width; height = (yoffset + height) >= dst_height ? dst_height - yoffset : height; yoffset = dst_height - yoffset - height - 1; src += rect->y * src_width + rect->x; dst += (yoffset + height) * dst_width + xoffset; for(i = 0; i < height; i++) { memcpy(dst, src, sizeof(FtkColor) * width); dst -= dst_width; src += src_width; } #if 0 display_bitmap(priv, priv->bitmap, xoffset, yoffset, width, height, xoffset, yoffset); #else display_bitmap(priv, priv->bitmap, 0, 0, screen_width, screen_height, 0, 0); #endif return ret; }
FontData* font_data_load(char* data, unsigned length) { FontData* thiz = font_data_create(0, 0); return_val_if_fail(data != NULL && length > sizeof(FontDataHeader), NULL); if(thiz != NULL) { int glyph_size = 0; thiz->header = *(FontDataHeader*)data; glyph_size = thiz->header.char_nr * sizeof(FGlyph); thiz->glyphs = (FGlyph*)(data + sizeof(FontDataHeader)); thiz->data = (unsigned char*)(data + sizeof(FontDataHeader) + glyph_size); thiz->data_size = length - ((char*)thiz->data - data); thiz->data_buffer_size = thiz->data_size; thiz->new_created = 0; thiz->org_data = data; } return thiz; }
mowgli_queue_t * mowgli_queue_shift(mowgli_queue_t *head, void *data) { mowgli_queue_t *out = mowgli_heap_alloc(mowgli_queue_heap); return_val_if_fail(head != NULL, NULL); out->next = head; out->data = data; if (head != NULL) { out->prev = head->prev; if (out->prev != NULL) out->prev->next = out; head->prev = out; } return out; }
FtkWidget* ftk_painter_create(FtkWidget* parent, int x, int y, int width, int height) { FtkWidget* thiz = (FtkWidget*)FTK_ZALLOC(sizeof(FtkWidget)); return_val_if_fail(thiz != NULL, NULL); thiz->priv_subclass[0] = (PrivInfo*)FTK_ZALLOC(sizeof(PrivInfo)); if(thiz->priv_subclass[0] != NULL) { thiz->on_event = ftk_painter_on_event; thiz->on_paint = ftk_painter_on_paint; thiz->destroy = ftk_painter_destroy; ftk_widget_init(thiz, FTK_PAINTER, 0, x, y, width, height, 0); ftk_widget_append_child(parent, thiz); } else { FTK_FREE(thiz); } return thiz; }
static Atom _fbdevVideoGetPortAtom (FBDevPortAttrAtom paa) { int i; return_val_if_fail (paa > PAA_MIN && paa < PAA_MAX, None); for (i = 0; i < NUM_ATOMS; i++) { if (paa == atom_list[i].paa) { if (atom_list[i].atom == None) atom_list[i].atom = MakeAtom (atom_list[i].name, strlen (atom_list[i].name), TRUE); return atom_list[i].atom; } } ErrorF ("Error: Unknown Port Attribute Name!\n"); return None; }
k3d::iunknown* create_plugin() { if(!delegate_factory) delegate_factory = dynamic_cast<k3d::iapplication_plugin_factory*>(k3d::plugin::factory::lookup(delegate_factory_name)); if(!delegate_factory) { k3d::log() << error << "Couldn't locate delegate factory [" << delegate_factory_name << "]" << std::endl; return 0; } k3d::iunknown* const plugin = delegate_factory->create_plugin(); return_val_if_fail(plugin, 0); k3d::filesystem::ifstream script_file(script_path); std::stringstream script_stream; script_stream << script_file.rdbuf(); k3d::property::set_internal_value(*plugin, "script", script_stream.str()); return plugin; }
Ret ini_parser_load_from_file(INIParser* thiz, const char* filename, char comment_char, char delim_char) { return_val_if_fail(thiz != NULL && filename != NULL, RET_INVALID_PARAMS); struct stat fstat; char* buf; int fd; if (stat(filename, &fstat)) { printf("Can't read the stat of config file -- %s\n", filename); return RET_FAIL; } buf = (char*)malloc(fstat.st_size); if ((fd = open(filename, O_RDONLY)) < 0) { return RET_FAIL; } read(fd, buf, fstat.st_size); return ini_parser_load_from_buf(thiz, buf, comment_char, delim_char); }
static Ret ftk_key_board_candidate_text(FtkWidget* thiz, FtkKeyBoardCell* cell) { FtkEvent event; DECL_PRIV0(thiz, priv); FtkKeyBoardDesc* desc = priv->desc; FtkKeyBoardCandidate* candidate = NULL; return_val_if_fail(desc->candidate_focus < desc->candidate_nr, RET_FAIL); if(priv->editor != NULL) { candidate = desc->candidates + desc->candidate_focus; ftk_event_init(&event, FTK_EVT_IM_COMMIT); event.widget = priv->editor; event.u.extra = (char*)candidate->text; ftk_widget_event(priv->editor, &event); } ftk_logd("%s:%d %s\n", __func__, __LINE__, cell->text); return RET_OK; }
XmlNode* xml_node_create_normal(const char* name, const char** attrs) { XmlNode* node = NULL; return_val_if_fail(name != NULL, NULL); if((node = calloc(1, sizeof(XmlNode))) != NULL) { int i = 0; node->type = XML_NODE_NORMAL; node->u.normal.name = strdup(name); if(attrs != NULL) { for(i = 0; attrs[i] != NULL && attrs[i+1] != NULL; i += 2) { xml_node_append_attr(node, attrs[i], attrs[i+1]); } } } return node; }
FtkWidget* ftk_key_board_create(FtkWidget* parent, int x, int y, int width, int height) { FtkWidget* thiz = (FtkWidget*)FTK_ZALLOC(sizeof(FtkWidget)); return_val_if_fail(thiz != NULL, NULL); thiz->priv_subclass[0] = (PrivInfo*)FTK_ZALLOC(sizeof(PrivInfo)); if(thiz->priv_subclass[0] != NULL) { thiz->on_event = ftk_key_board_on_event; thiz->on_paint = ftk_key_board_on_paint; thiz->destroy = ftk_key_board_destroy; ftk_widget_init(thiz, FTK_KEY_BOARD, 0, x, y, width, height, FTK_ATTR_BG_FOUR_CORNER|FTK_ATTR_NO_FOCUS); ftk_widget_append_child(parent, thiz); } else { FTK_FREE(thiz); } return thiz; }
Ret ftk_input_method_manager_unregister(FtkInputMethodManager* thiz, FtkInputMethod* im) { size_t i = 0; return_val_if_fail(thiz != NULL && im != NULL, RET_FAIL); for(i = 0; i < thiz->nr; i++) { if(thiz->methods[i] == im) { ftk_input_method_destroy(thiz->methods[i]); thiz->methods[i] = NULL; break; } } for(; i < thiz->nr; i++) { thiz->methods[i] = thiz->methods[i+1]; } return RET_OK; }
static STATUS backup_restore(char* path) { return_val_if_fail(p_current != NULL, RET_FAIL); miui_busy_process(); switch(p_current->result) { case RESTORE_ALL: #ifdef DUALSYSTEM_PARTITIONS miuiIntent_send(INTENT_RESTORE, 9, path, "1", "1", "1", "1", "0", "0", "1", "1"); #else miuiIntent_send(INTENT_RESTORE, 9, path, "1", "1", "1", "1", "0", "0", "0", "0"); #endif break; case RESTORE_CACHE: miuiIntent_send(INTENT_RESTORE, 9, path, "0", "0", "0", "1", "0", "0", "0", "0"); break; case RESTORE_DATA: miuiIntent_send(INTENT_RESTORE, 9, path, "0", "0", "1", "0", "0", "0", "0", "0"); break; case RESTORE_SYSTEM: miuiIntent_send(INTENT_RESTORE, 9, path, "0", "1", "0", "0", "0", "0", "0", "0"); break; case RESTORE_BOOT: miuiIntent_send(INTENT_RESTORE, 9, path, "1", "0", "0", "0", "0", "0", "0", "0"); break; #ifdef DUALSYSTEM_PARTITIONS case RESTORE_SYSTEM1: miuiIntent_send(INTENT_RESTORE, 9, path, "0", "0", "0", "0", "0", "0", "0", "1"); break; case RESTORE_BOOT1: miuiIntent_send(INTENT_RESTORE, 9, path, "0", "0", "0", "0", "0", "0", "1", "0"); break; #endif default: miui_error("p->resulte %d should not be the value\n", p_current->result); break; } return RET_OK; }
/* check the given path is indicating sdp file */ bool util_is_sdp_file ( const char *path ) { gboolean ret = FALSE; gchar* uri = NULL; debug_fenter(); return_val_if_fail ( path, FALSE ); uri = g_ascii_strdown ( path, -1 ); /* trimming */ g_strstrip( uri ); /* strlen(".sdp") == 4 */ if ( strlen( uri ) <= 4 ) { debug_warning ( "path is too short.\n" ); return ret; } /* first, check extension name */ ret = g_str_has_suffix ( uri, "sdp" ); /* second, if no suffix is there, check it's contents */ if ( ! ret ) { /* FIXIT : do it soon */ debug_warning("determining whether it's sdp or not with it's content is not implemented yet. ;)\n"); } if ( uri ) g_free( uri); uri = NULL; return ret; }
FtkWidget* ftk_scroll_bar_create(FtkWidget* parent, int x, int y, int width, int height) { FtkWidget* thiz = (FtkWidget*)FTK_ZALLOC(sizeof(FtkWidget)); return_val_if_fail(thiz != NULL, NULL); thiz->priv_subclass[0] = (PrivInfo*)FTK_ZALLOC(sizeof(PrivInfo)); if(thiz != NULL) { DECL_PRIV0(thiz, priv); thiz->on_event = ftk_scroll_bar_on_event; thiz->on_paint = ftk_scroll_bar_on_paint; thiz->destroy = ftk_scroll_bar_destroy; if(width < height) { /*vertical*/ priv->vertical = 1; priv->bitmap = ftk_theme_load_image(ftk_default_theme(), "scrollbar_handle_vertical"FTK_STOCK_IMG_SUFFIX); width = ftk_bitmap_width(priv->bitmap); assert(width < height); } else { priv->vertical = 0; priv->bitmap = ftk_theme_load_image(ftk_default_theme(), "scrollbar_handle_horizontal"FTK_STOCK_IMG_SUFFIX); height = ftk_bitmap_height(priv->bitmap); assert(width > height); } ftk_widget_init(thiz, width < height ? FTK_SCROLL_VBAR : FTK_SCROLL_HBAR, 0, x, y, width, height, FTK_ATTR_TRANSPARENT); ftk_widget_append_child(parent, thiz); } return thiz; }
static Ret ftk_file_browser_on_ok(void* ctx, void* obj) { int i = 0; FtkWidget* win = (FtkWidget*)ctx; FtkListItemInfo* info = NULL; char path[FTK_MAX_PATH+1] = {0}; PrivInfo* priv = (PrivInfo*)ftk_widget_user_data(win); return_val_if_fail(priv != NULL && priv->on_choosed != NULL, RET_FAIL); if(priv->type == FTK_FILE_BROWER_SINGLE_CHOOSER) { i = ftk_list_view_get_selected(priv->list_view); ftk_list_model_get_data(priv->model, i, (void**)&info); if(info != NULL) { ftk_strs_cat(path, FTK_MAX_PATH, priv->path, "/", info->text, NULL); priv->on_choosed(priv->on_choosed_ctx, 0, path); } } else { int index = 0; int n = ftk_list_model_get_total(priv->model); for(i = 0; i < n; i++) { ftk_list_model_get_data(priv->model, i, (void**)&info); if(info != NULL && info->state) { ftk_strs_cat(path, FTK_MAX_PATH, priv->path, "/", info->text, NULL); priv->on_choosed(priv->on_choosed_ctx, index++, path); } } priv->on_choosed(priv->on_choosed_ctx, -1, NULL); } ftk_widget_unref((FtkWidget*)ctx); return RET_OK; }
Ret dlist_delete(DList* thiz, size_t index) { Ret ret = RET_OK; DListNode* cursor = NULL; return_val_if_fail(thiz != NULL, RET_INVALID_PARAMS); dlist_wrlock(thiz); cursor = dlist_get_node(thiz, index, 0); do { if (cursor == NULL) { ret = RET_INVALID_PARAMS; break; } if (cursor != NULL) { if (cursor == thiz->first) { thiz->first = cursor->next; } if (cursor->next != NULL) { cursor->next->prev = cursor->prev; } if (cursor->prev != NULL) { cursor->prev->next = cursor->next; } dlist_destroy_node(thiz, cursor); } } while (0); dlist_unlock(thiz); return RET_OK; }
PUBLIC Iterator* dlist_iterator_create(DList* dlist){ Iterator* thiz = NULL; return_val_if_fail(dlist != NULL, NULL); if((thiz = (Iterator*)calloc(1, sizeof(Iterator) + sizeof(PrivInfo))) != NULL){ PrivInfo* priv = (PrivInfo*)thiz->priv; thiz->set = dlist_iterator_set; thiz->get = dlist_iterator_get; thiz->next = dlist_iterator_next; thiz->prev = dlist_iterator_prev; thiz->advance = dlist_iterator_advance; thiz->clone = dlist_iterator_clone; thiz->offset = dlist_iterator_offset; thiz->destroy = dlist_iterator_destroy; priv->dlist = dlist; priv->cursor = dlist->first; priv->offset = 0; } return thiz; }
static int lua_ftk_text_view_create(lua_State* L) { tolua_Error err = {0}; FtkTextView* retv; FtkWidget* parent; int x; int y; int width; int height; int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isnumber(L, 2, 0, &err) && tolua_isnumber(L, 3, 0, &err) && tolua_isnumber(L, 4, 0, &err) && tolua_isnumber(L, 5, 0, &err); return_val_if_fail(param_ok, 0); parent = tolua_tousertype(L, 1, 0); x = tolua_tonumber(L, 2, 0); y = tolua_tonumber(L, 3, 0); width = tolua_tonumber(L, 4, 0); height = tolua_tonumber(L, 5, 0); retv = ftk_text_view_create(parent, x, y, width, height); tolua_pushusertype(L, (FtkTextView*)retv, "FtkTextView"); return 1; }
k3d::bool_t compile_shader(const k3d::filesystem::path& Shader) { // Compute some paths that will be used by the compiler ... const k3d::filesystem::path shader_source_path = Shader; const k3d::filesystem::path shader_binary_path = k3d::shader_cache_path() / k3d::filesystem::generic_path(k3d::filesystem::replace_extension(Shader, ".slb").leaf()); const k3d::filesystem::path shader_source_directory = Shader.branch_path(); const k3d::filesystem::path global_source_directory = k3d::share_path() / k3d::filesystem::generic_path("shaders"); if(k3d::filesystem::up_to_date(shader_source_path, shader_binary_path)) return true; std::ostringstream command_line; command_line << "shaded"; command_line << " -I\"" << shader_source_directory.native_filesystem_string() << "\""; command_line << " -I\"" << global_source_directory.native_filesystem_string() << "\""; command_line << " -o \"" << shader_binary_path.native_filesystem_string() << "\""; command_line << " \"" << shader_source_path.native_filesystem_string() << "\""; // Make it happen ... return_val_if_fail(k3d::system::spawn_sync(command_line.str()), false); return true; }
HashTable* hash_table_create(DataDestroyFunc data_destroy, void* ctx, DataHashFunc hash, int slot_nr) { HashTable* thiz = NULL; return_val_if_fail(hash != NULL && slot_nr > 1, NULL); thiz = (HashTable*)malloc(sizeof(HashTable)); if(thiz != NULL) { thiz->hash = hash; thiz->slot_nr = slot_nr; thiz->data_destroy_ctx = ctx; thiz->data_destroy = data_destroy; if((thiz->slots = (DList**)calloc(sizeof(DList*)*slot_nr, 1)) == NULL) { free(thiz); thiz = NULL; } } return thiz; }
FtkWidget* ftk_progress_bar_create(FtkWidget* parent, int x, int y, int width, int height) { FtkWidget* thiz = (FtkWidget*)FTK_ZALLOC(sizeof(FtkWidget)); return_val_if_fail(thiz != NULL, NULL); thiz->priv_subclass[0] = (PrivInfo*)FTK_ZALLOC(sizeof(PrivInfo)); if(thiz->priv_subclass[0] != NULL) { thiz->on_event = ftk_progress_bar_on_event; thiz->on_paint = ftk_progress_bar_on_paint; thiz->destroy = ftk_progress_bar_destroy; ftk_widget_init(thiz, FTK_PROGRESS_BAR, 0, x, y, width, height, FTK_ATTR_TRANSPARENT|FTK_ATTR_INSENSITIVE); ftk_widget_append_child(parent, thiz); } else { FTK_FREE(thiz); } return thiz; }
FtkWidget* ftk_menu_item_create(FtkWidget* parent) { FtkWidget* thiz = (FtkWidget*)FTK_ZALLOC(sizeof(FtkWidget)); return_val_if_fail(thiz != NULL, NULL); thiz->priv_subclass[0] = (PrivInfo*)FTK_ZALLOC(sizeof(PrivInfo)); if(thiz != NULL) { thiz->on_event = ftk_menu_item_on_event; thiz->on_paint = ftk_menu_item_on_paint; thiz->destroy = ftk_menu_item_destroy; ftk_widget_init(thiz, FTK_MENU_ITEM, 0, 0, 0, 0, 0, FTK_ATTR_TRANSPARENT|FTK_ATTR_BG_FOUR_CORNER); ftk_menu_panel_add(parent, thiz); } else { FTK_FREE(thiz); } return thiz; }
static STATUS restore_child_show(menuUnit* p) { p_current = p; miuiIntent_send(INTENT_MOUNT, 1, "/sdcard"); return_val_if_fail(miuiIntent_result_get_int() == 0, MENU_BACK); char path_name[PATH_MAX]; switch(p->result) { case RESTORE_ALL: snprintf(path_name,PATH_MAX, "%s/backup/backup", RECOVERY_PATH); break; case RESTORE_CACHE: snprintf(path_name,PATH_MAX, "%s/backup/cache", RECOVERY_PATH); break; case RESTORE_DATA: snprintf(path_name,PATH_MAX, "%s/backup/data", RECOVERY_PATH); break; case RESTORE_SYSTEM: snprintf(path_name,PATH_MAX, "%s/backup/system", RECOVERY_PATH); break; case RESTORE_BOOT: snprintf(path_name,PATH_MAX, "%s/backup/boot", RECOVERY_PATH); break; #ifdef DUALSYSTEM_PARTITIONS case RESTORE_SYSTEM1: snprintf(path_name,PATH_MAX, "%s/backup/system1", RECOVERY_PATH); break; case RESTORE_BOOT1: snprintf(path_name,PATH_MAX, "%s/backup/boot1", RECOVERY_PATH); break; #endif default: miui_error("p->resulte %d should not be the value\n", p->result); return MENU_BACK; } _backup_dir_show(path_name); return MENU_BACK; }
static Block *access_avi_block(Access *thiz) { return_val_if_fail(thiz != NULL, NULL); DECL_PRIV(thiz, priv); AVPacket packet; if(av_read_frame(priv->format_ctx, &packet)>=0) { if(packet.stream_index == priv->video_stream_index) { memcpy(priv->block->p_buffer, packet.data, packet.size); priv->block->buffer_len = packet.size; priv->block->frame_flag = VIDEO_FRAME_FLAG; // priv->block->pts = packet.pts; av_free_packet(&packet); return priv->block; } else if(packet.stream_index == priv->audio_stream_index) { memcpy(priv->block->p_buffer, packet.data, packet.size); priv->block->buffer_len = packet.size; priv->block->frame_flag = AUDIO_FRAME_FLAG; // priv->block->pts = packet.pts; av_free_packet(&packet); return priv->block; } else { printf("not define this stream!\n"); } } msg_dbg("access_avi_block error:return null !\n"); return NULL; }
bool p11_extract_x509_directory (p11_enumerate *ex, const char *destination) { p11_save_file *file; p11_save_dir *dir; char *filename; CK_RV rv; bool ret; dir = p11_save_open_directory (destination, ex->flags); if (dir == NULL) return false; while ((rv = p11_kit_iter_next (ex->iter)) == CKR_OK) { filename = p11_enumerate_filename (ex); return_val_if_fail (filename != NULL, -1); file = p11_save_open_file_in (dir, filename, ".cer"); free (filename); if (!p11_save_write_and_finish (file, ex->cert_der, ex->cert_len)) { p11_save_finish_directory (dir, false); return false; } } if (rv != CKR_OK && rv != CKR_CANCEL) { p11_message ("failed to find certificates: %s", p11_kit_strerror (rv)); ret = false; } else { ret = true; } p11_save_finish_directory (dir, ret); return ret; }
//default group list static INT32 _contact_provider_add_default_groups(DatabaseHandle* db_handle) { ContentValues* values=content_values_create(); INT32 num = 0; INT32 i = 0; INT32 db_ret=DB_OK; DatabaseStatement* stmt = NULL; static CHAR* s_contact_group_name[]={"Blacklist","Frequent","Colleague","Classmate","Family","Other"}; num= sizeof(s_contact_group_name)/sizeof(s_contact_group_name[0]); return_val_if_fail(values, DB_ERROR); stmt = db_stmt_build_insert_statement(db_handle,CONTACT_ME_GROUP_TABLE_NAME,CONTACT_ME_GROUP_GROUP_COL_NAME,1); if (!stmt) { content_values_destroy(values); return DB_ERROR; } for (i=0;i<num;i++) { content_values_put_string(values,CONTACT_ME_GROUP_GROUP_COL_NAME,s_contact_group_name[i]); db_ret = db_stmt_bind_content_values( stmt,values); if (db_ret == DB_OK) { db_ret=db_stmt_step(stmt); if (db_ret!=DB_OK) { break; } } } db_stmt_finalize(stmt); content_values_destroy(values); return db_ret; }
static int anchor_remove (int argc, char *argv[], bool *changed) { CK_FUNCTION_LIST **modules; p11_array *iters; p11_kit_iter *iter; int ret = 0; int i; iters = uris_or_files_to_iters (argc, argv, P11_KIT_ITER_WANT_WRITABLE); return_val_if_fail (iters != NULL, 1); if (iters->num == 0) { p11_message ("at least one file or uri must be specified"); p11_array_free (iters); return 2; } modules = p11_kit_modules_load_and_initialize (P11_KIT_MODULE_TRUSTED); if (modules == NULL) ret = 1; for (i = 0; ret == 0 && i < iters->num; i++) { iter = iters->elem[i]; p11_kit_iter_begin (iter, modules); if (!remove_all (iter, changed)) ret = 1; } p11_array_free (iters); p11_kit_modules_finalize_and_release (modules); return ret; }