Changes in uspace/srv/audio/hound/hound.c [b7fd2a0:8a637a4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/hound.c
rb7fd2a0 r8a637a4 110 110 } 111 111 112 static errno_t hound_disconnect_internal(hound_t *hound, const char* source_name, const char* sink_name);112 static int hound_disconnect_internal(hound_t *hound, const char* source_name, const char* sink_name); 113 113 114 114 /** … … 162 162 * @return Error code. 163 163 */ 164 errno_t hound_init(hound_t *hound)164 int hound_init(hound_t *hound) 165 165 { 166 166 assert(hound); … … 180 180 * @return Error code. 181 181 */ 182 errno_t hound_add_ctx(hound_t *hound, hound_ctx_t *ctx)182 int hound_add_ctx(hound_t *hound, hound_ctx_t *ctx) 183 183 { 184 184 log_info("Trying to add context %p", ctx); … … 189 189 list_append(&ctx->link, &hound->contexts); 190 190 fibril_mutex_unlock(&hound->list_guard); 191 errno_t ret = EOK;191 int ret = EOK; 192 192 if (ret == EOK && ctx->source) 193 193 ret = hound_add_source(hound, ctx->source); … … 208 208 * @return Error code. 209 209 */ 210 errno_t hound_remove_ctx(hound_t *hound, hound_ctx_t *ctx)210 int hound_remove_ctx(hound_t *hound, hound_ctx_t *ctx) 211 211 { 212 212 assert(hound); … … 254 254 * @return Error code. 255 255 */ 256 errno_t hound_add_device(hound_t *hound, service_id_t id, const char *name)256 int hound_add_device(hound_t *hound, service_id_t id, const char *name) 257 257 { 258 258 log_verbose("Adding device \"%s\", service: %zu", name, id); … … 283 283 } 284 284 285 const errno_t ret = audio_device_init(dev, id, name);285 const int ret = audio_device_init(dev, id, name); 286 286 if (ret != EOK) { 287 287 log_debug("Failed to initialize new audio device: %s", … … 296 296 audio_source_t *source = audio_device_get_source(dev); 297 297 if (source) { 298 const errno_t ret = hound_add_source(hound, source);298 const int ret = hound_add_source(hound, source); 299 299 if (ret != EOK) { 300 300 log_debug("Failed to add device source: %s", … … 308 308 audio_sink_t *sink = audio_device_get_sink(dev); 309 309 if (sink) { 310 const errno_t ret = hound_add_sink(hound, sink);310 const int ret = hound_add_sink(hound, sink); 311 311 if (ret != EOK) { 312 312 log_debug("Failed to add device sink: %s", … … 330 330 * @return Error code. 331 331 */ 332 errno_t hound_add_source(hound_t *hound, audio_source_t *source)332 int hound_add_source(hound_t *hound, audio_source_t *source) 333 333 { 334 334 assert(hound); … … 354 354 * @return Error code. 355 355 */ 356 errno_t hound_add_sink(hound_t *hound, audio_sink_t *sink)356 int hound_add_sink(hound_t *hound, audio_sink_t *sink) 357 357 { 358 358 assert(hound); … … 378 378 * @return Error code. 379 379 */ 380 errno_t hound_remove_source(hound_t *hound, audio_source_t *source)380 int hound_remove_source(hound_t *hound, audio_source_t *source) 381 381 { 382 382 assert(hound); … … 395 395 * @return Error code. 396 396 */ 397 errno_t hound_remove_sink(hound_t *hound, audio_sink_t *sink)397 int hound_remove_sink(hound_t *hound, audio_sink_t *sink) 398 398 { 399 399 assert(hound); … … 413 413 * @return Error code. 414 414 */ 415 errno_t hound_list_sources(hound_t *hound, const char ***list, size_t *size)415 int hound_list_sources(hound_t *hound, const char ***list, size_t *size) 416 416 { 417 417 assert(hound); … … 428 428 } 429 429 const char **names = calloc(count, sizeof(char *)); 430 errno_t ret = names ? EOK : ENOMEM;430 int ret = names ? EOK : ENOMEM; 431 431 for (unsigned long i = 0; i < count && ret == EOK; ++i) { 432 432 link_t *slink = list_nth(&hound->sources, i); … … 455 455 * @return Error code. 456 456 */ 457 errno_t hound_list_sinks(hound_t *hound, const char ***list, size_t *size)457 int hound_list_sinks(hound_t *hound, const char ***list, size_t *size) 458 458 { 459 459 assert(hound); … … 470 470 } 471 471 const char **names = calloc(count, sizeof(char *)); 472 errno_t ret = names ? EOK : ENOMEM;472 int ret = names ? EOK : ENOMEM; 473 473 for (size_t i = 0; i < count && ret == EOK; ++i) { 474 474 link_t *slink = list_nth(&hound->sinks, i); … … 501 501 * identifiers with the same index are connected. 502 502 */ 503 errno_t hound_list_connections(hound_t *hound, const char ***sources,503 int hound_list_connections(hound_t *hound, const char ***sources, 504 504 const char ***sinks, size_t *size) 505 505 { … … 516 516 * @return Error code. 517 517 */ 518 errno_t hound_connect(hound_t *hound, const char* source_name, const char* sink_name)518 int hound_connect(hound_t *hound, const char* source_name, const char* sink_name) 519 519 { 520 520 assert(hound); … … 555 555 * @return Error code. 556 556 */ 557 errno_t hound_disconnect(hound_t *hound, const char* source_name, const char* sink_name)558 { 559 assert(hound); 560 fibril_mutex_lock(&hound->list_guard); 561 const errno_t ret = hound_disconnect_internal(hound, source_name, sink_name);557 int hound_disconnect(hound_t *hound, const char* source_name, const char* sink_name) 558 { 559 assert(hound); 560 fibril_mutex_lock(&hound->list_guard); 561 const int ret = hound_disconnect_internal(hound, source_name, sink_name); 562 562 fibril_mutex_unlock(&hound->list_guard); 563 563 return ret; … … 573 573 * This function has to be called with the list_guard lock held. 574 574 */ 575 static errno_t hound_disconnect_internal(hound_t *hound, const char* source_name,575 static int hound_disconnect_internal(hound_t *hound, const char* source_name, 576 576 const char* sink_name) 577 577 {
Note:
See TracChangeset
for help on using the changeset viewer.