Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtpdmd / nlmsg.c
1 /* $XConsortium: nlmsg.c /main/1 1996/10/30 19:10:20 cde-hp $ */
2 /*
3  * dtpdmd/nlmsg.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 DTPDMD_CAT_NAME "dtpdmd"
24
25 #endif /* I18N_MSG */
26
27 /*
28  * ------------------------------------------------------------------------
29  * Default message values
30  */
31
32 /*** dtpdmd.c ***/
33 const char DtPdmdMsg_0001[]  = "\
34 usage: %1$s [options]\n\
35 \n\
36 where [options] includes:\n\
37    -d <display>        host:display[.screen] of X Print Server\n\
38    -a <alt selection>  an alternate selection name (\"%2$s\" default)\n\
39    -p <default pdm>    a default pdm to launch (\"%3$s\" default)\n\
40    -P <the pdm>        the pdm to launch, overrides all others\n\
41    -s                  turn on security protocol\n\
42    -f <auth file>      an initial set of authorization cookies\n\
43    -l <log file>       a file for the logging of errors, etc";
44
45 const char DtPdmdMsg_0002[]  = "%1$s: error, cannot open display %2$s\n";
46 const char DtPdmdMsg_0003[]  = "%1$s: error, cannot acquire selection %2$s\n";
47 const char DtPdmdMsg_0004[]  = "%s: error, cannot create Xt Signal Pipe\n";
48
49 /*** manager.c ***/
50
51 const char DtPdmdMsg_0005[]  = "%s: error, unable to get SelectionRequest property\n";
52 const char DtPdmdMsg_0006[]  = "%s: error, invalid format for SelectionRequest property\n";
53 const char DtPdmdMsg_0007[]  = "%s: error, XmbTextPropertyToTestList failed on SelectionRequest property\n";
54 const char DtPdmdMsg_0008[]  = "%s: error, unable to create message pipe\n";
55 const char DtPdmdMsg_0009[]  = "%s: error, unable to fork\n";
56 const char DtPdmdMsg_0010[] = "%1$s: error, cannot execute \"%2$s\" \n";
57
58 const char DtPdmdMsg_0011[] = "\
59 %1$s: exec message logged at %2$s\n\
60    exec error message = \"%3$s\"\n\
61    exec error code    = %4$s\n\
62    pdm                = \"%5$s\"\n\
63    -display           = \"%6$s\"\n\
64    -vdisplay          = \"%7$s\" \n";
65
66 const char DtPdmdMsg_0012[] = "\
67 %1$s: error, unable to send the final %2$s\n\
68 message to the requesting client on behalf of\n\
69 the PDM because of a generated X error\n";
70
71 const char DtPdmdMsg_0013[] = "\
72 %1$s: error, unable to send the final %2$s\n\
73 message to the requesting client on behalf of\n\
74 the PDM because of an XIO error\n";
75
76 const char DtPdmdMsg_0014[] = "\
77 %1$s: pdm message logged at %2$s\n\
78    pdm       = \"%3$s\"\n\
79    -display  = \"%4$s\"\n\
80    -vdisplay = \"%5$s\"\n\
81    exit code = \"%6$d\"\n\
82    stderr    = \"%7$s\" \n";
83
84 const char DtPdmdMsg_0015[] = "\
85    attached pdmd error= \n\"%s\" \n";
86
87 const char DtPdmdMsg_0016[] = "%1$s: error, cannot open log file \"%2$s\". Turning off stderr message logging\n";
88
89 #ifdef I18N_MSG
90
91 /*
92  * ------------------------------------------------------------------------
93  * Name: DtPdmdGetMessage
94  *
95  * Parameters:
96  *
97  *   int        set -           The message catalog set number.
98  *
99  *   int        n -             The message number.
100  *
101  *   char       *s -            The default message if the message is not
102  *                              retrieved from a message catalog.
103  *
104  * Returns: the string for set 'set' and number 'n'.
105  */
106 const char *
107 DtPdmdGetMessage(
108                 int set,
109                 int n,
110                 char * s)
111 {
112     char *msg;
113     nl_catd catopen();
114     char *catgets();
115     static int first = 1;
116     static nl_catd nlmsg_fd;
117     
118     if(set == -1 || n == -1)
119         return s;
120     
121     if(first) 
122     {
123         first = 0;
124         nlmsg_fd = catopen(DTPDMD_CAT_NAME, NL_CAT_LOCALE);
125     }
126     msg=catgets(nlmsg_fd,set,n,s);
127     return (msg);
128 }
129 #endif /* I18N_MSG */