Browse Source

Clean docstrings.

scossu 4 days ago
parent
commit
01a7df9da7
2 changed files with 49 additions and 21 deletions
  1. 1 1
      include/lsup/graph.h
  2. 48 20
      include/lsup/store.h

+ 1 - 1
include/lsup/graph.h

@@ -366,7 +366,7 @@ LSUP_graph_remove_txn (
  * @param[out] ct If not NULL, this handle is populated with the number of
  *  entries found.
  *
- * @return Pointer to a #LSUP_GraphIterator to be generated. It must be
+ * @return Pointer to a LSUP_GraphIterator to be generated. It must be
  *  freed with #LSUP_graph_iter_free() after use.
  */
 LSUP_GraphIterator *

+ 48 - 20
include/lsup/store.h

@@ -194,12 +194,13 @@ LSUP_store_abort (LSUP_Store *store, void *txn);
  *
  * @param[in] store Store handle.
  *
+ * @param[in] txn Transaction handle. If NULL, a new transaction is opened.
+ *  This is ignored by non-transactional back ends.
+ *
  * @param[in] old_c Old context handle.
  *
  * @param[in] new_c New context handle.
  *
- * @param[in] udata Implementation-specific context data.
- *
  * @return LSUP_OK on success; LSUP_NOACTION if no triples were found under the
  *  given context; <0 on error.
  */
@@ -220,15 +221,15 @@ LSUP_store_update_ctx_txn (
  *
  * @param[in] store The store to add to.
  *
+ * @param[in] txn Transaction handle. If NULL, a new transaction is opened.
+ *  This is ignored by non-transactional back ends.
+ *
  * @param[in] sc Context as a serialized term. If this is NULL, and the
  *  default context is not NULL, triples will be added to the default context
  *  for the store, If the default context for the store is NULL, regardless of
  *  the value of sc, triples will be added with no context. Only meaningful
  *  for stores with the LSUP_STORE_CTX feature.
  *
- *  @param[in] udata User data. Consult individual store implementations for
- *   how this is interpreted.
- *
  * @return Iterator handle to be passed to the following load steps.
  */
 void *
@@ -246,9 +247,9 @@ LSUP_store_add_init_txn (
  * yielded by that function. It may be called multiple times and must be
  * followed by #store_add_done_fn_t or #store_add_abort_fn_t (if supported).
  *
- * @param[in] it Iterator obtained by #store_add_init_fn_t.
- *  The following members are of interest:
- *  it->i stores the total number of records inserted.
+ * @param[in] store Store handle.
+ *
+ * @param[in] it Iterator obtained by #LSUP_store_add_init().
  *
  * @param[in] sspo Serialized triple to be added.
  *
@@ -279,7 +280,10 @@ LSUP_store_add_abort (LSUP_Store *store, void *it);
  *
  * @param[in] store Store handle.
  *
- * @param[in] it Iterator obtained by #store_add_init_fn_t.
+ * @param[in] it Iterator obtained by #LSUP_store_add_init().
+ *
+ * @return LSUP_OK on success, <0 on failure. In the latter case, a transaction
+ *  may be aborted in a transactional back end.
  */
 LSUP_rc
 LSUP_store_add_done (LSUP_Store *store, void *it);
@@ -289,10 +293,10 @@ LSUP_store_add_done (LSUP_Store *store, void *it);
  *
  * @param[in] store Store handle.
  *
- * @param[in] sterm Serialized term to store.
+ * @param[in] txn Transaction handle. If NULL, a new transaction is opened.
+ *  This is ignored by non-transactional back ends.
  *
- * @param[in] udata Implementation-defined data. See individual
- *  implementations' documentation.
+ * @param[in] sterm Serialized term to store.
  */
 LSUP_rc
 LSUP_store_add_term_txn (LSUP_Store *store, void *txn, LSUP_Buffer *sterm);
@@ -316,6 +320,9 @@ LSUP_store_add_term_txn (LSUP_Store *store, void *txn, LSUP_Buffer *sterm);
  *
  * @param[in] store The store to be queried.
  *
+ * @param[in] txn Transaction handle. If NULL, a new transaction is opened.
+ *  This is ignored by non-transactional back ends.
+ *
  * @param[in] ss Serialized s term.
  *
  * @param[in] sp Serialized p term.
@@ -326,9 +333,6 @@ LSUP_store_add_term_txn (LSUP_Store *store, void *txn, LSUP_Buffer *sterm);
  * which case search is done in all contexts. Note that triples inserted
  * without context are assigned the *default* context for the store.
  *
- *  @param[in] udata User data. Consult individual store implementations for
- *   how this is interpreted.
- *
  * @param[out] ct If not NULL, this will be populated with the number of
  *  entries found. In some implementations, it is very inexpensive to set for
  *  lookups without context, much less so for 1-bound and 2-bound context
@@ -365,6 +369,8 @@ LSUP_store_lookup_txn (
  * `LSUP_BUF_BORROWED` flag, so that they can be safely freed with
  * #LSUP_buffer_free() and #LSUP_btriple_free().
  *
+ * @param[in] store Store handle.
+ *
  * @param[in] it Opaque iterator handle obtained with #store_lookup_fn_t.
  *
  * @param[out] sspo #LSUP_BufferTriple to be populated with three serialized
@@ -392,6 +398,8 @@ LSUP_store_iter_next (
 
 
 /** @brief Free an iterator allocated by a lookup.
+ *
+ * @param[in] store Store handle.
  *
  * @param[in] it Iterator pointer. It will be set to NULL after freeing.
  */
@@ -407,6 +415,8 @@ LSUP_store_iter_free (LSUP_Store *store, void *it);
  * is also the only way to perform anything else than iterating or committing
  * while a loop is open.
  *
+ * @param[in] store Store handle.
+ *
  * @param[in] it Iterator handle to get the transaction from.
  *
  * @return Transaction handle. DO NOT close this transaction directly.
@@ -417,12 +427,27 @@ LSUP_store_iter_txn (const LSUP_Store *store, void *it);
 
 /** @brief Delete triples by pattern matching.
  *
- * The ss, sp, so, sc terms act as a matching pattern as documented in
- * @sa #store_lookup_fn_t(). if not NULL, ct yields the number of triples
- * actually deleted.
+ * @param[in] store The store to be queried.
+ *
+ * @param[in] txn Transaction handle. If NULL, a new transaction is opened.
+ *  This is ignored by non-transactional back ends.
+ *
+ * @param[in] ss Serialized s term.
+ *
+ * @param[in] sp Serialized p term.
+ *
+ * @param[in] so Serialized o term.
+ *
+ * @param[in] sc Serialized context to limit search to. It may be NULL, in
+ *  which case search is done in all contexts. Note that triples inserted
+ *  without context are assigned the *default* context for the store.
+ *
+ * @param[out] ct If not NULL, this will be populated with the number of
+ *  triples actually deleted.
+ *
+ * @return LSUP_OK on success; LSUP_NOACTION if no triples were deleted;
+ *  <0 on error.
  *
- *  @param[in] udata User data. Consult individual store implementations for
- *   how this is interpreted.
  */
 LSUP_rc
 LSUP_store_remove_txn (
@@ -441,6 +466,9 @@ LSUP_store_remove_txn (
  *
  * @param[in] store Store handle.
  *
+ * @param[in] txn Transaction handle. If NULL, a new transaction is opened.
+ *  This is ignored by non-transactional back ends.
+ *
  * @return Set of all context URIs.
  */
 LSUP_Buffer **