]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/codepage.h
Joe Clarke's fix for linux/quota.h checking, removed NO_DLFCN_H define
[netatalk.git] / etc / afpd / codepage.h
1 #ifndef AFPD_CODEPAGE_H
2 #define AFPD_CODEPAGE_H 1
3
4 /* 
5  * header of a codepage --
6  * file magic:                   2 bytes
7  * file version:                 1 byte
8  * size of name:                 1 byte
9  * quantum:                      1 byte
10  * rules:                        1 byte
11  * offset to data:               2 bytes (network byte order)
12  * size of data:                 2 bytes (network byte order)
13  * name:                         strlen(name) bytes (padded)
14  * 
15  * data for a version 2 codepage --
16  * mapping rule: 1 byte
17  * mac/bad code:     <quantum> bytes
18  * xlate/rule code:  <quantum> bytes
19  * ...
20  */
21
22 #define CODEPAGE_FILE_ID 0xCFAF
23 #define CODEPAGE_FILE_VERSION 0x02
24 #define CODEPAGE_FILE_HEADER_SIZE 10
25
26 /* m->u and u->m mappings */
27 #define CODEPAGE_RULE_MTOU       (1 << 0)
28 #define CODEPAGE_RULE_UTOM       (1 << 1)
29 #define CODEPAGE_RULE_BADU       (1 << 2)
30
31 /* rules for bad character assignment.
32  *
33  * bit assignments:
34  * bit 0 set:  it's an illegal character
35  *     unset:  it's okay
36  *
37  * bit 1 set:  bad anywhere
38  *     unset:  only check at the beginning of each quantum. 
39  *
40  * bit 2 set:  all quanta are the same length
41  *     unset:  quanta beginning with ascii characters are 1-byte long  
42  *
43  */
44 #define CODEPAGE_BADCHAR_SET      (1 << 0) 
45 #define CODEPAGE_BADCHAR_ANYWHERE (1 << 1)  
46 #define CODEPAGE_BADCHAR_QUANTUM  (1 << 2) 
47 #endif