Changes in uspace/srv/clipboard/clipboard.c [a35b458:77f0a1d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/clipboard/clipboard.c
ra35b458 r77f0a1d 47 47 static service_id_t svc_id; 48 48 49 static void clip_put_data( ipc_callid_t rid, ipc_call_t *request)49 static void clip_put_data(cap_call_handle_t req_handle, ipc_call_t *request) 50 50 { 51 51 char *data; … … 65 65 66 66 fibril_mutex_unlock(&clip_mtx); 67 async_answer_0(r id, EOK);67 async_answer_0(req_handle, EOK); 68 68 break; 69 69 case CLIPBOARD_TAG_DATA: 70 70 rc = async_data_write_accept((void **) &data, false, 0, 0, 0, &size); 71 71 if (rc != EOK) { 72 async_answer_0(r id, rc);72 async_answer_0(req_handle, rc); 73 73 break; 74 74 } … … 84 84 85 85 fibril_mutex_unlock(&clip_mtx); 86 async_answer_0(r id, EOK);86 async_answer_0(req_handle, EOK); 87 87 break; 88 88 default: 89 async_answer_0(r id, EINVAL);90 } 91 } 92 93 static void clip_get_data( ipc_callid_t rid, ipc_call_t *request)89 async_answer_0(req_handle, EINVAL); 90 } 91 } 92 93 static void clip_get_data(cap_call_handle_t req_handle, ipc_call_t *request) 94 94 { 95 95 fibril_mutex_lock(&clip_mtx); 96 96 97 ipc_callid_t callid;97 cap_call_handle_t chandle; 98 98 size_t size; 99 99 … … 101 101 switch (IPC_GET_ARG1(*request)) { 102 102 case CLIPBOARD_TAG_DATA: 103 if (!async_data_read_receive(&c allid, &size)) {104 async_answer_0(c allid, EINVAL);105 async_answer_0(r id, EINVAL);103 if (!async_data_read_receive(&chandle, &size)) { 104 async_answer_0(chandle, EINVAL); 105 async_answer_0(req_handle, EINVAL); 106 106 break; 107 107 } … … 109 109 if (clip_tag != CLIPBOARD_TAG_DATA) { 110 110 /* So far we only understand binary data */ 111 async_answer_0(c allid, EOVERFLOW);112 async_answer_0(r id, EOVERFLOW);111 async_answer_0(chandle, EOVERFLOW); 112 async_answer_0(req_handle, EOVERFLOW); 113 113 break; 114 114 } … … 116 116 if (clip_size != size) { 117 117 /* The client expects different size of data */ 118 async_answer_0(c allid, EOVERFLOW);119 async_answer_0(r id, EOVERFLOW);120 break; 121 } 122 123 errno_t retval = async_data_read_finalize(c allid, clip_data, size);118 async_answer_0(chandle, EOVERFLOW); 119 async_answer_0(req_handle, EOVERFLOW); 120 break; 121 } 122 123 errno_t retval = async_data_read_finalize(chandle, clip_data, size); 124 124 if (retval != EOK) { 125 async_answer_0(r id, retval);126 break; 127 } 128 129 async_answer_0(r id, EOK);125 async_answer_0(req_handle, retval); 126 break; 127 } 128 129 async_answer_0(req_handle, EOK); 130 130 break; 131 131 default: … … 134 134 * data from the clipbard 135 135 */ 136 async_answer_0(r id, EINVAL);136 async_answer_0(req_handle, EINVAL); 137 137 break; 138 138 } … … 141 141 } 142 142 143 static void clip_content( ipc_callid_t rid, ipc_call_t *request)143 static void clip_content(cap_call_handle_t req_handle, ipc_call_t *request) 144 144 { 145 145 fibril_mutex_lock(&clip_mtx); … … 149 149 150 150 fibril_mutex_unlock(&clip_mtx); 151 async_answer_2(rid, EOK, (sysarg_t) size, (sysarg_t) tag); 152 } 153 154 static void clip_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 151 async_answer_2(req_handle, EOK, (sysarg_t) size, (sysarg_t) tag); 152 } 153 154 static void clip_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, 155 void *arg) 155 156 { 156 157 /* Accept connection */ 157 async_answer_0(i id, EOK);158 async_answer_0(icall_handle, EOK); 158 159 159 160 while (true) { 160 161 ipc_call_t call; 161 ipc_callid_t callid= async_get_call(&call);162 cap_call_handle_t chandle = async_get_call(&call); 162 163 163 164 if (!IPC_GET_IMETHOD(call)) … … 166 167 switch (IPC_GET_IMETHOD(call)) { 167 168 case CLIPBOARD_PUT_DATA: 168 clip_put_data(c allid, &call);169 clip_put_data(chandle, &call); 169 170 break; 170 171 case CLIPBOARD_GET_DATA: 171 clip_get_data(c allid, &call);172 clip_get_data(chandle, &call); 172 173 break; 173 174 case CLIPBOARD_CONTENT: 174 clip_content(c allid, &call);175 clip_content(chandle, &call); 175 176 break; 176 177 default: 177 async_answer_0(c allid, ENOENT);178 async_answer_0(chandle, ENOENT); 178 179 } 179 180 }
Note:
See TracChangeset
for help on using the changeset viewer.