struct res_key key = {restype, resid };
struct resource *resource;
const frsh_resource_type_t restype_to_find = restype;
+ struct fcb_contract * fc;
+ struct res_key * rk;
+ //TODO: delete debug outputs
+ int num_of_resources = 0;
+ gavl_cust_for_each(fcb_resource, fcb, resource) {
+ num_of_resources++;
+ }
+ printf("Number of resources: %d\n", num_of_resources);
+
resource = fcb_resource_find(fcb, &key);
+ if(resource == NULL)
+ printf("Resource not found\n");
+ else printf("Found resource with name %s, type %d and ID %d\n", resource->name, resource->key.type, resource->key.id);
assert(resource != NULL);
-
- //TODO: delete debug output
- printf("\ncalled function 'redistribute_spare_capacity'\n");
-
- struct fcb_contract * fc;
- struct res_key * rk;
+
+ int num_of_contracts = 0;
+ ul_list_for_each(sc_contracts, resource, fc) {
+ num_of_contracts++;
+ }
+ printf("Number of contracts in resource %s: %d\n", resource->name, num_of_contracts);
gavl_cust_for_each(fcb_contract, fcb, fc) {
rk = get_fc_res_key(fc, &key);