|
29 | 29 |
|
30 | 30 | #define CHD_SHA1_BYTES 20
|
31 | 31 |
|
32 |
| -/** |
33 |
| - * Error types that may occur when reading a CHD file or hunk. |
34 |
| - * |
35 |
| - * This type tries to be ABI-compatible with [libchdr](https://github.com/rtissera/libchdr/blob/6eeb6abc4adc094d489c8ba8cafdcff9ff61251b/include/libchdr/chd.h#L258), |
36 |
| - * given sane defaults in the C compiler. See [repr(C) in the Rustonomicon](https://doc.rust-lang.org/nomicon/other-reprs.html#reprc) for more details. |
37 |
| - */ |
38 |
| -typedef enum chd_error { |
39 |
| - /** |
40 |
| - * No error. |
41 |
| - * This is only used by the C API bindings. |
42 |
| - */ |
43 |
| - CHDERR_NONE, |
44 |
| - /** |
45 |
| - * No drive interface. |
46 |
| - * This is only for C-compatibility purposes and is otherwise unused. |
47 |
| - */ |
48 |
| - CHDERR_NO_INTERFACE, |
49 |
| - /** |
50 |
| - * Unable to allocate the required size of buffer. |
51 |
| - */ |
52 |
| - CHDERR_OUT_OF_MEMORY, |
53 |
| - /** |
54 |
| - * The file is not a valid CHD file. |
55 |
| - */ |
56 |
| - CHDERR_INVALID_FILE, |
57 |
| - /** |
58 |
| - * An invalid parameter was provided. |
59 |
| - */ |
60 |
| - CHDERR_INVALID_PARAMETER, |
61 |
| - /** |
62 |
| - * The data is invalid. |
63 |
| - */ |
64 |
| - CHDERR_INVALID_DATA, |
65 |
| - /** |
66 |
| - * The file was not found. |
67 |
| - */ |
68 |
| - CHDERR_FILE_NOT_FOUND, |
69 |
| - /** |
70 |
| - * This CHD requires a parent CHD that was not provided. |
71 |
| - */ |
72 |
| - CHDERR_REQUIRES_PARENT, |
73 |
| - /** |
74 |
| - * The provided file is not writable. |
75 |
| - * Since chd-rs does not implement CHD creation, this is unused. |
76 |
| - */ |
77 |
| - CHDERR_FILE_NOT_WRITEABLE, |
78 |
| - /** |
79 |
| - * An error occurred when reading this CHD file. |
80 |
| - */ |
81 |
| - CHDERR_READ_ERROR, |
82 |
| - /** |
83 |
| - * An error occurred when writing this CHD file. |
84 |
| - * Since chd-rs does not implement CHD creation, this is unused. |
85 |
| - */ |
86 |
| - CHDERR_WRITE_ERROR, |
87 |
| - /** |
88 |
| - * An error occurred when initializing a codec. |
89 |
| - */ |
90 |
| - CHDERR_CODEC_ERROR, |
91 |
| - /** |
92 |
| - * The provided parent CHD is invalid. |
93 |
| - */ |
94 |
| - CHDERR_INVALID_PARENT, |
95 |
| - /** |
96 |
| - * The request hunk is out of range for this CHD file. |
97 |
| - */ |
98 |
| - CHDERR_HUNK_OUT_OF_RANGE, |
99 |
| - /** |
100 |
| - * An error occurred when decompressing a hunk. |
101 |
| - */ |
102 |
| - CHDERR_DECOMPRESSION_ERROR, |
103 |
| - /** |
104 |
| - * An error occurred when compressing a hunk. |
105 |
| - * Since chd-rs does not implement CHD creation, this is unused. |
106 |
| - */ |
107 |
| - CHDERR_COMPRESSION_ERROR, |
108 |
| - /** |
109 |
| - * Could not create the file. |
110 |
| - * Since chd-rs does not implement CHD creation, this is unused. |
111 |
| - */ |
112 |
| - CHDERR_CANT_CREATE_FILE, |
113 |
| - /** |
114 |
| - * Could not verify the CHD. |
115 |
| - * This is only for C-compatibility purposes and is otherwise unused. |
116 |
| - */ |
117 |
| - CHDERR_CANT_VERIFY, |
118 |
| - /** |
119 |
| - * The requested operation is not supported. |
120 |
| - * This is only for C-compatibility purposes and is otherwise unused. |
121 |
| - */ |
122 |
| - CHDERR_NOT_SUPPORTED, |
123 |
| - /** |
124 |
| - * The requested metadata was not found. |
125 |
| - * This is only used by the C API bindings. |
126 |
| - */ |
127 |
| - CHDERR_METADATA_NOT_FOUND, |
128 |
| - /** |
129 |
| - * The metadata has an invalid size. |
130 |
| - * This is only for C-compatibility purposes and is otherwise unused. |
131 |
| - */ |
132 |
| - CHDERR_INVALID_METADATA_SIZE, |
133 |
| - /** |
134 |
| - * The CHD version of the provided file is not supported by this library. |
135 |
| - */ |
136 |
| - CHDERR_UNSUPPORTED_VERSION, |
137 |
| - /** |
138 |
| - * Unable to verify the CHD completely. |
139 |
| - * This is only for C-compatibility purposes and is otherwise unused. |
140 |
| - */ |
141 |
| - CHDERR_VERIFY_INCOMPLETE, |
142 |
| - /** |
143 |
| - * The requested metadata is invalid. |
144 |
| - */ |
145 |
| - CHDERR_INVALID_METADATA, |
146 |
| - /** |
147 |
| - * The internal state of the decoder/encoder is invalid. |
148 |
| - * This is only for C-compatibility purposes and is otherwise unused. |
149 |
| - */ |
150 |
| - CHDERR_INVALID_STATE, |
151 |
| - /** |
152 |
| - * An operation is already pending. |
153 |
| - * This is only for C-compatibility purposes and is otherwise unused. |
154 |
| - */ |
155 |
| - CHDERR_OPERATION_PENDING, |
156 |
| - /** |
157 |
| - * No async operations are allowed. |
158 |
| - * This is only for C-compatibility purposes and is otherwise unused. |
159 |
| - */ |
160 |
| - CHDERR_NO_ASYNC_OPERATION, |
161 |
| - /** |
162 |
| - * Decompressing the CHD requires a codec that is not supported. |
163 |
| - */ |
164 |
| - CHDERR_UNSUPPORTED_FORMAT, |
165 |
| - /** |
166 |
| - * Unknown error. |
167 |
| - */ |
168 |
| - CHDERR_UNKNOWN, |
169 |
| -} chd_error; |
170 |
| - |
171 | 32 | /**
|
172 | 33 | * An opaque type for an opened CHD file.
|
173 | 34 | */
|
|
0 commit comments