Changes in uspace/lib/hound/src/protocol.c [84239b1:5a6cc679] in mainline
- File:
-
- 1 edited
-
uspace/lib/hound/src/protocol.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/hound/src/protocol.c
r84239b1 r5a6cc679 73 73 uint8_t channels; 74 74 uint8_t format; 75 } __attribute__((packed)) f;75 } f __attribute__((packed)); 76 76 sysarg_t arg; 77 77 } format_convert_t; … … 173 173 * @retval Error code. 174 174 */ 175 errno_t hound_service_get_list(hound_sess_t *sess, c har ***ids, size_t *count,175 errno_t hound_service_get_list(hound_sess_t *sess, const char ***ids, size_t *count, 176 176 int flags, const char *connection) 177 177 { … … 206 206 207 207 /* Start receiving names */ 208 c har **names = NULL;208 const char **names = NULL; 209 209 if (name_count) { 210 210 size_t *sizes = calloc(name_count, sizeof(size_t)); … … 385 385 void hound_connection_handler(ipc_callid_t iid, ipc_call_t *icall, void *arg) 386 386 { 387 hound_context_id_t id;388 errno_t ret;389 int flags;390 void *source;391 void *sink;392 393 387 /* Accept connection if there is a valid iface*/ 394 388 if (server_iface) { … … 403 397 ipc_callid_t callid = async_get_call(&call); 404 398 switch (IPC_GET_IMETHOD(call)) { 405 case IPC_M_HOUND_CONTEXT_REGISTER: 399 case IPC_M_HOUND_CONTEXT_REGISTER: { 406 400 /* check interface functions */ 407 401 if (!server_iface || !server_iface->add_context) { … … 413 407 414 408 /* Get context name */ 415 ret = async_data_write_accept(&name, true, 0, 0, 0, 0); 409 errno_t ret = 410 async_data_write_accept(&name, true, 0, 0, 0, 0); 416 411 if (ret != EOK) { 417 412 async_answer_0(callid, ret); 418 413 break; 419 414 } 420 421 id = 0; 415 hound_context_id_t id = 0; 422 416 ret = server_iface->add_context(server_iface->server, 423 417 &id, name, record); … … 430 424 } 431 425 break; 432 case IPC_M_HOUND_CONTEXT_UNREGISTER: 426 } 427 case IPC_M_HOUND_CONTEXT_UNREGISTER: { 433 428 /* check interface functions */ 434 429 if (!server_iface || !server_iface->rem_context) { … … 438 433 439 434 /* get id, 1st param */ 440 id = IPC_GET_ARG1(call);441 ret = server_iface->rem_context(server_iface->server,442 id);435 hound_context_id_t id = IPC_GET_ARG1(call); 436 const errno_t ret = 437 server_iface->rem_context(server_iface->server, id); 443 438 async_answer_0(callid, ret); 444 439 break; 445 case IPC_M_HOUND_GET_LIST: 440 } 441 case IPC_M_HOUND_GET_LIST: { 446 442 /* check interface functions */ 447 443 if (!server_iface || !server_iface->get_list) { … … 450 446 } 451 447 452 c har **list = NULL;453 flags = IPC_GET_ARG1(call);448 const char **list = NULL; 449 const int flags = IPC_GET_ARG1(call); 454 450 size_t count = IPC_GET_ARG2(call); 455 451 const bool conn = IPC_GET_ARG3(call); 456 452 char *conn_name = NULL; 457 ret = EOK;453 errno_t ret = EOK; 458 454 459 455 /* get connected actor name if provided */ … … 505 501 free(list); 506 502 break; 507 case IPC_M_HOUND_CONNECT: 503 } 504 case IPC_M_HOUND_CONNECT: { 508 505 /* check interface functions */ 509 506 if (!server_iface || !server_iface->connect) { … … 512 509 } 513 510 514 source = NULL;515 sink = NULL;511 void *source = NULL; 512 void *sink = NULL; 516 513 517 514 /* read source name */ 518 ret = async_data_write_accept(&source, true, 0, 0, 0,519 0);515 errno_t ret = 516 async_data_write_accept(&source, true, 0, 0, 0, 0); 520 517 /* read sink name */ 521 518 if (ret == EOK) … … 530 527 async_answer_0(callid, ret); 531 528 break; 532 case IPC_M_HOUND_DISCONNECT: 529 } 530 case IPC_M_HOUND_DISCONNECT: { 533 531 /* check interface functions */ 534 532 if (!server_iface || !server_iface->disconnect) { … … 537 535 } 538 536 539 source = NULL;540 sink = NULL;537 void *source = NULL; 538 void *sink = NULL; 541 539 542 540 /* read source name */ 543 ret = async_data_write_accept(&source, true, 0, 0, 0,544 0);541 errno_t ret = 542 async_data_write_accept(&source, true, 0, 0, 0, 0); 545 543 /*read sink name */ 546 544 if (ret == EOK) … … 554 552 async_answer_0(callid, ret); 555 553 break; 556 case IPC_M_HOUND_STREAM_ENTER: 554 } 555 case IPC_M_HOUND_STREAM_ENTER: { 557 556 /* check interface functions */ 558 557 if (!server_iface || !server_iface->is_record_context … … 564 563 565 564 /* get parameters */ 566 id = IPC_GET_ARG1(call);567 flags = IPC_GET_ARG2(call);565 hound_context_id_t id = IPC_GET_ARG1(call); 566 const int flags = IPC_GET_ARG2(call); 568 567 const format_convert_t c = {.arg = IPC_GET_ARG3(call)}; 569 568 const pcm_format_t f = { … … 575 574 576 575 void *stream; 577 ret = server_iface->add_stream(server_iface->server,576 errno_t ret = server_iface->add_stream(server_iface->server, 578 577 id, flags, f, bsize, &stream); 579 578 if (ret != EOK) { … … 605 604 } 606 605 break; 606 } 607 607 case IPC_M_HOUND_STREAM_EXIT: 608 608 case IPC_M_HOUND_STREAM_DRAIN:
Note:
See TracChangeset
for help on using the changeset viewer.
