scossu пре 8 месеци
родитељ
комит
39aafd8150
4 измењених фајлова са 46 додато и 35 уклоњено
  1. 9 9
      include/codec.h
  2. 28 23
      include/core.h
  3. 7 1
      include/term.h
  4. 2 2
      src/term.c

+ 9 - 9
include/codec.h

@@ -175,20 +175,20 @@ typedef LSUP_rc (*gr_decode_fn_t)(
  * related function prototypes.
  */
 struct codec_t {
-    char                name[16];       // Name of the codec.
-    char                mimetype[32];   // MIME type associated with the codec.
-    char                extension[8];   // Serialized file extension.
+    char                name[16];           ///< Name of the codec.
+    char                mimetype[32]; ///< MIME type associated with the codec.
+    char                extension[8];       ///< Serialized file extension.
 
     // Encoding.
-    term_enc_fn_t       encode_term;    // Term encoder function.
+    term_enc_fn_t       encode_term;        ///< Term encoder function.
 
-    gr_encode_init_fn_t encode_graph_init; // Graph encoder initialization.
-    gr_encode_iter_fn_t encode_graph_iter; // Graph encoder iteration.
-    gr_encode_done_fn_t encode_graph_done; // Graph encoder finalization.
+    gr_encode_init_fn_t encode_graph_init;  ///< Graph encoder initialization.
+    gr_encode_iter_fn_t encode_graph_iter;  ///< Graph encoder iteration.
+    gr_encode_done_fn_t encode_graph_done;  ///< Graph encoder finalization.
 
     // Decoding.
-    term_decode_fn_t    decode_term;   // Term decoder function.
-    gr_decode_fn_t      decode_graph;     // Graph decoder function.
+    term_decode_fn_t    decode_term;        ///< Term decoder function.
+    gr_decode_fn_t      decode_graph;       ///< Graph decoder function.
 };
 
 

+ 28 - 23
include/core.h

@@ -111,36 +111,28 @@ typedef int LSUP_rc;
 #define LSUP_MIN_WARNING    LSUP_NOACTION
 #define LSUP_MAX_WARNING    LSUP_CONFLICT
 
-/** @brief Generic error return code.
- */
+/// Generic error return code.
 #define LSUP_ERROR          -88899
 
-/** @brief TODO
- */
+/// Codec parser error.
 #define LSUP_PARSE_ERR      -88898
 
-/** @brief TODO
- */
+/// An invalid input value was provided.
 #define LSUP_VALUE_ERR      -88897
 
-/** @brief TODO
- */
+/// Error handling a store transaction.
 #define LSUP_TXN_ERR        -88896
 
-/** @brief TODO
- */
+/// Low-level database error.
 #define LSUP_DB_ERR         -88895
 
-/** @brief TODO
- */
+/// Functionality is not implemented.
 #define LSUP_NOT_IMPL_ERR   -88894
 
-/** @brief TODO
- */
+/// I/O error.
 #define LSUP_IO_ERR         -88893
 
-/** @brief TODO
- */
+/// Memory error.
 #define LSUP_MEM_ERR        -88892
 
 /** @brief Conflict error.
@@ -152,8 +144,7 @@ typedef int LSUP_rc;
  */
 #define LSUP_CONFLICT_ERR   -88891
 
-/** @brief TODO
- */
+/// Error while handling environment setup or teardown.
 #define LSUP_ENV_ERR        -88890
 
 /*
@@ -184,25 +175,39 @@ extern char *warning_msg[], *error_msg[];
 extern char *LSUP_root_path;
 
 
+/// 32-bit hash data type.
 typedef XXH32_hash_t LSUP_Hash32;
+/// 64-bit hash data type.
 typedef XXH64_hash_t LSUP_Hash64;
+/// 128-bit hash data type.
 typedef XXH128_hash_t LSUP_Hash128;
-// TODO Add 32-bit switch.
+/** @brief Default hash data type.
+ *
+ * This is 64 bit long for 64-bit systems.
+ *
+ * @todo Add 32-bit switch.
+ */
 typedef LSUP_Hash64 LSUP_Hash;
 
+/// Boolean operations that can be performed on a graph.
 typedef enum {
-    LSUP_BOOL_UNION,
-    LSUP_BOOL_SUBTRACTION,
-    LSUP_BOOL_INTERSECTION,
-    LSUP_BOOL_XOR,
+    LSUP_BOOL_UNION,                ///< Boolean union.
+    LSUP_BOOL_SUBTRACTION,          ///< Boolean subtraction.
+    LSUP_BOOL_INTERSECTION,         ///< Boolean intersection.
+    LSUP_BOOL_XOR,                  ///< Boolean XOR.
 } LSUP_bool_op;
 
 
+/// Term key, i.e., hash of a serialized term.
 typedef size_t LSUP_Key;
+/// Array of two #LSUP_Key values.
 typedef LSUP_Key LSUP_DoubleKey[2];
+/// Array of three #LSUP_Key values, representing a triple.
 typedef LSUP_Key LSUP_TripleKey[3];
+/// Array of three #LSUP_Key values, representing a triple with context.
 typedef LSUP_Key LSUP_QuadKey[4];
 
+/// UUID string tpe.
 typedef char uuid_str_t[UUIDSTR_SIZE];
 
 

+ 7 - 1
include/term.h

@@ -546,6 +546,9 @@ LSUP_term_set_next (LSUP_TermSet *ts, size_t *i, LSUP_Term **term);
  * Predicates and term lists can be added with #LSUP_link_map_add, and terms
  * can be added to a term list with #LSUP_term_list_add.
  *
+ * @param[in] type Type of links that the link map shall contain.
+ * @sa #LSUP_LinkType
+ *
  * @return a new empty predicate-object list.
  */
 LSUP_LinkMap *
@@ -562,7 +565,10 @@ void
 LSUP_link_map_free (LSUP_LinkMap *pol);
 
 
-/// Return the link map type.
+/** @brief Return the link map type.
+ *
+ * @return Link type. @sa #LSUP_LinkType
+ */
 LSUP_LinkType
 LSUP_link_map_type (const LSUP_LinkMap *map);
 

+ 2 - 2
src/term.c

@@ -41,7 +41,7 @@ typedef struct keyed_term {
 
 /** @brief Single link between a term and a term set.
  *
- * This link is not qualified and may not be used by itself. It belongs
+ * This link is not qualified and must not be used by itself. It belongs
  * in a #LSUP_LinkMap which qualifies all links of the same type.
  */
 typedef struct link {
@@ -70,7 +70,7 @@ struct link_map_iter {
  */
 typedef struct link_map {
     LSUP_LinkType       type;       ///< Link type.
-    struct hashmap *    links;       ///< Map of #Link instances.
+    struct hashmap *    links;      ///< Map of #Link instances.
 } LSUP_LinkMap;