2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: dtpdmdP.h /main/6 1996/10/30 19:11:15 cde-hp $ */
24 /******************************************************************************
25 ******************************************************************************
29 ** Description: misc header stuff for the dtpdmd
31 ** (c) Copyright 1995, 1996, Hewlett-Packard Company, all rights reserved.
33 ******************************************************************************
34 *****************************************************************************/
44 #include "X11/Xlibint.h"
45 #include "X11/Intrinsic.h"
46 #include "X11/Xatom.h"
47 #if 0 && defined(PRINTING_SUPPORTED)
48 #include <X11/extensions/Print.h>
49 #endif /* PRINTING_SUPPORTED */
50 #include <X11/Xauth.h>
53 /*****************************************************************************
55 * dtpdm/dtpdmd Protocol
57 #include <Dt/dtpdmd.h>
60 /******************************************************************************
62 * Child Tracking Record - for each fork/exec'ed child, the following
63 * structure is added to an array to maintain status on the child.
68 * Manager selection portion.
70 Bool mgr_flag; /* is MGR tracking portion active */
72 char *video_display_str; /* Video Server Connection Info */
75 char *print_display_str; /* Print Server Connection Info */
77 #if 0 && defined(PRINTING_SUPPORTED)
78 XPContext print_context;
79 #endif /* PRINTING_SUPPORTED */
82 Display *selection_display; /* Selection & Property Connection */
87 Time time; /* time of selection request */
89 Bool seldpy_as_printdpy; /* Can the selection display connection
90 be used in lieu of opening a new
91 print display connection? */
94 * fork/exec and SIGCLD tracking portion.
99 int message_pipe[2]; /* pipe fildes, -1 if disconnected */
100 XtInputId message_xtid; /* XtAddInput id for message handler */
101 char *message_string; /* child's stderr */
102 char *message_string2; /* dtpdmd's addition to child's err */
106 char **pdm_exec_argvs; /* PDM exec string in argv[] format */
107 char *pdm_exec_errormessage; /* exec error message (opt) for log */
108 Atom pdm_exec_errorcode; /* exec error code */
109 pid_t pid; /* pid of child */
110 Bool do_launch_reply; /* can someone call mgr_launch_reply? */
113 Bool exit_received; /* child has exited (SIGCLD) */
114 int exit_code; /* exit code */
117 * Mailbox selection portion.
119 Bool mbox_flag; /* do we have valid cookies */
120 Window mbox_window; /* assigned window serving as mbox */
121 char *in_buf; /* partial-cookie crumbs received */
122 int in_sofar; /* - total in so far */
123 int in_expected; /* - grand total expected */
125 Xauth **cookies; /* completed cookie collection */
126 int cookie_cnt; /* cookie cnt - partial & completed */
127 short cookie_state; /* 0 = NULL term, 1 = non-NULL term,
129 char auth_filename[L_tmpnam];
131 } XpPdmServiceRec, *XpPdmServiceList;
133 /******************************************************************************
135 * Global dtpdmd information. Rather than pass it around in
136 * parameter lists, clump in all in one global.
141 * Type Atom References
143 Atom pdm_selection; /* PDM Selection */
144 Atom pdm_targets; /* - target */
145 Atom pdm_timestamp; /* - target */
146 Atom pdm_multiple; /* - target */
147 Atom pdm_start; /* - target */
148 Atom pdm_start_ok; /* - status code */
149 Atom pdm_start_vxauth; /* - status code */
150 Atom pdm_start_pxauth; /* - status code */
151 Atom pdm_start_error; /* - status code */
153 Atom pdm_reply; /* OK/Cancel SendMessage type */
154 Atom pdm_exit_ok; /* - status code */
155 Atom pdm_exit_cancel; /* - status code */
156 Atom pdm_exit_vxauth; /* - status code */
157 Atom pdm_exit_pxauth; /* - status code */
158 Atom pdm_exit_error; /* - status code */
160 Atom pdm_mbox; /* - target */
162 Atom pdm_mail; /* Cookie-Package SendMessage type */
165 * X-Selection Information
169 Time time; /* time selection was owned */
174 char *default_pdm, *override_pdm;
177 * Child Service Tracking Record Information
180 int maxServiceRecNum;
181 XpPdmServiceRec **serviceRecs;
186 XtAppContext context;
194 unsigned char xerrno;
195 unsigned char xerrreq;
196 unsigned char xerrmin;
197 } XpPdmGlobals, *XpPdmGlobalsP;
199 /******************************************************************************
203 * In each group, one module will define, and all other modules
204 * will make extern references to them. Here are the extern
205 * reference statements.
209 extern void dispatch_mgr();
210 extern void dispatch_mbox();
211 extern void dispatch_targets();
212 extern void dispatch_multiple();
213 extern void dispatch_timestamp();
214 extern void dispatch_not_supported();
217 extern XpPdmGlobals g;
220 extern void mbox_initialize();
221 extern void mbox_build();
222 extern void mbox_reply();
223 extern void mbox_receive();
226 extern void mgr_initialize();
227 extern void mgr_launch_pdm();
228 extern void mgr_fetch_pdm();
229 extern void mgr_launch_reply();
230 extern void mgr_shutdown_reply();
231 extern void mgr_shutdown_scan();
234 extern XpPdmServiceRec *find_rec();
235 extern XpPdmServiceRec *find_rec_by_mbox_win();
236 extern void delete_rec( XpPdmServiceRec *rec );
239 extern Bool _PdmMgrSetup();
242 extern jmp_buf xio_quickie_jmp_buf;
243 extern int xio_quickie_handler();
244 extern char *xpstrdup();
245 extern int xpstrspn();
246 extern int xpstrcspn();
247 extern char *xpstrtok();
248 extern void xp_add_argv();