/usr/share/doc/libxml-encoding-perl/encoding.h is in libxml-encoding-perl 2.09-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | /*****************************************************************
** encoding.h
**
** Copyright 1998 Clark Cooper
** All rights reserved.
**
** This program is free software; you can redistribute it and/or
** modify it under the same terms as Perl itself.
*/
#ifndef ENCODING_H
#define ENCODING_H 1
#define ENCMAP_MAGIC 0xfeebface
typedef struct prefixmap {
unsigned char min;
unsigned char len; /* 0 => 256 */
unsigned short bmap_start;
unsigned char ispfx[32];
unsigned char ischar[32];
} PrefixMap;
typedef struct encinf
{
unsigned short prefixes_size;
unsigned short bytemap_size;
int firstmap[256];
PrefixMap *prefixes;
unsigned short *bytemap;
} Encinfo;
typedef struct encmaphdr
{
unsigned int magic;
char name[40];
unsigned short pfsize;
unsigned short bmsize;
int map[256];
} Encmap_Header;
/*================================================================
** Structure of Encoding map binary encoding
**
** Note that all shorts and ints are in network order,
** so when packing or unpacking with perl, use 'n' and 'N' respectively.
** In C, use the htonl family of functions.
**
** The basic structure is:
**
** _______________________
** |Header (including map expat needs for 1st byte)
** |PrefixMap * pfsize
** | This section isn't included for single-byte encodings.
** | For multiple byte encodings, when a byte represents a prefix
** | then it indexes into this vector instead of mapping to a
** | Unicode character. The PrefixMap type is declared above. The
** | ispfx and ischar fields are bitvectors indicating whether
** | the byte being mapped is a prefix or character respectively.
** | If neither is set, then the character is not mapped to Unicode.
** |
** | The min field is the 1st byte mapped for this prefix; the
** | len field is the number of bytes mapped; and bmap_start is
** | the starting index of the map for this prefix in the overall
** | map (next section).
** |unsigned short * bmsize
** | This section also is omitted for single-byte encodings.
** | Each short is either a Unicode scalar or an index into the
** | PrefixMap vector.
**
** The header for these files is declared above as the Encmap_Header type.
** The magic field is a magic number which should match the ENCMAP_MAGIC
** macro above. The next 40 bytes stores IANA registered name for the
** encoding. The pfsize field holds the number of PrefixMaps, which should
** be zero for single byte encodings. The bmsize field holds the number of
** shorts used for the overall map.
**
** The map field contains either the Unicode scalar encoded by the 1st byte
** or -n where n is the number of bytes that such a 1st byte implies (Expat
** requires that the number of bytes to encode a character is indicated by
** the 1st byte) or -1 if the byte doesn't map to any Unicode character.
**
** If the encoding is a multiple byte encoding, then there will be PrefixMap
** and character map sections. The 1st PrefixMap (index 0), covers a range
** of bytes that includes all 1st byte prefixes.
**
** Look at convert_to_unicode in Expat.xs to see how this data structure
** is used.
*/
#endif /* ndef ENCODING_H */
|