unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [RFC PATCH 4/4] lib: add reStructuredText bling for API documentation in notmuch.h
Date: Sun, 20 Aug 2017 22:30:39 +0300	[thread overview]
Message-ID: <c9ab1d31c241850e34d98da7ac19a2c3e05a0275.1503256651.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1503256651.git.jani@nikula.org>
In-Reply-To: <cover.1503256651.git.jani@nikula.org>

Document notmuch_database_create() using as much bling as
possible. This is pretty nice in the output, but probably too
excessive in source code. Nonetheless, it's an example of what could
be done.
---
 lib/notmuch.h | 45 +++++++++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 20 deletions(-)

diff --git a/lib/notmuch.h b/lib/notmuch.h
index ab01944cb2b0..c3307d5835dd 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -229,38 +229,43 @@ typedef struct _notmuch_param notmuch_param_t;
 #endif /* __DOXYGEN__ */
 
 /**
- * Create a new, empty notmuch database located at 'path'.
+ * Create a new, empty notmuch database located at ``path``.
  *
- * The path should be a top-level directory to a collection of
- * plain-text email messages (one message per file). This call will
- * create a new ".notmuch" directory within 'path' where notmuch will
- * store its data.
+ * This call will create a new ``.notmuch`` directory within ``path``
+ * where notmuch will store its data.
  *
- * After a successful call to notmuch_database_create, the returned
- * database will be open so the caller should call
- * notmuch_database_destroy when finished with it.
+ * After a successful call to :c:func:`notmuch_database_create()`, the
+ * returned database will be open so the caller should call
+ * :c:func:`notmuch_database_destroy()` when finished with it.
  *
  * The database will not yet have any data in it
- * (notmuch_database_create itself is a very cheap function). Messages
- * contained within 'path' can be added to the database by calling
- * notmuch_database_add_message.
+ * (:c:func:`notmuch_database_create()` itself is a very cheap
+ * function). Messages contained within ``path`` can be added to the
+ * database by calling :c:func:`notmuch_database_add_message()`.
  *
  * In case of any failure, this function returns an error status and
- * sets *database to NULL (after printing an error message on stderr).
+ * sets ``*database`` to ``NULL`` (after printing an error message on
+ * ``stderr``).
  *
- * Return value:
+ * @param path The ``path`` should be a top-level directory to a
+ *   collection of plain-text email messages (one message per file).
  *
- * NOTMUCH_STATUS_SUCCESS: Successfully created the database.
+ * @param database Pointer to database.
  *
- * NOTMUCH_STATUS_NULL_POINTER: The given 'path' argument is NULL.
+ * @return 
+ *   :c:macro:`NOTMUCH_STATUS_SUCCESS`: Successfully created the database.
  *
- * NOTMUCH_STATUS_OUT_OF_MEMORY: Out of memory.
+ *   :c:macro:`NOTMUCH_STATUS_NULL_POINTER`: The given ``path``
+ *   argument is ``NULL``.
  *
- * NOTMUCH_STATUS_FILE_ERROR: An error occurred trying to create the
- *	database file (such as permission denied, or file not found,
- *	etc.), or the database already exists.
+ *   :c:macro:`NOTMUCH_STATUS_OUT_OF_MEMORY`: Out of memory.
  *
- * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred.
+ *   :c:macro:`NOTMUCH_STATUS_FILE_ERROR`: An error occurred trying to
+ *   create the database file (such as permission denied, or file not
+ *   found, etc.), or the database already exists.
+ *
+ *   :c:macro:`NOTMUCH_STATUS_XAPIAN_EXCEPTION`: A Xapian exception
+ *   occurred.
  */
 notmuch_status_t
 notmuch_database_create (const char *path, notmuch_database_t **database);
-- 
2.11.0

      parent reply	other threads:[~2017-08-20 19:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-20 19:30 [RFC PATCH 0/4] doc: use Hawkmoth for API documentation Jani Nikula
2017-08-20 19:30 ` [RFC PATCH 1/4] doc: add man section 3 handling Jani Nikula
2017-08-20 19:30 ` [RFC PATCH 2/4] doc: use hawkmoth for generating libnotmuch api documentation Jani Nikula
2017-08-20 19:30 ` [RFC PATCH 3/4] lib: fix the biggest hawkmoth offenders in notmuch.h Jani Nikula
2017-08-20 19:30 ` Jani Nikula [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c9ab1d31c241850e34d98da7ac19a2c3e05a0275.1503256651.git.jani@nikula.org \
    --to=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).