Changes in uspace/lib/hound/src/protocol.c [25a179e:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/hound/src/protocol.c
r25a179e rb7fd2a0 93 93 { 94 94 service_id_t id = 0; 95 const int ret =95 const errno_t ret = 96 96 loc_service_get_id(service, &id, IPC_FLAG_BLOCKING); 97 97 if (ret != EOK) … … 120 120 * @return EOK on success, Error code on failure. 121 121 */ 122 int hound_service_register_context(hound_sess_t *sess,122 errno_t hound_service_register_context(hound_sess_t *sess, 123 123 const char *name, bool record, hound_context_id_t *id) 124 124 { … … 129 129 aid_t mid = 130 130 async_send_1(exch, IPC_M_HOUND_CONTEXT_REGISTER, record, &call); 131 int ret = mid ? EOK : EPARTY;131 errno_t ret = mid ? EOK : EPARTY; 132 132 133 133 if (ret == EOK) … … 153 153 * @return Error code. 154 154 */ 155 int hound_service_unregister_context(hound_sess_t *sess, hound_context_id_t id)155 errno_t hound_service_unregister_context(hound_sess_t *sess, hound_context_id_t id) 156 156 { 157 157 assert(sess); 158 158 async_exch_t *exch = async_exchange_begin(sess); 159 const int ret =159 const errno_t ret = 160 160 async_req_1_0(exch, IPC_M_HOUND_CONTEXT_UNREGISTER, id); 161 161 async_exchange_end(exch); … … 173 173 * @retval Error code. 174 174 */ 175 int hound_service_get_list(hound_sess_t *sess, const char ***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 { … … 191 191 connection != NULL, &res_call); 192 192 193 int ret = EOK;193 errno_t ret = EOK; 194 194 if (mid && connection) 195 195 ret = async_data_write_start(exch, connection, … … 247 247 * @return Error code. 248 248 */ 249 int hound_service_connect_source_sink(hound_sess_t *sess, const char *source,249 errno_t hound_service_connect_source_sink(hound_sess_t *sess, const char *source, 250 250 const char *sink) 251 251 { … … 259 259 ipc_call_t call; 260 260 aid_t id = async_send_0(exch, IPC_M_HOUND_CONNECT, &call); 261 int ret = id ? EOK : EPARTY;261 errno_t ret = id ? EOK : EPARTY; 262 262 if (ret == EOK) 263 263 ret = async_data_write_start(exch, source, str_size(source)); … … 276 276 * @return Error code. 277 277 */ 278 int hound_service_disconnect_source_sink(hound_sess_t *sess, const char *source,278 errno_t hound_service_disconnect_source_sink(hound_sess_t *sess, const char *source, 279 279 const char *sink) 280 280 { … … 285 285 ipc_call_t call; 286 286 aid_t id = async_send_0(exch, IPC_M_HOUND_DISCONNECT, &call); 287 int ret = id ? EOK : EPARTY;287 errno_t ret = id ? EOK : EPARTY; 288 288 if (ret == EOK) 289 289 ret = async_data_write_start(exch, source, str_size(source)); … … 304 304 * @return Error code. 305 305 */ 306 int hound_service_stream_enter(async_exch_t *exch, hound_context_id_t id,306 errno_t hound_service_stream_enter(async_exch_t *exch, hound_context_id_t id, 307 307 int flags, pcm_format_t format, size_t bsize) 308 308 { … … 321 321 * @return Error code. 322 322 */ 323 int hound_service_stream_exit(async_exch_t *exch)323 errno_t hound_service_stream_exit(async_exch_t *exch) 324 324 { 325 325 return async_req_0_0(exch, IPC_M_HOUND_STREAM_EXIT); … … 331 331 * @return Error code. 332 332 */ 333 int hound_service_stream_drain(async_exch_t *exch)333 errno_t hound_service_stream_drain(async_exch_t *exch) 334 334 { 335 335 return async_req_0_0(exch, IPC_M_HOUND_STREAM_DRAIN); … … 343 343 * @return Error code. 344 344 */ 345 int hound_service_stream_write(async_exch_t *exch, const void *data, size_t size)345 errno_t hound_service_stream_write(async_exch_t *exch, const void *data, size_t size) 346 346 { 347 347 return async_data_write_start(exch, data, size); … … 355 355 * @return Error code. 356 356 */ 357 int hound_service_stream_read(async_exch_t *exch, void *data, size_t size)357 errno_t hound_service_stream_read(async_exch_t *exch, void *data, size_t size) 358 358 { 359 359 return async_data_read_start(exch, data, size); … … 407 407 408 408 /* Get context name */ 409 int ret =409 errno_t ret = 410 410 async_data_write_accept(&name, true, 0, 0, 0, 0); 411 411 if (ret != EOK) { … … 434 434 /* get id, 1st param */ 435 435 hound_context_id_t id = IPC_GET_ARG1(call); 436 const int ret =436 const errno_t ret = 437 437 server_iface->rem_context(server_iface->server, id); 438 438 async_answer_0(callid, ret); … … 451 451 const bool conn = IPC_GET_ARG3(call); 452 452 char *conn_name = NULL; 453 int ret = EOK;453 errno_t ret = EOK; 454 454 455 455 /* get connected actor name if provided */ … … 513 513 514 514 /* read source name */ 515 int ret =515 errno_t ret = 516 516 async_data_write_accept(&source, true, 0, 0, 0, 0); 517 517 /* read sink name */ … … 539 539 540 540 /* read source name */ 541 int ret =541 errno_t ret = 542 542 async_data_write_accept(&source, true, 0, 0, 0, 0); 543 543 /*read sink name */ … … 574 574 575 575 void *stream; 576 int ret = server_iface->add_stream(server_iface->server,576 errno_t ret = server_iface->add_stream(server_iface->server, 577 577 id, flags, f, bsize, &stream); 578 578 if (ret != EOK) { … … 626 626 ipc_call_t call; 627 627 size_t size = 0; 628 int ret_answer = EOK;628 errno_t ret_answer = EOK; 629 629 /* accept data write or drain */ 630 630 while (async_data_write_receive_call(&callid, &call, &size) … … 632 632 /* check drain first */ 633 633 if (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN) { 634 int ret = ENOTSUP;634 errno_t ret = ENOTSUP; 635 635 if (server_iface->drain_stream) 636 636 ret = server_iface->drain_stream(stream); … … 650 650 continue; 651 651 } 652 const int ret = async_data_write_finalize(callid, buffer, size);652 const errno_t ret = async_data_write_finalize(callid, buffer, size); 653 653 if (ret == EOK) { 654 654 /* push data to stream */ … … 657 657 } 658 658 } 659 const int ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT659 const errno_t ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT 660 660 ? EOK : EINVAL; 661 661 … … 673 673 ipc_call_t call; 674 674 size_t size = 0; 675 int ret_answer = EOK;675 errno_t ret_answer = EOK; 676 676 /* accept data read and drain */ 677 677 while (async_data_read_receive_call(&callid, &call, &size) … … 679 679 /* drain does not make much sense but it is allowed */ 680 680 if (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN) { 681 int ret = ENOTSUP;681 errno_t ret = ENOTSUP; 682 682 if (server_iface->drain_stream) 683 683 ret = server_iface->drain_stream(stream); … … 695 695 continue; 696 696 } 697 int ret = server_iface->stream_data_read(stream, buffer, size);697 errno_t ret = server_iface->stream_data_read(stream, buffer, size); 698 698 if (ret == EOK) { 699 699 ret_answer = … … 701 701 } 702 702 } 703 const int ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT703 const errno_t ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT 704 704 ? EOK : EINVAL; 705 705 … … 718 718 * @return Error code. 719 719 */ 720 int hound_server_register(const char *name, service_id_t *id)720 errno_t hound_server_register(const char *name, service_id_t *id) 721 721 { 722 722 if (!name || !id) 723 723 return EINVAL; 724 724 725 int ret = loc_server_register(name);725 errno_t ret = loc_server_register(name); 726 726 if (ret != EOK) 727 727 return ret; … … 744 744 * @return Error code. 745 745 */ 746 int hound_server_set_device_change_callback(dev_change_callback_t cb)746 errno_t hound_server_set_device_change_callback(dev_change_callback_t cb) 747 747 { 748 748 return loc_register_cat_change_cb(cb); … … 754 754 * @return Error code. 755 755 */ 756 int hound_server_devices_iterate(device_callback_t callback)756 errno_t hound_server_devices_iterate(device_callback_t callback) 757 757 { 758 758 if (!callback) … … 762 762 763 763 if (!resolved) { 764 const int ret = loc_category_get_id("audio-pcm", &cat_id,764 const errno_t ret = loc_category_get_id("audio-pcm", &cat_id, 765 765 IPC_FLAG_BLOCKING); 766 766 if (ret != EOK) … … 771 771 service_id_t *svcs = NULL; 772 772 size_t count = 0; 773 const int ret = loc_category_get_svcs(cat_id, &svcs, &count);773 const errno_t ret = loc_category_get_svcs(cat_id, &svcs, &count); 774 774 if (ret != EOK) 775 775 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.