static void mutate_outputs(void) { if (!tx.vout) tx.vout = parr_new(8, bp_txout_freep); // delete outputs clist *tmp = opt_del_txout; while (tmp) { int idx = ptr_to_int(tmp->data); tmp = tmp->next; if ((idx >= 0) && (idx < tx.vin->len)) parr_remove_idx(tx.vout, idx); } // append new outputs tmp = opt_txout; while (tmp) { char *arg = tmp->data; tmp = tmp->next; size_t alloc_len = strlen(arg) + 1; char addr_str[alloc_len]; strcpy(addr_str, arg); char *colon = strchr(addr_str, ':'); *colon = 0; char amount_str[alloc_len]; strcpy(amount_str, colon + 1); append_output(addr_str, amount_str); } }
static void put_text_in_textview(const char * text, const char * tv) { gchar widget_name[128]; sprintf(widget_name, "%s_textview", tv); GtkWidget * w = glade_xml_get_widget(glade_xml, widget_name); if (!w) { printf("Bad: %s\n", widget_name); return; } append_output(text, w); }