1 /* treaty.h Header file for Treaty of Babel compliant format modules
\r
2 * By L. Ross Raszewski
\r
5 * This file is public domain, but please note that derived versions
\r
6 * may not not be compliant with the Treaty of Babel.
\r
8 * It would be wise for derived works to change the value of
\r
9 * TREATY_COMPLIANCE to reflect deviations
\r
16 #define TREATY_COMPLIANCE "Treaty of Babel revision 7"
\r
17 #define TREATY_VERSION "r7"
\r
20 #define NO_REPLY_RV 0
\r
21 #define INVALID_STORY_FILE_RV -1
\r
22 #define UNAVAILABLE_RV -2
\r
23 #define INVALID_USAGE_RV -3
\r
24 #define INCOMPLETE_REPLY_RV -4
\r
25 #define VALID_STORY_FILE_RV 1
\r
27 #define PNG_COVER_FORMAT 1
\r
28 #define JPEG_COVER_FORMAT 2
\r
30 /* Treaty bitmasks. These are not required by the treaty, but are here
\r
33 #define TREATY_SELECTOR_INPUT 0x100
\r
34 #define TREATY_SELECTOR_OUTPUT 0x200
\r
35 #define TREATY_SELECTOR_NUMBER 0xFF
\r
37 #define TREATY_CONTAINER_SELECTOR 0x400
\r
39 /* Treaty selectors */
\r
40 #define GET_HOME_PAGE_SEL 0x201
\r
41 #define GET_FORMAT_NAME_SEL 0x202
\r
42 #define GET_FILE_EXTENSIONS_SEL 0x203
\r
43 #define CLAIM_STORY_FILE_SEL 0x104
\r
44 #define GET_STORY_FILE_METADATA_EXTENT_SEL 0x105
\r
45 #define GET_STORY_FILE_COVER_EXTENT_SEL 0x106
\r
46 #define GET_STORY_FILE_COVER_FORMAT_SEL 0x107
\r
47 #define GET_STORY_FILE_IFID_SEL 0x308
\r
48 #define GET_STORY_FILE_METADATA_SEL 0x309
\r
49 #define GET_STORY_FILE_COVER_SEL 0x30A
\r
50 #define GET_STORY_FILE_EXTENSION_SEL 0x30B
\r
52 /* Container selectors */
\r
53 #define CONTAINER_GET_STORY_FORMAT_SEL 0x710
\r
54 #define CONTAINER_GET_STORY_EXTENT_SEL 0x511
\r
55 #define CONTAINER_GET_STORY_FILE_SEL 0x711
\r
60 /* Other magic size limits */
\r
61 #define TREATY_MINIMUM_EXTENT 512
\r
66 /* 32-bit integer types */
\r
68 #if SCHAR_MAX >= 0x7FFFFFFFL && SCHAR_MIN <= -0x7FFFFFFFL
\r
69 typedef signed char int32;
\r
70 #elif SHRT_MAX >= 0x7FFFFFFFL && SHRT_MIN <= -0x7FFFFFFFL
\r
71 typedef signed short int int32;
\r
72 #elif INT_MAX >= 0x7FFFFFFFL && INT_MIN <= -0x7FFFFFFFL
\r
73 typedef signed int int32;
\r
74 #elif LONG_MAX >= 0x7FFFFFFFL && LONG_MIN <= -0x7FFFFFFFL
\r
75 typedef signed long int int32;
\r
77 #error No type large enough to support 32-bit integers.
\r
80 /* VAX C does not provide these limit constants, contrary to ANSI */
\r
86 /* Pointer to treaty function. Treaty functions must follow this prototype */
\r
88 typedef int32 (*TREATY)(int32 selector, void *, int32, void *, int32);
\r