Changeset a46e56b in mainline for uspace/lib/c/generic/io/input.c


Ignore:
Timestamp:
2018-03-22T06:49:35Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
77f0a1d
Parents:
3e242d2
git-author:
Jakub Jermar <jakub@…> (2018-03-21 23:29:06)
git-committer:
Jakub Jermar <jakub@…> (2018-03-22 06:49:35)
Message:

Prefer handle over ID in naming handle variables

File:
1 edited

Legend:

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

    r3e242d2 ra46e56b  
    4343#include <stdlib.h>
    4444
    45 static void input_cb_conn(cap_call_handle_t iid, ipc_call_t *icall, void *arg);
     45static void input_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg);
    4646
    4747errno_t input_open(async_sess_t *sess, input_ev_ops_t *ev_ops,
     
    9292}
    9393
    94 static void input_ev_active(input_t *input, cap_call_handle_t callid,
     94static void input_ev_active(input_t *input, cap_call_handle_t chandle,
    9595    ipc_call_t *call)
    9696{
    9797        errno_t rc = input->ev_ops->active(input);
    98         async_answer_0(callid, rc);
    99 }
    100 
    101 static void input_ev_deactive(input_t *input, cap_call_handle_t callid,
     98        async_answer_0(chandle, rc);
     99}
     100
     101static void input_ev_deactive(input_t *input, cap_call_handle_t chandle,
    102102    ipc_call_t *call)
    103103{
    104104        errno_t rc = input->ev_ops->deactive(input);
    105         async_answer_0(callid, rc);
    106 }
    107 
    108 static void input_ev_key(input_t *input, cap_call_handle_t callid,
     105        async_answer_0(chandle, rc);
     106}
     107
     108static void input_ev_key(input_t *input, cap_call_handle_t chandle,
    109109    ipc_call_t *call)
    110110{
     
    121121
    122122        rc = input->ev_ops->key(input, type, key, mods, c);
    123         async_answer_0(callid, rc);
    124 }
    125 
    126 static void input_ev_move(input_t *input, cap_call_handle_t callid,
     123        async_answer_0(chandle, rc);
     124}
     125
     126static void input_ev_move(input_t *input, cap_call_handle_t chandle,
    127127    ipc_call_t *call)
    128128{
     
    135135
    136136        rc = input->ev_ops->move(input, dx, dy);
    137         async_answer_0(callid, rc);
    138 }
    139 
    140 static void input_ev_abs_move(input_t *input, cap_call_handle_t callid,
     137        async_answer_0(chandle, rc);
     138}
     139
     140static void input_ev_abs_move(input_t *input, cap_call_handle_t chandle,
    141141    ipc_call_t *call)
    142142{
     
    153153
    154154        rc = input->ev_ops->abs_move(input, x, y, max_x, max_y);
    155         async_answer_0(callid, rc);
    156 }
    157 
    158 static void input_ev_button(input_t *input, cap_call_handle_t callid,
     155        async_answer_0(chandle, rc);
     156}
     157
     158static void input_ev_button(input_t *input, cap_call_handle_t chandle,
    159159    ipc_call_t *call)
    160160{
     
    167167
    168168        rc = input->ev_ops->button(input, bnum, press);
    169         async_answer_0(callid, rc);
    170 }
    171 
    172 static void input_cb_conn(cap_call_handle_t iid, ipc_call_t *icall, void *arg)
     169        async_answer_0(chandle, rc);
     170}
     171
     172static void input_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
    173173{
    174174        input_t *input = (input_t *)arg;
     
    176176        while (true) {
    177177                ipc_call_t call;
    178                 cap_call_handle_t callid = async_get_call(&call);
     178                cap_call_handle_t chandle = async_get_call(&call);
    179179
    180180                if (!IPC_GET_IMETHOD(call)) {
     
    185185                switch (IPC_GET_IMETHOD(call)) {
    186186                case INPUT_EVENT_ACTIVE:
    187                         input_ev_active(input, callid, &call);
     187                        input_ev_active(input, chandle, &call);
    188188                        break;
    189189                case INPUT_EVENT_DEACTIVE:
    190                         input_ev_deactive(input, callid, &call);
     190                        input_ev_deactive(input, chandle, &call);
    191191                        break;
    192192                case INPUT_EVENT_KEY:
    193                         input_ev_key(input, callid, &call);
     193                        input_ev_key(input, chandle, &call);
    194194                        break;
    195195                case INPUT_EVENT_MOVE:
    196                         input_ev_move(input, callid, &call);
     196                        input_ev_move(input, chandle, &call);
    197197                        break;
    198198                case INPUT_EVENT_ABS_MOVE:
    199                         input_ev_abs_move(input, callid, &call);
     199                        input_ev_abs_move(input, chandle, &call);
    200200                        break;
    201201                case INPUT_EVENT_BUTTON:
    202                         input_ev_button(input, callid, &call);
     202                        input_ev_button(input, chandle, &call);
    203203                        break;
    204204                default:
    205                         async_answer_0(callid, ENOTSUP);
     205                        async_answer_0(chandle, ENOTSUP);
    206206                }
    207207        }
Note: See TracChangeset for help on using the changeset viewer.