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