Changeset b7fd2a0 in mainline for uspace/lib/c/generic/io
- Timestamp:
- 2018-01-13T03:10:29Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- uspace/lib/c/generic/io
- Files:
-
- 15 edited
-
chardev.c (modified) (10 diffs)
-
chardev_srv.c (modified) (3 diffs)
-
con_srv.c (modified) (8 diffs)
-
console.c (modified) (8 diffs)
-
input.c (modified) (9 diffs)
-
io.c (modified) (8 diffs)
-
kio.c (modified) (1 diff)
-
klog.c (modified) (1 diff)
-
log.c (modified) (5 diffs)
-
logctl.c (modified) (8 diffs)
-
output.c (modified) (9 diffs)
-
serial.c (modified) (4 diffs)
-
table.c (modified) (10 diffs)
-
visualizer.c (modified) (8 diffs)
-
window.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/chardev.c
r36f0738 rb7fd2a0 50 50 * @return EOK on success, ENOMEM if out of memory, EIO on I/O error 51 51 */ 52 int chardev_open(async_sess_t *sess, chardev_t **rchardev)52 errno_t chardev_open(async_sess_t *sess, chardev_t **rchardev) 53 53 { 54 54 chardev_t *chardev; … … 94 94 * @return EOK on success or non-zero error code 95 95 */ 96 int chardev_read(chardev_t *chardev, void *buf, size_t size, size_t *nread)96 errno_t chardev_read(chardev_t *chardev, void *buf, size_t size, size_t *nread) 97 97 { 98 98 async_exch_t *exch = async_exchange_begin(chardev->sess); … … 105 105 ipc_call_t answer; 106 106 aid_t req = async_send_0(exch, CHARDEV_READ, &answer); 107 int rc = async_data_read_start(exch, buf, size);107 errno_t rc = async_data_read_start(exch, buf, size); 108 108 async_exchange_end(exch); 109 109 … … 114 114 } 115 115 116 int retval;116 errno_t retval; 117 117 async_wait_for(req, &retval); 118 118 … … 124 124 *nread = IPC_GET_ARG2(answer); 125 125 /* In case of partial success, ARG1 contains the error code */ 126 return ( int) IPC_GET_ARG1(answer);126 return (errno_t) IPC_GET_ARG1(answer); 127 127 128 128 } … … 144 144 * @return EOK on success or non-zero error code 145 145 */ 146 static int chardev_write_once(chardev_t *chardev, const void *data,146 static errno_t chardev_write_once(chardev_t *chardev, const void *data, 147 147 size_t size, size_t *nwritten) 148 148 { … … 150 150 ipc_call_t answer; 151 151 aid_t req; 152 int rc;152 errno_t rc; 153 153 154 154 /* Break down large transfers */ … … 166 166 } 167 167 168 int retval;168 errno_t retval; 169 169 async_wait_for(req, &retval); 170 170 if (retval != EOK) { … … 175 175 *nwritten = IPC_GET_ARG2(answer); 176 176 /* In case of partial success, ARG1 contains the error code */ 177 return ( int) IPC_GET_ARG1(answer);177 return (errno_t) IPC_GET_ARG1(answer); 178 178 } 179 179 … … 193 193 * @return EOK on success or non-zero error code 194 194 */ 195 int chardev_write(chardev_t *chardev, const void *data, size_t size,195 errno_t chardev_write(chardev_t *chardev, const void *data, size_t size, 196 196 size_t *nwritten) 197 197 { 198 198 size_t nw; 199 199 size_t p; 200 int rc;200 errno_t rc; 201 201 202 202 p = 0; -
uspace/lib/c/generic/io/chardev_srv.c
r36f0738 rb7fd2a0 49 49 size_t size; 50 50 size_t nread; 51 int rc;51 errno_t rc; 52 52 ipc_callid_t rcallid; 53 53 … … 91 91 size_t size; 92 92 size_t nwr; 93 int rc;93 errno_t rc; 94 94 95 95 rc = async_data_write_accept(&data, false, 0, 0, 0, &size); … … 132 132 } 133 133 134 int chardev_conn(ipc_callid_t iid, ipc_call_t *icall, chardev_srvs_t *srvs)134 errno_t chardev_conn(ipc_callid_t iid, ipc_call_t *icall, chardev_srvs_t *srvs) 135 135 { 136 136 chardev_srv_t *srv; 137 int rc;137 errno_t rc; 138 138 139 139 /* Accept the connection */ -
uspace/lib/c/generic/io/con_srv.c
r36f0738 rb7fd2a0 42 42 #include <io/con_srv.h> 43 43 44 static int console_ev_encode(cons_event_t *event, ipc_call_t *call)44 static errno_t console_ev_encode(cons_event_t *event, ipc_call_t *call) 45 45 { 46 46 IPC_SET_ARG1(*call, event->type); … … 71 71 void *buf; 72 72 size_t size; 73 int rc;73 errno_t rc; 74 74 ipc_callid_t rcallid; 75 75 … … 113 113 void *data; 114 114 size_t size; 115 int rc;115 errno_t rc; 116 116 117 117 rc = async_data_write_accept(&data, false, 0, 0, 0, &size); … … 178 178 ipc_call_t *call) 179 179 { 180 int rc;180 errno_t rc; 181 181 sysarg_t col; 182 182 sysarg_t row; … … 194 194 ipc_call_t *call) 195 195 { 196 int rc;196 errno_t rc; 197 197 sysarg_t cols; 198 198 sysarg_t rows; … … 210 210 ipc_call_t *call) 211 211 { 212 int rc;212 errno_t rc; 213 213 console_caps_t ccap; 214 214 … … 295 295 ipc_call_t *call) 296 296 { 297 int rc;297 errno_t rc; 298 298 cons_event_t event; 299 299 ipc_call_t result; … … 340 340 } 341 341 342 int con_conn(ipc_callid_t iid, ipc_call_t *icall, con_srvs_t *srvs)342 errno_t con_conn(ipc_callid_t iid, ipc_call_t *icall, con_srvs_t *srvs) 343 343 { 344 344 con_srv_t *srv; 345 int rc;345 errno_t rc; 346 346 347 347 /* Accept the connection */ -
uspace/lib/c/generic/io/console.c
r36f0738 rb7fd2a0 90 90 } 91 91 92 int console_get_size(console_ctrl_t *ctrl, sysarg_t *cols, sysarg_t *rows)93 { 94 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 95 int rc = async_req_0_2(exch, CONSOLE_GET_SIZE, cols, rows);92 errno_t console_get_size(console_ctrl_t *ctrl, sysarg_t *cols, sysarg_t *rows) 93 { 94 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 95 errno_t rc = async_req_0_2(exch, CONSOLE_GET_SIZE, cols, rows); 96 96 async_exchange_end(exch); 97 97 … … 129 129 } 130 130 131 int console_get_color_cap(console_ctrl_t *ctrl, sysarg_t *ccap)132 { 133 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 134 int rc = async_req_0_1(exch, CONSOLE_GET_COLOR_CAP, ccap);131 errno_t console_get_color_cap(console_ctrl_t *ctrl, sysarg_t *ccap) 132 { 133 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 134 errno_t rc = async_req_0_1(exch, CONSOLE_GET_COLOR_CAP, ccap); 135 135 async_exchange_end(exch); 136 136 … … 138 138 } 139 139 140 int console_get_pos(console_ctrl_t *ctrl, sysarg_t *col, sysarg_t *row)141 { 142 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 143 int rc = async_req_0_2(exch, CONSOLE_GET_POS, col, row);140 errno_t console_get_pos(console_ctrl_t *ctrl, sysarg_t *col, sysarg_t *row) 141 { 142 async_exch_t *exch = async_exchange_begin(ctrl->output_sess); 143 errno_t rc = async_req_0_2(exch, CONSOLE_GET_POS, col, row); 144 144 async_exchange_end(exch); 145 145 … … 154 154 } 155 155 156 static int console_ev_decode(ipc_call_t *call, cons_event_t *event)156 static errno_t console_ev_decode(ipc_call_t *call, cons_event_t *event) 157 157 { 158 158 event->type = IPC_GET_ARG1(*call); … … 188 188 async_exchange_end(exch); 189 189 190 int rc;190 errno_t rc; 191 191 async_wait_for(aid, &rc); 192 192 … … 202 202 } 203 203 } else { 204 int retval;204 errno_t retval; 205 205 async_wait_for(ctrl->input_aid, &retval); 206 206 … … 212 212 } 213 213 214 int rc = console_ev_decode(&ctrl->input_call, event);214 errno_t rc = console_ev_decode(&ctrl->input_call, event); 215 215 if (rc != EOK) { 216 216 errno = rc; … … 235 235 } 236 236 237 int retval;238 int rc = async_wait_timeout(ctrl->input_aid, &retval, *timeout);237 errno_t retval; 238 errno_t rc = async_wait_timeout(ctrl->input_aid, &retval, *timeout); 239 239 if (rc != EOK) { 240 240 *timeout = 0; -
uspace/lib/c/generic/io/input.c
r36f0738 rb7fd2a0 45 45 static void input_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg); 46 46 47 int input_open(async_sess_t *sess, input_ev_ops_t *ev_ops,47 errno_t input_open(async_sess_t *sess, input_ev_ops_t *ev_ops, 48 48 void *arg, input_t **rinput) 49 49 { … … 59 59 60 60 port_id_t port; 61 int rc = async_create_callback_port(exch, INTERFACE_INPUT_CB, 0, 0,61 errno_t rc = async_create_callback_port(exch, INTERFACE_INPUT_CB, 0, 0, 62 62 input_cb_conn, input, &port); 63 63 … … 83 83 } 84 84 85 int input_activate(input_t *input)85 errno_t input_activate(input_t *input) 86 86 { 87 87 async_exch_t *exch = async_exchange_begin(input->sess); 88 int rc = async_req_0_0(exch, INPUT_ACTIVATE);88 errno_t rc = async_req_0_0(exch, INPUT_ACTIVATE); 89 89 async_exchange_end(exch); 90 90 … … 95 95 ipc_call_t *call) 96 96 { 97 int rc = input->ev_ops->active(input);97 errno_t rc = input->ev_ops->active(input); 98 98 async_answer_0(callid, rc); 99 99 } … … 102 102 ipc_call_t *call) 103 103 { 104 int rc = input->ev_ops->deactive(input);104 errno_t rc = input->ev_ops->deactive(input); 105 105 async_answer_0(callid, rc); 106 106 } … … 113 113 keymod_t mods; 114 114 wchar_t c; 115 int rc;115 errno_t rc; 116 116 117 117 type = IPC_GET_ARG1(*call); … … 129 129 int dx; 130 130 int dy; 131 int rc;131 errno_t rc; 132 132 133 133 dx = IPC_GET_ARG1(*call); … … 145 145 unsigned max_x; 146 146 unsigned max_y; 147 int rc;147 errno_t rc; 148 148 149 149 x = IPC_GET_ARG1(*call); … … 161 161 int bnum; 162 162 int press; 163 int rc;163 errno_t rc; 164 164 165 165 bnum = IPC_GET_ARG1(*call); -
uspace/lib/c/generic/io/io.c
r36f0738 rb7fd2a0 297 297 flags |= WALK_MAY_CREATE; 298 298 int file; 299 int rc = vfs_lookup(path, flags, &file);299 errno_t rc = vfs_lookup(path, flags, &file); 300 300 if (rc != EOK) { 301 301 errno = rc; … … 364 364 static int _fclose_nofree(FILE *stream) 365 365 { 366 int rc = 0;366 errno_t rc = 0; 367 367 368 368 fflush(stream); … … 433 433 static size_t _fread(void *buf, size_t size, size_t nmemb, FILE *stream) 434 434 { 435 int rc;435 errno_t rc; 436 436 size_t nread; 437 437 … … 462 462 static size_t _fwrite(const void *buf, size_t size, size_t nmemb, FILE *stream) 463 463 { 464 int rc;464 errno_t rc; 465 465 size_t nwritten; 466 466 … … 495 495 static void _ffillbuf(FILE *stream) 496 496 { 497 int rc;497 errno_t rc; 498 498 size_t nread; 499 499 … … 801 801 int fseek(FILE *stream, long offset, int whence) 802 802 { 803 int rc;803 errno_t rc; 804 804 805 805 if (stream->error) … … 877 877 878 878 if ((stream->fd >= 0) && (stream->need_sync)) { 879 int rc;879 errno_t rc; 880 880 881 881 /** … … 934 934 } 935 935 936 int vfs_fhandle(FILE *stream, int *handle)936 errno_t vfs_fhandle(FILE *stream, int *handle) 937 937 { 938 938 if (stream->fd >= 0) { -
uspace/lib/c/generic/io/kio.c
r36f0738 rb7fd2a0 43 43 #include <io/printf_core.h> 44 44 45 int kio_write(const void *buf, size_t size, size_t *nwritten)45 errno_t kio_write(const void *buf, size_t size, size_t *nwritten) 46 46 { 47 int rc = (int) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) buf, size);47 errno_t rc = (errno_t) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) buf, size); 48 48 49 49 if (rc == EOK) -
uspace/lib/c/generic/io/klog.c
r36f0738 rb7fd2a0 42 42 #include <abi/log.h> 43 43 44 int klog_write(log_level_t lvl, const void *buf, size_t size)44 errno_t klog_write(log_level_t lvl, const void *buf, size_t size) 45 45 { 46 return ( int) __SYSCALL4(SYS_KLOG, KLOG_WRITE, (sysarg_t) buf,46 return (errno_t) __SYSCALL4(SYS_KLOG, KLOG_WRITE, (sysarg_t) buf, 47 47 size, lvl); 48 48 } 49 49 50 int klog_read(void *data, size_t size, size_t *nread)50 errno_t klog_read(void *data, size_t size, size_t *nread) 51 51 { 52 return ( int) __SYSCALL5(SYS_KLOG, KLOG_READ, (uintptr_t) data,52 return (errno_t) __SYSCALL5(SYS_KLOG, KLOG_READ, (uintptr_t) data, 53 53 size, 0, (sysarg_t) nread); 54 54 } -
uspace/lib/c/generic/io/log.c
r36f0738 rb7fd2a0 74 74 * @return Error code of the conversion or EOK on success. 75 75 */ 76 static int logger_message(async_sess_t *session, log_t log, log_level_t level, char *message)76 static errno_t logger_message(async_sess_t *session, log_t log, log_level_t level, char *message) 77 77 { 78 78 async_exch_t *exchange = async_exchange_begin(session); … … 88 88 aid_t reg_msg = async_send_2(exchange, LOGGER_WRITER_MESSAGE, 89 89 log, level, NULL); 90 int rc = async_data_write_start(exchange, message, str_size(message));91 int reg_msg_rc;90 errno_t rc = async_data_write_start(exchange, message, str_size(message)); 91 errno_t reg_msg_rc; 92 92 async_wait_for(reg_msg, ®_msg_rc); 93 93 … … 127 127 * @return Error code of the conversion or EOK on success. 128 128 */ 129 int log_level_from_str(const char *name, log_level_t *level_out)129 errno_t log_level_from_str(const char *name, log_level_t *level_out) 130 130 { 131 131 log_level_t level = LVL_FATAL; … … 160 160 * @param prog_name Program name, will be printed as part of message 161 161 */ 162 int log_init(const char *prog_name)162 errno_t log_init(const char *prog_name) 163 163 { 164 164 log_prog_name = str_dup(prog_name); … … 198 198 aid_t reg_msg = async_send_1(exchange, LOGGER_WRITER_CREATE_LOG, 199 199 parent, &answer); 200 int rc = async_data_write_start(exchange, name, str_size(name));201 int reg_msg_rc;200 errno_t rc = async_data_write_start(exchange, name, str_size(name)); 201 errno_t reg_msg_rc; 202 202 async_wait_for(reg_msg, ®_msg_rc); 203 203 -
uspace/lib/c/generic/io/logctl.c
r36f0738 rb7fd2a0 43 43 static async_sess_t *logger_session = NULL; 44 44 45 static int start_logger_exchange(async_exch_t **exchange_out)45 static errno_t start_logger_exchange(async_exch_t **exchange_out) 46 46 { 47 47 assert(exchange_out != NULL); … … 78 78 * @return Error code of the conversion or EOK on success. 79 79 */ 80 int logctl_set_default_level(log_level_t new_level)80 errno_t logctl_set_default_level(log_level_t new_level) 81 81 { 82 82 async_exch_t *exchange = NULL; 83 int rc = start_logger_exchange(&exchange);83 errno_t rc = start_logger_exchange(&exchange); 84 84 if (rc != EOK) 85 85 return rc; 86 86 87 rc = ( int) async_req_1_0(exchange,87 rc = (errno_t) async_req_1_0(exchange, 88 88 LOGGER_CONTROL_SET_DEFAULT_LEVEL, new_level); 89 89 … … 101 101 * @return Error code of the conversion or EOK on success. 102 102 */ 103 int logctl_set_log_level(const char *logname, log_level_t new_level)103 errno_t logctl_set_log_level(const char *logname, log_level_t new_level) 104 104 { 105 105 async_exch_t *exchange = NULL; 106 int rc = start_logger_exchange(&exchange);106 errno_t rc = start_logger_exchange(&exchange); 107 107 if (rc != EOK) 108 108 return rc; … … 111 111 new_level, NULL); 112 112 rc = async_data_write_start(exchange, logname, str_size(logname)); 113 int reg_msg_rc;113 errno_t reg_msg_rc; 114 114 async_wait_for(reg_msg, ®_msg_rc); 115 115 … … 119 119 return rc; 120 120 121 return ( int) reg_msg_rc;121 return (errno_t) reg_msg_rc; 122 122 } 123 123 … … 126 126 * @return Error code or EOK on success. 127 127 */ 128 int logctl_set_root(void)128 errno_t logctl_set_root(void) 129 129 { 130 130 async_exch_t *exchange = NULL; 131 int rc = start_logger_exchange(&exchange);131 errno_t rc = start_logger_exchange(&exchange); 132 132 if (rc != EOK) 133 133 return rc; … … 137 137 rc = vfs_pass_handle(vfs_exch, vfs_root(), exchange); 138 138 vfs_exchange_end(vfs_exch); 139 int reg_msg_rc;139 errno_t reg_msg_rc; 140 140 async_wait_for(reg_msg, ®_msg_rc); 141 141 … … 145 145 return rc; 146 146 147 return ( int) reg_msg_rc;147 return (errno_t) reg_msg_rc; 148 148 } 149 149 -
uspace/lib/c/generic/io/output.c
r36f0738 rb7fd2a0 40 40 #include <io/output.h> 41 41 42 int output_yield(async_sess_t *sess)42 errno_t output_yield(async_sess_t *sess) 43 43 { 44 44 async_exch_t *exch = async_exchange_begin(sess); 45 int ret = async_req_0_0(exch, OUTPUT_YIELD);45 errno_t ret = async_req_0_0(exch, OUTPUT_YIELD); 46 46 async_exchange_end(exch); 47 47 … … 49 49 } 50 50 51 int output_claim(async_sess_t *sess)51 errno_t output_claim(async_sess_t *sess) 52 52 { 53 53 async_exch_t *exch = async_exchange_begin(sess); 54 int ret = async_req_0_0(exch, OUTPUT_CLAIM);54 errno_t ret = async_req_0_0(exch, OUTPUT_CLAIM); 55 55 async_exchange_end(exch); 56 56 … … 58 58 } 59 59 60 int output_get_dimensions(async_sess_t *sess, sysarg_t *maxx, sysarg_t *maxy)60 errno_t output_get_dimensions(async_sess_t *sess, sysarg_t *maxx, sysarg_t *maxy) 61 61 { 62 62 async_exch_t *exch = async_exchange_begin(sess); 63 int ret = async_req_0_2(exch, OUTPUT_GET_DIMENSIONS, maxx, maxy);63 errno_t ret = async_req_0_2(exch, OUTPUT_GET_DIMENSIONS, maxx, maxy); 64 64 async_exchange_end(exch); 65 65 … … 67 67 } 68 68 69 int output_get_caps(async_sess_t *sess, console_caps_t *ccaps)69 errno_t output_get_caps(async_sess_t *sess, console_caps_t *ccaps) 70 70 { 71 71 async_exch_t *exch = async_exchange_begin(sess); 72 72 73 73 sysarg_t rv; 74 int ret = async_req_0_1(exch, OUTPUT_GET_CAPS, &rv);74 errno_t ret = async_req_0_1(exch, OUTPUT_GET_CAPS, &rv); 75 75 76 76 async_exchange_end(exch); … … 89 89 ipc_call_t answer; 90 90 aid_t req = async_send_0(exch, OUTPUT_FRONTBUF_CREATE, &answer); 91 int rc = async_share_out_start(exch, frontbuf, AS_AREA_READ91 errno_t rc = async_share_out_start(exch, frontbuf, AS_AREA_READ 92 92 | AS_AREA_WRITE | AS_AREA_CACHEABLE); 93 93 94 94 async_exchange_end(exch); 95 95 96 int ret;96 errno_t ret; 97 97 async_wait_for(req, &ret); 98 98 … … 103 103 } 104 104 105 int output_set_style(async_sess_t *sess, console_style_t style)105 errno_t output_set_style(async_sess_t *sess, console_style_t style) 106 106 { 107 107 async_exch_t *exch = async_exchange_begin(sess); 108 int ret = async_req_1_0(exch, OUTPUT_SET_STYLE, style);108 errno_t ret = async_req_1_0(exch, OUTPUT_SET_STYLE, style); 109 109 async_exchange_end(exch); 110 110 … … 112 112 } 113 113 114 int output_cursor_update(async_sess_t *sess, frontbuf_handle_t frontbuf)114 errno_t output_cursor_update(async_sess_t *sess, frontbuf_handle_t frontbuf) 115 115 { 116 116 async_exch_t *exch = async_exchange_begin(sess); 117 int ret = async_req_1_0(exch, OUTPUT_CURSOR_UPDATE, frontbuf);117 errno_t ret = async_req_1_0(exch, OUTPUT_CURSOR_UPDATE, frontbuf); 118 118 async_exchange_end(exch); 119 119 … … 121 121 } 122 122 123 int output_update(async_sess_t *sess, frontbuf_handle_t frontbuf)123 errno_t output_update(async_sess_t *sess, frontbuf_handle_t frontbuf) 124 124 { 125 125 async_exch_t *exch = async_exchange_begin(sess); 126 int ret = async_req_1_0(exch, OUTPUT_UPDATE, frontbuf);126 errno_t ret = async_req_1_0(exch, OUTPUT_UPDATE, frontbuf); 127 127 async_exchange_end(exch); 128 128 … … 130 130 } 131 131 132 int output_damage(async_sess_t *sess, frontbuf_handle_t frontbuf, sysarg_t col,132 errno_t output_damage(async_sess_t *sess, frontbuf_handle_t frontbuf, sysarg_t col, 133 133 sysarg_t row, sysarg_t cols, sysarg_t rows) 134 134 { 135 135 async_exch_t *exch = async_exchange_begin(sess); 136 int ret = async_req_5_0(exch, OUTPUT_DAMAGE, frontbuf, col, row,136 errno_t ret = async_req_5_0(exch, OUTPUT_DAMAGE, frontbuf, col, row, 137 137 cols, rows); 138 138 async_exchange_end(exch); -
uspace/lib/c/generic/io/serial.c
r36f0738 rb7fd2a0 41 41 * @return EOK on success, ENOMEM if out of memory, EIO on I/O error 42 42 */ 43 int serial_open(async_sess_t *sess, serial_t **rserial)43 errno_t serial_open(async_sess_t *sess, serial_t **rserial) 44 44 { 45 45 serial_t *serial; … … 68 68 69 69 /** Set serial port communication properties. */ 70 int serial_set_comm_props(serial_t *serial, unsigned rate,70 errno_t serial_set_comm_props(serial_t *serial, unsigned rate, 71 71 serial_parity_t parity, unsigned datab, unsigned stopb) 72 72 { 73 73 async_exch_t *exch = async_exchange_begin(serial->sess); 74 74 75 int rc = async_req_4_0(exch, SERIAL_SET_COM_PROPS, rate, parity,75 errno_t rc = async_req_4_0(exch, SERIAL_SET_COM_PROPS, rate, parity, 76 76 datab, stopb); 77 77 … … 81 81 82 82 /** Get serial port communication properties. */ 83 int serial_get_comm_props(serial_t *serial, unsigned *rrate,83 errno_t serial_get_comm_props(serial_t *serial, unsigned *rrate, 84 84 serial_parity_t *rparity, unsigned *rdatab, unsigned *rstopb) 85 85 { … … 87 87 sysarg_t rate, parity, datab, stopb; 88 88 89 int rc = async_req_0_4(exch, SERIAL_GET_COM_PROPS, &rate, &parity,89 errno_t rc = async_req_0_4(exch, SERIAL_GET_COM_PROPS, &rate, &parity, 90 90 &datab, &stopb); 91 91 -
uspace/lib/c/generic/io/table.c
r36f0738 rb7fd2a0 51 51 * @return EOK on success, ENOMEM if out of memory 52 52 */ 53 static int table_add_row(table_t *table, table_row_t **rrow)53 static errno_t table_add_row(table_t *table, table_row_t **rrow) 54 54 { 55 55 table_row_t *row; … … 74 74 * @return EOK on success, ENOMEM if out of memory 75 75 */ 76 static int table_row_add_cell(table_row_t *row, table_cell_t **rcell)76 static errno_t table_row_add_cell(table_row_t *row, table_cell_t **rcell) 77 77 { 78 78 table_cell_t *cell; … … 99 99 * @return EOK on success, ENOMEM if out of memory 100 100 */ 101 static int table_add_column(table_t *table, table_column_t **rcolumn)101 static errno_t table_add_column(table_t *table, table_column_t **rcolumn) 102 102 { 103 103 table_column_t *column; … … 121 121 * @return EOK on success, ENOMEM if out of memory 122 122 */ 123 static int table_write_next_cell(table_t *table)124 { 125 int rc;123 static errno_t table_write_next_cell(table_t *table) 124 { 125 errno_t rc; 126 126 127 127 rc = table_row_add_cell(table->wrow, &table->wcell); … … 155 155 * @return EOK on success, ENOMEM if out of memory 156 156 */ 157 static int table_write_next_row(table_t *table)158 { 159 int rc;157 static errno_t table_write_next_row(table_t *table) 158 { 159 errno_t rc; 160 160 161 161 rc = table_add_row(table, &table->wrow); … … 272 272 * @return EOK on success, ENOMEM if out of memory 273 273 */ 274 static int table_cell_extend(table_cell_t *cell, const char *str, size_t len)274 static errno_t table_cell_extend(table_cell_t *cell, const char *str, size_t len) 275 275 { 276 276 char *cstr; … … 298 298 * @return EOK on success, ENOMEM if out of memory 299 299 */ 300 int table_create(table_t **rtable)300 errno_t table_create(table_t **rtable) 301 301 { 302 302 table_t *table; 303 int rc;303 errno_t rc; 304 304 305 305 table = calloc(1, sizeof(table_t)); … … 377 377 * @return EOK on success, EIO on I/O error 378 378 */ 379 int table_print_out(table_t *table, FILE *f)379 errno_t table_print_out(table_t *table, FILE *f) 380 380 { 381 381 table_row_t *row; … … 474 474 * @return EOK on success, ENOMEM if out of memory 475 475 */ 476 int table_printf(table_t *table, const char *fmt, ...)476 errno_t table_printf(table_t *table, const char *fmt, ...) 477 477 { 478 478 va_list args; 479 int rc;479 errno_t rc; 480 480 int ret; 481 481 char *str; … … 548 548 * @return EOK if no error indicated, non-zero error code otherwise 549 549 */ 550 int table_get_error(table_t *table)550 errno_t table_get_error(table_t *table) 551 551 { 552 552 return table->error; -
uspace/lib/c/generic/io/visualizer.c
r36f0738 rb7fd2a0 39 39 #include <io/visualizer.h> 40 40 41 int visualizer_claim(async_sess_t *sess, sysarg_t notif_callback_id)42 { 43 async_exch_t *exch = async_exchange_begin(sess); 44 int ret = async_req_1_0(exch, VISUALIZER_CLAIM, notif_callback_id);45 async_exchange_end(exch); 46 47 return ret; 48 } 49 50 int visualizer_yield(async_sess_t *sess)51 { 52 async_exch_t *exch = async_exchange_begin(sess); 53 int ret = async_req_0_0(exch, VISUALIZER_YIELD);54 async_exchange_end(exch); 55 56 return ret; 57 } 58 59 int visualizer_enumerate_modes(async_sess_t *sess, vslmode_t *mode, sysarg_t nth)41 errno_t visualizer_claim(async_sess_t *sess, sysarg_t notif_callback_id) 42 { 43 async_exch_t *exch = async_exchange_begin(sess); 44 errno_t ret = async_req_1_0(exch, VISUALIZER_CLAIM, notif_callback_id); 45 async_exchange_end(exch); 46 47 return ret; 48 } 49 50 errno_t visualizer_yield(async_sess_t *sess) 51 { 52 async_exch_t *exch = async_exchange_begin(sess); 53 errno_t ret = async_req_0_0(exch, VISUALIZER_YIELD); 54 async_exchange_end(exch); 55 56 return ret; 57 } 58 59 errno_t visualizer_enumerate_modes(async_sess_t *sess, vslmode_t *mode, sysarg_t nth) 60 60 { 61 61 async_exch_t *exch = async_exchange_begin(sess); … … 64 64 aid_t req = async_send_1(exch, VISUALIZER_ENUMERATE_MODES, nth, &answer); 65 65 66 int rc = async_data_read_start(exch, mode, sizeof(vslmode_t));67 68 async_exchange_end(exch); 69 70 int ret;71 async_wait_for(req, &ret); 72 73 if (rc != EOK) { 74 return rc; 75 } else if (ret != EOK) { 76 return ret; 77 } else { 78 return EOK; 79 } 80 } 81 82 int visualizer_get_default_mode(async_sess_t *sess, vslmode_t *mode)66 errno_t rc = async_data_read_start(exch, mode, sizeof(vslmode_t)); 67 68 async_exchange_end(exch); 69 70 errno_t ret; 71 async_wait_for(req, &ret); 72 73 if (rc != EOK) { 74 return rc; 75 } else if (ret != EOK) { 76 return ret; 77 } else { 78 return EOK; 79 } 80 } 81 82 errno_t visualizer_get_default_mode(async_sess_t *sess, vslmode_t *mode) 83 83 { 84 84 async_exch_t *exch = async_exchange_begin(sess); … … 87 87 aid_t req = async_send_0(exch, VISUALIZER_GET_DEFAULT_MODE, &answer); 88 88 89 int rc = async_data_read_start(exch, mode, sizeof(vslmode_t));90 91 async_exchange_end(exch); 92 93 int ret;94 async_wait_for(req, &ret); 95 96 if (rc != EOK) { 97 return rc; 98 } else if (ret != EOK) { 99 return ret; 100 } else { 101 return EOK; 102 } 103 } 104 105 int visualizer_get_current_mode(async_sess_t *sess, vslmode_t *mode)89 errno_t rc = async_data_read_start(exch, mode, sizeof(vslmode_t)); 90 91 async_exchange_end(exch); 92 93 errno_t ret; 94 async_wait_for(req, &ret); 95 96 if (rc != EOK) { 97 return rc; 98 } else if (ret != EOK) { 99 return ret; 100 } else { 101 return EOK; 102 } 103 } 104 105 errno_t visualizer_get_current_mode(async_sess_t *sess, vslmode_t *mode) 106 106 { 107 107 async_exch_t *exch = async_exchange_begin(sess); … … 110 110 aid_t req = async_send_0(exch, VISUALIZER_GET_CURRENT_MODE, &answer); 111 111 112 int rc = async_data_read_start(exch, mode, sizeof(vslmode_t));113 114 async_exchange_end(exch); 115 116 int ret;117 async_wait_for(req, &ret); 118 119 if (rc != EOK) { 120 return rc; 121 } else if (ret != EOK) { 122 return ret; 123 } else { 124 return EOK; 125 } 126 } 127 128 int visualizer_get_mode(async_sess_t *sess, vslmode_t *mode, sysarg_t index)112 errno_t rc = async_data_read_start(exch, mode, sizeof(vslmode_t)); 113 114 async_exchange_end(exch); 115 116 errno_t ret; 117 async_wait_for(req, &ret); 118 119 if (rc != EOK) { 120 return rc; 121 } else if (ret != EOK) { 122 return ret; 123 } else { 124 return EOK; 125 } 126 } 127 128 errno_t visualizer_get_mode(async_sess_t *sess, vslmode_t *mode, sysarg_t index) 129 129 { 130 130 async_exch_t *exch = async_exchange_begin(sess); … … 133 133 aid_t req = async_send_1(exch, VISUALIZER_GET_MODE, index, &answer); 134 134 135 int rc = async_data_read_start(exch, mode, sizeof(vslmode_t));136 137 async_exchange_end(exch); 138 139 int ret;140 async_wait_for(req, &ret); 141 142 if (rc != EOK) { 143 return rc; 144 } else if (ret != EOK) { 145 return ret; 146 } else { 147 return EOK; 148 } 149 } 150 151 int visualizer_set_mode(async_sess_t *sess, sysarg_t index, sysarg_t version, void *cells)135 errno_t rc = async_data_read_start(exch, mode, sizeof(vslmode_t)); 136 137 async_exchange_end(exch); 138 139 errno_t ret; 140 async_wait_for(req, &ret); 141 142 if (rc != EOK) { 143 return rc; 144 } else if (ret != EOK) { 145 return ret; 146 } else { 147 return EOK; 148 } 149 } 150 151 errno_t visualizer_set_mode(async_sess_t *sess, sysarg_t index, sysarg_t version, void *cells) 152 152 { 153 153 async_exch_t *exch = async_exchange_begin(sess); … … 156 156 aid_t req = async_send_2(exch, VISUALIZER_SET_MODE, index, version, &answer); 157 157 158 int rc = async_share_out_start(exch, cells, AS_AREA_READ | AS_AREA_CACHEABLE);159 160 async_exchange_end(exch); 161 162 int ret;163 async_wait_for(req, &ret); 164 165 if (rc != EOK) { 166 return rc; 167 } else if (ret != EOK) { 168 return ret; 169 } else { 170 return EOK; 171 } 172 } 173 174 int visualizer_update_damaged_region(async_sess_t *sess,158 errno_t rc = async_share_out_start(exch, cells, AS_AREA_READ | AS_AREA_CACHEABLE); 159 160 async_exchange_end(exch); 161 162 errno_t ret; 163 async_wait_for(req, &ret); 164 165 if (rc != EOK) { 166 return rc; 167 } else if (ret != EOK) { 168 return ret; 169 } else { 170 return EOK; 171 } 172 } 173 174 errno_t visualizer_update_damaged_region(async_sess_t *sess, 175 175 sysarg_t x, sysarg_t y, sysarg_t width, sysarg_t height, 176 176 sysarg_t x_offset, sysarg_t y_offset) … … 182 182 183 183 async_exch_t *exch = async_exchange_begin(sess); 184 int ret = async_req_5_0(exch, VISUALIZER_UPDATE_DAMAGED_REGION,184 errno_t ret = async_req_5_0(exch, VISUALIZER_UPDATE_DAMAGED_REGION, 185 185 x, y, width, height, offsets); 186 186 async_exchange_end(exch); … … 189 189 } 190 190 191 int visualizer_suspend(async_sess_t *sess)192 { 193 async_exch_t *exch = async_exchange_begin(sess); 194 int ret = async_req_0_0(exch, VISUALIZER_SUSPEND);195 async_exchange_end(exch); 196 197 return ret; 198 } 199 200 int visualizer_wakeup(async_sess_t *sess)201 { 202 async_exch_t *exch = async_exchange_begin(sess); 203 int ret = async_req_0_0(exch, VISUALIZER_WAKE_UP);191 errno_t visualizer_suspend(async_sess_t *sess) 192 { 193 async_exch_t *exch = async_exchange_begin(sess); 194 errno_t ret = async_req_0_0(exch, VISUALIZER_SUSPEND); 195 async_exchange_end(exch); 196 197 return ret; 198 } 199 200 errno_t visualizer_wakeup(async_sess_t *sess) 201 { 202 async_exch_t *exch = async_exchange_begin(sess); 203 errno_t ret = async_req_0_0(exch, VISUALIZER_WAKE_UP); 204 204 async_exchange_end(exch); 205 205 -
uspace/lib/c/generic/io/window.c
r36f0738 rb7fd2a0 40 40 #include <stdio.h> 41 41 42 int win_register(async_sess_t *sess, window_flags_t flags, service_id_t *in,42 errno_t win_register(async_sess_t *sess, window_flags_t flags, service_id_t *in, 43 43 service_id_t *out) 44 44 { 45 45 async_exch_t *exch = async_exchange_begin(sess); 46 int ret = async_req_1_2(exch, WINDOW_REGISTER, flags, in, out);46 errno_t ret = async_req_1_2(exch, WINDOW_REGISTER, flags, in, out); 47 47 async_exchange_end(exch); 48 48 … … 50 50 } 51 51 52 int win_get_event(async_sess_t *sess, window_event_t *event)52 errno_t win_get_event(async_sess_t *sess, window_event_t *event) 53 53 { 54 54 async_exch_t *exch = async_exchange_begin(sess); … … 57 57 aid_t req = async_send_0(exch, WINDOW_GET_EVENT, &answer); 58 58 59 int rc = async_data_read_start(exch, event, sizeof(window_event_t));59 errno_t rc = async_data_read_start(exch, event, sizeof(window_event_t)); 60 60 61 61 async_exchange_end(exch); 62 62 63 int ret;63 errno_t ret; 64 64 async_wait_for(req, &ret); 65 65 … … 73 73 } 74 74 75 int win_damage(async_sess_t *sess,75 errno_t win_damage(async_sess_t *sess, 76 76 sysarg_t x, sysarg_t y, sysarg_t width, sysarg_t height) 77 77 { 78 78 async_exch_t *exch = async_exchange_begin(sess); 79 int ret = async_req_4_0(exch, WINDOW_DAMAGE, x, y, width, height);79 errno_t ret = async_req_4_0(exch, WINDOW_DAMAGE, x, y, width, height); 80 80 async_exchange_end(exch); 81 81 … … 83 83 } 84 84 85 int win_grab(async_sess_t *sess, sysarg_t pos_id, sysarg_t grab_flags)85 errno_t win_grab(async_sess_t *sess, sysarg_t pos_id, sysarg_t grab_flags) 86 86 { 87 87 async_exch_t *exch = async_exchange_begin(sess); 88 int ret = async_req_2_0(exch, WINDOW_GRAB, pos_id, grab_flags);88 errno_t ret = async_req_2_0(exch, WINDOW_GRAB, pos_id, grab_flags); 89 89 async_exchange_end(exch); 90 90 … … 92 92 } 93 93 94 int win_resize(async_sess_t *sess, sysarg_t x, sysarg_t y, sysarg_t width,94 errno_t win_resize(async_sess_t *sess, sysarg_t x, sysarg_t y, sysarg_t width, 95 95 sysarg_t height, window_placement_flags_t placement_flags, void *cells) 96 96 { … … 101 101 (sysarg_t) placement_flags, &answer); 102 102 103 int rc = async_share_out_start(exch, cells, AS_AREA_READ | AS_AREA_CACHEABLE);103 errno_t rc = async_share_out_start(exch, cells, AS_AREA_READ | AS_AREA_CACHEABLE); 104 104 105 105 async_exchange_end(exch); 106 106 107 int ret;107 errno_t ret; 108 108 async_wait_for(req, &ret); 109 109 … … 116 116 } 117 117 118 int win_close(async_sess_t *sess)118 errno_t win_close(async_sess_t *sess) 119 119 { 120 120 async_exch_t *exch = async_exchange_begin(sess); 121 int ret = async_req_0_0(exch, WINDOW_CLOSE);121 errno_t ret = async_req_0_0(exch, WINDOW_CLOSE); 122 122 async_exchange_end(exch); 123 123 … … 125 125 } 126 126 127 int win_close_request(async_sess_t *sess)127 errno_t win_close_request(async_sess_t *sess) 128 128 { 129 129 async_exch_t *exch = async_exchange_begin(sess); 130 int ret = async_req_0_0(exch, WINDOW_CLOSE_REQUEST);130 errno_t ret = async_req_0_0(exch, WINDOW_CLOSE_REQUEST); 131 131 async_exchange_end(exch); 132 132
Note:
See TracChangeset
for help on using the changeset viewer.
