Changeset b48e680f in mainline for uspace/lib/c/generic/io/con_srv.c


Ignore:
Timestamp:
2021-11-03T10:23:28Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ec8a1bf
Parents:
ce862ac
git-author:
Jiri Svoboda <jiri@…> (2021-11-02 19:19:50)
git-committer:
Jiri Svoboda <jiri@…> (2021-11-03 10:23:28)
Message:

Allow console application to set the terminal window caption

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/io/con_srv.c

    rce862ac rb48e680f  
    281281}
    282282
     283static void con_set_caption_srv(con_srv_t *srv, ipc_call_t *icall)
     284{
     285        char *caption;
     286        errno_t rc;
     287
     288        rc = async_data_write_accept((void **) &caption, true, 0,
     289            CON_CAPTION_MAXLEN, 0, NULL);
     290        if (rc != EOK) {
     291                async_answer_0(icall, rc);
     292                return;
     293        }
     294
     295        if (srv->srvs->ops->set_caption == NULL) {
     296                async_answer_0(icall, ENOTSUP);
     297                return;
     298        }
     299
     300        srv->srvs->ops->set_caption(srv, caption);
     301        free(caption);
     302        async_answer_0(icall, EOK);
     303}
     304
    283305static void con_get_event_srv(con_srv_t *srv, ipc_call_t *icall)
    284306{
     
    488510                        con_set_cursor_visibility_srv(srv, &call);
    489511                        break;
     512                case CONSOLE_SET_CAPTION:
     513                        con_set_caption_srv(srv, &call);
     514                        break;
    490515                case CONSOLE_GET_EVENT:
    491516                        con_get_event_srv(srv, &call);
Note: See TracChangeset for help on using the changeset viewer.