Ignore:
File:
1 edited

Legend:

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

    r11d9630 r1d6dd2a  
    4040#include <stdio.h>
    4141#include <stdlib.h>
     42#include <str.h>
    4243
    4344static table_column_t *table_column_first(table_t *);
     
    5152 * @return EOK on success, ENOMEM if out of memory
    5253 */
    53 static int table_add_row(table_t *table, table_row_t **rrow)
     54static errno_t table_add_row(table_t *table, table_row_t **rrow)
    5455{
    5556        table_row_t *row;
     
    7475 * @return EOK on success, ENOMEM if out of memory
    7576 */
    76 static int table_row_add_cell(table_row_t *row, table_cell_t **rcell)
     77static errno_t table_row_add_cell(table_row_t *row, table_cell_t **rcell)
    7778{
    7879        table_cell_t *cell;
     
    99100 * @return EOK on success, ENOMEM if out of memory
    100101 */
    101 static int table_add_column(table_t *table, table_column_t **rcolumn)
     102static errno_t table_add_column(table_t *table, table_column_t **rcolumn)
    102103{
    103104        table_column_t *column;
     
    121122 * @return EOK on success, ENOMEM if out of memory
    122123 */
    123 static int table_write_next_cell(table_t *table)
    124 {
    125         int rc;
     124static errno_t table_write_next_cell(table_t *table)
     125{
     126        errno_t rc;
    126127
    127128        rc = table_row_add_cell(table->wrow, &table->wcell);
     
    155156 * @return EOK on success, ENOMEM if out of memory
    156157 */
    157 static int table_write_next_row(table_t *table)
    158 {
    159         int rc;
     158static errno_t table_write_next_row(table_t *table)
     159{
     160        errno_t rc;
    160161
    161162        rc = table_add_row(table, &table->wrow);
     
    272273 * @return EOK on success, ENOMEM if out of memory
    273274 */
    274 static int table_cell_extend(table_cell_t *cell, const char *str, size_t len)
     275static errno_t table_cell_extend(table_cell_t *cell, const char *str, size_t len)
    275276{
    276277        char *cstr;
     
    298299 * @return EOK on success, ENOMEM if out of memory
    299300 */
    300 int table_create(table_t **rtable)
     301errno_t table_create(table_t **rtable)
    301302{
    302303        table_t *table;
    303         int rc;
     304        errno_t rc;
    304305
    305306        table = calloc(1, sizeof(table_t));
     
    377378 * @return EOK on success, EIO on I/O error
    378379 */
    379 int table_print_out(table_t *table, FILE *f)
     380errno_t table_print_out(table_t *table, FILE *f)
    380381{
    381382        table_row_t *row;
     
    474475 * @return EOK on success, ENOMEM if out of memory
    475476 */
    476 int table_printf(table_t *table, const char *fmt, ...)
     477errno_t table_printf(table_t *table, const char *fmt, ...)
    477478{
    478479        va_list args;
    479         int rc;
     480        errno_t rc;
     481        int ret;
    480482        char *str;
    481483        char *sp, *ep;
     
    486488
    487489        va_start(args, fmt);
    488         rc = vasprintf(&str, fmt, args);
     490        ret = vasprintf(&str, fmt, args);
    489491        va_end(args);
    490492
    491         if (rc < 0) {
     493        if (ret < 0) {
    492494                table->error = ENOMEM;
    493495                return table->error;
     
    547549 * @return EOK if no error indicated, non-zero error code otherwise
    548550 */
    549 int table_get_error(table_t *table)
     551errno_t table_get_error(table_t *table)
    550552{
    551553        return table->error;
Note: See TracChangeset for help on using the changeset viewer.