Przeglądaj źródła

Add const qualifiers to some function signatures.

scossu 2 tygodni temu
rodzic
commit
822adc2fd6
3 zmienionych plików z 8 dodań i 6 usunięć
  1. 3 2
      include/graph.h
  2. 2 2
      include/term.h
  3. 3 2
      src/graph.c

+ 3 - 2
include/graph.h

@@ -37,7 +37,7 @@ typedef struct graph_iter_t LSUP_GraphIterator;
  * @return New graph, or NULL on error. Must be freed with #LSUP_graph_free().
  */
 LSUP_Graph *
-LSUP_graph_new (LSUP_Store *store, LSUP_Term *uri, LSUP_NSMap *nsm);
+LSUP_graph_new (LSUP_Store *store, const LSUP_Term *uri, LSUP_NSMap *nsm);
 
 
 /** @brief Create a temp graph from stored triples.
@@ -57,7 +57,8 @@ LSUP_graph_new (LSUP_Store *store, LSUP_Term *uri, LSUP_NSMap *nsm);
  * context URI was found, NULL is returned.
  */
 LSUP_Graph *
-LSUP_graph_get_txn (void *txn, LSUP_Store *store, LSUP_Term *uri, size_t *ct);
+LSUP_graph_get_txn (
+        void *txn, LSUP_Store *store, const LSUP_Term *uri, size_t *ct);
 
 
 /// Non-transactional version of #LSUP_graph_get_txn().

+ 2 - 2
include/term.h

@@ -147,8 +147,8 @@ extern LSUP_TermSet *LSUP_term_cache;
 /** @brief Create a new term.
  *
  * This is a generic function; it is recommended to use specialized functions
- * such as #LSUP_term_new(), #LSUP_literal_new(), etc. as they have strict type
- * checks for the metadata parameter.
+ * such as #LSUP_iriref_new(), #LSUP_literal_new(), etc. as they have strict
+ * type checks for the metadata parameter.
  *
  * @param type[in] Term type. One of #LSUP_TermType.
  *

+ 3 - 2
src/graph.c

@@ -42,7 +42,7 @@ check_backend (LSUP_StoreType be)
  */
 
 LSUP_Graph *
-LSUP_graph_new (LSUP_Store *store, LSUP_Term *uri, LSUP_NSMap *nsm)
+LSUP_graph_new (LSUP_Store *store, const LSUP_Term *uri, LSUP_NSMap *nsm)
 {
     // Create a HTable graph by default.
     if (!store) store = LSUP_store_new (LSUP_STORE_HTABLE, NULL, 0);
@@ -62,7 +62,8 @@ LSUP_graph_new (LSUP_Store *store, LSUP_Term *uri, LSUP_NSMap *nsm)
 
 
 LSUP_Graph *
-LSUP_graph_get_txn (void *txn, LSUP_Store *store, LSUP_Term *uri, size_t *ct)
+LSUP_graph_get_txn (
+        void *txn, LSUP_Store *store, const LSUP_Term *uri, size_t *ct)
 {
     LSUP_Buffer *sc = LSUP_term_serialize (uri);
     void *it = store->sif->lookup_fn (