guint distance_between_services(struct service_info_s *s0, struct service_info_s *s1) { return distance_between_location( service_info_get_rawx_location(s0, ""), service_info_get_rawx_location(s1, "")); }
static gboolean __test_location(gchar *loc, GSList *used_loc, gint64 distance) { GRID_DEBUG("Required distance is %ld", distance); GSList *l = NULL; for (l = used_loc; l && l->data; l = l->next) { gint64 d = distance_between_location(loc, (gchar*) l->data); GRID_DEBUG("-> found distance %ld", d); if(d < distance) return FALSE; } return TRUE; }