123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- #ifndef _LSUP_GRAPH_H
- #define _LSUP_GRAPH_H
- #include "store_mdb.h"
- #define BACKEND_TBL \
- ENTRY( MEM, 0) \
- ENTRY( MDB, 1) \
- ENTRY( MDB_TMP, 2) \
- typedef enum LSUP_store_type {
- #define ENTRY(a, b) LSUP_STORE_##a = b,
- BACKEND_TBL
- #undef ENTRY
- } LSUP_store_type;
- typedef struct Graph LSUP_Graph;
- typedef struct GraphIterator LSUP_GraphIterator;
- LSUP_Graph *
- LSUP_graph_new (const LSUP_store_type store_type);
- LSUP_Graph *
- LSUP_graph_copy (const LSUP_Graph *src);
- LSUP_Graph *
- LSUP_graph_bool_op(
- const LSUP_bool_op op, const LSUP_Graph *gr1, const LSUP_Graph *gr2);
- void
- LSUP_graph_free (LSUP_Graph *gr);
- size_t
- LSUP_graph_capacity (const LSUP_Graph *gr);
- size_t
- LSUP_graph_size (const LSUP_Graph *gr);
- LSUP_rc
- LSUP_graph_resize (LSUP_Graph *gr, size_t size);
- LSUP_Term *
- LSUP_graph_uri (const LSUP_Graph *gr);
- LSUP_rc
- LSUP_graph_set_uri (LSUP_Graph *gr, const char *uri);
- bool
- LSUP_graph_contains (const LSUP_Graph *gr, const LSUP_Triple *spo);
- LSUP_GraphIterator *
- LSUP_graph_add_stream_init (LSUP_Graph *gr);
- LSUP_rc
- LSUP_graph_add_stream_iter (
- LSUP_GraphIterator *it, const LSUP_SerTriple *sspo);
- void
- LSUP_graph_add_stream_done (LSUP_GraphIterator *it);
- LSUP_rc
- LSUP_graph_add(
- LSUP_Graph *gr,
- const LSUP_Triple trp[], size_t trp_ct,
- const LSUP_SerTriple strp[], size_t strp_ct, size_t *inserted);
- #define LSUP_graph_add_trp(gr, trp, ct, ins) \
- LSUP_graph_add (gr, trp, ct, NULL, 0, ins)
- LSUP_rc
- LSUP_graph_remove (LSUP_Graph *gr, const LSUP_Triple *spo, size_t *ct);
- LSUP_GraphIterator *
- LSUP_graph_lookup (const LSUP_Graph *gr, const LSUP_Triple *spo, size_t *ct);
- LSUP_rc
- LSUP_graph_iter_next (LSUP_GraphIterator *it, LSUP_Triple *spo);
- void
- LSUP_graph_iter_free (LSUP_GraphIterator *it);
- size_t
- LSUP_graph_iter_cur (LSUP_GraphIterator *it);
- #endif
|