|
@@ -4,6 +4,9 @@
|
|
|
#include "graph.h"
|
|
|
|
|
|
|
|
|
+typedef struct codec_iter_t LSUP_CodecIterator;
|
|
|
+
|
|
|
+
|
|
|
/** @brief Term encoder callback type.
|
|
|
*
|
|
|
* @param[in] term Single term handle.
|
|
@@ -26,25 +29,15 @@ typedef LSUP_rc (*term_dec_fn_t)(
|
|
|
const char *rep, const LSUP_NSMap *nsm, LSUP_Term **term);
|
|
|
|
|
|
|
|
|
-/** @brief Triple encoder callback type.
|
|
|
+/** @brief Graph encoder callback type.
|
|
|
*
|
|
|
* @return LSUP_OK on successful encoding; <0 for other errors.
|
|
|
*/
|
|
|
-typedef LSUP_rc (*trp_enc_fn_t)(
|
|
|
- const LSUP_Triple trp[], const LSUP_NSMap *nsm, char **rep);
|
|
|
-
|
|
|
-
|
|
|
-/** TODO
|
|
|
- */
|
|
|
-typedef LSUP_rc (*trp_dec_fn_t)(
|
|
|
- const char *rep, const LSUP_NSMap *nsm, LSUP_Triple **trp);
|
|
|
+typedef LSUP_CodecIterator * (*gr_codec_init_fn_t)(const LSUP_Graph *gr);
|
|
|
|
|
|
+typedef LSUP_rc (*gr_codec_iter_fn_t)(LSUP_CodecIterator *it);
|
|
|
|
|
|
-/** @brief Graph encoder callback type.
|
|
|
- *
|
|
|
- * @return LSUP_OK on successful encoding; <0 for other errors.
|
|
|
- */
|
|
|
-typedef LSUP_rc (*gr_enc_fn_t)(const LSUP_Graph *gr, char **rep);
|
|
|
+typedef void (*gr_codec_done_fn_t)(LSUP_CodecIterator *it);
|
|
|
|
|
|
|
|
|
/** TODO
|
|
@@ -72,12 +65,20 @@ typedef 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.
|
|
|
+
|
|
|
+ // Term encoding and decoding.
|
|
|
term_enc_fn_t term_encoder; // Term encoder function.
|
|
|
term_dec_fn_t term_decoder; // Term decoder function.
|
|
|
- trp_enc_fn_t trp_encoder; // Triple encoder function.
|
|
|
- trp_dec_fn_t trp_decoder; // Triple decoder function.
|
|
|
- gr_enc_fn_t gr_encoder; // Graph encoder function.
|
|
|
- gr_dec_fn_t gr_decoder; // Graph decoder function.
|
|
|
+
|
|
|
+ // Graph encoding.
|
|
|
+ gr_codec_init_fn_t gr_encode_init; // Graph encoder initialization.
|
|
|
+ gr_codec_iter_fn_t gr_encode_iter; // Graph encoder initialization.
|
|
|
+ gr_codec_done_fn_t gr_encode_done; // Graph encoder initialization.
|
|
|
+
|
|
|
+ // Graph decoding.
|
|
|
+ gr_codec_init_fn_t gr_decode_init; // Graph decoder initialization.
|
|
|
+ gr_codec_iter_fn_t gr_decode_iter; // Graph decoder initialization.
|
|
|
+ gr_codec_done_fn_t gr_decode_done; // Graph decoder initialization.
|
|
|
} LSUP_Codec;
|
|
|
|
|
|
#endif
|