Esempio n. 1
0
static void display_variable(GtkTreeModel *Variables, GtkTreeIter *Iter, Std$Object$t *Value, Std$Object_t **Address) {
	//printf("Address = 0x%x, Value = 0x%x\n", Address, Value);
	const char *String;
	if (Value->Type == Agg$Table$T) {
		size_t OldGeneration, CurrentGeneration = Agg$Table$generation(Value);
		gtk_tree_model_get(Variables, Iter, 5, &OldGeneration, -1);
		//printf("OldGeneration = %d, CurrentGeneration = %d\n", OldGeneration, CurrentGeneration);
		if (OldGeneration != CurrentGeneration) {
			gtk_tree_store_set(Variables, Iter, 1, "{...}", 3, Value, 5, CurrentGeneration, -1);
			GtkTreeIter Child;
			while (gtk_tree_model_iter_children(Variables, &Child, Iter)) gtk_tree_store_remove(Variables, &Child);
			if (Agg$Table$size(Value) < 100) {
				Agg$Table$trav *Trav = Agg$Table$trav_new();
				for (Std$Object$t *Node = Agg$Table$trav_first(Trav, Value); Node; Node = Agg$Table$trav_next(Trav)) {
					gtk_tree_store_append(Variables, &Child, Iter);
					gtk_tree_store_set(Variables, &Child, 0, to_string(Agg$Table$node_key(Node)) ?: "<key>", 5, -1, -1);
					Std$Object$t **NodeAddress = Agg$Table$node_value_ref(Node);
					display_variable(Variables, &Child, *NodeAddress, NodeAddress);
				};
			};
Esempio n. 2
0
bool P2PProvider::is_loopback(const blob& pubkey) {
	return node_key().public_key() == pubkey;
}