summaryrefslogtreecommitdiffstats
path: root/libsmartcols/src/table_print.c
diff options
context:
space:
mode:
authorOndrej Oprala2014-03-25 15:09:09 +0100
committerKarel Zak2014-04-03 12:29:18 +0200
commit1d90bcb1a82cea0c994425cb12e2df436107168c (patch)
tree50488666c5d8299eea69136ab7c987d5d32c36ac /libsmartcols/src/table_print.c
parentlibsmartcols: move some code around (diff)
downloadkernel-qcow2-util-linux-1d90bcb1a82cea0c994425cb12e2df436107168c.tar.gz
kernel-qcow2-util-linux-1d90bcb1a82cea0c994425cb12e2df436107168c.tar.xz
kernel-qcow2-util-linux-1d90bcb1a82cea0c994425cb12e2df436107168c.zip
libsmartcols: documentation
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Diffstat (limited to 'libsmartcols/src/table_print.c')
-rw-r--r--libsmartcols/src/table_print.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libsmartcols/src/table_print.c b/libsmartcols/src/table_print.c
index 9851be0e3..095034071 100644
--- a/libsmartcols/src/table_print.c
+++ b/libsmartcols/src/table_print.c
@@ -535,9 +535,12 @@ static size_t strlen_line(struct libscols_line *ln)
}
/*
+ * scols_print_table:
* @tb: table
*
* Prints the table to the output stream.
+ *
+ * Returns: 0, a negative value in case of an error.
*/
int scols_print_table(struct libscols_table *tb)
{
@@ -582,6 +585,15 @@ int scols_print_table(struct libscols_table *tb)
return 0;
}
+/*
+ * scols_print_table_to_string:
+ * @tb: table
+ * @data: pointer to the beginning of a memory area to print to
+ *
+ * Prints the table to @data.
+ *
+ * Returns: 0, a negative value in case of an error.
+ */
int scols_print_table_to_string(struct libscols_table *tb, char **data)
{
#ifdef HAVE_OPEN_MEMSTREAM
@@ -591,7 +603,7 @@ int scols_print_table_to_string(struct libscols_table *tb, char **data)
if (!tb)
return -EINVAL;
- /* create a streem for output */
+ /* create a stream for output */
stream = open_memstream(data, &sz);
if (!stream)
return -ENOMEM;