]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: improve docs
authorKarel Zak <kzak@redhat.com>
Mon, 7 Apr 2014 12:07:49 +0000 (14:07 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 7 Apr 2014 12:07:49 +0000 (14:07 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/docs/libsmartcols-docs.xml
libsmartcols/src/cell.c
libsmartcols/src/column.c
libsmartcols/src/init.c
libsmartcols/src/libsmartcols.h.in
libsmartcols/src/line.c
libsmartcols/src/table.c
libsmartcols/src/table_print.c

index a699fd07beb5f5177fc5c307229fcab2f669a4ef..6145ec3089c0dd20556c1ec9faccadc394e5754a 100644 (file)
@@ -42,6 +42,8 @@ available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
   <part>
     <title>Misc</title>
     <xi:include href="xml/iter.xml"/>
+    <xi:include href="xml/version.xml"/>
+    <xi:include href="xml/init.xml"/>
   </part>
   <index id="api-index-full">
     <title>API Index</title>
index 28e255786090d5533c262137b954df79c2789b44..491b8a15c0d62a5a4de35b2059b640788385f0cf 100644 (file)
@@ -13,7 +13,9 @@
  * @title: Cell
  * @short_description: cell API
  *
- * An API to access and modify per-cell data and information.
+ * An API to access and modify per-cell data and information. Note that cell is
+ * always part of the line. If you destroy (un-reference) a line than it
+ * destroys all line cells too.
  */
 
 
@@ -146,7 +148,7 @@ int scols_cell_set_color(struct libscols_cell *ce, const char *color)
 }
 
 /**
- * scols_cell_get_data:
+ * scols_cell_get_color:
  * @ce: a pointer to a struct libscols_cell instance
  *
  * Returns: the current color of @ce.
index 91e3655cb92edf33a224b5414c2fa1ce1ebec8b5..4ee782fb2485241edaaba13baaad40512ceb9699 100644 (file)
@@ -175,7 +175,7 @@ int scols_column_get_flags(struct libscols_column *cl)
 }
 
 /**
- * scols_column_get_flags:
+ * scols_column_get_header:
  * @cl: a pointer to a struct libscols_column instance
  *
  * Returns: A pointer to a struct libscols_cell instance, representing the
index 97e088059439caad09af2aa8faeacf6c638588ef..95b4610b77a468b8f90294ff349ce6c7ec840d47 100644 (file)
@@ -9,6 +9,8 @@
  * SECTION: init
  * @title: Library initialization
  * @short_description: initialize debugging
+ *
+ * The library debug stuff.
  */
 
 #include <stdarg.h>
index 579a28a7ea032704787815e0dc632b6afe5bc1ce..b3ceeeab96572e1a0254a7f92b183672fa49d619 100644 (file)
@@ -18,6 +18,11 @@ extern "C" {
 #include <stdio.h>
 #include <sys/types.h>
 
+/**
+ * LIBSMARTCOLS_VERSION:
+ *
+ * Library version string
+ */
 #define LIBSMARTCOLS_VERSION   "@LIBSMARTCOLS_VERSION@"
 
 /**
index 931cc08218399ec35821655f8706aea05a3c74b3..686a1194547a739362547043525307e1fa03c608 100644 (file)
@@ -106,7 +106,10 @@ void scols_line_free_cells(struct libscols_line *ln)
  * @ln: a pointer to a struct libscols_line instance
  * @n: the number of elements
  *
- * Allocates space for @n cells.
+ * Allocates space for @n cells. This function is optional,
+ * and libsmartcols automatically allocates necessary cells
+ * according to number of columns in the table when you add
+ * the line to the table. See scols_table_add_line().
  *
  * Returns: 0, a negative value in case of an error.
  */
@@ -369,7 +372,7 @@ int scols_line_set_data(struct libscols_line *ln, size_t n, const char *data)
 }
 
 /**
- * scols_line_set_data:
+ * scols_line_refer_data:
  * @ln: a pointer to a struct libscols_cell instance
  * @n: number of the cell which will refer to @data
  * @data: actual data to refer to
index 1fa7d05f01381592ff570ff70d94ecef85e9b382..914cc2ed9afcf15f00d4c72f4d5fccba1846586d 100644 (file)
@@ -9,11 +9,11 @@
  */
 
 /**
- * SECTION: table 
+ * SECTION: table
  * @title: Table
- * @short_description: table API
+ * @short_description: table data API
  *
- * Table manipulation API.
+ * Table data manipulation API.
  */
 
 
@@ -284,7 +284,7 @@ int scols_table_get_ncols(struct libscols_table *tb)
        return tb ? tb->ncols : -EINVAL;
 }
 
-/*
+/**
  * scols_table_get_nlines:
  * @tb: table
  *
index 6b846d49db6ebc74c2ff30ecb2e16da1546165a8..d25bd252dfaf0d2702f0e1a2ccb89f0d0473d0e6 100644 (file)
@@ -7,6 +7,14 @@
  * GNU Lesser General Public License.
  */
 
+/**
+ * SECTION: table_print
+ * @title: Table print
+ * @short_description: table print API
+ *
+ * Table output API.
+ */
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
@@ -534,7 +542,7 @@ static size_t strlen_line(struct libscols_line *ln)
        return sz;
 }
 
-/*
+/**
  * scols_print_table:
  * @tb: table
  *
@@ -588,7 +596,7 @@ 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