Fix warnings on FreeBSD
[oweals/cde.git] / cde / programs / ttsnoop / ttsnoop_stubs.C.src
1 /*** DTB_USER_CODE_START vvv Add file header below vvv ***/
2 //%%  (c) Copyright 1993, 1994 Hewlett-Packard Company
3 //%%  (c) Copyright 1993, 1994 International Business Machines Corp.
4 //%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
5 //%%  (c) Copyright 1993, 1994 Novell, Inc.
6 //%%  $XConsortium: ttsnoop_stubs.C.src /main/3 1995/11/06 17:14:48 rswiston $
7 /*** DTB_USER_CODE_END   ^^^ Add file header above ^^^ ***/
8
9 /*
10  * File: ttsnoop_stubs.c
11  * Contains: Module callbacks and connection functions
12  *
13  * This file was generated by dtcodegen, from module ttsnoop
14  *
15  * Any text may be added between the DTB_USER_CODE_START and
16  * DTB_USER_CODE_END comments (even non-C code). Descriptive comments
17  * are provided only as an aid.
18  *
19  *  ** EDIT ONLY WITHIN SECTIONS MARKED WITH DTB_USER_CODE COMMENTS.  **
20  *  ** ALL OTHER MODIFICATIONS WILL BE OVERWRITTEN. DO NOT MODIFY OR  **
21  *  ** DELETE THE GENERATED COMMENTS!                                 **
22  */
23
24 #include <stdio.h>
25 #include <Xm/Xm.h>
26 #include "dtb_utils.h"
27 #include "ttsnoop_ui.h"
28
29
30 /**************************************************************************
31  *** DTB_USER_CODE_START
32  ***
33  *** All necessary header files have been included.
34  ***
35  *** Add include files, types, macros, externs, and user functions here.
36  ***/
37
38 #include <unistd.h>
39
40 #if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
41 #include <fstream>
42 #include <strstream>
43 #else
44 #include <fstream.h>
45 #include <strstream.h>
46 #endif
47
48 #include "apiTracer_ui.h"
49 #include "DtTt.h"
50
51 extern "C" { const char *_tt_lib_version; };
52
53 extern std::ofstream    snoopStream;
54 extern unsigned int     globalSaveLines;
55 extern char *           traceScript;
56 extern const char *     globalVersionString;
57 extern Tt_pattern       snoopPat;
58 extern Boolean          snoopPatIsRegistered;
59
60 /*** DTB_USER_CODE_END
61  ***
62  *** End of user code section
63  ***
64  **************************************************************************/
65
66
67
68 void 
69 ttsnoop_Help_menu_On_Item_item_CB1(
70     Widget widget,
71     XtPointer clientData,
72     XtPointer callData
73 )
74 {
75     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
76     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
77     
78     dtb_do_onitem_help();
79     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
80     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
81 }
82
83
84 void 
85 fork_tttrace(
86     Widget widget,
87     XtPointer clientData,
88     XtPointer callData
89 )
90 {
91     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
92     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
93     
94     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
95     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
96     std::ostrstream tttraceCmd;
97     tttraceCmd << "unset TT_TRACE_SCRIPT; dtterm -sb -sl ";
98     tttraceCmd << globalSaveLines;
99     tttraceCmd << " -title tttrace -geometry 120x24 -e tttrace &";
100     DtTtSetLabel( instance->ttsnoopWin_label, "tttrace" );
101     system( tttraceCmd.str() );
102     delete tttraceCmd.str();
103     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
104 }
105
106
107 void 
108 turnOnTracing(
109     Widget widget,
110     XtPointer clientData,
111     XtPointer callData
112 )
113 {
114     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
115     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
116     
117     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
118     DtbApiTracerTracerInfo instance = &dtb_api_tracer_tracer;
119     if (!(instance->initialized))
120     {
121         dtb_api_tracer_tracer_initialize(
122                 instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
123     }
124     DtTtSetLabel( instance->cancelButton, "Stop" );
125     XtManageChild(instance->tracer_shellform);
126     tt_trace_control( 0 );
127     putenv( traceScript );
128     tt_trace_control( 1 );
129     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
130 }
131
132
133 void 
134 createMessage(
135     Widget widget,
136     XtPointer clientData,
137     XtPointer callData
138 )
139 {
140     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
141     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
142     
143     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
144     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
145     Tt_message msg = tt_message_create();
146     Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
147                                      "tt_message_create()", msg );
148     if (tt_is_err( status )) {
149             return;
150     }
151     DtTtCreated( DTTT_MESSAGE, msg );
152     Widget newWidget = DtTtMessageWidgetCreate( instance->ttsnoopWin, msg,
153                                                 DtTtMessageWidgetUpdate );
154     status = tt_ptr_error( newWidget );
155     if (tt_is_err( status )) {
156             return;
157     }
158     XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
159     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
160 }
161
162
163 void 
164 receiveMessage(
165     Widget widget,
166     XtPointer clientData,
167     XtPointer callData
168 )
169 {
170     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
171     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
172     
173     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
174     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
175     Tt_message msg = tt_message_receive();
176     Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
177                                      "tt_message_receive()", msg );
178     if (tt_is_err( status )) {
179             return;
180     }
181     if (msg == 0) {
182             return;
183     }
184     DtTtCreated( DTTT_MESSAGE, msg );
185     Widget newWidget = DtTtMessageWidgetCreate( instance->ttsnoopWin, msg,
186                                                 DtTtMessageWidgetUpdate );
187     status = tt_ptr_error( newWidget );
188     if (tt_is_err( status )) {
189             return;
190     }
191     XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
192     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
193 }
194
195
196 void 
197 openMessage(
198     Widget widget,
199     XtPointer clientData,
200     XtPointer callData
201 )
202 {
203     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
204     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
205     
206     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
207     _DtTtChooserSet( _DtTtChooserMessageOpen );
208     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
209 }
210
211
212 void 
213 destroyMessage(
214     Widget widget,
215     XtPointer clientData,
216     XtPointer callData
217 )
218 {
219     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
220     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
221     
222     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
223     _DtTtChooserSet( _DtTtChooserMessageDestroy );
224     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
225 }
226
227
228 void 
229 help_ttsnoop(
230     Widget widget,
231     XtPointer clientData,
232     XtPointer callData
233 )
234 {
235     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
236     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
237     
238     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
239     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
240     _DtMan( instance->ttsnoopWin_label, "ttsnoop" );
241     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
242 }
243
244
245 void 
246 help_tttrace(
247     Widget widget,
248     XtPointer clientData,
249     XtPointer callData
250 )
251 {
252     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
253     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
254     
255     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
256     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
257     _DtMan( instance->ttsnoopWin_label, "tttrace" );
258     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
259 }
260
261
262 void 
263 help_ttsession(
264     Widget widget,
265     XtPointer clientData,
266     XtPointer callData
267 )
268 {
269     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
270     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
271     
272     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
273     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
274     _DtMan( instance->ttsnoopWin_label, "ttsession" );
275     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
276 }
277
278
279 void 
280 help_tt_type_comp(
281     Widget widget,
282     XtPointer clientData,
283     XtPointer callData
284 )
285 {
286     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
287     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
288     
289     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
290     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
291     _DtMan( instance->ttsnoopWin_label, "tt_type_comp" );
292     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
293 }
294
295
296 void 
297 help_dbserver(
298     Widget widget,
299     XtPointer clientData,
300     XtPointer callData
301 )
302 {
303     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
304     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
305     
306     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
307     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
308     _DtMan( instance->ttsnoopWin_label, "rpc.ttdbserverd" );
309     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
310 }
311
312
313 void 
314 help_tttracefile(
315     Widget widget,
316     XtPointer clientData,
317     XtPointer callData
318 )
319 {
320     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
321     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
322     
323     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
324     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
325     _DtMan( instance->ttsnoopWin_label, "tttracefile" );
326     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
327 }
328
329
330 void 
331 help_tt_c(
332     Widget widget,
333     XtPointer clientData,
334     XtPointer callData
335 )
336 {
337     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
338     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
339     
340     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
341     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
342     _DtMan( instance->ttsnoopWin_label, "Tttt_c" );
343     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
344 }
345
346
347 void 
348 help_tttk(
349     Widget widget,
350     XtPointer clientData,
351     XtPointer callData
352 )
353 {
354     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
355     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
356     
357     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
358     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
359     _DtMan( instance->ttsnoopWin_label, "Tttttk" );
360     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
361 }
362
363
364 void 
365 helpUsenet(
366     Widget widget,
367     XtPointer clientData,
368     XtPointer callData
369 )
370 {
371     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
372     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
373     
374     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
375     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
376     char *buf = "news:alt.soft-sys.tooltalk";
377     _DtOpen( instance->ttsnoopWin_label, buf, strlen(buf), "altTT" );
378     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
379 }
380
381
382 void 
383 sessionTypesLoad(
384     Widget widget,
385     XtPointer clientData,
386     XtPointer callData
387 )
388 {
389     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
390     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
391     
392     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
393     _DtFileChooserSet( _DtFileChooseTypesLoad, 0 );
394     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
395 }
396
397
398 void 
399 sessionTypesReload(
400     Widget widget,
401     XtPointer clientData,
402     XtPointer callData
403 )
404 {
405     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
406     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
407     
408     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
409     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
410     Tt_message msg = ttdt_file_notice( 0, TTDT_SAVED, TT_BOTH,
411                                        "/etc/tt/types.xdr", 0 );
412     Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
413                                      "ttdt_file_notice()", msg );
414     if (tt_is_err( status )) {
415             return;
416     }
417     status = tt_message_send( msg );
418     if (tt_is_err( status )) {
419             DtTtSetLabel( instance->ttsnoopWin_label, "tt_message_send()",
420                           status );
421     }
422     DtTtCreated( DTTT_MESSAGE, msg );
423     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
424 }
425
426
427 void 
428 dumpSource(
429     Widget widget,
430     XtPointer clientData,
431     XtPointer callData
432 )
433 {
434     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
435     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
436     
437     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
438     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
439     _DtOpen( instance->ttsnoopWin_label, "tt_type_comp -p", "types" );
440     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
441 }
442
443
444 void 
445 typesEnumerate(
446     Widget widget,
447     XtPointer clientData,
448     XtPointer callData
449 )
450 {
451     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
452     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
453     
454     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
455     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
456     _DtOpen( instance->ttsnoopWin_label, "tt_type_comp -P", "types" );
457     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
458 }
459
460
461 void 
462 createPattern(
463     Widget widget,
464     XtPointer clientData,
465     XtPointer callData
466 )
467 {
468     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
469     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
470     
471     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
472     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
473     Tt_pattern pat = tt_pattern_create();
474     Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
475                                      "tt_pattern_create()", pat );
476     if (tt_is_err( status )) {
477             return;
478     }
479     DtTtCreated( DTTT_PATTERN, pat );
480     Widget newWidget = DtTtPatternWidgetCreate( instance->ttsnoopWin, pat, 0 );
481     status = tt_ptr_error( newWidget );
482     if (tt_is_err( status )) {
483             return;
484     }
485     XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
486     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
487 }
488
489
490 void 
491 openPattern(
492     Widget widget,
493     XtPointer clientData,
494     XtPointer callData
495 )
496 {
497     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
498     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
499     
500     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
501     _DtTtChooserSet( _DtTtChooserPatternOpen );
502     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
503 }
504
505
506 void 
507 destroyPattern(
508     Widget widget,
509     XtPointer clientData,
510     XtPointer callData
511 )
512 {
513     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
514     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
515     
516     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
517     _DtTtChooserSet( _DtTtChooserPatternDestroy );
518     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
519 }
520
521
522 void 
523 ptypeDeclare(
524     Widget widget,
525     XtPointer clientData,
526     XtPointer callData
527 )
528 {
529     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
530     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
531     
532     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
533     _DtStringChooserSet( _DtStringChoosePtype2Declare, 0 );
534     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
535 }
536
537
538 void 
539 mediaPtypeDeclare(
540     Widget widget,
541     XtPointer clientData,
542     XtPointer callData
543 )
544 {
545     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
546     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
547     
548     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
549     _DtStringChooserSet( _DtStringChooseMediaPtype2Declare, 0 );
550     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
551 }
552
553
554 void 
555 ptypeUnDeclare(
556     Widget widget,
557     XtPointer clientData,
558     XtPointer callData
559 )
560 {
561     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
562     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
563     
564     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
565     _DtStringChooserSet( _DtStringChoosePtype2UnDeclare, 0 );
566     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
567 }
568
569
570 void 
571 ptypeSetDefault(
572     Widget widget,
573     XtPointer clientData,
574     XtPointer callData
575 )
576 {
577     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
578     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
579     
580     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
581     _DtStringChooserSet( _DtStringChoosePtype2SetDefault, 0 );
582     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
583 }
584
585
586 void 
587 ptypeExists(
588     Widget widget,
589     XtPointer clientData,
590     XtPointer callData
591 )
592 {
593     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
594     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
595     
596     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
597     _DtStringChooserSet( _DtStringChoosePtype2Exists, 0 );
598     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
599 }
600
601
602 void 
603 libcSystem(
604     Widget widget,
605     XtPointer clientData,
606     XtPointer callData
607 )
608 {
609     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
610     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
611     
612     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
613     _DtStringChooserSet( _DtStringChooseSystem, 0 );
614     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
615 }
616
617
618 void 
619 libcChdir(
620     Widget widget,
621     XtPointer clientData,
622     XtPointer callData
623 )
624 {
625     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
626     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
627     
628     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
629     _DtFileChooserSet( _DtFileChooseChdir, 0 );
630     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
631 }
632
633
634 void 
635 libcPutenv(
636     Widget widget,
637     XtPointer clientData,
638     XtPointer callData
639 )
640 {
641     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
642     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
643     
644     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
645     _DtStringChooserSet( _DtStringChoosePutenv, 0 );
646     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
647 }
648
649
650 void 
651 libcPause(
652     Widget widget,
653     XtPointer clientData,
654     XtPointer callData
655 )
656 {
657     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
658     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
659     
660     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
661     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
662     std::ostrstream advice;
663     advice << "pause(); /* kill -CONT " << getpid() << " */";
664     DtTtSetLabel( instance->ttsnoopWin_label, advice.str() );
665     delete advice.str();
666
667     //
668     // run "(if dterror.ds blah blah; then kill -CONT pid; fi)&"
669     //
670     std::ostrstream script;
671     script << "(if dterror.ds ";
672     // arg 1: text
673     script << "\"kill -CONT " << getpid() << "\" ";
674     // arg 2: window title
675     script << "\"pause()\" ";
676     // arg 3: confirmation button label
677     script << "CONT; then ";
678     // After confirmation, invoke kill(1)
679     script << "kill -CONT " << getpid() << "; fi)&";
680     system( script.str() );
681     delete script.str();
682
683     // Run the event loop a few laps, to paint the footer
684     tttk_block_while( XtWidgetToApplicationContext( widget ), 0, 50 );
685
686     pause();
687     DtTtSetLabel( instance->ttsnoopWin_label, " " );
688     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
689 }
690
691
692 void 
693 libcExit(
694     Widget widget,
695     XtPointer clientData,
696     XtPointer callData
697 )
698 {
699     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
700     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
701     
702     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
703     exit( 0 );
704     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
705 }
706
707
708 void 
709 msgActions(
710     Widget widget,
711     XtPointer clientData,
712     XtPointer callData
713 )
714 {
715     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
716     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
717     
718     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
719     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
720     _DtOpen( instance->ttsnoopWin_label,
721              "dttypes -db ACTION -w fld_name TYPE fld_value TT_MSG", "actns" );
722     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
723 }
724
725
726 void 
727 sessionJoin(
728     Widget widget,
729     XtPointer clientData,
730     XtPointer callData
731 )
732 {
733     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
734     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
735     
736     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
737     _DtSessionChooserSet( _DtSessionChooseJoin, 0 );
738     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
739 }
740
741
742 void 
743 dtSessionJoin(
744     Widget widget,
745     XtPointer clientData,
746     XtPointer callData
747 )
748 {
749     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
750     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
751     
752     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
753     _DtSessionChooserSet( _DtSessionChooseDtJoin, 0 );
754     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
755 }
756
757
758 void 
759 sessionQuit(
760     Widget widget,
761     XtPointer clientData,
762     XtPointer callData
763 )
764 {
765     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
766     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
767     
768     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
769     _DtSessionChooserSet( _DtSessionChooseQuit, 0 );
770     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
771 }
772
773
774 void 
775 sessionSetDefault(
776     Widget widget,
777     XtPointer clientData,
778     XtPointer callData
779 )
780 {
781     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
782     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
783     
784     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
785     _DtSessionChooserSet( _DtSessionChooseDefault, 0 );
786     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
787 }
788
789
790 void 
791 fileJoin(
792     Widget widget,
793     XtPointer clientData,
794     XtPointer callData
795 )
796 {
797     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
798     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
799     
800     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
801     _DtFileChooserSet( _DtFileChooseJoin, 0 );
802     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
803 }
804
805
806 void 
807 fileDesktopJoin(
808     Widget widget,
809     XtPointer clientData,
810     XtPointer callData
811 )
812 {
813     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
814     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
815     
816     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
817     _DtFileChooserSet( _DtFileChooseDtJoin, 0 );
818     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
819 }
820
821
822 void 
823 fileQuit(
824     Widget widget,
825     XtPointer clientData,
826     XtPointer callData
827 )
828 {
829     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
830     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
831     
832     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
833     _DtFileChooserSet( _DtFileChooseQuit, 0 );
834     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
835 }
836
837
838 void 
839 fileSetDefault(
840     Widget widget,
841     XtPointer clientData,
842     XtPointer callData
843 )
844 {
845     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
846     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
847     
848     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
849     _DtFileChooserSet( _DtFileChooseDefault, 0 );
850     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
851 }
852
853
854 void 
855 fileUnSetDefault(
856     Widget widget,
857     XtPointer clientData,
858     XtPointer callData
859 )
860 {
861     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
862     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
863     
864     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
865     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
866     Tt_status status = tt_default_file_set( 0 );
867     DtTtSetLabel( instance->ttsnoopWin_label, "tt_default_file_set( 0 )",
868                   status );
869     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
870 }
871
872
873 void 
874 fileSaved(
875     Widget widget,
876     XtPointer clientData,
877     XtPointer callData
878 )
879 {
880     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
881     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
882     
883     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
884     _DtTtChooserSet( _DtTtChooserDtFileSaved );
885     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
886 }
887
888
889 void 
890 fileModified(
891     Widget widget,
892     XtPointer clientData,
893     XtPointer callData
894 )
895 {
896     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
897     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
898     
899     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
900     _DtTtChooserSet( _DtTtChooserDtFileModified );
901     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
902 }
903
904
905 void 
906 fileReverted(
907     Widget widget,
908     XtPointer clientData,
909     XtPointer callData
910 )
911 {
912     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
913     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
914     
915     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
916     _DtTtChooserSet( _DtTtChooserDtFileReverted );
917     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
918 }
919
920
921 void 
922 fileGetModified(
923     Widget widget,
924     XtPointer clientData,
925     XtPointer callData
926 )
927 {
928     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
929     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
930     
931     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
932     _DtFileChooserSet( _DtFileChooseGetModified, 0 );
933     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
934 }
935
936
937 void 
938 fileSave(
939     Widget widget,
940     XtPointer clientData,
941     XtPointer callData
942 )
943 {
944     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
945     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
946     
947     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
948     _DtFileChooserSet( _DtFileChooseSave, 0 );
949     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
950 }
951
952
953 void 
954 fileRevert(
955     Widget widget,
956     XtPointer clientData,
957     XtPointer callData
958 )
959 {
960     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
961     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
962     
963     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
964     _DtFileChooserSet( _DtFileChooseRevert, 0 );
965     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
966 }
967
968
969 void 
970 fileNetfile(
971     Widget widget,
972     XtPointer clientData,
973     XtPointer callData
974 )
975 {
976     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
977     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
978     
979     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
980     _DtFileChooserSet( _DtFileChooseNetfile, 0 );
981     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
982 }
983
984
985 void 
986 netfileFile(
987     Widget widget,
988     XtPointer clientData,
989     XtPointer callData
990 )
991 {
992     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
993     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
994     
995     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
996     _DtStringChooserSet( _DtStringChooseNetfile2File, 0 );
997     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
998 }
999
1000
1001 void 
1002 fileDesktopQuit(
1003     Widget widget,
1004     XtPointer clientData,
1005     XtPointer callData
1006 )
1007 {
1008     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1009     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1010     
1011     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1012     _DtTtChooserSet( _DtTtChooserDtFileQuit );
1013     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1014 }
1015
1016
1017 void 
1018 fileMoved(
1019     Widget widget,
1020     XtPointer clientData,
1021     XtPointer callData
1022 )
1023 {
1024     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1025     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1026     
1027     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1028     _DtTtChooserSet( _DtTtChooserDtFileMoved );
1029     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1030 }
1031
1032
1033 void 
1034 fileDeleted(
1035     Widget widget,
1036     XtPointer clientData,
1037     XtPointer callData
1038 )
1039 {
1040     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1041     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1042     
1043     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1044     _DtTtChooserSet( _DtTtChooserDtFileDeleted );
1045     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1046 }
1047
1048
1049 void 
1050 dtSessionQuit(
1051     Widget widget,
1052     XtPointer clientData,
1053     XtPointer callData
1054 )
1055 {
1056     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1057     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1058     
1059     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1060     _DtTtChooserSet( _DtTtChooserDtSessionQuit );
1061     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1062 }
1063
1064
1065 void 
1066 procidOpen(
1067     Widget widget,
1068     XtPointer clientData,
1069     XtPointer callData
1070 )
1071 {
1072     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1073     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1074     
1075     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1076     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1077     char *procid = tt_open();
1078     Widget label = instance->ttsnoopWin_label;
1079     DtTtSetLabel( label, "tt_open()", procid );
1080     int fd = tt_fd();
1081     Tt_status status = tt_int_error( fd );
1082     if (tt_is_err( status )) {
1083             DtTtSetLabel( instance->ttsnoopWin_label, "tt_fd()", status );
1084             return;
1085     }
1086     XtInputId id = XtAppAddInput( XtWidgetToApplicationContext( label ),
1087                                   fd, (XtPointer)XtInputReadMask,
1088                                   tttk_Xt_input_handler, procid );
1089     DtTtCreated( DTTT_PROCID, procid, (void *)id );
1090     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1091 }
1092
1093
1094 void 
1095 procidClose(
1096     Widget widget,
1097     XtPointer clientData,
1098     XtPointer callData
1099 )
1100 {
1101     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1102     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1103     
1104     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1105     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1106     char *procid = tt_default_procid();
1107     Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
1108                                      "tt_default_procid()", procid );
1109     if (tt_is_err( status )) {
1110             return;
1111     }
1112     status = tt_close();
1113     DtTtSetLabel( instance->ttsnoopWin_label, "tt_close()", status );
1114     int nth = DtTtIndex( DTTT_PROCID, procid );
1115     if (nth < 0) {
1116             return;
1117     }
1118     XtInputId id = (XtInputId)DtTtNthClientDatum( DTTT_PROCID, nth );
1119     if (id != 0) {
1120             XtRemoveInput( id );
1121     }
1122     DtTtDestroyed( DTTT_PROCID, procid );
1123     tt_free( procid );
1124     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1125 }
1126
1127
1128 void 
1129 procidSetDefault(
1130     Widget widget,
1131     XtPointer clientData,
1132     XtPointer callData
1133 )
1134 {
1135     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1136     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1137     
1138     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1139     _DtTtChooserSet( _DtTtChooserProcidSetDefault );
1140     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1141 }
1142
1143
1144 void 
1145 procidSuspend(
1146     Widget widget,
1147     XtPointer clientData,
1148     XtPointer callData
1149 )
1150 {
1151     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1152     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1153     
1154     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1155     _DtTtChooserSet( _DtTtChooserProcidSuspend );
1156     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1157 }
1158
1159
1160 void 
1161 procidResume(
1162     Widget widget,
1163     XtPointer clientData,
1164     XtPointer callData
1165 )
1166 {
1167     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1168     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1169     
1170     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1171     _DtTtChooserSet( _DtTtChooserProcidResume );
1172     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1173 }
1174
1175
1176 void 
1177 procidDtOpen(
1178     Widget widget,
1179     XtPointer clientData,
1180     XtPointer callData
1181 )
1182 {
1183     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1184     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1185     
1186     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1187     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1188     int fd;
1189     char *procid = ttdt_open( &fd, "Ttsnoop", "CDE", globalVersionString, 1 );
1190     Widget label = instance->ttsnoopWin_label;
1191     DtTtSetLabel( label, "ttdt_open()", procid );
1192     if (! tt_is_err( tt_ptr_error( procid ) )) {
1193             XtInputId id;
1194             id = XtAppAddInput( XtWidgetToApplicationContext( label ),
1195                                 fd, (XtPointer)XtInputReadMask,
1196                                 tttk_Xt_input_handler, procid );
1197             DtTtCreated( DTTT_PROCID, procid, (void *)id );
1198     }
1199     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1200 }
1201
1202
1203 void 
1204 procidDtClose(
1205     Widget widget,
1206     XtPointer clientData,
1207     XtPointer callData
1208 )
1209 {
1210     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1211     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1212     
1213     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1214     _DtTtChooserSet( _DtTtChooserDtProcidClose );
1215     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1216 }
1217
1218
1219 void 
1220 procidDefault(
1221     Widget widget,
1222     XtPointer clientData,
1223     XtPointer callData
1224 )
1225 {
1226     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1227     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1228     
1229     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1230     char *val = tt_default_procid();
1231     snoopStream << "tt_default_procid() = " << (void *)val;
1232     if (tt_is_err( tt_ptr_error( val ))) {
1233             snoopStream << tt_ptr_error( val );
1234     } else if (val != 0) {
1235             snoopStream << val;
1236     }
1237     snoopStream << endl;
1238     tt_free( val );
1239     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1240 }
1241
1242
1243 void 
1244 ptypeDefault(
1245     Widget widget,
1246     XtPointer clientData,
1247     XtPointer callData
1248 )
1249 {
1250     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1251     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1252     
1253     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1254     char *val = tt_default_ptype();
1255     snoopStream << "tt_default_ptype() = " << (void *)val;
1256     if (tt_is_err( tt_ptr_error( val ))) {
1257             snoopStream << tt_ptr_error( val );
1258     } else if (val != 0) {
1259             snoopStream << val;
1260     }
1261     snoopStream << endl;
1262     tt_free( val );
1263     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1264 }
1265
1266
1267 void 
1268 sessionDefault(
1269     Widget widget,
1270     XtPointer clientData,
1271     XtPointer callData
1272 )
1273 {
1274     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1275     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1276     
1277     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1278     char *val = tt_default_session();
1279     snoopStream << "tt_default_session() = " << (void *)val;
1280     if (tt_is_err( tt_ptr_error( val ))) {
1281             snoopStream << tt_ptr_error( val );
1282     } else if (val != 0) {
1283             snoopStream << val;
1284     }
1285     snoopStream << endl;
1286     tt_free( val );
1287     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1288 }
1289
1290
1291 void 
1292 fileDefault(
1293     Widget widget,
1294     XtPointer clientData,
1295     XtPointer callData
1296 )
1297 {
1298     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1299     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1300     
1301     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1302     char *val = tt_default_file();
1303     snoopStream << "tt_default_file() = " << (void *)val;
1304     if (tt_is_err( tt_ptr_error( val ))) {
1305             snoopStream << tt_ptr_error( val );
1306     } else if (val != 0) {
1307             snoopStream << val;
1308     }
1309     snoopStream << endl;
1310     tt_free( val );
1311     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1312 }
1313
1314
1315 void 
1316 toggleSnooping(
1317     Widget widget,
1318     XtPointer clientData,
1319     XtPointer callData
1320 )
1321 {
1322     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1323     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1324     
1325     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1326     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1327     if (snoopPat == 0) {
1328             DtTtSetLabel( instance->ttsnoopWin_label, "Tt_pattern == 0" );
1329             XtSetSensitive(
1330                 instance->menubar_Snoop_item_Snoop_menu_items.Off_item,
1331                 False );
1332             return;
1333     }
1334     Tt_status status;
1335     char *func;
1336     if (snoopPatIsRegistered) {
1337             status = tt_pattern_unregister( snoopPat );
1338             func = "tt_pattern_unregister(";
1339     } else {
1340             status = tt_pattern_register( snoopPat );
1341             func = "tt_pattern_register(";
1342     }
1343     if (! tt_is_err( status )) {
1344             snoopPatIsRegistered = ! snoopPatIsRegistered;
1345     }
1346     std::ostrstream stream;
1347     stream << func << (void *)snoopPat << ")" << ends;
1348     DtTtSetLabel( instance->ttsnoopWin_label, stream.str(), status );
1349     delete stream.str();
1350     DtTtSetLabel( instance->menubar_Snoop_item_Snoop_menu_items.Off_item,
1351                   snoopPatIsRegistered ? "Off" : "On" );
1352     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1353 }
1354
1355
1356 void 
1357 printVersion(
1358     Widget widget,
1359     XtPointer clientData,
1360     XtPointer callData
1361 )
1362 {
1363     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1364     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1365     
1366     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1367     snoopStream << "ttsnoop: " << globalVersionString << endl;
1368     snoopStream << "tt_c.h: " << TT_VERSION << endl;
1369     snoopStream << "libtt: " << _tt_lib_version << endl;
1370     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1371 }
1372
1373
1374 void 
1375 createStandardMessage(
1376     Widget widget,
1377     XtPointer clientData,
1378     XtPointer callData
1379 )
1380 {
1381     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1382     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1383     
1384     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1385     _DtTtChooserSet( _DtTtChooserMessageCreateStandard );
1386     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1387 }
1388
1389
1390
1391 /**************************************************************************
1392  *** DTB_USER_CODE_START
1393  ***
1394  *** All automatically-generated data and functions have been defined.
1395  ***
1396  *** Add new functions here, or at the top of the file.
1397  ***/
1398
1399 /*** DTB_USER_CODE_END
1400  ***
1401  *** End of user code section
1402  ***
1403  **************************************************************************/
1404
1405