xref: /aosp_15_r20/external/libcups/cups/transcode.h (revision 5e7646d21f1134fb0638875d812ef646c12ab91e)
1*5e7646d2SAndroid Build Coastguard Worker /*
2*5e7646d2SAndroid Build Coastguard Worker  * Transcoding definitions for CUPS.
3*5e7646d2SAndroid Build Coastguard Worker  *
4*5e7646d2SAndroid Build Coastguard Worker  * Copyright 2007-2011 by Apple Inc.
5*5e7646d2SAndroid Build Coastguard Worker  * Copyright 1997-2006 by Easy Software Products.
6*5e7646d2SAndroid Build Coastguard Worker  *
7*5e7646d2SAndroid Build Coastguard Worker  * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
8*5e7646d2SAndroid Build Coastguard Worker  */
9*5e7646d2SAndroid Build Coastguard Worker 
10*5e7646d2SAndroid Build Coastguard Worker #ifndef _CUPS_TRANSCODE_H_
11*5e7646d2SAndroid Build Coastguard Worker #  define _CUPS_TRANSCODE_H_
12*5e7646d2SAndroid Build Coastguard Worker 
13*5e7646d2SAndroid Build Coastguard Worker /*
14*5e7646d2SAndroid Build Coastguard Worker  * Include necessary headers...
15*5e7646d2SAndroid Build Coastguard Worker  */
16*5e7646d2SAndroid Build Coastguard Worker 
17*5e7646d2SAndroid Build Coastguard Worker #  include "language.h"
18*5e7646d2SAndroid Build Coastguard Worker 
19*5e7646d2SAndroid Build Coastguard Worker #  ifdef __cplusplus
20*5e7646d2SAndroid Build Coastguard Worker extern "C" {
21*5e7646d2SAndroid Build Coastguard Worker #  endif /* __cplusplus */
22*5e7646d2SAndroid Build Coastguard Worker 
23*5e7646d2SAndroid Build Coastguard Worker 
24*5e7646d2SAndroid Build Coastguard Worker /*
25*5e7646d2SAndroid Build Coastguard Worker  * Constants...
26*5e7646d2SAndroid Build Coastguard Worker  */
27*5e7646d2SAndroid Build Coastguard Worker 
28*5e7646d2SAndroid Build Coastguard Worker #  define CUPS_MAX_USTRING	8192	/* Max size of Unicode string */
29*5e7646d2SAndroid Build Coastguard Worker 
30*5e7646d2SAndroid Build Coastguard Worker 
31*5e7646d2SAndroid Build Coastguard Worker /*
32*5e7646d2SAndroid Build Coastguard Worker  * Types...
33*5e7646d2SAndroid Build Coastguard Worker  */
34*5e7646d2SAndroid Build Coastguard Worker 
35*5e7646d2SAndroid Build Coastguard Worker typedef unsigned char  cups_utf8_t;	/* UTF-8 Unicode/ISO-10646 unit */
36*5e7646d2SAndroid Build Coastguard Worker typedef unsigned long  cups_utf32_t;	/* UTF-32 Unicode/ISO-10646 unit */
37*5e7646d2SAndroid Build Coastguard Worker typedef unsigned short cups_ucs2_t;	/* UCS-2 Unicode/ISO-10646 unit */
38*5e7646d2SAndroid Build Coastguard Worker typedef unsigned long  cups_ucs4_t;	/* UCS-4 Unicode/ISO-10646 unit */
39*5e7646d2SAndroid Build Coastguard Worker typedef unsigned char  cups_sbcs_t;	/* SBCS Legacy 8-bit unit */
40*5e7646d2SAndroid Build Coastguard Worker typedef unsigned short cups_dbcs_t;	/* DBCS Legacy 16-bit unit */
41*5e7646d2SAndroid Build Coastguard Worker typedef unsigned long  cups_vbcs_t;	/* VBCS Legacy 32-bit unit */
42*5e7646d2SAndroid Build Coastguard Worker 					/* EUC uses 8, 16, 24, 32-bit */
43*5e7646d2SAndroid Build Coastguard Worker 
44*5e7646d2SAndroid Build Coastguard Worker 
45*5e7646d2SAndroid Build Coastguard Worker /*
46*5e7646d2SAndroid Build Coastguard Worker  * Prototypes...
47*5e7646d2SAndroid Build Coastguard Worker  */
48*5e7646d2SAndroid Build Coastguard Worker 
49*5e7646d2SAndroid Build Coastguard Worker extern int	cupsCharsetToUTF8(cups_utf8_t *dest,
50*5e7646d2SAndroid Build Coastguard Worker 				  const char *src,
51*5e7646d2SAndroid Build Coastguard Worker 				  const int maxout,
52*5e7646d2SAndroid Build Coastguard Worker 				  const cups_encoding_t encoding) _CUPS_API_1_2;
53*5e7646d2SAndroid Build Coastguard Worker extern int	cupsUTF8ToCharset(char *dest,
54*5e7646d2SAndroid Build Coastguard Worker 				  const cups_utf8_t *src,
55*5e7646d2SAndroid Build Coastguard Worker 				  const int maxout,
56*5e7646d2SAndroid Build Coastguard Worker 				  const cups_encoding_t encoding) _CUPS_API_1_2;
57*5e7646d2SAndroid Build Coastguard Worker extern int	cupsUTF8ToUTF32(cups_utf32_t *dest,
58*5e7646d2SAndroid Build Coastguard Worker 				const cups_utf8_t *src,
59*5e7646d2SAndroid Build Coastguard Worker 				const int maxout) _CUPS_API_1_2;
60*5e7646d2SAndroid Build Coastguard Worker extern int	cupsUTF32ToUTF8(cups_utf8_t *dest,
61*5e7646d2SAndroid Build Coastguard Worker 				const cups_utf32_t *src,
62*5e7646d2SAndroid Build Coastguard Worker 				const int maxout) _CUPS_API_1_2;
63*5e7646d2SAndroid Build Coastguard Worker 
64*5e7646d2SAndroid Build Coastguard Worker #  ifdef __cplusplus
65*5e7646d2SAndroid Build Coastguard Worker }
66*5e7646d2SAndroid Build Coastguard Worker #  endif /* __cplusplus */
67*5e7646d2SAndroid Build Coastguard Worker 
68*5e7646d2SAndroid Build Coastguard Worker #endif /* !_CUPS_TRANSCODE_H_ */
69