123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- typedef struct codec_t LSUP_Codec;
- typedef struct codec_iter_t {
- const LSUP_Codec * codec;
- LSUP_Triple * trp;
- LSUP_GraphIterator *gr_it;
- const LSUP_NSMap * nsm;
- size_t cur;
- LSUP_rc rc;
- char * rep,
- * str_s,
- * str_p,
- * str_o;
- } LSUP_CodecIterator;
- typedef LSUP_rc (*term_enc_fn_t)(
- const LSUP_Term *term, const LSUP_NSMap *nsm, char **rep);
- typedef LSUP_CodecIterator * (*gr_encode_init_fn_t)(const LSUP_Graph *gr);
- typedef LSUP_rc (*gr_encode_iter_fn_t)(
- LSUP_CodecIterator *it, unsigned char **res);
- typedef void (*gr_encode_done_fn_t)(LSUP_CodecIterator *it);
- typedef LSUP_rc (*term_decode_fn_t)(
- const char *rep, const LSUP_NSMap *nsm, LSUP_Term **term);
- typedef LSUP_rc (*gr_decode_fn_t)(
- FILE *rep, LSUP_Graph **gr, size_t *ct, char **err);
- struct codec_t {
- char name[16];
- char mimetype[32];
- char extension[8];
-
- term_enc_fn_t encode_term;
- gr_encode_init_fn_t encode_graph_init;
- gr_encode_iter_fn_t encode_graph_iter;
- gr_encode_done_fn_t encode_graph_done;
-
- term_decode_fn_t decode_term;
- gr_decode_fn_t decode_graph;
- };
|