2 * This program is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation, either version 3 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #define RNC_FILE_IS_NOT_RNC (-1)
27 #define RNC_HUF_DECODE_ERROR (-2)
28 #define RNC_FILE_SIZE_MISMATCH (-3)
29 #define RNC_PACKED_CRC_ERROR (-4)
30 #define RNC_UNPACKED_CRC_ERROR (-5)
34 * The compressor needs this define
36 #define RNC_SIGNATURE (0x524E4301) /* "RNC\001" */
39 extern int rnc_sign (const void *packed
) __attribute__((pure
)); // is RNC signature valid? (!0: yes)
40 extern int rnc_plen (const void *packed
) __attribute__((pure
)); // packed data length
41 extern int rnc_ulen (const void *packed
) __attribute__((pure
)); // unpacked data length
42 extern int rnc_over (const void *packed
) __attribute__((pure
)); // overlap data for in-place unpacking
43 extern int rnc_unpack (const void *packed
, void *unpacked
, int *leeway
); // packed data must contain 4 extra zero bytes
44 extern const char *rnc_error (int errcode
) __attribute__((const));
45 extern int rnc_crc (const void *data
, int len
);
47 extern void *rnc_pack (const void *original
, int datalen
, int *packlen
);