|
@@ -100,10 +100,11 @@ typedef struct term_cache_entry_t {
|
|
} LSUP_KeyedTerm;
|
|
} LSUP_KeyedTerm;
|
|
|
|
|
|
|
|
|
|
-/// Connection type: inbound or outbound.
|
|
|
|
|
|
+/// Connection type.
|
|
typedef enum {
|
|
typedef enum {
|
|
- LSUP_CONN_INBOUND, ///< Inbound connection.
|
|
|
|
- LSUP_CONN_OUTBOUND, ///< Outbound connection.
|
|
|
|
|
|
+ LSUP_CONN_INBOUND, ///< Inbound connection (sp).
|
|
|
|
+ LSUP_CONN_OUTBOUND, ///< Outbound connection (po).
|
|
|
|
+ LSUP_CONN_EDGE, ///< Edge connection (so).
|
|
} LSUP_ConnectionType;
|
|
} LSUP_ConnectionType;
|
|
|
|
|
|
|
|
|
|
@@ -112,20 +113,21 @@ typedef enum {
|
|
* A list of predicates and related lists of terms, that can be used to list
|
|
* A list of predicates and related lists of terms, that can be used to list
|
|
* inbound or outbound connections to a node.
|
|
* inbound or outbound connections to a node.
|
|
*
|
|
*
|
|
- * Each term in the NUL-terminated `p` list represent a predicate which is
|
|
|
|
- * paired with a list of terms in the `tl` list. The index of each predicate
|
|
|
|
- * corresponds to the same index of a term list.
|
|
|
|
|
|
+ * Each term in the NUL-terminated `p` list represent a term which is
|
|
|
|
+ * paired with a list of terms in the `tl` list. The index of each term in this
|
|
|
|
+ * list corresponds to the same index of a term list in `tl`.
|
|
*
|
|
*
|
|
* If the type of the connection list is `LSUP_CONN_INBOUND`, the term list
|
|
* If the type of the connection list is `LSUP_CONN_INBOUND`, the term list
|
|
* represent subjects and a term that is associated with the connection list is
|
|
* represent subjects and a term that is associated with the connection list is
|
|
* the related object; if `LSUP_CONN_OUTBOUND`, the term list represents
|
|
* the related object; if `LSUP_CONN_OUTBOUND`, the term list represents
|
|
* objects, and a term that is associated with the connection list represents
|
|
* objects, and a term that is associated with the connection list represents
|
|
- * the subject.
|
|
|
|
|
|
+ * the subject. If `LSUP_CONN_EDGE`, the members of the connection list
|
|
|
|
+ * represent subjects and objects, and the associated term is the predicate.
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
typedef struct {
|
|
typedef struct {
|
|
LSUP_ConnectionType type; ///< Inbound or outbound connection.
|
|
LSUP_ConnectionType type; ///< Inbound or outbound connection.
|
|
- LSUP_Term ** p; ///< NUL-terminated array of term handles.
|
|
|
|
|
|
+ LSUP_Term ** t; ///< NUL-terminated array of term handles.
|
|
LSUP_Term *** tl; /**<
|
|
LSUP_Term *** tl; /**<
|
|
* NUL-terminated array of
|
|
* NUL-terminated array of
|
|
* NUL-terminated arrays of term handles.
|
|
* NUL-terminated arrays of term handles.
|
|
@@ -527,9 +529,9 @@ LSUP_Term **
|
|
LSUP_term_list_add (LSUP_Term **tl, LSUP_Term *t);
|
|
LSUP_term_list_add (LSUP_Term **tl, LSUP_Term *t);
|
|
|
|
|
|
|
|
|
|
-/** @brief New predicate-object list.
|
|
|
|
|
|
+/** @brief New connection list.
|
|
*
|
|
*
|
|
- * The initial state of the returned list is: `{p: [NULL], tl: [NULL]}`
|
|
|
|
|
|
+ * The initial state of the returned list is: `{t: [NULL], tl: [NULL]}`
|
|
*
|
|
*
|
|
* Predicates and term lists can be added with #LSUP_conn_list_add, and terms
|
|
* Predicates and term lists can be added with #LSUP_conn_list_add, and terms
|
|
* can be added to a term list with #LSUP_term_list_add.
|
|
* can be added to a term list with #LSUP_term_list_add.
|
|
@@ -537,7 +539,7 @@ LSUP_term_list_add (LSUP_Term **tl, LSUP_Term *t);
|
|
* @return a new empty predicate-object list.
|
|
* @return a new empty predicate-object list.
|
|
*/
|
|
*/
|
|
LSUP_ConnectionList *
|
|
LSUP_ConnectionList *
|
|
-LSUP_conn_list_list_new (LSUP_ConnectionType type);
|
|
|
|
|
|
+LSUP_conn_list_new (LSUP_ConnectionType type);
|
|
|
|
|
|
|
|
|
|
/** @brief Free a predicate-object list.
|
|
/** @brief Free a predicate-object list.
|
|
@@ -545,27 +547,28 @@ LSUP_conn_list_list_new (LSUP_ConnectionType type);
|
|
* All arrays and term handles are recursively freed.
|
|
* All arrays and term handles are recursively freed.
|
|
*
|
|
*
|
|
* @param[in] pol Predicate-object list handle obtained with
|
|
* @param[in] pol Predicate-object list handle obtained with
|
|
- * #LSUP_conn_list_list_new().
|
|
|
|
|
|
+ * #LSUP_conn_list_new().
|
|
*/
|
|
*/
|
|
void
|
|
void
|
|
-LSUP_conn_list_list_free (LSUP_ConnectionList *pol);
|
|
|
|
|
|
+LSUP_conn_list_free (LSUP_ConnectionList *pol);
|
|
|
|
|
|
|
|
|
|
-/** @brief Add a predicate-object list pair to a PO list.
|
|
|
|
|
|
+/** @brief Add a term - term list pair to a connection list.
|
|
*
|
|
*
|
|
- * @param[in] pol Predicate-object list handle obtained with
|
|
|
|
- * #LSUP_conn_list_list_new().
|
|
|
|
|
|
+ * @param[in] cl Connection list handle obtained with
|
|
|
|
+ * #LSUP_conn_list_new().
|
|
*
|
|
*
|
|
- * @param[in] p Predicate to be associated with the given object list. The
|
|
|
|
- * PO structure takes ownership of the term.
|
|
|
|
|
|
+ * @param[in] t Term to be associated with the given object list. The
|
|
|
|
+ * connection list structure takes ownership of the term.
|
|
*
|
|
*
|
|
* @param[in] o NULL-terminated array of object term handles to be associated
|
|
* @param[in] o NULL-terminated array of object term handles to be associated
|
|
- * with the given predicate. The PO structire takes ownership of the whole
|
|
|
|
- * term array.
|
|
|
|
|
|
+ * with the given predicate. The connection list structire takes ownership of
|
|
|
|
+ * the whole term array.
|
|
*
|
|
*
|
|
* @return LSUP_OK on success; LSUP_MEM_ERR on allocation error.
|
|
* @return LSUP_OK on success; LSUP_MEM_ERR on allocation error.
|
|
*/
|
|
*/
|
|
LSUP_rc
|
|
LSUP_rc
|
|
-LSUP_conn_list_list_add (LSUP_ConnectionList *pol, LSUP_Term *p, LSUP_Term **o);
|
|
|
|
|
|
+LSUP_conn_list_add (
|
|
|
|
+ LSUP_ConnectionList *cl, LSUP_Term *t, LSUP_Term **tl);
|
|
|
|
|
|
#endif
|
|
#endif
|