Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtpdm / PdmMsgs.c
1 /* $XConsortium: PdmMsgs.c /main/3 1996/08/12 18:42:25 cde-hp $ */
2 /*
3  * dtpdm/PdmMsgs.c
4  */
5 /*
6  * (c) Copyright 1996 Digital Equipment Corporation.
7  * (c) Copyright 1996 Hewlett-Packard Company.
8  * (c) Copyright 1996 International Business Machines Corp.
9  * (c) Copyright 1996 Sun Microsystems, Inc.
10  * (c) Copyright 1996 Novell, Inc. 
11  * (c) Copyright 1996 FUJITSU LIMITED.
12  * (c) Copyright 1996 Hitachi.
13  */
14
15 #ifdef I18N_MSG
16
17 #include <nl_types.h>
18
19 #if !defined(NL_CAT_LOCALE)
20 #define NL_CAT_LOCALE 0
21 #endif 
22
23 #define DTPDM_CAT_NAME "dtpdm"
24
25 #endif /* I18N_MSG */
26
27 /*
28  * ------------------------------------------------------------------------
29  * Default message values
30  */
31 const char DtPdmMsg_0001[] = "Locale unsupported by X";
32 const char DtPdmMsg_0002[] = "Auto-select";
33 const char DtPdmMsg_0003[] = "Default";
34 const char DtPdmMsg_0004[] = "Syntax error parsing medium-source-sizes";
35 const char DtPdmMsg_0005[] = "Syntax error parsing input-trays-medium";
36 const char DtPdmMsg_0006[] = "Syntax error parsing document format";
37
38
39 #ifdef I18N_MSG
40
41 /*
42  * ------------------------------------------------------------------------
43  * Name: DtPdmGetMessage
44  *
45  * Parameters:
46  *
47  *   int        set -           The message catalog set number.
48  *
49  *   int        n -             The message number.
50  *
51  *   char       *s -            The default message if the message is not
52  *                              retrieved from a message catalog.
53  *
54  * Returns: the string for set 'set' and number 'n'.
55  */
56 const char *
57 DtPdmGetMessage(
58                 int set,
59                 int n,
60                 char * s)
61 {
62     char *msg;
63     nl_catd catopen();
64     char *catgets();
65     static int first = 1;
66     static nl_catd nlmsg_fd;
67     
68     if(set == -1 || n == -1)
69         return s;
70     
71     if(first) 
72     {
73         first = 0;
74         nlmsg_fd = catopen(DTPDM_CAT_NAME, NL_CAT_LOCALE);
75     }
76     msg=catgets(nlmsg_fd,set,n,s);
77     return (msg);
78 }
79 #endif /* I18N_MSG */