]> git.tuebingen.mpg.de Git - osl.git/commitdiff
osltar: Minor cleanups.
authorAndre Noll <maan@systemlinux.org>
Sun, 26 Jul 2009 16:26:06 +0000 (18:26 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 26 Jul 2009 16:26:06 +0000 (18:26 +0200)
examples/osltar/osltar.c

index 0b2263a072206a09b7c7a183a5bc3388b3a7931b..3d3a6400a6425ed3ba4eddd624145af968b63edf 100644 (file)
@@ -4,9 +4,9 @@
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
-/*
- * A simple file archiver with many limitations. Do not use it. It is just an
- * example to illustrate programming with libosl.
+/**
+ * \file osltar.c A simple file archiver with many limitations. Do not use it.
+ * It is just an * example to illustrate programming with libosl.
  */
 
 #include <inttypes.h>
  */
 
 #include <inttypes.h>
 #include <sys/mman.h>
 #include <fcntl.h>
 
 #include <sys/mman.h>
 #include <fcntl.h>
 
+/** The columns of the osl table. */
 enum osltar_columns {
 enum osltar_columns {
+       /** File name. */
        OTC_NAME,
        OTC_NAME,
+       /** File content. */
        OTC_DATA,
        OTC_DATA,
+       /** two. */
        NUM_OT_COLUMNS
 };
 
        NUM_OT_COLUMNS
 };
 
+
+/**
+ * We want doxygen to create documentation for certain static functions. So we
+ * use __static__ for such functions.
+ */
+#define __static__ static
+
 /**
  * Compare two osl objects of string type.
  *
  * \param obj1 Pointer to the first object.
  * \param obj2 Pointer to the second object.
  *
 /**
  * Compare two osl objects of string type.
  *
  * \param obj1 Pointer to the first object.
  * \param obj2 Pointer to the second object.
  *
- * In any case, only \p MIN(obj1->size, obj2->size) characters of each string
- * are taken into account.
- *
  * \return It returns an integer less than, equal to, or greater than zero if
  * \a obj1 is found, respectively, to be less than, to match, or be greater than
  * obj2.
  *
  * \sa strcmp(3), strncmp(3), osl_compare_func.
  */
  * \return It returns an integer less than, equal to, or greater than zero if
  * \a obj1 is found, respectively, to be less than, to match, or be greater than
  * obj2.
  *
  * \sa strcmp(3), strncmp(3), osl_compare_func.
  */
-int string_compare(const struct osl_object *obj1, const struct osl_object *obj2)
+__static__ int string_compare(const struct osl_object *obj1, const struct osl_object *obj2)
 {
        const char *str1 = (const char *)obj1->data;
        const char *str2 = (const char *)obj2->data;
 {
        const char *str1 = (const char *)obj1->data;
        const char *str2 = (const char *)obj2->data;
@@ -307,7 +315,7 @@ static int list_entry(struct osl_row *row, void *data)
        return 1;
 }
 
        return 1;
 }
 
-int com_list(int argc, char **argv)
+static int com_list(int argc, char **argv)
 {
        int ret;
 
 {
        int ret;
 
@@ -325,6 +333,12 @@ int com_list(int argc, char **argv)
        return ret;
 }
 
        return ret;
 }
 
+/**
+ * The osltar main funcion.
+ *
+ * \param argc Usual argument count.
+ * \param argv Usual argument vector.
+ */
 int main(int argc, char **argv)
 {
        if (argc < 2)
 int main(int argc, char **argv)
 {
        if (argc < 2)