]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/language-private.h
Generate strings files for localizing PPD options (Issue #5194)
[thirdparty/cups.git] / cups / language-private.h
CommitLineData
ef416fc2 1/*
503b54c9 2 * Private localization support for CUPS.
ef416fc2 3 *
c245abfe 4 * Copyright 2007-2017 by Apple Inc.
503b54c9 5 * Copyright 1997-2006 by Easy Software Products.
ef416fc2 6 *
e3101897 7 * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
ef416fc2 8 */
9
71e16022
MS
10#ifndef _CUPS_LANGUAGE_PRIVATE_H_
11# define _CUPS_LANGUAGE_PRIVATE_H_
ef416fc2 12
13/*
14 * Include necessary headers...
15 */
16
d6ae789d 17# include <stdio.h>
71e16022 18# include <cups/transcode.h>
454708a4
MS
19# ifdef __APPLE__
20# include <CoreFoundation/CoreFoundation.h>
21# endif /* __APPLE__ */
ef416fc2 22
23# ifdef __cplusplus
24extern "C" {
25# endif /* __cplusplus */
26
27
28/*
29 * Macro for localized text...
30 */
31
32# define _(x) x
33
34
89550f3f
MS
35/*
36 * Constants...
37 */
38
84de5e92 39# define _CUPS_MESSAGE_PO 0 /* Message file is in GNU .po format */
89550f3f
MS
40# define _CUPS_MESSAGE_UNQUOTE 1 /* Unescape \foo in strings? */
41# define _CUPS_MESSAGE_STRINGS 2 /* Message file is in Apple .strings format */
42
43
ef416fc2 44/*
45 * Types...
46 */
47
48typedef struct _cups_message_s /**** Message catalog entry ****/
49{
89550f3f 50 char *msg, /* Original string */
ef416fc2 51 *str; /* Localized string */
52} _cups_message_t;
53
54
55/*
56 * Prototypes...
57 */
58
f8b3a85b 59# ifdef __APPLE__
454708a4
MS
60extern const char *_cupsAppleLanguage(const char *locale, char *language, size_t langsize);
61extern const char *_cupsAppleLocale(CFStringRef languageName, char *locale, size_t localesize);
f8b3a85b 62# endif /* __APPLE__ */
d6ae789d 63extern void _cupsCharmapFlush(void);
ef416fc2 64extern const char *_cupsEncodingName(cups_encoding_t encoding);
0837b7e8
MS
65extern void _cupsLangPrintError(const char *prefix,
66 const char *message);
67extern int _cupsLangPrintFilter(FILE *fp, const char *prefix,
68 const char *message, ...)
85dda01c 69 __attribute__ ((__format__ (__printf__, 3, 4)));
fa73b229 70extern int _cupsLangPrintf(FILE *fp, const char *message, ...)
85dda01c 71 __attribute__ ((__format__ (__printf__, 2, 3)));
fa73b229 72extern int _cupsLangPuts(FILE *fp, const char *message);
0837b7e8
MS
73extern const char *_cupsLangString(cups_lang_t *lang,
74 const char *message);
ef416fc2 75extern void _cupsMessageFree(cups_array_t *a);
89550f3f 76extern cups_array_t *_cupsMessageLoad(const char *filename, int flags);
ef416fc2 77extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
a29fd7dd 78extern cups_array_t *_cupsMessageNew(void *context);
2fa1ba3c 79extern int _cupsMessageSave(const char *filename, int flags, cups_array_t *a);
07725fee 80extern void _cupsSetLocale(char *argv[]);
ef416fc2 81
a603edef 82
ef416fc2 83# ifdef __cplusplus
84}
85# endif /* __cplusplus */
86
71e16022 87#endif /* !_CUPS_LANGUAGE_PRIVATE_H_ */