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