Ignore:
File:
1 edited

Legend:

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

    r84239b1 r5a6cc679  
    7373                uint8_t channels;
    7474                uint8_t format;
    75         } __attribute__((packed)) f;
     75        } f __attribute__((packed));
    7676        sysarg_t arg;
    7777} format_convert_t;
     
    173173 * @retval Error code.
    174174 */
    175 errno_t hound_service_get_list(hound_sess_t *sess, 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{
     
    206206
    207207        /* Start receiving names */
    208         char **names = NULL;
     208        const char **names = NULL;
    209209        if (name_count) {
    210210                size_t *sizes = calloc(name_count, sizeof(size_t));
     
    385385void hound_connection_handler(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    386386{
    387         hound_context_id_t id;
    388         errno_t ret;
    389         int flags;
    390         void *source;
    391         void *sink;
    392 
    393387        /* Accept connection if there is a valid iface*/
    394388        if (server_iface) {
     
    403397                ipc_callid_t callid = async_get_call(&call);
    404398                switch (IPC_GET_IMETHOD(call)) {
    405                 case IPC_M_HOUND_CONTEXT_REGISTER:
     399                case IPC_M_HOUND_CONTEXT_REGISTER: {
    406400                        /* check interface functions */
    407401                        if (!server_iface || !server_iface->add_context) {
     
    413407
    414408                        /* 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);
    416411                        if (ret != EOK) {
    417412                                async_answer_0(callid, ret);
    418413                                break;
    419414                        }
    420 
    421                         id = 0;
     415                        hound_context_id_t id = 0;
    422416                        ret = server_iface->add_context(server_iface->server,
    423417                            &id, name, record);
     
    430424                        }
    431425                        break;
    432                 case IPC_M_HOUND_CONTEXT_UNREGISTER:
     426                }
     427                case IPC_M_HOUND_CONTEXT_UNREGISTER: {
    433428                        /* check interface functions */
    434429                        if (!server_iface || !server_iface->rem_context) {
     
    438433
    439434                        /* 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);
    443438                        async_answer_0(callid, ret);
    444439                        break;
    445                 case IPC_M_HOUND_GET_LIST:
     440                }
     441                case IPC_M_HOUND_GET_LIST: {
    446442                        /* check interface functions */
    447443                        if (!server_iface || !server_iface->get_list) {
     
    450446                        }
    451447
    452                         char **list = NULL;
    453                         flags = IPC_GET_ARG1(call);
     448                        const char **list = NULL;
     449                        const int flags = IPC_GET_ARG1(call);
    454450                        size_t count = IPC_GET_ARG2(call);
    455451                        const bool conn = IPC_GET_ARG3(call);
    456452                        char *conn_name = NULL;
    457                         ret = EOK;
     453                        errno_t ret = EOK;
    458454
    459455                        /* get connected actor name if provided */
     
    505501                        free(list);
    506502                        break;
    507                 case IPC_M_HOUND_CONNECT:
     503                }
     504                case IPC_M_HOUND_CONNECT: {
    508505                        /* check interface functions */
    509506                        if (!server_iface || !server_iface->connect) {
     
    512509                        }
    513510
    514                         source = NULL;
    515                         sink = NULL;
     511                        void *source = NULL;
     512                        void *sink = NULL;
    516513
    517514                        /* 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);
    520517                        /* read sink name */
    521518                        if (ret == EOK)
     
    530527                        async_answer_0(callid, ret);
    531528                        break;
    532                 case IPC_M_HOUND_DISCONNECT:
     529                }
     530                case IPC_M_HOUND_DISCONNECT: {
    533531                        /* check interface functions */
    534532                        if (!server_iface || !server_iface->disconnect) {
     
    537535                        }
    538536
    539                         source = NULL;
    540                         sink = NULL;
     537                        void *source = NULL;
     538                        void *sink = NULL;
    541539
    542540                        /* 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);
    545543                        /*read sink name */
    546544                        if (ret == EOK)
     
    554552                        async_answer_0(callid, ret);
    555553                        break;
    556                 case IPC_M_HOUND_STREAM_ENTER:
     554                }
     555                case IPC_M_HOUND_STREAM_ENTER: {
    557556                        /* check interface functions */
    558557                        if (!server_iface || !server_iface->is_record_context
     
    564563
    565564                        /* 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);
    568567                        const format_convert_t c = {.arg = IPC_GET_ARG3(call)};
    569568                        const pcm_format_t f = {
     
    575574
    576575                        void *stream;
    577                         ret = server_iface->add_stream(server_iface->server,
     576                        errno_t ret = server_iface->add_stream(server_iface->server,
    578577                            id, flags, f, bsize, &stream);
    579578                        if (ret != EOK) {
     
    605604                        }
    606605                        break;
     606                }
    607607                case IPC_M_HOUND_STREAM_EXIT:
    608608                case IPC_M_HOUND_STREAM_DRAIN:
Note: See TracChangeset for help on using the changeset viewer.