X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=babel%2Fbabel_handler.h;fp=babel%2Fbabel_handler.h;h=a01194a2054a00a7383e6f94c9beba7d74f8226c;hb=6fd0347f330cb24ef6145662023053a1c0f81a64;hp=0000000000000000000000000000000000000000;hpb=7d14a66ee234db0898de6fabb8f850ebc4bb733a;p=projects%2Fchimara%2Fchimara.git diff --git a/babel/babel_handler.h b/babel/babel_handler.h new file mode 100644 index 0000000..a01194a --- /dev/null +++ b/babel/babel_handler.h @@ -0,0 +1,65 @@ +/* babel_handler.h declarations for the babel handler API + * (c) 2006 By L. Ross Raszewski + * + * This code is freely usable for all purposes. + * + * This work is licensed under the Creative Commons Attribution2.5 License. + * To view a copy of this license, visit + * http://creativecommons.org/licenses/by/2.5/ or send a letter to + * Creative Commons, + * 543 Howard Street, 5th Floor, + * San Francisco, California, 94105, USA. + * + */ + +#ifndef BABEL_HANDLER_H +#define BABEL_HANDLER_H + +#include "treaty.h" + +/* Functions from babel_handler.c */ +char *babel_init(char *filename); + /* initialize the babel handler */ +char *babel_init_raw(void *sf, int32 extent); + /* Initialize from loaded data */ +int32 babel_treaty(int32 selector, void *output, int32 output_extent); + /* Dispatch treaty calls */ +void babel_release(void); + /* Release babel_handler resources */ +char *babel_get_format(void); + /* return the format of the loaded file */ +int32 babel_md5_ifid(char *buffer, int32 extent); + /* IFID generator of last resort */ +int32 babel_get_length(void); + /* Fetch file length */ +int32 babel_get_story_length(void); + /* Fetch file length */ +int32 babel_get_authoritative(void); + /* Determine if babel handler has a good grasp on the format */ +void *babel_get_file(void); + /* Get loaded story file */ +void *babel_get_story_file(void); + /* Get loaded story file */ + +/* threadsafe versions of above */ +char *babel_init_ctx(char *filename, void *); + /* initialize the babel handler */ +int32 babel_treaty_ctx(int32 selector, void *output, int32 output_extent, void *); + /* Dispatch treaty calls */ +void babel_release_ctx(void *); + /* Release babel_handler resources */ +char *babel_get_format_ctx(void *); + /* return the format of the loaded file */ +int32 babel_md5_ifid_ctx(char *buffer, int extent, void *); + /* IFID generator of last resort */ +int32 babel_get_length_ctx(void *); +int32 babel_get_story_length_ctx(void *); +void *babel_get_file_ctx(void *bhp); +void *babel_get_story_ctx(void *bhp); +int32 babel_get_authoritative_ctx(void *bhp); +char *babel_init_raw_ctx(void *sf, int32 extent, void *bhp); +void *get_babel_ctx(void); +void release_babel_ctx(void *); + /* get and release babel contexts */ + +#endif