Debian Codegraph @

support/babel/treaty.h

raw symbols SCIP
1 /* treaty.h Header file for Treaty of Babel compliant format modules
2 * By L. Ross Raszewski
3 * Version 0.7
4 *
5 * This file is public domain, but please note that derived versions
6 * may not not be compliant with the Treaty of Babel.
7 *
8 * It would be wise for derived works to change the value of
9 * TREATY_COMPLIANCE to reflect deviations
10 */
11
12 #ifndef TREATY_H
13
14 #define TREATY_H
15
16 #define TREATY_COMPLIANCE "Treaty of Babel revision 12"
17 #define TREATY_VERSION "r12"
18
19 /* return codes */
20 #define NO_REPLY_RV 0
21 #define INVALID_STORY_FILE_RV -1
22 #define UNAVAILABLE_RV -2
23 #define INVALID_USAGE_RV -3
24 #define INCOMPLETE_REPLY_RV -4
25 #define VALID_STORY_FILE_RV 1
26
27 #define PNG_COVER_FORMAT 1
28 #define JPEG_COVER_FORMAT 2
29
30 /* Treaty bitmasks. These are not required by the treaty, but are here
31 as a convenience.
32 */
33 #define TREATY_SELECTOR_INPUT 0x100
34 #define TREATY_SELECTOR_OUTPUT 0x200
35 #define TREATY_SELECTOR_NUMBER 0xFF
36
37 #define TREATY_CONTAINER_SELECTOR 0x400
38
39 /* Treaty selectors */
40 #define GET_HOME_PAGE_SEL 0x201
41 #define GET_FORMAT_NAME_SEL 0x202
42 #define GET_FILE_EXTENSIONS_SEL 0x203
43 #define CLAIM_STORY_FILE_SEL 0x104
44 #define GET_STORY_FILE_METADATA_EXTENT_SEL 0x105
45 #define GET_STORY_FILE_COVER_EXTENT_SEL 0x106
46 #define GET_STORY_FILE_COVER_FORMAT_SEL 0x107
47 #define GET_STORY_FILE_IFID_SEL 0x308
48 #define GET_STORY_FILE_METADATA_SEL 0x309
49 #define GET_STORY_FILE_COVER_SEL 0x30A
50 #define GET_STORY_FILE_EXTENSION_SEL 0x30B
51
52 /* Container selectors */
53 #define CONTAINER_GET_STORY_FORMAT_SEL 0x710
54 #define CONTAINER_GET_STORY_EXTENT_SEL 0x511
55 #define CONTAINER_GET_STORY_FILE_SEL 0x711
56
57
58
59
60 /* Other magic size limits */
61 #define TREATY_MINIMUM_EXTENT 512
62
63
64 #include <limits.h>
65
66 /* 32-bit integer types */
67 #ifndef VAX
68 #if SCHAR_MAX >= 0x7FFFFFFFL && SCHAR_MIN <= -0x7FFFFFFFL
69 typedef signed char int32;
70 typedef unsigned char uint32;
71 #elif SHRT_MAX >= 0x7FFFFFFFL && SHRT_MIN <= -0x7FFFFFFFL
72 typedef signed short int int32;
73 typedef unsigned short int uint32;
74 #elif INT_MAX >= 0x7FFFFFFFL && INT_MIN <= -0x7FFFFFFFL
75 typedef signed int int32;
76 typedef unsigned int uint32;
77 #elif LONG_MAX >= 0x7FFFFFFFL && LONG_MIN <= -0x7FFFFFFFL
78 typedef signed long int int32;
79 typedef unsigned long int uint32;
80 #else
81 #error No type large enough to support 32-bit integers.
82 #endif
83 #else
84 /* VAX C does not provide these limit constants, contrary to ANSI */
85 typedef int int32;
86 typedef unsigned int uint32;
87 #endif
88
89 #ifdef __cplusplus
90 extern "C" {
91 #endif
92
93
94 /* Pointer to treaty function. Treaty functions must follow this prototype */
95
96 typedef int32 (*TREATY)(int32 selector, void *, int32, void *, int32);
97
98 #ifdef __cplusplus
99 }
100 #endif
101
102 #endif
103