Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/hound/src/protocol.c

    r25a179e rb7fd2a0  
    9393{
    9494        service_id_t id = 0;
    95         const int ret =
     95        const errno_t ret =
    9696            loc_service_get_id(service, &id, IPC_FLAG_BLOCKING);
    9797        if (ret != EOK)
     
    120120 * @return EOK on success, Error code on failure.
    121121 */
    122 int hound_service_register_context(hound_sess_t *sess,
     122errno_t hound_service_register_context(hound_sess_t *sess,
    123123    const char *name, bool record, hound_context_id_t *id)
    124124{
     
    129129        aid_t mid =
    130130            async_send_1(exch, IPC_M_HOUND_CONTEXT_REGISTER, record, &call);
    131         int ret = mid ? EOK : EPARTY;
     131        errno_t ret = mid ? EOK : EPARTY;
    132132
    133133        if (ret == EOK)
     
    153153 * @return Error code.
    154154 */
    155 int hound_service_unregister_context(hound_sess_t *sess, hound_context_id_t id)
     155errno_t hound_service_unregister_context(hound_sess_t *sess, hound_context_id_t id)
    156156{
    157157        assert(sess);
    158158        async_exch_t *exch = async_exchange_begin(sess);
    159         const int ret =
     159        const errno_t ret =
    160160            async_req_1_0(exch, IPC_M_HOUND_CONTEXT_UNREGISTER, id);
    161161        async_exchange_end(exch);
     
    173173 * @retval Error code.
    174174 */
    175 int hound_service_get_list(hound_sess_t *sess, const char ***ids, size_t *count,
     175errno_t hound_service_get_list(hound_sess_t *sess, const char ***ids, size_t *count,
    176176    int flags, const char *connection)
    177177{
     
    191191            connection != NULL, &res_call);
    192192
    193         int ret = EOK;
     193        errno_t ret = EOK;
    194194        if (mid && connection)
    195195                ret = async_data_write_start(exch, connection,
     
    247247 * @return Error code.
    248248 */
    249 int hound_service_connect_source_sink(hound_sess_t *sess, const char *source,
     249errno_t hound_service_connect_source_sink(hound_sess_t *sess, const char *source,
    250250    const char *sink)
    251251{
     
    259259        ipc_call_t call;
    260260        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;
    262262        if (ret == EOK)
    263263                ret = async_data_write_start(exch, source, str_size(source));
     
    276276 * @return Error code.
    277277 */
    278 int hound_service_disconnect_source_sink(hound_sess_t *sess, const char *source,
     278errno_t hound_service_disconnect_source_sink(hound_sess_t *sess, const char *source,
    279279    const char *sink)
    280280{
     
    285285        ipc_call_t call;
    286286        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;
    288288        if (ret == EOK)
    289289                ret = async_data_write_start(exch, source, str_size(source));
     
    304304 * @return Error code.
    305305 */
    306 int hound_service_stream_enter(async_exch_t *exch, hound_context_id_t id,
     306errno_t hound_service_stream_enter(async_exch_t *exch, hound_context_id_t id,
    307307    int flags, pcm_format_t format, size_t bsize)
    308308{
     
    321321 * @return Error code.
    322322 */
    323 int hound_service_stream_exit(async_exch_t *exch)
     323errno_t hound_service_stream_exit(async_exch_t *exch)
    324324{
    325325        return async_req_0_0(exch, IPC_M_HOUND_STREAM_EXIT);
     
    331331 * @return Error code.
    332332 */
    333 int hound_service_stream_drain(async_exch_t *exch)
     333errno_t hound_service_stream_drain(async_exch_t *exch)
    334334{
    335335        return async_req_0_0(exch, IPC_M_HOUND_STREAM_DRAIN);
     
    343343 * @return Error code.
    344344 */
    345 int hound_service_stream_write(async_exch_t *exch, const void *data, size_t size)
     345errno_t hound_service_stream_write(async_exch_t *exch, const void *data, size_t size)
    346346{
    347347        return async_data_write_start(exch, data, size);
     
    355355 * @return Error code.
    356356 */
    357 int hound_service_stream_read(async_exch_t *exch, void *data, size_t size)
     357errno_t hound_service_stream_read(async_exch_t *exch, void *data, size_t size)
    358358{
    359359        return async_data_read_start(exch, data, size);
     
    407407
    408408                        /* Get context name */
    409                         int ret =
     409                        errno_t ret =
    410410                            async_data_write_accept(&name, true, 0, 0, 0, 0);
    411411                        if (ret != EOK) {
     
    434434                        /* get id, 1st param */
    435435                        hound_context_id_t id = IPC_GET_ARG1(call);
    436                         const int ret =
     436                        const errno_t ret =
    437437                            server_iface->rem_context(server_iface->server, id);
    438438                        async_answer_0(callid, ret);
     
    451451                        const bool conn = IPC_GET_ARG3(call);
    452452                        char *conn_name = NULL;
    453                         int ret = EOK;
     453                        errno_t ret = EOK;
    454454
    455455                        /* get connected actor name if provided */
     
    513513
    514514                        /* read source name */
    515                         int ret =
     515                        errno_t ret =
    516516                            async_data_write_accept(&source, true, 0, 0, 0, 0);
    517517                        /* read sink name */
     
    539539
    540540                        /* read source name */
    541                         int ret =
     541                        errno_t ret =
    542542                            async_data_write_accept(&source, true, 0, 0, 0, 0);
    543543                        /*read sink name */
     
    574574
    575575                        void *stream;
    576                         int ret = server_iface->add_stream(server_iface->server,
     576                        errno_t ret = server_iface->add_stream(server_iface->server,
    577577                            id, flags, f, bsize, &stream);
    578578                        if (ret != EOK) {
     
    626626        ipc_call_t call;
    627627        size_t size = 0;
    628         int ret_answer = EOK;
     628        errno_t ret_answer = EOK;
    629629        /* accept data write or drain */
    630630        while (async_data_write_receive_call(&callid, &call, &size)
     
    632632                /* check drain first */
    633633                if (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN) {
    634                         int ret = ENOTSUP;
     634                        errno_t ret = ENOTSUP;
    635635                        if (server_iface->drain_stream)
    636636                                ret = server_iface->drain_stream(stream);
     
    650650                        continue;
    651651                }
    652                 const int ret = async_data_write_finalize(callid, buffer, size);
     652                const errno_t ret = async_data_write_finalize(callid, buffer, size);
    653653                if (ret == EOK) {
    654654                        /* push data to stream */
     
    657657                }
    658658        }
    659         const int ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT
     659        const errno_t ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT
    660660            ? EOK : EINVAL;
    661661
     
    673673        ipc_call_t call;
    674674        size_t size = 0;
    675         int ret_answer = EOK;
     675        errno_t ret_answer = EOK;
    676676        /* accept data read and drain */
    677677        while (async_data_read_receive_call(&callid, &call, &size)
     
    679679                /* drain does not make much sense but it is allowed */
    680680                if (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN) {
    681                         int ret = ENOTSUP;
     681                        errno_t ret = ENOTSUP;
    682682                        if (server_iface->drain_stream)
    683683                                ret = server_iface->drain_stream(stream);
     
    695695                        continue;
    696696                }
    697                 int ret = server_iface->stream_data_read(stream, buffer, size);
     697                errno_t ret = server_iface->stream_data_read(stream, buffer, size);
    698698                if (ret == EOK) {
    699699                        ret_answer =
     
    701701                }
    702702        }
    703         const int ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT
     703        const errno_t ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT
    704704            ? EOK : EINVAL;
    705705
     
    718718 * @return Error code.
    719719 */
    720 int hound_server_register(const char *name, service_id_t *id)
     720errno_t hound_server_register(const char *name, service_id_t *id)
    721721{
    722722        if (!name || !id)
    723723                return EINVAL;
    724724
    725         int ret = loc_server_register(name);
     725        errno_t ret = loc_server_register(name);
    726726        if (ret != EOK)
    727727                return ret;
     
    744744 * @return Error code.
    745745 */
    746 int hound_server_set_device_change_callback(dev_change_callback_t cb)
     746errno_t hound_server_set_device_change_callback(dev_change_callback_t cb)
    747747{
    748748        return loc_register_cat_change_cb(cb);
     
    754754 * @return Error code.
    755755 */
    756 int hound_server_devices_iterate(device_callback_t callback)
     756errno_t hound_server_devices_iterate(device_callback_t callback)
    757757{
    758758        if (!callback)
     
    762762
    763763        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,
    765765                    IPC_FLAG_BLOCKING);
    766766                if (ret != EOK)
     
    771771        service_id_t *svcs = NULL;
    772772        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);
    774774        if (ret != EOK)
    775775                return ret;
Note: See TracChangeset for help on using the changeset viewer.