if ((dicname_printed == FALSE) && (GTK_TOGGLE_BUTTON(wordDic->radiob_searchall)->active)) { gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, _("Matches in "), -1); gtk_text_buffer_insert_with_tags_by_name(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, dicfile->name, -1, "brown_foreground", NULL); gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, ":\n", -1); dicname_printed = TRUE; }
print_matches_in(dicfile);
void print_verb_inflections(GjitenDicfile *dicfile, gchar *srchstrg) {	int srchresp, roff, rlen;  int32_t oldrespos, respos;  int gjit_search = SRCH_START;  unsigned char repstr[1024];  GSList *tmp_list_ptr;  struct vinfl_struct *tmp_vinfl_struct;  gchar *deinflected, *prevresult;  int printit = TRUE;  tmp_list_ptr = vinfl_list;  if (vinfl_list == NULL) {     printf("VINFL LIST == NULL\n");    return;  }  deinflected = (gchar *) g_malloc(strlen(srchstrg) + 20);    do {    tmp_vinfl_struct = (struct vinfl_struct *) tmp_list_ptr->data;    if (strg_end_compare(srchstrg, tmp_vinfl_struct->conj) == TRUE) {      // create deinflected string      strncpy(deinflected, srchstrg, strlen(srchstrg) - strlen(tmp_vinfl_struct->conj));      strcpy(deinflected + strlen(srchstrg) - strlen(tmp_vinfl_struct->conj), 						 tmp_vinfl_struct->infl);			oldrespos = srchpos = 0;          gjit_search = SRCH_START;      prevresult = NULL;      do { // search loop				oldrespos = respos;    				srchresp = search4string(gjit_search, dicfile, deinflected, &respos, &roff, &rlen, repstr);				//    printf("respos:%d, oldrespos:%d, roffset:%d, rlen:%d\nrepstr:%s\n", respos, oldrespos, roff, rlen, repstr);				if (srchresp != SRCH_OK)  {					break;   //No more matches				}				if (gjit_search == SRCH_START) {					srchpos = respos;					gjit_search = SRCH_CONT;				}				srchpos++;				if (oldrespos == respos) continue;				printit = TRUE;				if (is_kanji_only(repstr) == TRUE) {					printit = FALSE;				}				else if (strlen(tmp_vinfl_struct->conj) == strlen(srchstrg)) 					printit = FALSE; // don't display if conjugation is the same length as the srchstrg				else if (get_jp_match_type(repstr, deinflected, roff) != EXACT_MATCH) 					printit = FALSE; // Display only EXACT_MATCHes				if (printit == TRUE) {					//Print dicfile name if all dictionaries are selected					if ((dicname_printed == FALSE) && (GTK_TOGGLE_BUTTON(wordDic->radiob_searchall)->active)) {						gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, _("Matches in "), -1);						gtk_text_buffer_insert_with_tags_by_name(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter,  																										 dicfile->name, -1, "brown_foreground", NULL);						gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, ":\n", -1);						dicname_printed = TRUE;					}					gtk_text_buffer_insert_with_tags_by_name(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter,  																									 _("Possible inflected verb or adjective: "), 																									 -1, "brown_foreground", NULL);					gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, tmp_vinfl_struct->type, -1);					gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, " " , -1);					gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, tmp_vinfl_struct->conj, -1);					gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, "\xe2\x86\x92", -1); //arrow					gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, tmp_vinfl_struct->infl, -1);					gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, "\n   ", -1);					print_result(repstr, roff, deinflected);					word_matches++;				}      } while (srchresp == SRCH_OK);    }  }      while ((tmp_list_ptr = g_slist_next(tmp_list_ptr)) != NULL);    g_free(deinflected);}