X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=blobdiff_plain;f=examples%2Fosltar%2Fosltar.c;h=d59909ffed677550384acb71104212250258d64f;hp=0b2263a072206a09b7c7a183a5bc3388b3a7931b;hb=188bc1b06879b7fcd56c599e20db0ac87a0da4e3;hpb=e7a4c2cc4b391e0e30ea8f4cd8c2ba4614248550 diff --git a/examples/osltar/osltar.c b/examples/osltar/osltar.c index 0b2263a..d59909f 100644 --- a/examples/osltar/osltar.c +++ b/examples/osltar/osltar.c @@ -1,12 +1,12 @@ /* - * Copyright (C) 2009 Andre Noll + * Copyright (C) 2009 Andre Noll * * 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,37 @@ #include #include +/** 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)