2 * $Id: codepage.h,v 1.3 2001-12-03 05:03:38 jmarcus Exp $
5 #ifndef AFPD_CODEPAGE_H
6 #define AFPD_CODEPAGE_H 1
9 * header of a codepage --
11 * file version: 1 byte
12 * size of name: 1 byte
15 * offset to data: 2 bytes (network byte order)
16 * size of data: 2 bytes (network byte order)
17 * name: strlen(name) bytes (padded)
19 * data for a version 2 codepage --
20 * mapping rule: 1 byte
21 * mac/bad code: <quantum> bytes
22 * xlate/rule code: <quantum> bytes
26 #define CODEPAGE_FILE_ID 0xCFAF
27 #define CODEPAGE_FILE_VERSION 0x02
28 #define CODEPAGE_FILE_HEADER_SIZE 10
30 /* m->u and u->m mappings */
31 #define CODEPAGE_RULE_MTOU (1 << 0)
32 #define CODEPAGE_RULE_UTOM (1 << 1)
33 #define CODEPAGE_RULE_BADU (1 << 2)
35 /* rules for bad character assignment.
38 * bit 0 set: it's an illegal character
41 * bit 1 set: bad anywhere
42 * unset: only check at the beginning of each quantum.
44 * bit 2 set: all quanta are the same length
45 * unset: quanta beginning with ascii characters are 1-byte long
48 #define CODEPAGE_BADCHAR_SET (1 << 0)
49 #define CODEPAGE_BADCHAR_ANYWHERE (1 << 1)
50 #define CODEPAGE_BADCHAR_QUANTUM (1 << 2)