void flom_handle_set_resource_quantity(flom_handle_t *handle, int value) { FLOM_TRACE(("flom_handle_set_resource_quantity: " "old value=%d, new value=%d\n", flom_config_get_resource_quantity(handle->config), value)); flom_config_set_resource_quantity(handle->config, (int)value); }
int flom_handle_set_resource_quantity(flom_handle_t *handle, int value) { FLOM_TRACE(("flom_handle_set_resource_quantity: " "old value=%d, new value=%d\n", flom_config_get_resource_quantity(handle->config), value)); switch (handle->state) { case FLOM_HANDLE_STATE_INIT: case FLOM_HANDLE_STATE_DISCONNECTED: case FLOM_HANDLE_STATE_CONNECTED: flom_config_set_resource_quantity(handle->config, (int)value); break; default: FLOM_TRACE(("flom_handle_set_resource_quantity: state %d " \ "is not compatible with set operation\n", handle->state)); return FLOM_RC_API_IMMUTABLE_HANDLE; } /* switch (handle->state) */ return FLOM_RC_OK; }
int flom_handle_get_resource_quantity(const flom_handle_t *handle) { FLOM_TRACE(("flom_handle_get_resource_quantity: value=%d\n", flom_config_get_resource_quantity(handle->config))); return (int)flom_config_get_resource_quantity(handle->config); }