]> git.tuebingen.mpg.de Git - osl.git/blobdiff - examples/osltar/osltar.c
Update URLs and email addresses.
[osl.git] / examples / osltar / osltar.c
index 0b2263a072206a09b7c7a183a5bc3388b3a7931b..d59909ffed677550384acb71104212250258d64f 100644 (file)
@@ -1,12 +1,12 @@
 /*
- * Copyright (C) 2009 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2009 Andre Noll <maan@tuebingen.mpg.de>
  *
  * 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 <sys/mman.h>
 #include <fcntl.h>
 
+/** The columns of the osl table. */
 enum osltar_columns {
+       /** File name. */
        OTC_NAME,
+       /** File content. */
        OTC_DATA,
+       /** two. */
        NUM_OT_COLUMNS
 };
 
+
+/**
+ * \cond We want doxygen to create documentation for certain static functions.
+ * So we use __static__ for such functions.
+ */
+#define __static__ static
+/** \endcond */
+
 /**
  * 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.
  */
-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;
@@ -212,7 +221,7 @@ static int com_create(int argc, char **argv)
 /**
  * Write the whole buffer to a file descriptor.
  */
-ssize_t write_all(int fd, const void *buf, size_t size)
+static ssize_t write_all(int fd, const void *buf, size_t size)
 {
        const char *b = buf;
        while (size) {
@@ -307,7 +316,7 @@ static int list_entry(struct osl_row *row, void *data)
        return 1;
 }
 
-int com_list(int argc, char **argv)
+static int com_list(int argc, char **argv)
 {
        int ret;
 
@@ -325,6 +334,12 @@ int com_list(int argc, char **argv)
        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)