void tst_vres_(const char *file, const int lineno, int ttype, const char *fmt, va_list va) { print_result(file, lineno, ttype, fmt, va); update_results(file, lineno, TTYPE_RESULT(ttype)); }
static int run_tcases_per_fs(void) { int ret = 0; unsigned int i; const char *const *filesystems = tst_get_supported_fs_types(); if (!filesystems[0]) tst_brk(TCONF, "There are no supported filesystems"); for (i = 0; filesystems[i]; i++) { tdev.fs_type = filesystems[i]; prepare_device(); ret = fork_testrun(); if (mntpoint_mounted) { tst_umount(tst_test->mntpoint); mntpoint_mounted = 0; } if (ret == TCONF) { update_results(ret); continue; } if (ret == 0) continue; do_exit(ret); } return ret; }
SearchNotesWidget::SearchNotesWidget(NoteManager & m) : m_accel_group(Gtk::AccelGroup::create()) , m_no_matches_box(NULL) , m_manager(m) , m_clickX(0), m_clickY(0) , m_matches_column(NULL) , m_note_list_context_menu(NULL) , m_notebook_list_context_menu(NULL) , m_initial_position_restored(false) , m_sort_column_id(2) , m_sort_column_order(Gtk::SORT_DESCENDING) { set_hexpand(true); set_vexpand(true); make_actions(); // Notebooks Pane Gtk::Widget *notebooksPane = Gtk::manage(make_notebooks_pane()); notebooksPane->show(); set_position(150); add1(*notebooksPane); add2(m_matches_window); make_recent_tree(); m_tree = manage(m_tree); m_tree->set_enable_search(false); m_tree->show(); update_results(); m_matches_window.property_hscrollbar_policy() = Gtk::POLICY_AUTOMATIC; m_matches_window.property_vscrollbar_policy() = Gtk::POLICY_AUTOMATIC; m_matches_window.add(*m_tree); m_matches_window.show(); // Update on changes to notes m.signal_note_deleted.connect(sigc::mem_fun(*this, &SearchNotesWidget::on_note_deleted)); m.signal_note_added.connect(sigc::mem_fun(*this, &SearchNotesWidget::on_note_added)); m.signal_note_renamed.connect(sigc::mem_fun(*this, &SearchNotesWidget::on_note_renamed)); m.signal_note_saved.connect(sigc::mem_fun(*this, &SearchNotesWidget::on_note_saved)); // Watch when notes are added to notebooks so the search // results will be updated immediately instead of waiting // until the note's queue_save () kicks in. notebooks::NotebookManager::obj().signal_note_added_to_notebook() .connect(sigc::mem_fun(*this, &SearchNotesWidget::on_note_added_to_notebook)); notebooks::NotebookManager::obj().signal_note_removed_from_notebook() .connect(sigc::mem_fun(*this, &SearchNotesWidget::on_note_removed_from_notebook)); notebooks::NotebookManager::obj().signal_note_pin_status_changed .connect(sigc::mem_fun(*this, &SearchNotesWidget::on_note_pin_status_changed)); Glib::RefPtr<Gio::Settings> settings = Preferences::obj().get_schema_settings(Preferences::SCHEMA_GNOTE); settings->signal_changed().connect(sigc::mem_fun(*this, &SearchNotesWidget::on_settings_changed)); parse_sorting_setting(settings->get_string(Preferences::SEARCH_SORTING)); settings = Preferences::obj().get_schema_settings(Preferences::SCHEMA_DESKTOP_GNOME_INTERFACE); settings->signal_changed().connect(sigc::mem_fun(*this, &SearchNotesWidget::on_settings_changed)); }
static void tst_cvres(const char *file, const int lineno, int ttype, const char *fmt, va_list va) { if (TTYPE_RESULT(ttype) == TBROK) { ttype &= ~TTYPE_MASK; ttype |= TWARN; } print_result(file, lineno, ttype, fmt, va); update_results(TTYPE_RESULT(ttype)); }
/* * Reveals all match objects in a repeat style metaobject. This is currently * the only way to reshow objects as we haven't got a user interface to * obj_reveal(). */ void csmatch_reveal(Tcl_Interp *interp, char *cs_plot, mobj_repeat *r, HTablePtr T[]) { int i; for (i = 0; i < r->num_match; i++) r->match[i].flags &= ~OBJ_FLAG_HIDDEN; DeleteRepeats(interp, r, cs_plot, T); PlotRepeats(r->io, r); r->all_hidden = 0; update_results(r->io); }
int cib_process_delete_absolute(const char *op, int options, const char *section, xmlNode * req, xmlNode * input, xmlNode * existing_cib, xmlNode ** result_cib, xmlNode ** answer) { xmlNode *failed = NULL; int result = pcmk_ok; xmlNode *update_section = NULL; crm_trace("Processing \"%s\" event for section=%s", op, crm_str(section)); if (safe_str_eq(XML_CIB_TAG_SECTION_ALL, section)) { section = NULL; } else if (safe_str_eq(XML_TAG_CIB, section)) { section = NULL; } else if (safe_str_eq(crm_element_name(input), XML_TAG_CIB)) { section = NULL; } CRM_CHECK(strcasecmp(CIB_OP_DELETE, op) == 0, return -EINVAL); if (input == NULL) { crm_err("Cannot perform modification with no data"); return -EINVAL; } failed = create_xml_node(NULL, XML_TAG_FAILED); update_section = get_object_root(section, *result_cib); result = delete_cib_object(update_section, input); update_results(failed, input, op, result); if (xml_has_children(failed)) { CRM_CHECK(result != pcmk_ok, result = -EINVAL); } if (result != pcmk_ok) { crm_log_xml_err(failed, "CIB Update failures"); *answer = failed; } else { free_xml(failed); } return result; }
/* * Hides all match objects in a repeat style metaobject without removing * them. Reveal later using csmatch_reveal(). */ void csmatch_hide(Tcl_Interp *interp, char *cs_plot, mobj_repeat *r, HTablePtr T[]) { int i; for (i = 0; i < r->num_match; i++) r->match[i].flags |= OBJ_FLAG_HIDDEN; DeleteRepeats(interp, r, cs_plot, T); PlotRepeats(r->io, r); /* * We also need to shut down the configure window as this doesn't work * with everything hidden. */ Tcl_VarEval(interp, "cs_config_quit ", cs_plot, " ", r->tagname, NULL); r->all_hidden = 1; update_results(r->io); }
enum cib_errors cib_process_create(const char *op, int options, const char *section, xmlNode * req, xmlNode * input, xmlNode * existing_cib, xmlNode ** result_cib, xmlNode ** answer) { xmlNode *failed = NULL; enum cib_errors result = cib_ok; xmlNode *update_section = NULL; crm_debug_2("Processing \"%s\" event for section=%s", op, crm_str(section)); if (safe_str_eq(XML_CIB_TAG_SECTION_ALL, section)) { section = NULL; } else if (safe_str_eq(XML_TAG_CIB, section)) { section = NULL; } else if (safe_str_eq(crm_element_name(input), XML_TAG_CIB)) { section = NULL; } CRM_CHECK(strcasecmp(CIB_OP_CREATE, op) == 0, return cib_operation); if (input == NULL) { crm_err("Cannot perform modification with no data"); return cib_NOOBJECT; } if (section == NULL) { return cib_process_modify(op, options, section, req, input, existing_cib, result_cib, answer); } failed = create_xml_node(NULL, XML_TAG_FAILED); update_section = get_object_root(section, *result_cib); if (safe_str_eq(crm_element_name(input), section)) { xmlNode *a_child = NULL; for (a_child = __xml_first_child(input); a_child != NULL; a_child = __xml_next(a_child)) { result = add_cib_object(update_section, a_child); if (update_results(failed, a_child, op, result)) { break; } } } else { result = add_cib_object(update_section, input); update_results(failed, input, op, result); } if (xml_has_children(failed)) { CRM_CHECK(result != cib_ok, result = cib_unknown); } if (result != cib_ok) { crm_log_xml_err(failed, "CIB Update failures"); *answer = failed; } else { free_xml(failed); } return result; }
int check_assembly_plot(GapIO *io, tg_rec *reads, tg_rec *conts, int *score, int *pos, int *length, int count) { int i, id; mobj_checkass *ca; obj_checkass *matches; char *val; if (count == 0) return 0; if (NULL == (ca = (mobj_checkass *)xmalloc(sizeof(mobj_checkass)))) { return -1; } if (NULL == (matches = (obj_checkass *)xmalloc(count * sizeof(obj_checkass)))) { xfree(ca); return -1; } /* Setup the meta-object */ ca->num_match = count; ca->match = (obj_match *)matches; ca->io = io; ca->cutoffs = 0; strcpy(ca->tagname, CPtr2Tcl(ca)); val = get_default_string(GetInterp(), gap5_defs, "CHECK_ASSEMBLY.COLOUR"); strcpy(ca->colour, val); ca->linewidth = get_default_int(GetInterp(), gap5_defs, "CHECK_ASSEMBLY.LINEWIDTH"); ca->params = (char *)xmalloc(100); if (ca->params) sprintf(ca->params, "Unknown at present"); ca->all_hidden = 0; ca->current = -1; ca->current = -1; ca->reg_func = check_assembly_callback; ca->match_type = REG_TYPE_CHECKASS; /* Set up each object */ for (i=0; i<count; i++) { matches[i].func = (void *(*)(int, void *, struct obj_match_t *, struct mobj_repeat_t *))checkass_obj_func; matches[i].data = (mobj_repeat *)ca; matches[i].c1 = matches[i].c2 = conts[i]; matches[i].pos1 = matches[i].pos2 = pos[i]; matches[i].end1 = matches[i].end2 = pos[i] + length[i]; matches[i].length = length[i]; matches[i].score = score[i]; matches[i].flags = 0; matches[i].read = reads[i]; } /* Sort matches */ qsort(ca->match, ca->num_match, sizeof(obj_match), sort_func); PlotRepeats(io, (mobj_repeat *)ca); Tcl_VarEval(GetInterp(), "CSLastUsed ", CPtr2Tcl(ca), NULL); /* * Register the repeat search with each of the contigs used. * Currently we assume that this is all. */ id = register_id(); contig_register(io, 0, check_assembly_callback, (void *)ca, id, REG_REQUIRED | REG_DATA_CHANGE | REG_OPS | REG_NUMBER_CHANGE | REG_ORDER, REG_TYPE_CHECKASS); update_results(io); return 0; }
int RegFindOligo(GapIO *io, int type, int *pos1, int *pos2, int *score, int *length, tg_rec *c1, tg_rec *c2, int n_matches) { mobj_find_oligo *find_oligo; obj_match *matches = NULL; char *val; int i, id; if (0 == n_matches) return 0; if (NULL == (find_oligo = (mobj_find_oligo *)xmalloc(sizeof(mobj_find_oligo)))) return -1; if (NULL == (matches = (obj_match *)xmalloc(n_matches * sizeof(obj_match)))) return -1; find_oligo->num_match = n_matches; find_oligo->match = matches; find_oligo->io = io; strcpy(find_oligo->tagname, CPtr2Tcl(find_oligo)); val = get_default_string(GetInterp(), gap5_defs, "FINDOLIGO.COLOUR"); strcpy(find_oligo->colour, val); find_oligo->linewidth = get_default_int(GetInterp(), gap5_defs, "FINDOLIGO.LINEWIDTH"); find_oligo->params = (char *)xmalloc(100); if (find_oligo->params) sprintf(find_oligo->params, "Unknown at present"); find_oligo->all_hidden = 0; find_oligo->current = -1; find_oligo->reg_func = find_oligo_callback; find_oligo->match_type = REG_TYPE_OLIGO; for (i = 0; i < n_matches; i++) { if (type == TAG) { matches[i].func = (void *(*)(int, void *, struct obj_match_t *, struct mobj_repeat_t *))find_oligo_obj_func1; } else if (type == SEQUENCE) { matches[i].func = (void *(*)(int, void *, struct obj_match_t *, struct mobj_repeat_t *))find_oligo_obj_func2; } else { return -1; } matches[i].data = find_oligo; matches[i].c1 = c1[i]; matches[i].c2 = c2[i]; matches[i].pos1 = pos1[i]; matches[i].pos2 = pos2[i]; matches[i].length = length[i]; matches[i].score = score[i]; matches[i].flags = 0; } /* Sort matches */ qsort(find_oligo->match, find_oligo->num_match, sizeof(obj_match), sort_func); PlotRepeats(io, find_oligo); Tcl_VarEval(GetInterp(), "CSLastUsed ", CPtr2Tcl(find_oligo), NULL); /* * Register the find oligo search with each of the contigs used. * Currently we assume that this is all. */ id = register_id(); contig_register(io, 0, find_oligo_callback, (void *)find_oligo, id, REG_REQUIRED | REG_DATA_CHANGE | REG_OPS | REG_NUMBER_CHANGE | REG_ORDER, REG_TYPE_OLIGO); update_results(io); return 0; }