Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtpdm / PdmMsgs.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: PdmMsgs.c /main/3 1996/08/12 18:42:25 cde-hp $ */
24 /*
25  * dtpdm/PdmMsgs.c
26  */
27 /*
28  * (c) Copyright 1996 Digital Equipment Corporation.
29  * (c) Copyright 1996 Hewlett-Packard Company.
30  * (c) Copyright 1996 International Business Machines Corp.
31  * (c) Copyright 1996 Sun Microsystems, Inc.
32  * (c) Copyright 1996 Novell, Inc. 
33  * (c) Copyright 1996 FUJITSU LIMITED.
34  * (c) Copyright 1996 Hitachi.
35  */
36
37 #ifdef I18N_MSG
38
39 #include <nl_types.h>
40
41 #if !defined(NL_CAT_LOCALE)
42 #define NL_CAT_LOCALE 0
43 #endif 
44
45 #define DTPDM_CAT_NAME "dtpdm"
46
47 #endif /* I18N_MSG */
48
49 /*
50  * ------------------------------------------------------------------------
51  * Default message values
52  */
53 const char DtPdmMsg_0001[] = "Locale unsupported by X";
54 const char DtPdmMsg_0002[] = "Auto-select";
55 const char DtPdmMsg_0003[] = "Default";
56 const char DtPdmMsg_0004[] = "Syntax error parsing medium-source-sizes";
57 const char DtPdmMsg_0005[] = "Syntax error parsing input-trays-medium";
58 const char DtPdmMsg_0006[] = "Syntax error parsing document format";
59
60
61 #ifdef I18N_MSG
62
63 /*
64  * ------------------------------------------------------------------------
65  * Name: DtPdmGetMessage
66  *
67  * Parameters:
68  *
69  *   int        set -           The message catalog set number.
70  *
71  *   int        n -             The message number.
72  *
73  *   char       *s -            The default message if the message is not
74  *                              retrieved from a message catalog.
75  *
76  * Returns: the string for set 'set' and number 'n'.
77  */
78 const char *
79 DtPdmGetMessage(
80                 int set,
81                 int n,
82                 char * s)
83 {
84     char *msg;
85     nl_catd catopen();
86     char *catgets();
87     static int first = 1;
88     static nl_catd nlmsg_fd;
89     
90     if(set == -1 || n == -1)
91         return s;
92     
93     if(first) 
94     {
95         first = 0;
96         nlmsg_fd = catopen(DTPDM_CAT_NAME, NL_CAT_LOCALE);
97     }
98     msg=catgets(nlmsg_fd,set,n,s);
99     return (msg);
100 }
101 #endif /* I18N_MSG */