/* Copyright (c) 2010 Matthias Blankertz This work is licensed under the Open Software License ("OSL") v. 3.0. */ #ifndef TCFS_ENCODE_H #define TCFS_ENCODE_H 1 struct encode_ctx { struct encode_ops *ops; }; struct encode_ops { struct encode_ctx *(*open)(const char *); int (*encode)(void *, size_t, const void *, size_t, struct encode_ctx *); int (*close)(struct encode_ctx *); }; struct encoders_entry { struct encode_ops *ops; char name[]; }; extern struct encoders_entry encoders[]; struct encode_ctx *encode_open(const char *tfmt); int encode_encode(void *dst, size_t dst_size, const void *src, size_t src_size, struct encode_ctx *ctx); int encode_close(struct encode_ctx *ctx); #endif