From 114488051fe7e637c43f83a0ff67f48e7a9a4439 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 26 Jul 2009 18:26:06 +0200 Subject: [PATCH] osltar: Minor cleanups. --- examples/osltar/osltar.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/examples/osltar/osltar.c b/examples/osltar/osltar.c index 0b2263a..3d3a640 100644 --- a/examples/osltar/osltar.c +++ b/examples/osltar/osltar.c @@ -4,9 +4,9 @@ * 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 @@ -23,28 +23,36 @@ #include #include +/** The columns of the osl table. */ enum osltar_columns { + /** File name. */ OTC_NAME, + /** File content. */ OTC_DATA, + /** two. */ 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. * - * 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; @@ -307,7 +315,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 +333,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) -- 2.30.2