Changes in uspace/lib/c/generic/io/table.c [11d9630:1d6dd2a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/table.c
r11d9630 r1d6dd2a 40 40 #include <stdio.h> 41 41 #include <stdlib.h> 42 #include <str.h> 42 43 43 44 static table_column_t *table_column_first(table_t *); … … 51 52 * @return EOK on success, ENOMEM if out of memory 52 53 */ 53 static int table_add_row(table_t *table, table_row_t **rrow)54 static errno_t table_add_row(table_t *table, table_row_t **rrow) 54 55 { 55 56 table_row_t *row; … … 74 75 * @return EOK on success, ENOMEM if out of memory 75 76 */ 76 static int table_row_add_cell(table_row_t *row, table_cell_t **rcell)77 static errno_t table_row_add_cell(table_row_t *row, table_cell_t **rcell) 77 78 { 78 79 table_cell_t *cell; … … 99 100 * @return EOK on success, ENOMEM if out of memory 100 101 */ 101 static int table_add_column(table_t *table, table_column_t **rcolumn)102 static errno_t table_add_column(table_t *table, table_column_t **rcolumn) 102 103 { 103 104 table_column_t *column; … … 121 122 * @return EOK on success, ENOMEM if out of memory 122 123 */ 123 static int table_write_next_cell(table_t *table)124 { 125 int rc;124 static errno_t table_write_next_cell(table_t *table) 125 { 126 errno_t rc; 126 127 127 128 rc = table_row_add_cell(table->wrow, &table->wcell); … … 155 156 * @return EOK on success, ENOMEM if out of memory 156 157 */ 157 static int table_write_next_row(table_t *table)158 { 159 int rc;158 static errno_t table_write_next_row(table_t *table) 159 { 160 errno_t rc; 160 161 161 162 rc = table_add_row(table, &table->wrow); … … 272 273 * @return EOK on success, ENOMEM if out of memory 273 274 */ 274 static int table_cell_extend(table_cell_t *cell, const char *str, size_t len)275 static errno_t table_cell_extend(table_cell_t *cell, const char *str, size_t len) 275 276 { 276 277 char *cstr; … … 298 299 * @return EOK on success, ENOMEM if out of memory 299 300 */ 300 int table_create(table_t **rtable)301 errno_t table_create(table_t **rtable) 301 302 { 302 303 table_t *table; 303 int rc;304 errno_t rc; 304 305 305 306 table = calloc(1, sizeof(table_t)); … … 377 378 * @return EOK on success, EIO on I/O error 378 379 */ 379 int table_print_out(table_t *table, FILE *f)380 errno_t table_print_out(table_t *table, FILE *f) 380 381 { 381 382 table_row_t *row; … … 474 475 * @return EOK on success, ENOMEM if out of memory 475 476 */ 476 int table_printf(table_t *table, const char *fmt, ...)477 errno_t table_printf(table_t *table, const char *fmt, ...) 477 478 { 478 479 va_list args; 479 int rc; 480 errno_t rc; 481 int ret; 480 482 char *str; 481 483 char *sp, *ep; … … 486 488 487 489 va_start(args, fmt); 488 r c= vasprintf(&str, fmt, args);490 ret = vasprintf(&str, fmt, args); 489 491 va_end(args); 490 492 491 if (r c< 0) {493 if (ret < 0) { 492 494 table->error = ENOMEM; 493 495 return table->error; … … 547 549 * @return EOK if no error indicated, non-zero error code otherwise 548 550 */ 549 int table_get_error(table_t *table)551 errno_t table_get_error(table_t *table) 550 552 { 551 553 return table->error;
Note:
See TracChangeset
for help on using the changeset viewer.