]> git.tuebingen.mpg.de Git - osl.git/commitdiff
web: Convert QUICK_START to markdown syntax.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 15 Jun 2020 17:16:50 +0000 (19:16 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 22 Sep 2020 19:28:31 +0000 (21:28 +0200)
This file is rather simple and we don't need doxygen to convert it
to html. After this, the quick start document becomes part of the
main page.

Although this patch modifies almost every line of QUICK_START, the
changes to the actual contents have been kept to a minimum.

Makefile
QUICK_START
web/Doxyfile
web/header.html
web/index.html.in

index bdf78a2728ab67eb4a7a6096f46132663570437f..bc0d6ed7cd4fc9e9ed71f05461ccd8fc06170615 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -150,12 +150,14 @@ www: web/index.html web/osl.png web/doxygen/index.html
 web/osl.png: web/osl.pdf Makefile
        convert -scale 200x200 $< $@
 
-web/index.html: oslfsck.1 web/index.html.in INSTALL README
+web/index.html: oslfsck.1 web/index.html.in INSTALL README QUICK_START
        sed -e '/@README@/,$$d' web/index.html.in > $@
        markdown < README >> $@
        sed -e '1,/@README@/d' -e '/@INSTALL@/,$$d' web/index.html.in >> $@
        markdown < INSTALL >> $@
-       sed -e '1,/@INSTALL@/d' -e '/@MAN_PAGE@/,$$d' web/index.html.in >> $@
+       sed -e '1,/@INSTALL@/d' -e '/@QUICK_START@/,$$d' web/index.html.in >> $@
+       markdown < QUICK_START >> $@
+       sed -e '1,/@QUICK_START@/d' -e '/@MAN_PAGE@/,$$d' web/index.html.in >> $@
        groff -m man -Thtml -P -l oslfsck.1 | sed -e '1,/^<body>/d; /^<\/body>/,$$d' >> $@
        sed -e '1,/@MAN_PAGE@/d' web/index.html.in >> $@
 
index cbb55a16d48ddca55af22449e6f326a0252d8b41..39666ab85a0e710619b407e888e6cfa77ab38c6c 100644 (file)
-/** \mainpage OSL Quick start
-
 This document describes the steps which have to be performed in order
 to create and use an osl table. The code sniplets in this section
-are taken from the file \ref osltar.c in the source distribution.
+are taken from the file `osltar.c` in the source distribution.
 
-The complete API reference is contained in the file \ref osl.h.
+The complete API reference is contained in the file `osl.h.`
 
-Define an enum that assigns descriptive names to the columns
+Define an enum that assigns descriptive names to the columns
 of your table. Example:
 
-\verbatim
-
-enum osltar_columns {
-       OTC_NAME,
-       OTC_DATA,
-       NUM_OT_COLUMNS
-};
-
-\endverbatim
-
-The last element is is useful because the number of columns
-of your table must be specified later, see below.
-
-- Define an array of struct osl_column_description, one
-array member per column:
-
-\verbatim
-
-struct osl_column_description tar_table_cols[] = {
-       [OTC_NAME] = {
-               .storage_type = OSL_MAPPED_STORAGE,
-               .storage_flags = OSL_RBTREE | OSL_UNIQUE,
-               .name = "filename",
-               .compare_function = string_compare,
-       },
-       [OTC_DATA] = {
-               .storage_type = OSL_MAPPED_STORAGE,
-               .name = "data",
-       },
-};
-
-\endverbatim
-
-Three different storage types are available which may be
-selected on a per-column basis: \ref OSL_DISK_STORAGE, \ref
-OSL_MAPPED_STORAGE, and \ref OSL_NO_STORAGE.
-
-For columns of type OSL_MAPPED_STORAGE and OSL_NO_STORAGE an optional
-rbtree is maintained by the osl library which allows to quickly lookup
-rows by cell content. Whether or not an rbtree should be used must be
-specified in the storage_flags field which should contain the bitwise
-or of suitable \ref osl_storage_flags.
-
-If a column has an associated rbtree, i.e. if the OSL_RBTREE flag
-is set in the storage flags for the column, the compare_function
-field must be initialized to point to a function of type \ref
-osl_compare_func. In this example, \ref string_compare() is used,
-which is just a wrapper for strcmp() that interprets osl objects as
-C-strings and calls strcmp() on the object data.
-
-- Define a struct \ref osl_table_description and initialize
-it with the number of columns of your table and the column
-descriptions:
-
-\verbatim
-
-struct osl_table_description tar_table_desc = {
-       .name = "tar_table",
-       .num_columns = NUM_OT_COLUMNS,
-       .column_descriptions = tar_table_cols,
-       .dir = "/tmp/osltest"
-};
-
-\endverbatim
-
-- Create the table by calling \ref osl_create_table():
-
-\verbatim
-
-ret = osl_create_table(&tar_table_desc);
-
-\endverbatim
-
-- Open the newly created table by calling osl_open_table:
-
-\verbatim
-
-struct osl_table *table;
-ret = osl_open_table(&tar_table_desc, &table);
-
-\endverbatim
-
-- To add a new row to the table, you must define an array of struct
-osl_object of length NUM_OT_COLUMNS which holds the contents of the
-new row. Note that an osl object is just a blob: It consists of a
-data pointer and a size value. Once the array has been initialized,
-pass it to \ref osl_add_row() together with the table handle obtained
-from osl_open_table():
-
-\verbatim
-
-struct osl_object objs[NUM_OT_COLUMNS];
-/* ...init the array... */
-ret = osl_add_row(table, objs);
-
-\endverbatim
-
-- Close the table with \ref osl_close_table().
-
-\verbatim
-
-osl_close_table(table, OSL_MARK_CLEAN);
-
-\endverbatim
-
-The storage type of both columns of the table in this example
-is OSL_MAPPED_STORAGE, so you can later open the table again
-and retrieve its contents:
-
-\verbatim
-
-ret = osl_get_row(table, OTC_NAME, &obj, &row);
-if (ret < 0) {
-       fprintf(stderr, "osl_get_row(%s): %s\n", name,
-               osl_strerror(-ret));
-       return ret;
-}
-ret = osl_get_object(table, row, OTC_DATA, &obj);
-
-\endverbatim
-
-The call to \ref osl_get_row() uses the rbtree of the OTC_NAME
-column to find the row whose object in the OTC_NAME column
-matches the given object obj. If a row was found, it is
-passed to \ref osl_get_object() which returns the object of
-the OTC_DATA column of this row.
-
+<pre>
+       enum osltar_columns {
+               OTC_NAME,
+               OTC_DATA,
+               NUM_OT_COLUMNS
+       };
+</pre>
+
+The last element is is useful because the number of columns of your
+table must be specified later, see below.
+
+Define an array of struct osl_column_description, one array member
+per column:
+
+<pre>
+       struct osl_column_description tar_table_cols[] = {
+               [OTC_NAME] = {
+                       .storage_type = OSL_MAPPED_STORAGE,
+                       .storage_flags = OSL_RBTREE | OSL_UNIQUE,
+                       .name = "filename",
+                       .compare_function = string_compare,
+               },
+               [OTC_DATA] = {
+                       .storage_type = OSL_MAPPED_STORAGE,
+                       .name = "data",
+               },
+       };
+</pre>
+
+Three different storage types are available which may be selected
+on a per-column basis: `OSL_DISK_STORAGE`, `OSL_MAPPED_STORAGE`, and
+`OSL_NO_STORAGE`.
+
+For columns of type `OSL_MAPPED_STORAGE` and `OSL_NO_STORAGE` an
+optional rbtree is maintained by the osl library which allows to
+quickly lookup rows by cell content. Whether or not an rbtree should
+be used must be specified in the `storage_flags` field which should
+contain the bitwise or of suitable `osl_storage_flags`.
+
+If a column has an associated rbtree, i.e. if the `OSL_RBTREE` flag
+is set in the storage flags for the column, the `compare_function`
+field must be initialized to point to a function of type
+`osl_compare_func`. In this example, `string_compare()` is used,
+which is just a wrapper for `strcmp()` that interprets osl objects
+as C-strings and calls `strcmp()` on the object data.
+
+Define a struct `osl_table_description` and initialize it with
+the number of columns of your table and the column descriptions:
+
+<pre>
+       struct osl_table_description tar_table_desc = {
+               .name = "tar_table",
+               .num_columns = NUM_OT_COLUMNS,
+               .column_descriptions = tar_table_cols,
+               .dir = "/tmp/osltest"
+       };
+</pre>
+
+Create the table by calling `osl_create_table()`:
+
+<pre>
+       ret = osl_create_table(&tar_table_desc);
+</pre>
+
+Open the newly created table by calling `osl_open_table()`:
+
+<pre>
+       struct osl_table *table;
+       ret = osl_open_table(&tar_table_desc, &table);
+</pre>
+
+To add a new row to the table, you must define an array of struct
+osl_object of length `NUM_OT_COLUMNS` which holds the contents of
+the new row. Note that an osl object is just a blob: It consists of
+a data pointer and a size value. Once the array has been initialized,
+pass it to `osl_add_row()` together with the table handle obtained from
+`osl_open_table()`:
+
+<pre>
+       struct osl_object objs[NUM_OT_COLUMNS];
+       /* ...init the array... */
+       ret = osl_add_row(table, objs);
+</pre>
+
+Close the table with `osl_close_table()`.
+
+<pre>
+       osl_close_table(table, OSL_MARK_CLEAN);
+</pre>
+
+The storage type of both columns of the table in this example is
+`OSL_MAPPED_STORAGE`, so you can later open the table again and
+retrieve its contents:
+
+<pre>
+       ret = osl_get_row(table, OTC_NAME, &obj, &row);
+       if (ret < 0) {
+               fprintf(stderr, "osl_get_row(%s): %s\n", name,
+                       osl_strerror(-ret));
+               return ret;
+       }
+       ret = osl_get_object(table, row, OTC_DATA, &obj);
+</pre>
+
+The call to `osl_get_row()` uses the rbtree of the `OTC_NAME`
+column to find the row whose object in the `OTC_NAME` column
+matches the given object `obj`. If a row was found, it is
+passed to `osl_get_object()` which returns the object of
+the `OTC_DATA` column of this row.
 
 This concludes the quick start document. Of course, libosl contains
 many more public functions than those used above. For details on the
-C-API, look at the file \ref osl.h which contains the declarations of
-all public functions and the complete documentation of the public part
-of the library.
+C-API, look at the file `osl.h` which contains the declarations of
+all public functions and the complete documentation of the public
+part of the library.
 
 The "examples" subdirectory of the source distribution
 contains the full code of the above example and another
-small program which illustrates the use of columns of
-type OSL_NO_STORAGE. Larger applications using libosl are <a
-href="http://people.tuebingen.mpg.de/maan/paraslash/">paraslash</a>, a network audio
-streaming system, and <a href="http://people.tuebingen.mpg.de/maan/adu/">adu
-</a>, the advanced disk usage tool.
-
-*/
+small program which illustrates the use of columns of type
+`OSL_NO_STORAGE`. Larger applications using libosl are <a
+href="http://people.tuebingen.mpg.de/maan/paraslash/">paraslash</a>,
+a network audio streaming system, and <a
+href="http://people.tuebingen.mpg.de/maan/adu/">adu</a>, the advanced
+disk usage tool.
index 5e69f3c1dd9e54f4c63188396ffa6833465930d7..37ea5974f2295fdafc2fdc58e2897ab2066098fe 100644 (file)
@@ -766,7 +766,6 @@ INPUT_ENCODING         = UTF-8
 
 FILE_PATTERNS          = osl.h \
                          osltar.c \
-                         QUICK_START
 
 # The RECURSIVE tag can be used to specify whether or not subdirectories should
 # be searched for input files as well.
index 2f824d92e3b122d339a6aae90d50c3c9b3412895..f81f79335e8bca006b09d2d433fa62003b7ad458 100644 (file)
@@ -33,7 +33,7 @@
        [<a href="../index.html#readme">README</a>]
        [<a href="../index.html#download">Download</a>]
        [<a href="../index.html#install">INSTALL</a>]
-       [<a href="index.html">Quick Start</a>]
+       [<a href="../index.html#quick_start">Quick Start</a>]
        [<a href="osl_8h.html">API</a>]
        [<a href="../index.html#license">License</a>]
        [<a href="../index.html#contact">Contact</a>]
index 359772f0e4fb0880d511cd45e6f7fb089c24cb92..e783e7f43d3404e5b2cc8250eea64e1e18b1aa03 100644 (file)
@@ -25,7 +25,7 @@
        [<a href="#readme">README</a>]
        [<a href="#download">Download</a>]
        [<a href="#install">INSTALL</a>]
-       [<a href="doxygen/index.html">Quick Start</a>]
+       [<a href="#quick_start">Quick Start</a>]
        [<a href="doxygen/osl_8h.html">API</a>]
        [<a href="#license">License</a>]
        [<a href="#contact">Contact</a>]
 
        <hr>
 
+       <center>
+               <h2>
+                       <a name="quick_start">QUICK START</a>
+               </h2>
+       </center>
+
+       @QUICK_START@
+
+       <hr>
+
        <center>
                <h2>
                        <a name="license">License</a>