1 /*
2 * Copyright (c) Kermin Elliott Fleming 2007-2017.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 */
9
10 #include "globals.h"
11 #include "analyzer.h"
12 #include "bsearch.h"
13 #include "busy.h"
14 #include "clipping.h"
15 #include "color.h"
16 #include "currenttime.h"
17 #include "debug.h"
18 #include "fgetdynamic.h"
19 #include "ghw.h"
20 #include "globals.h"
21 #include "gnu-getopt.h"
22 #include "gnu_regex.h"
23 #include "gtk12compat.h"
24 #include "lx2.h"
25 #include "lxt.h"
26 #include "main.h"
27 #include "menu.h"
28 #include "pipeio.h"
29 #include "pixmaps.h"
30 #include "print.h"
31 #include "ptranslate.h"
32 #include "ttranslate.h"
33 #include "rc.h"
34 #include "regex_wave.h"
35 #include "strace.h"
36 #include "symbol.h"
37 #include "translate.h"
38 #include "tree.h"
39 #include "vcd.h"
40 #include "vcd_saver.h"
41 #include "vlist.h"
42 #include "vzt.h"
43 #include "wavealloca.h"
44
45 #include "lxt2_read.h"
46 #include "vzt_read.h"
47 #include "fst.h"
48 #include "hierpack.h"
49
50 #include "fsdb_wrapper_api.h"
51
52 #ifdef __MINGW32__
53 #define sleep(x) Sleep(x)
54 #endif
55
56 #if !defined __MINGW32__ && !defined _MSC_VER
57 #include <unistd.h>
58 #include <sys/mman.h>
59 #else
60 #include <windows.h>
61 #include <io.h>
62 #endif
63
64
65 struct Global *GLOBALS = NULL;
66
67 /* make this const so if we try to write to it we coredump */
68 static const struct Global globals_base_values =
69 {
70 /*
71 * ae2.c
72 */
73 #ifdef AET2_IS_PRESENT
74 #ifdef AET2_ALIASDB_IS_PRESENT
75 NULL, /* adb_alias_stream_file */
76 0, /* adb */
77 0, /* adb_max_terms */
78 NULL, /* adb_terms */
79 NULL, /* adb_aliases */
80 NULL, /* adb_num_terms */
81 NULL, /* adb_idx_first */
82 NULL, /* adb_idx_last */
83 NULL, /* adb_alloc_pool_base */
84 0, /* adb_alloc_idx */
85 #endif
86 0, /* ae2_num_facs */
87 0, /* ae2_num_aliases */
88 0, /* ae2_num_sections */
89 NULL, /* ae2_lx2_table */
90 NULL, /* ae2_f */
91 NULL, /* ae2 */
92 NULL, /* ae2_fr */
93 LLDescriptor(0), /* ae2_start_limit_cyc */
94 LLDescriptor(0), /* ae2_end_limit_cyc */
95 NULL, /* ae2_process_mask */
96 #endif
97 LLDescriptor(0), /* ae2_start_cyc */
98 LLDescriptor(0), /* ae2_end_cyc */
99 NULL, /* ae2_time_xlate */
100 0, /* disable_ae2_alias */
101
102
103 /*
104 * analyzer.c
105 */
106 TR_RJUSTIFY, /* default_flags 5 */
107 0, /* default_fpshift */
108 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.0}, /* tims 6 */
109 {0, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0}, /* traces 9 */
110 0, /* hier_max_level 8 */
111 0, /* hier_max_level_shadow */
112 0, /* timestart_from_savefile */
113 0, /* timestart_from_savefile_valid */
114 0, /* group_depth */
115 0, /* hier_ignore_escapes */
116
117 /*
118 * baseconvert.c
119 */
120 0, /* color_active_in_filter 9 */
121
122
123 /*
124 * bsearch.c
125 */
126 LLDescriptor(0), /* shift_timebase 10 */
127 LLDescriptor(0), /* shift_timebase_default_for_add 11 */
128 0, /* max_compare_time_tc_bsearch_c_1 12 */
129 0, /* max_compare_pos_tc_bsearch_c_1 13 */
130 0, /* max_compare_time_bsearch_c_1 14 */
131 0, /* max_compare_pos_bsearch_c_1 15 */
132 0, /* max_compare_index 16 */
133 0, /* vmax_compare_time_bsearch_c_1 17 */
134 0, /* vmax_compare_pos_bsearch_c_1 18 */
135 0, /* vmax_compare_index 19 */
136 0, /* maxlen_trunc 20 */
137 0, /* maxlen_trunc_pos_bsearch_c_1 21 */
138 0, /* trunc_asciibase_bsearch_c_1 22 */
139
140
141 /*
142 * busy.c
143 */
144 NULL, /* busycursor_busy_c_1 23 */
145 0, /* busy_busy_c_1 24 */
146
147
148 /*
149 * color.c
150 */
151 0, /* keep_xz_colors */
152 NULL, /* wave_gcchain */
153 -1, /* color_back 25 */
154 -1, /* color_baseline 26 */
155 -1, /* color_grid 27 */
156 -1, /* color_grid2 27 */
157 -1, /* color_high 28 */
158 -1, /* color_low 29 */
159 -1, /* color_mark 30 */
160 -1, /* color_mid 31 */
161 -1, /* color_time 32 */
162 -1, /* color_timeb 33 */
163 -1, /* color_trans 34 */
164 -1, /* color_umark 35 */
165 -1, /* color_value 36 */
166 -1, /* color_vbox 37 */
167 -1, /* color_vtrans 38 */
168 -1, /* color_x 39 */
169 -1, /* color_xfill 40 */
170 -1, /* color_0 41 */
171 -1, /* color_1 42 */
172 -1, /* color_ufill 43 */
173 -1, /* color_u 44 */
174 -1, /* color_wfill 45 */
175 -1, /* color_w 46 */
176 -1, /* color_dashfill 47 */
177 -1, /* color_dash 48 */
178 -1, /* color_white 49 */
179 -1, /* color_black 50 */
180 -1, /* color_ltgray 51 */
181 -1, /* color_normal 52 */
182 -1, /* color_mdgray 53 */
183 -1, /* color_dkgray 54 */
184 -1, /* color_dkblue 55 */
185 -1, /* color_brkred */
186 -1, /* color_ltblue */
187 -1, /* color_gmstrd */
188 -1, /* color_highfill */
189 -1, /* color_1fill */
190
191
192 /*
193 * currenttime.c
194 */
195 LLDescriptor(0), /* global_time_offset */
196 0, /* is_vcd 56 */
197 0, /* partial_vcd */
198 1, /* use_maxtime_display 57 */
199 0, /* use_frequency_delta 58 */
200 NULL, /* max_or_marker_label_currenttime_c_1 59 */
201 NULL, /* base_or_curtime_label_currenttime_c_1 60 */
202 0, /* cached_currenttimeval_currenttime_c_1 61 */
203 0, /* currenttime 62 */
204 0, /* max_time 63 */
205 -1, /* min_time 64 */
206 ~0, /* display_grid 65 */
207 1, /* time_scale 66 */
208 'n', /* time_dimension 67 */
209 0, /* scale_to_time_dimension */
210 0, /* maxtimewid_currenttime_c_1 69 */
211 0, /* curtimewid_currenttime_c_1 70 */
212 0, /* maxtext_currenttime_c_1 71 */
213 0, /* curtext_currenttime_c_1 72 */
214 1, /* time_trunc_val_currenttime_c_1 76 */
215 0, /* use_full_precision 77 */
216
217
218 /*
219 * debug.c
220 */
221 NULL, /* alloc2_chain */
222 0, /* outstanding */
223 NULL, /* atoi_cont_ptr 78 */
224 0, /* disable_tooltips 79 */
225
226
227 /*
228 * entry.c
229 */
230 0, /* window_entry_c_1 80 */
231 0, /* entry_entry_c_1 81 */
232 NULL, /* entrybox_text 82 */
233 0, /* cleanup_entry_c_1 83 */
234 0, /* entry_raise_timer */
235
236 /*
237 * extload.c
238 */
239 0, /* extload_ffr_import_count */
240 NULL, /* extload_ffr_ctx */
241 NULL, /* extload */
242 NULL, /* extload_idcodes */
243 NULL, /* extload_inv_idcodes */
244 #if !defined __MINGW32__ && !defined _MSC_VER
245 0, /* extload_lastmod */
246 0, /* extload_already_errored */
247 #endif
248 NULL, /* extload_namecache */
249 NULL, /* extload_namecache_max */
250 NULL, /* extload_namecache_lens */
251 NULL, /* extload_namecache_patched */
252 NULL, /* extload_sym_block */
253 NULL, /* extload_node_block */
254 NULL, /* extload_xc */
255 NULL, /* extload_prevsymroot */
256 NULL, /* extload_prevsym */
257 NULL, /* extload_npar */
258 0, /* extload_i */
259 0, /* extload_hlen */
260 0, /* extload_vt_prev */
261 0, /* extload_vd_prev */
262 0, /* f_name_build_buf_len */
263 NULL, /* f_name_build_buf */
264 0, /* extload_max_tree */
265 0, /* extload_curr_tree */
266
267
268 /*
269 * fetchbuttons.c
270 */
271 100, /* fetchwindow 84 */
272
273
274 /*
275 * fgetdynamic.c
276 */
277 0, /* fgetmalloc_len 85 */
278
279
280 /*
281 * file.c
282 */
283 #if GTK_CHECK_VERSION(2,4,0)
284 NULL, /* pFileChoose */
285 NULL, /* pFileChooseFilterName */
286 NULL, /* pPatternSpec */
287 #endif
288 0, /* fs_file_c_1 86 */
289 NULL, /* fileselbox_text 87 */
290 0, /* filesel_ok 88 */
291 0, /* cleanup_file_c_2 89 */
292 0, /* bad_cleanup_file_c1 */
293
294
295 /*
296 * fonts.c
297 */
298 NULL, /* fontname_signals 90 */
299 NULL, /* fontname_waves 91 */
300 #if defined(WAVE_USE_GTK2) && !defined(GTK_ENABLE_BROKEN) && GTK_CHECK_VERSION(2,8,0)
301 NULL, /* fonts_renderer */
302 NULL, /* fonts_gc */
303 NULL, /* fonts_screen */
304 NULL, /* fonts_context */
305 NULL, /* fonts_layout */
306 #endif
307 1, /* use_pango_fonts */
308
309
310 /*
311 * fst.c
312 */
313 NULL, /* fst_fst_c_1 */
314 NULL, /* fst_scope_name */
315 0, /* fst_scope_name_len */
316 0, /* first_cycle_fst_c_3 */
317 0, /* last_cycle_fst_c_3 */
318 0, /* total_cycles_fst_c_3 */
319 NULL, /* fst_table_fst_c_1 */
320 NULL, /* mvlfacs_fst_c_3 */
321 NULL, /* mvlfacs_fst_alias */
322 NULL, /* mvlfacs_fst_rvs_alias */
323 0, /* fst_maxhandle */
324 0, /* busycnt_fst_c_2 */
325 NULL, /* double_curr_fst */
326 NULL, /* double_fini_fst */
327 0, /* nonimplicit_direction_encountered */
328 0, /* supplemental_datatypes_encountered */
329 0, /* supplemental_vartypes_encountered */
330 0, /* is_vhdl_component_format */
331 NULL, /* subvar_jrb */
332 0, /* subvar_jrb_count */
333 NULL, /* subvar_pnt */
334 0, /* fst_filetype */
335 0, /* subvar_jrb_count_locked */
336 0, /* stem_file_idx */
337 0, /* stem_line_number */
338 NULL, /* stem_path_string_table */
339 NULL, /* stem_struct_base */
340 NULL, /* istem_struct_base */
341 0, /* stem_path_string_table_siz */
342 0, /* stem_path_string_table_alloc */
343 0, /* stem_struct_base_siz */
344 0, /* stem_struct_base_siz_alloc */
345 0, /* istem_struct_base_siz */
346 0, /* istem_struct_base_siz_alloc */
347 0, /* stem_valid */
348 0, /* istem_valid */
349 NULL, /* fst_synclock_str */
350 NULL, /* synclock_jrb */
351 NULL, /* xl_enum_filter */
352 0, /* num_xl_enum_filter */
353 0, /* queued_xl_enum_filter */
354 NULL, /* enum_nptrs_jrb */
355
356
357 /*
358 * ghw.c
359 */
360 0, /* nxp_ghw_c_1 93 */
361 0, /* sym_which_ghw_c_1 95 */
362 NULL, /* gwt_ghw_c_1 96 */
363 NULL, /* gwt_corr_ghw_c_1 97 */
364 1, /* xlat_1164_ghw_c_1 98 */
365 0, /* is_ghw 99 */
366 NULL, /* asbuf */
367 0, /* nbr_sig_ref_ghw_c_1 101 */
368 0, /* num_glitches_ghw_c_1 102 */
369 0, /* num_glitch_regions_ghw_c_1 */
370 0, /* fac_name_ghw_c_1 104 */
371 0, /* fac_name_len_ghw_c_1 105 */
372 0, /* fac_name_max_ghw_c_1 106 */
373 0, /* last_fac_ghw_c_1 107 */
374 0, /* warned_ghw_c_1 108 */
375
376 /*
377 * globals.c
378 */
379 NULL, /* dead_context */
380 NULL, /* gtk_context_bridge_ptr */
381
382 /*
383 * help.c
384 */
385 0, /* helpbox_is_active 110 */
386 0, /* text_help_c_1 111 */
387 0, /* vscrollbar_help_c_1 112 */
388 #if defined(WAVE_USE_GTK2) && !defined(GTK_ENABLE_BROKEN)
389 {NULL, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL}, /* iter_help_c_1 113 */
390 0, /* bold_tag_help_c_1 114 */
391 #endif
392 0, /* window_help_c_2 115 */
393
394
395 /*
396 * hierpack.c
397 */
398 NULL, /* hp_buf */
399 NULL, /* hp_offs */
400 0, /* hp_prev */
401 0, /* hp_buf_siz */
402 NULL, /* fmem_buf */
403 0, /* fmem_buf_siz */
404 0, /* fmem_buf_offs */
405 0, /* fmem_uncompressed_siz */
406 0, /* disable_auto_comphier */
407
408
409 /*
410 * hiersearch.c
411 */
412 1, /* hier_grouping 116 */
413 0, /* window_hiersearch_c_3 117 */
414 0, /* entry_main_hiersearch_c_1 118 */
415 0, /* clist_hiersearch_c_1 119 */
416 0, /* bundle_direction_hiersearch_c_1 120 */
417 0, /* cleanup_hiersearch_c_3 121 */
418 0, /* num_rows_hiersearch_c_1 122 */
419 0, /* selected_rows_hiersearch_c_1 123 */
420 0, /* window1_hiersearch_c_1 124 */
421 0, /* entry_hiersearch_c_2 125 */
422 NULL, /* entrybox_text_local_hiersearch_c_1 126 */
423 NULL, /* cleanup_e_hiersearch_c_1 127 */
424 NULL, /* h_selectedtree_hiersearch_c_1 128 */
425 NULL, /* current_tree_hiersearch_c_1 129 */
426 NULL, /* treechain_hiersearch_c_1 130 */
427 0, /* is_active_hiersearch_c_1 131 */
428
429
430 /*
431 * logfile.c
432 */
433 NULL, /* logfiles */
434 NULL, /* fontname_logfile 133 */
435 NULL, /* font_logfile_c_1 134 */
436 #if defined(WAVE_USE_GTK2) && !defined(GTK_ENABLE_BROKEN)
437 {NULL, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL}, /* iter_logfile_c_2 135 */
438 NULL, /* bold_tag_logfile_c_2 136 */
439 NULL, /* mono_tag_logfile_c_1 137 */
440 NULL, /* size_tag_logfile_c_1 138 */
441 #endif
442
443
444 /*
445 * lx2.c
446 */
447 LXT2_IS_INACTIVE, /* is_lx2 139 */
448 NULL, /* lx2_lx2_c_1 140 */
449 0, /* first_cycle_lx2_c_1 141 */
450 0, /* last_cycle */
451 0, /* total_cycles */
452 NULL, /* lx2_table_lx2_c_1 142 */
453 NULL, /* mvlfacs_lx2_c_1 143 */
454 0, /* busycnt_lx2_c_1 144 */
455
456
457 /*
458 * lxt.c
459 */
460 NULL, /* mm_lxt_mmap_addr */
461 0, /* mm_lxt_mmap_len */
462 #if defined __MINGW32__ || defined _MSC_VER
463 NULL, /* HANDLE hIn */
464 NULL, /* HANDLE hInMap */
465 NULL, /* char *win_fname = NULL; */
466 #endif
467 0, /* fpos_lxt_c_1 145 */
468 0, /* is_lxt 146 */
469 0, /* lxt_clock_compress_to_z 147 */
470 NULL, /* mm_lxt_c_1 148 */
471 NULL, /* mmcache_lxt_c_1 */
472 0, /* version_lxt_c_1 149 */
473 NULL, /* mvlfacs_lxt_c_2 150 */
474 0, /* first_cycle_lxt_c_2 151 */
475 0, /* last_cycle */
476 0, /* total_cycles */
477 0, /* maxchange_lxt_c_1 152 */
478 0, /* maxindex */
479 0, /* f_len_lxt_c_1 153 */
480 NULL, /* positional_information_lxt_c_1 154 */
481 NULL, /* time_information 155 */
482 0, /* change_field_offset_lxt_c_1 156 */
483 0, /* facname_offset_lxt_c_1 157 */
484 0, /* facgeometry_offset_lxt_c_1 158 */
485 0, /* time_table_offset_lxt_c_1 159 */
486 0, /* time_table_offset64_lxt_c_1 160 */
487 0, /* sync_table_offset_lxt_c_1 161 */
488 0, /* initial_value_offset_lxt_c_1 162 */
489 0, /* timescale_offset_lxt_c_1 163 */
490 0, /* double_test_offset_lxt_c_1 164 */
491 0, /* zdictionary_offset_lxt_c_1 165 */
492 0, /* zfacname_predec_size_lxt_c_1 166 */
493 0, /* zfacname_size_lxt_c_1 167 */
494 0, /* zfacgeometry_size_lxt_c_1 168 */
495 0, /* zsync_table_size_lxt_c_1 169 */
496 0, /* ztime_table_size_lxt_c_1 170 */
497 0, /* zchg_predec_size_lxt_c_1 171 */
498 0, /* zchg_size_lxt_c_1 172 */
499 0, /* zdictionary_predec_size_lxt_c_1 173 */
500 AN_X, /* initial_value_lxt_c_1 174 */
501 0, /* dict_num_entries_lxt_c_1 175 */
502 0, /* dict_string_mem_required_lxt_c_1 176 */
503 0, /* dict_16_offset_lxt_c_1 177 */
504 0, /* dict_24_offset_lxt_c_1 178 */
505 0, /* dict_32_offset_lxt_c_1 179 */
506 0, /* dict_width_lxt_c_1 180 */
507 NULL, /* dict_string_mem_array_lxt_c_1 181 */
508 0, /* exclude_offset_lxt_c_1 182 */
509 0, /* lxt_timezero_offset */
510 NULL, /* lt_buf_lxt_c_1 183 */
511 0, /* lt_len_lxt_c_1 184 */
512 -1, /* fd_lxt_c_1 185 */
513 {0,0,0,0,0,0,0,0}, /* double_mask_lxt_c_1 186 */
514 0, /* double_is_native_lxt_c_1 187 */
515 0, /* max_compare_time_tc_lxt_c_2 189 */
516 0, /* max_compare_pos_tc_lxt_c_2 */
517 NULL, /* resolve_lxt_alias_to */
518 NULL, /* lastchange */
519
520
521 /*
522 * main.c
523 */
524 1, /* is_gtkw_save_file */
525 0, /* dumpfile_is_modified */
526 NULL, /* missing_file_toolbar */
527 NULL, /* argvlist */
528 #if defined(HAVE_LIBTCL)
529 NULL, /* interp */
530 #endif
531 NULL, /* repscript_name */
532 500, /* repscript_period */
533 NULL, /* tcl_init_cmd */
534 0, /* tcl_running */
535 0, /* block_xy_update */
536 NULL, /* winname */
537 0, /* num_notebook_pages */
538 1, /* num_notebook_pages_cumulative */
539 0, /* context_tabposition */
540 0, /* this_context_page */
541 0, /* second_page_created */
542 NULL, /* contexts */
543 NULL, /* notebook */
544 NULL, /* loaded_file_name */
545 NULL, /* unoptimized_vcd_file_name */
546 NULL, /* skip_start */
547 NULL, /* skip_end */
548 MISSING_FILE, /* loaded_file_type */
549 0, /* is_optimized_stdin_vcd */
550 NULL, /* whoami 190 */
551 NULL, /* logfile 191 */
552 NULL, /* stems_name 192 */
553 WAVE_ANNO_NONE, /* stems_type 193 */
554 NULL, /* aet_name 194 */
555 NULL, /* anno_ctx 195 */
556 NULL, /* dual_ctx 196 */
557 0, /* dual_id 197 */
558 0, /* dual_attach_id_main_c_1 198 */
559 0, /* dual_race_lock 199 */
560 NULL, /* mainwindow 200 */
561 NULL, /* signalwindow 201 */
562 NULL, /* wavewindow 202 */
563 NULL, /* toppanedwindow 203 */
564 NULL, /* panedwindow */
565 0, /* toppanedwindow_size_cache */
566 0, /* panedwindow_size_cache */
567 0, /* vpanedwindow_size_cache */
568 NULL, /* sstpane 204 */
569 NULL, /* expanderwindow 205 */
570 0, /* disable_window_manager 206 */
571 0, /* disable_empty_gui */
572 1, /* paned_pack_semantics 207 */
573 0, /* zoom_was_explicitly_set 208 */
574 1000, /* initial_window_x 209 */
575 600, /* initial_window_y */
576 -1, /* initial_window_width */
577 -1, /* initial_window_height 210 */
578 0, /* xy_ignore_main_c_1 211 */
579 0, /* optimize_vcd 212 */
580 1, /* num_cpus 213 */
581 -1, /* initial_window_xpos 214 */
582 -1, /* initial_window_ypos 214 */
583 0, /* initial_window_set_valid 215 */
584 -1, /* initial_window_xpos_set 216 */
585 -1, /* initial_window_ypos_set */
586 0, /* initial_window_get_valid 217 */
587 -1, /* initial_window_xpos_get 218 */
588 -1, /* initial_window_ypos_get 218 */
589 0, /* xpos_delta 219 */
590 0, /* ypos_delta 219 */
591 0, /* use_scrollbar_only 220 */
592 0, /* force_toolbars 221 */
593 0, /* hide_sst 222 */
594 1, /* sst_expanded 223 */
595 #ifdef WAVE_USE_GTK2
596 0, /* socket_xid 224 */
597 #endif
598 0, /* disable_menus 225 */
599 NULL, /* ftext_main_main_c_1 226 */
600 #ifdef WAVE_USE_GTK2
601 1, /* use_toolbutton_interface */
602 #else
603 0, /* use_toolbutton_interface */
604 #endif
605
606 /*
607 * markerbox.c
608 */
609 NULL, /* window_markerbox_c_4 231 */
610 {0}, /* entries_markerbox_c_1 232 */
611 NULL, /* cleanup_markerbox_c_4 233 */
612 0, /* dirty_markerbox_c_1 234 */
613 {0}, /* shadow_markers_markerbox_c_1 235 */
614 {NULL}, /* marker_names */
615 {NULL}, /* shadow_marker_names */
616
617
618 /*
619 * menu.c
620 */
621 NULL, /* cutcopylist */
622 0, /* enable_fast_exit 236 */
623 0, /* quiet_checkmenu */
624 NULL, /* wave_script_args 237 */
625 0, /* ignore_savefile_pane_pos */
626 0, /* ignore_savefile_pos 238 */
627 0, /* ignore_savefile_size 239 */
628 #ifndef WAVE_USE_MLIST_T
629 NULL, /* item_factory_menu_c_1 241 */
630 #endif
631 NULL, /* regexp_string_menu_c_1 242 */
632 NULL, /* trace_to_alias_menu_c_1 243 */
633 NULL, /* showchangeall_menu_c_1 244 */
634 NULL, /* filesel_newviewer_menu_c_1 245 */
635 NULL, /* filesel_logfile_menu_c_1 246 */
636 NULL, /* filesel_scriptfile_menu */
637 NULL, /* filesel_writesave 247 */
638 NULL, /* filesel_imagegrab */
639 0, /* save_success_menu_c_1 248 */
640 NULL, /* filesel_vcd_writesave 249 */
641 NULL, /* filesel_lxt_writesave 250 */
642 NULL, /* filesel_tim_writesave */
643 0, /* lock_menu_c_1 251 */
644 0, /* lock_menu_c_2 252 */
645 NULL, /* buf_menu_c_1 253 128 */
646 NULL, /* signal_popup_menu */
647 NULL, /* sst_signal_popup_menu */
648
649 /*
650 * mouseover.c
651 */
652 1, /* disable_mouseover 254 */
653 0, /* clipboard_mouseover */
654 NULL, /* mouseover_mouseover_c_1 255 */
655 NULL, /* mo_area_mouseover_c_1 256 */
656 NULL, /* mo_pixmap_mouseover_c_1 257 */
657 NULL, /* mo_dk_gray_mouseover_c_1 258 */
658 NULL, /* mo_black_mouseover_c_1 259 */
659 0, /* mo_width_mouseover_c_1 260 */
660 0, /* mo_height_mouseover_c_1 260 */
661
662
663 /*
664 * pagebuttons.c
665 */
666 1.0, /* page_divisor 261 */
667
668
669 /*
670 * pixmaps.c
671 */
672 NULL, /* redo_pixmap */
673 NULL, /* redo_mask */
674 NULL, /* larrow_pixmap 263 */
675 NULL, /* larrow_mask 264 */
676 NULL, /* rarrow_pixmap 266 */
677 NULL, /* rarrow_mask 267 */
678 NULL, /* zoomin_pixmap 269 */
679 NULL, /* zoomin_mask 270 */
680 NULL, /* zoomout_pixmap 272 */
681 NULL, /* zoomout_mask 273 */
682 NULL, /* zoomfit_pixmap 275 */
683 NULL, /* zoomfit_mask 276 */
684 NULL, /* zoomundo_pixmap 278 */
685 NULL, /* zoomundo_mask 279 */
686 NULL, /* zoom_larrow_pixmap 281 */
687 NULL, /* zoom_larrow_mask 282 */
688 NULL, /* zoom_rarrow_pixmap 284 */
689 NULL, /* zoom_rarrow_mask 285 */
690 NULL, /* prev_page_pixmap 287 */
691 NULL, /* prev_page_mask 288 */
692 NULL, /* next_page_pixmap 290 */
693 NULL, /* next_page_mask 291 */
694 NULL, /* wave_info_pixmap 293 */
695 NULL, /* wave_info_mask 294 */
696 NULL, /* wave_alert_pixmap 296 */
697 NULL, /* wave_alert_mask 297 */
698 NULL, /* hiericon_module_pixmap */
699 NULL, /* hiericon_module_mask */
700 NULL, /* hiericon_task_pixmap */
701 NULL, /* hiericon_task_mask */
702 NULL, /* hiericon_function_pixmap */
703 NULL, /* hiericon_function_mask */
704 NULL, /* hiericon_begin_pixmap */
705 NULL, /* hiericon_begin_mask */
706 NULL, /* hiericon_fork_pixmap */
707 NULL, /* hiericon_fork_mask */
708 NULL, /* hiericon_interface_pixmap */
709 NULL, /* hiericon_interface_mask */
710 NULL, /* hiericon_svpackage_pixmap */
711 NULL, /* hiericon_svpackage_mask */
712 NULL, /* hiericon_program_pixmap */
713 NULL, /* hiericon_program_mask */
714 NULL, /* hiericon_class_pixmap */
715 NULL, /* hiericon_class_mask */
716 NULL, /* hiericon_record_pixmap */
717 NULL, /* hiericon_record_mask */
718 NULL, /* hiericon_generate_pixmap */
719 NULL, /* hiericon_generate_mask */
720 NULL, /* hiericon_design_pixmap */
721 NULL, /* hiericon_design_mask */
722 NULL, /* hiericon_block_pixmap */
723 NULL, /* hiericon_block_mask */
724 NULL, /* hiericon_generateif_pixmap */
725 NULL, /* hiericon_generateif_mask */
726 NULL, /* hiericon_generatefor_pixmap */
727 NULL, /* hiericon_generatefor_mask */
728 NULL, /* hiericon_instance_pixmap */
729 NULL, /* hiericon_instance_mask */
730 NULL, /* hiericon_package_pixmap */
731 NULL, /* hiericon_package_mask */
732 NULL, /* hiericon_signal_pixmap */
733 NULL, /* hiericon_signal_mask */
734 NULL, /* hiericon_portin_pixmap */
735 NULL, /* hiericon_portin_mask */
736 NULL, /* hiericon_portout_pixmap */
737 NULL, /* hiericon_portout_mask */
738 NULL, /* hiericon_portinout_pixmap */
739 NULL, /* hiericon_portinout_mask */
740 NULL, /* hiericon_buffer_pixmap */
741 NULL, /* hiericon_buffer_mask */
742 NULL, /* hiericon_linkage_pixmap */
743 NULL, /* hiericon_linkage_mask */
744
745
746 /*
747 * print.c
748 */
749 72, /* inch_print_c_1 298 */
750 1.0, /* ps_chwidth_print_c_1 299 */
751 0, /* ybound_print_c_1 300 */
752 0, /* pr_signal_fill_width_print_c_1 301 */
753 0, /* ps_nummaxchars_print_c_1 302 */
754 1, /* ps_fullpage 303 */
755 66, /* ps_maxveclen 304 */
756 0, /* liney_max 305 */
757
758
759 /*
760 * ptranslate.c
761 */
762 0, /* current_translate_proc 308 */
763 0, /* current_filter_ptranslate_c_1 309 */
764 0, /* num_proc_filters 310 */
765 NULL, /* procsel_filter 311 */
766 NULL, /* proc_filter 312 */
767 0, /* is_active_ptranslate_c_2 313 */
768 NULL, /* fcurr_ptranslate_c_1 314 */
769 NULL, /* window_ptranslate_c_5 315 */
770 NULL, /* clist_ptranslate_c_2 316 */
771
772
773 /*
774 * rc.c
775 */
776 0, /* rc_line_no 318 */
777 1, /* possibly_use_rc_defaults 319 */
778 NULL, /* editor_string */
779
780
781 /*
782 * regex.c
783 */
784 NULL, /* preg_regex_c_1 321 */
785 NULL, /* regex_ok_regex_c_1 322 */
786
787
788 /*
789 * renderopt.c
790 */
791 #ifdef WAVE_GTK_UNIX_PRINT
792 NULL, /* gprs */
793 NULL, /* gps */
794 NULL, /* gp_tfn */
795 #endif
796 0, /* is_active_renderopt_c_3 323 */
797 0, /* window_renderopt_c_6 324 */
798 NULL, /* filesel_print_pdf_renderopt_c_1 */
799 NULL, /* filesel_print_ps_renderopt_c_1 325 */
800 NULL, /* filesel_print_mif_renderopt_c_1 326 */
801 {0,0,0,0}, /* target_mutex_renderopt_c_1 328 */
802 {0,0,0,0,0}, /* page_mutex_renderopt_c_1 330 */
803 {0,0,0}, /* render_mutex_renderopt_c_1 332 */
804 0, /* page_size_type_renderopt_c_1 333 */
805
806
807 /*
808 * savefile.c
809 */
810 NULL, /* sfn */
811 NULL, /* lcname */
812
813
814 /*
815 * search.c
816 */
817 {NULL,NULL,NULL,NULL,NULL}, /* menuitem_search */
818 NULL, /* window1_search_c_2 340 */
819 NULL, /* entry_a_search_c_1 341 */
820 NULL, /* entrybox_text_local_search_c_2 342 */
821 NULL, /* cleanup_e_search_c_2 343 */
822 NULL, /* pdata 344 */
823 0, /* is_active_search_c_4 345 */
824 0, /* is_insert_running_search_c_1 346 */
825 0, /* is_replace_running_search_c_1 347 */
826 0, /* is_append_running_search_c_1 348 */
827 0, /* is_searching_running_search_c_1 349 */
828 {0,0,0,0,0}, /* regex_mutex_search_c_1 352 */
829 0, /* regex_which_search_c_1 353 */
830 NULL, /* window_search_c_7 354 */
831 NULL, /* entry_search_c_3 355 */
832 NULL, /* clist_search_c_3 356 */
833 NULL, /* searchbox_text_search_c_1 358 */
834 0, /* bundle_direction_search_c_2 359 */
835 NULL, /* cleanup_search_c_5 360 */
836 0, /* num_rows_search_c_2 361 */
837 0, /* selected_rows_search_c_2 362 */
838
839
840 /*
841 * showchange.c
842 */
843 NULL, /* button1_showchange_c_1 363 */
844 NULL, /* button1_showchange_c_2 363 */
845 NULL, /* button1_showchange_c_3 363 */
846 NULL, /* button1_showchange_c_4 363 */
847 NULL, /* button1_showchange_c_5 363 */
848 NULL, /* button1_showchange_c_6 363 */
849 NULL, /* button1_showchange_c_7 363 */
850 NULL, /* button1_showchange_c_8 363 */
851 NULL, /* button1_showchange_c_9 363 */
852 NULL, /* toggle1_showchange_c_1 364 */
853 NULL, /* toggle2_showchange_c_1 364 */
854 NULL, /* toggle3_showchange_c_1 364 */
855 NULL, /* toggle4_showchange_c_1 364 */
856 NULL, /* toggle5_showchange_c_1 364 */
857 NULL, /* toggle6_showchange_c_1 364 */
858 NULL, /* window_showchange_c_8 365 */
859 NULL, /* cleanup_showchange_c_6 366 */
860 NULL, /* tcache_showchange_c_1 367 */
861 0, /* flags_showchange_c_1 368 */
862
863
864 /*
865 * signalwindow.c
866 */
867 NULL, /* signalarea 369 */
868 NULL, /* signalfont 370 */
869 NULL, /* signalpixmap 371 */
870 #ifdef WAVE_ALLOW_QUARTZ_FLUSH_WORKAROUND
871 0, /* force_hide_show */
872 #endif
873 0, /* max_signal_name_pixel_width 372 */
874 0, /* signal_pixmap_width 373 */
875 0, /* signal_fill_width 374 */
876 0, /* old_signal_fill_width 375 */
877 0, /* old_signal_fill_height */
878 1, /* right_align_active */
879 1, /* fontheight 376 */
880 0, /* dnd_state 377 */
881 0, /* dnd_cursor_timer */
882 NULL, /* hscroll_signalwindow_c_1 378 */
883 NULL, /* signal_hslider 379 */
884 0, /* cachedhiflag_signalwindow_c_1 380 */
885 -1, /* cachedwhich_signalwindow_c_1 381 */
886 NULL, /* cachedtrace 382 */
887 NULL, /* shift_click_trace 383 */
888 0, /* trtarget_signalwindow_c_1 384 */
889 NULL, /* starting_unshifted_trace */
890 0, /* standard_trace_dnd_degate */
891 0, /* use_standard_trace_select */
892 1, /* use_standard_clicking */
893 0, /* std_collapse_pressed */
894 0, /* std_dnd_tgt_on_signalarea */
895 0, /* std_dnd_tgt_on_wavearea */
896 0, /* signalarea_has_focus */
897 NULL, /* signalarea_event_box */
898 0, /* keypress_handler_id */
899 0, /* cached_mouseover_x */
900 0, /* cached_mouseover_y */
901 0, /* mouseover_counter */
902 0, /* button2_debounce_flag */
903 0, /* dragzoom_threshold */
904
905 /*
906 * simplereq.c
907 */
908 NULL, /* window_simplereq_c_9 385 */
909 NULL, /* cleanup 386 */
910
911
912 /*
913 * splash.c
914 */
915 0, /* splash_is_loading */
916 0, /* splash_fix_win_title */
917 1, /* splash_disable 387 */
918 NULL, /* wave_splash_pixmap 389 */
919 NULL, /* wave_splash_mask 390 */
920 NULL, /* splash_splash_c_1 391 */
921 NULL, /* darea_splash_c_1 392 */
922 NULL, /* gt_splash_c_1 393 */
923 0, /* timeout_tag 394 */
924 0, /* load_complete_splash_c_1 395 */
925 2, /* cnt_splash_c_1 396 */
926 0, /* prev_bar_x_splash_c_1 397 */
927
928
929 /*
930 * status.c
931 */
932 NULL, /* text_status_c_2 398 */
933 NULL, /* vscrollbar_status_c_2 399 */
934 #if defined(WAVE_USE_GTK2) && !defined(GTK_ENABLE_BROKEN)
935 {NULL, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL}, /* iter_status_c_3 400 */
936 NULL, /* bold_tag_status_c_3 401 */
937 #endif
938
939
940 /*
941 * strace.c
942 */
943 NULL, /* strace_ctx (defined in strace.h for multiple strace sessions) */
944
945 {
946 {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,{0,0,0,0,0,0},{0,0,0,0,0,0},0,0,0,0,0,0,0}, /* strace_windows[0] */
947 #ifdef WAVE_USE_GTK2
948 {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,{0,0,0,0,0,0},{0,0,0,0,0,0},0,0,0,0,0,0,0}
949 #endif
950 }, /* strace_windows[1] */
951 #if WAVE_NUM_STRACE_WINDOWS != 2
952 #ifdef WAVE_USE_GTK2
953 #error the number of strace windows as defined in strace.h does not match globals.c!
954 #else
955 #if WAVE_NUM_STRACE_WINDOWS != 1
956 #error gtk1 only supports 1 strace window, sorry!
957 #endif
958 #endif
959 #endif
960 0, /* strace_current_window */
961 1, /* strace_repeat_count */
962
963
964 /*
965 * symbol.c
966 */
967 #ifdef _WAVE_HAVE_JUDY
968 NULL, /* sym_judy */
969 NULL, /* s_selected */
970 #endif
971 NULL, /* sym_hash 424 */
972 NULL, /* facs 425 */
973 0, /* facs_are_sorted 426 */
974 0, /* facs_have_symbols_state_machine */
975 0, /* numfacs 427 */
976 0, /* regions 428 */
977 0, /* longestname 429 */
978 NULL, /* firstnode 430 */
979 NULL, /* curnode 431 */
980 0, /* hashcache 432 */
981
982
983 /*
984 * tcl_commands.c
985 */
986 NULL, /* previous_braced_tcl_string */
987
988
989 /*
990 * tcl_helper.c
991 */
992 0, /* in_tcl_callback */
993
994
995 /*
996 * timeentry.c
997 */
998 NULL, /* from_entry 433 */
999 NULL, /* to_entry */
1000
1001
1002 /*
1003 * translate.c
1004 */
1005 0, /* current_translate_file 434 */
1006 0, /* current_filter_translate_c_2 435 */
1007 0, /* num_file_filters 436 */
1008 NULL, /* filesel_filter 437 */
1009 NULL, /* xl_file_filter 438 */
1010 0, /* is_active_translate_c_5 439 */
1011 NULL, /* fcurr_translate_c_2 440 */
1012 NULL, /* window_translate_c_11 441 */
1013 NULL, /* clist_translate_c_4 442 */
1014
1015
1016 /*
1017 * tree.c
1018 */
1019 #ifdef _WAVE_HAVE_JUDY
1020 NULL, /* sym_tree */
1021 NULL, /* sym_tree_addresses */
1022 #endif
1023 NULL, /* treeroot 443 */
1024 NULL, /* mod_tree_parent */
1025 NULL, /* module_tree_c_1 444 */
1026 0, /* module_len_tree_c_1 445 */
1027 NULL, /* terminals_tchain_tree_c_1 446 */
1028 '.', /* hier_delimeter 447 */
1029 0, /* hier_was_explicitly_set 448 */
1030 0x00, /* alt_hier_delimeter 449 */
1031 1, /* fast_tree_sort 450 */
1032 NULL, /* facs2_tree_c_1 451 */
1033 0, /* facs2_pos_tree_c_1 452 */
1034 NULL, /* talloc_pool_base */
1035 0, /* talloc_idx */
1036 NULL, /* sst_exclude_filename */
1037 0, /* exclhiermask */
1038 NULL, /* exclcompname */
1039 NULL, /* exclinstname */
1040
1041
1042 /*
1043 * tree_component.c
1044 */
1045 #ifdef _WAVE_HAVE_JUDY
1046 NULL, /* comp_name_judy */
1047 #else
1048 NULL, /* comp_name_jrb */
1049 #endif
1050 NULL, /* comp_name_idx */
1051 0, /* comp_name_serial */
1052 0, /* comp_name_total_stringmem */
1053 0, /* comp_name_longest */
1054
1055
1056 /*
1057 * treesearch_gtk1.c
1058 */
1059 NULL, /* GtkWidget *window1_treesearch_gtk1_c; */
1060 NULL, /* GtkWidget *entry_a_treesearch_gtk1_c; */
1061 NULL, /* char *entrybox_text_local_treesearch_gtk1_c; */
1062 NULL, /* void (*cleanup_e_treesearch_gtk1_c)(); */
1063 NULL, /* struct tree *selectedtree_treesearch_gtk1_c; */
1064 0, /* int is_active_treesearch_gtk1_c; */
1065 NULL, /* GtkWidget *window_treesearch_gtk1_c; */
1066 NULL, /* GtkWidget *tree_treesearch_gtk1_c; */
1067 0, /* char bundle_direction_treesearch_gtk1_c; */
1068 NULL, /* void (*cleanup_treesearch_gtk1_c)(); */
1069
1070
1071 /*
1072 * treesearch_gtk2.c
1073 */
1074 #ifdef MAC_INTEGRATION
1075 NULL, /* dnd_helper_quartz */
1076 #endif
1077 NULL, /* treeopen_chain_head */
1078 NULL, /* treeopen_chain_curr */
1079 0, /* tree_dnd_begin */
1080 0, /* tree_dnd_requested */
1081 1, /* do_dynamic_treefilter */
1082 NULL, /* treesearch_gtk2_window_vbox */
1083 NULL, /* selected_hierarchy_name */
1084 NULL, /* selected_sig_name */
1085 NULL, /* gtk2_tree_frame */
1086 NULL, /* filter_entry */
1087 NULL, /* any_tree_node */
1088 NULL, /* open_tree_nodes */
1089 0, /* autoname_bundles 453 */
1090 NULL, /* window1_treesearch_gtk2_c_3 454 */
1091 NULL, /* entry_a_treesearch_gtk2_c_2 455 */
1092 NULL, /* entrybox_text_local_treesearch_gtk2_c_3 456 */
1093 NULL, /* cleanup_e_treesearch_gtk2_c_3 457 */
1094 NULL, /* sig_root_treesearch_gtk2_c_1 458 */
1095 NULL, /* sst_sig_root_treesearch_gtk2_c_1 */
1096 NULL, /* filter_str_treesearch_gtk2_c_1 459 */
1097 ND_DIR_UNSPECIFIED, /* filter_typ_treesearch_gtk2_c_1 */
1098 0, /* filter_typ_polarity_treesearch_gtk2_c_1 */
1099 0, /* filter_matlen_treesearch_gtk2_c_1 */
1100 0, /* filter_noregex_treesearch_gtk2_c_1 */
1101 #if defined(WAVE_USE_GTK2)
1102 NULL, /* sig_store_treesearch_gtk2_c_1 460 */
1103 NULL, /* sig_selection_treesearch_gtk2_c_1 461 */
1104 #endif
1105 0, /* is_active_treesearch_gtk2_c_6 462 */
1106 NULL, /* ctree_main 463 */
1107 NULL, /* afl_treesearch_gtk2_c_1 464 */
1108 NULL, /* window_treesearch_gtk2_c_12 465 */
1109 NULL, /* tree_treesearch_gtk2_c_1 466 */
1110 NULL, /* cleanup_treesearch_gtk2_c_8 468 */
1111 0, /* pre_import_treesearch_gtk2_c_1 469 */
1112 {0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0}, /* tcache_treesearch_gtk2_c_2 470 */
1113 0, /* dnd_tgt_on_signalarea_treesearch_gtk2_c_1 471 */
1114 0, /* dnd_tgt_on_wavearea_treesearch_gtk2_c_1 */
1115 NULL, /* dnd_sigview */
1116 NULL, /* sst_vpaned */
1117 0, /* fetchlow */
1118 0, /* fetchhigh */
1119 SST_ACTION_INSERT, /* sst_dbl_action_type */
1120
1121
1122 /*
1123 * ttranslate.c
1124 */
1125 0, /* current_translate_ttrans */
1126 0, /* current_filter_ttranslate_c_1 */
1127 0, /* num_ttrans_filters */
1128 NULL, /* ttranssel_filter */
1129 NULL, /* ttrans_filter */
1130 0, /* is_active_ttranslate_c_2 */
1131 NULL, /* fcurr_ttranslate_c_1 */
1132 NULL, /* window_ttranslate_c_5 */
1133 NULL, /* clist_ttranslate_c_2 */
1134 NULL, /* ttranslate_args */
1135
1136
1137 /*
1138 * vcd.c
1139 */
1140 0, /* do_hier_compress */
1141 NULL, /* prev_hier_uncompressed_name */
1142 NULL, /* vcd_jmp_buf */
1143 -1, /* vcd_warning_filesize 472 */
1144 1, /* autocoalesce 473 */
1145 0, /* autocoalesce_reversal */
1146 -1, /* vcd_explicit_zero_subscripts 474 */
1147 0, /* convert_to_reals 475 */
1148 1, /* atomic_vectors 476 */
1149 0, /* make_vcd_save_file 477 */
1150 0, /* vcd_preserve_glitches 478 */
1151 0, /* vcd_preserve_glitches_real */
1152 NULL, /* vcd_save_handle 479 */
1153 NULL, /* vcd_handle_vcd_c_1 480 */
1154 0, /* vcd_is_compressed_vcd_c_1 481 */
1155 0, /* vcdbyteno_vcd_c_1 482 */
1156 0, /* error_count_vcd_c_1 483 */
1157 0, /* header_over_vcd_c_1 484 */
1158 0, /* dumping_off_vcd_c_1 485 */
1159 -1, /* start_time_vcd_c_1 486 */
1160 -1, /* end_time_vcd_c_1 487 */
1161 -1, /* current_time_vcd_c_1 488 */
1162 0, /* num_glitches_vcd_c_2 489 */
1163 0, /* num_glitch_regions_vcd_c_2 490 */
1164 {0, 0}, /* vcd_hier_delimeter 491 */
1165 NULL, /* pv_vcd_c_1 492 */
1166 NULL, /* rootv_vcd_c_1 */
1167 NULL, /* vcdbuf_vcd_c_1 493 */
1168 NULL, /* vst */
1169 NULL, /* vend */
1170 0, /* escaped_names_found_vcd_c_1 494 */
1171 NULL, /* slistroot 495 */
1172 NULL, /* slistcurr */
1173 NULL, /* slisthier 496 */
1174 0, /* slisthier_len 497x */
1175 1024, /* T_MAX_STR_vcd_c_1 499 */
1176 NULL, /* yytext_vcd_c_1 500 */
1177 0, /* yylen_vcd_c_1 501 */
1178 0, /* yylen_cache */
1179 NULL, /* vcdsymroot_vcd_c_1 502 */
1180 NULL, /* vcdsymcurr */
1181 NULL, /* sorted_vcd_c_1 503 */
1182 NULL, /* indexed_vcd_c_1 504 */
1183 0, /* numsyms_vcd_c_1 505 */
1184 NULL, /* he_curr_vcd_c_1 506 */
1185 NULL, /* he_fini */
1186 ~0, /* vcd_minid_vcd_c_1 508 */
1187 0, /* vcd_maxid_vcd_c_1 509 */
1188 0, /* err_vcd_c_1 510 */
1189 0, /* vcd_fsiz_vcd_c_1 511 */
1190 NULL, /* varsplit_vcd_c_1 512 */
1191 NULL, /* varsplitcurr */
1192 0, /* var_prevch_vcd_c_1 513 */
1193 0, /* vcd_already_backtracked */
1194
1195
1196 /*
1197 * vcd_partial.c
1198 */
1199 0, /* vcdbyteno_vcd_partial_c_2 516 */
1200 0, /* error_count_vcd_partial_c_2 517 */
1201 0, /* header_over_vcd_partial_c_2 518 */
1202 0, /* dumping_off_vcd_partial_c_2 519 */
1203 -1, /* start_time_vcd_partial_c_2 520 */
1204 -1, /* end_time_vcd_partial_c_2 521 */
1205 -1, /* current_time_vcd_partial_c_2 522 */
1206 0, /* num_glitches_vcd_partial_c_3 523 */
1207 0, /* num_glitch_regions_vcd_partial_c_3 524 */
1208 NULL, /* pv_vcd_partial_c_2 525 */
1209 NULL, /* rootv */
1210 NULL, /* vcdbuf_vcd_partial_c_2 526 */
1211 NULL, /* vst */
1212 NULL, /* vend */
1213 NULL, /* consume_ptr_vcd_partial_c_1 527 */
1214 NULL, /* buf_vcd_partial_c_2 528 */
1215 100000, /* consume_countdown_vcd_partial_c_1 529 */
1216 1024, /* T_MAX_STR_vcd_partial_c_2 531 */
1217 NULL, /* yytext_vcd_partial_c_2 532 */
1218 0, /* yylen_vcd_partial_c_2 533 */
1219 0, /* yylen_cache */
1220 NULL, /* vcdsymroot_vcd_partial_c_2 534 */
1221 NULL, /* vcdsymcurr */
1222 NULL, /* sorted_vcd_partial_c_2 535 */
1223 NULL, /* indexed_vcd_partial_c_2 536 */
1224 0, /* numsyms_vcd_partial_c_2 538 */
1225 ~0, /* vcd_minid_vcd_partial_c_2 540 */
1226 0, /* vcd_maxid_vcd_partial_c_2 541 */
1227 0, /* err_vcd_partial_c_2 542 */
1228 NULL, /* varsplit_vcd_partial_c_2 543 */
1229 NULL, /* vsplitcurr */
1230 0, /* var_prevch_vcd_partial_c_2 544 */
1231 0, /* timeset_vcd_partial_c_1 547 */
1232
1233
1234 /*
1235 * vcd_recoder.c
1236 */
1237 NULL, /* time_vlist_vcd_recoder_c_1 548 */
1238 NULL, /* time_vlist_vcd_recoder_write */
1239 NULL, /* fastload_depacked */
1240 NULL, /* fastload_current */
1241 0, /* time_vlist_count_vcd_recoder_c_1 549 */
1242 NULL, /* vcd_handle_vcd_recoder_c_2 550 */
1243 0, /* vcd_is_compressed_vcd_recoder_c_2 551 */
1244 VCD_FSL_NONE, /* use_fastload */
1245 0, /* vcdbyteno_vcd_recoder_c_3 552 */
1246 0, /* error_count_vcd_recoder_c_3 553 */
1247 0, /* header_over_vcd_recoder_c_3 554 */
1248 0, /* dumping_off_vcd_recoder_c_3 555 */
1249 -1, /* start_time_vcd_recoder_c_3 556 */
1250 -1, /* end_time_vcd_recoder_c_3 557 */
1251 -1, /* current_time_vcd_recoder_c_3 558 */
1252 0, /* num_glitches_vcd_recoder_c_4 559 */
1253 0, /* num_glitch_regions_vcd_recoder_c_4 560 */
1254 NULL, /* pv_vcd_recoder_c_3 561 */
1255 NULL, /* rootv */
1256 NULL, /* vcdbuf_vcd_recoder_c_3 562 */
1257 NULL, /* vst */
1258 NULL, /* vend */
1259 1024, /* T_MAX_STR_vcd_recoder_c_3 564 */
1260 NULL, /* yytext_vcd_recoder_c_3 565 */
1261 0, /* yylen_vcd_recoder_c_3 566 */
1262 0, /* yylen_cache */
1263 NULL, /* vcdsymroot_vcd_recoder_c_3 567 */
1264 NULL, /* vcdsymcurr */
1265 NULL, /* sorted_vcd_recoder_c_3 568 */
1266 NULL, /* indexed_vcd_recoder_c_3 569 */
1267 0, /* numsyms_vcd_recoder_c_3 570 */
1268 ~0, /* vcd_minid_vcd_recoder_c_3 571 */
1269 0, /* vcd_maxid_vcd_recoder_c_3 572 */
1270 0, /* err_vcd_recoder_c_3 573 */
1271 0, /* vcd_fsiz_vcd_recoder_c_2 574 */
1272 NULL, /* varsplit_vcd_recoder_c_3 575 */
1273 NULL, /* vsplitcurr */
1274 0, /* var_prevch_vcd_recoder_c_3 576 */
1275 0, /* vcd_hash_max */
1276 0, /* vcd_hash_kill */
1277
1278
1279 /*
1280 * vcd_saver.c
1281 */
1282 NULL, /* f_vcd_saver_c_1 579 */
1283 {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0}, /* buf_vcd_saver_c_3 580 */
1284 NULL, /* hp_vcd_saver_c_1 581 */
1285 NULL, /* nhold_vcd_saver_c_1 582 */
1286
1287
1288 /*
1289 * vlist.c
1290 */
1291 0, /* vlist_spill_to_disk */
1292 0, /* vlist_prepack */
1293 NULL, /* vlist_handle */
1294 0, /* vlist_bytes_written */
1295 4, /* vlist_compression_depth 583 */
1296
1297
1298 /*
1299 * vzt.c
1300 */
1301 NULL, /* vzt_vzt_c_1 584 */
1302 0, /* first_cycle_vzt_c_3 585 */
1303 0, /* last_cycle */
1304 0, /* total_cycles */
1305 NULL, /* vzt_table_vzt_c_1 586 */
1306 NULL, /* mvlfacs_vzt_c_3 587 */
1307 0, /* busycnt_vzt_c_2 588 */
1308
1309
1310 /*
1311 * wavewindow.c
1312 */
1313 0, /* highlight_wavewindow */
1314 1, /* alt_wheel_mode */
1315 0, /* use_scrollwheel_as_y */
1316 0, /* enable_slider_zoom */
1317 0, /* m1x_wavewindow_c_1 589 */
1318 0, /* m2x_wavewindow_c_1 */
1319 0, /* black_and_white */
1320 1, /* signalwindow_width_dirty 590 */
1321 1, /* enable_ghost_marker 591 */
1322 1, /* enable_horiz_grid 592 */
1323 1, /* enable_vert_grid 593 */
1324 0, /* use_big_fonts 594 */
1325 0, /* use_nonprop_fonts */
1326 ~0, /* do_resize_signals 595 */
1327 ~0, /* first_unsized_signals */
1328 0, /* initial_signal_window_width */
1329 0, /* constant_marker_update 596 */
1330 0, /* use_roundcaps 597 */
1331 ~0, /* show_base 598 */
1332 ~0, /* wave_scrolling 599 */
1333 4, /* vector_padding 600 */
1334 0, /* in_button_press_wavewindow_c_1 601 */
1335 0, /* left_justify_sigs 602 */
1336 0, /* zoom_pow10_snap 603 */
1337 0, /* zoom_dyn */
1338 0, /* zoom_dyne */
1339 0, /* cursor_snap 604 */
1340 -1.0, /* old_wvalue 605 */
1341 NULL, /* blackout_regions 606 */
1342 0, /* zoom 607 */
1343 1, /* scale */
1344 1, /* nsperframe */
1345 1, /* pixelsperframe 608 */
1346 1.0, /* hashstep 609 */
1347 -1, /* prevtim_wavewindow_c_1 610 */
1348 1.0, /* pxns 611 */
1349 1.0, /* nspx */
1350 2.0, /* zoombase 612 */
1351 NULL, /* topmost_trace 613 */
1352 1, /* waveheight 614 */
1353 0, /* wavecrosspiece */
1354 1, /* wavewidth 615 */
1355 NULL, /* wavefont 616 */
1356 NULL, /* wavefont_smaller 617 */
1357 NULL, /* wavearea 618 */
1358 NULL, /* vscroll_wavewindow_c_1 619 */
1359 NULL, /* hscroll_wavewindow_c_2 620 */
1360 NULL, /* wavepixmap_wavewindow_c_1 621 */
1361 NULL, /* wave_vslider 622 */
1362 NULL, /* wave_hslider */
1363 {0}, /* named_markers 623 */
1364 -1, /* named_marker_lock_idx */
1365 0, /* made_gc_contexts_wavewindow_c_1 624 */
1366 0, /* which_t_color */
1367 NULL, /* gc_white 650 */
1368 NULL, /* gc_black 651 */
1369 {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, /* gc */
1370 WAVE_RAINBOW_INITIALIZER, /* gc_rainbow */
1371 0, /* made_sgc_contexts_wavewindow_c_1 649 */
1372 0, /* fill_in_smaller_rgb_areas_wavewindow_c_1 659 */
1373 -1, /* prev_markertime */
1374 {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, /* gccache */
1375 20, /* analog_redraw_skip_count */
1376 0, /* str_wid_x */
1377 0, /* str_wid_width */
1378 0, /* str_wid_bigw */
1379 0, /* str_wid_state */
1380 0, /* str_wid_slider */
1381 0, /* str_wid_height */
1382 0, /* ruler_origin */
1383 0, /* ruler_step */
1384 0, /* fill_waveform */
1385 FALSE, /*save_on_exit */
1386
1387
1388 /*
1389 * zoombuttons.c
1390 */
1391 1, /* do_zoom_center 660 */
1392 0, /* do_initial_zoom_fit 661 */
1393 0, /* do_initial_zoom_fit_used */
1394 };
1395
1396
1397 /*
1398 * prototypes (because of struct Global header recursion issues
1399 */
1400 void *calloc_2_into_context(struct Global *g, size_t nmemb, size_t size);
1401
1402
1403 /*
1404 * context manipulation functions
1405 */
initialize_globals(void)1406 struct Global *initialize_globals(void)
1407 {
1408 struct Global *g = calloc(1,sizeof(struct Global)); /* allocate viewer context */
1409
1410 memcpy(g, &globals_base_values, sizeof(struct Global)); /* fill in the blanks */
1411
1412 g->gtk_context_bridge_ptr = calloc(1, sizeof(struct Global *));
1413 *(g->gtk_context_bridge_ptr) = g;
1414
1415 g->buf_menu_c_1 = calloc_2_into_context(g, 1, 65537); /* do remaining mallocs into new ctx */
1416 g->regexp_string_menu_c_1 = calloc_2_into_context(g, 1, 129);
1417 g->regex_ok_regex_c_1 = calloc_2_into_context(g, WAVE_REGEX_TOTAL, sizeof(int));
1418 g->preg_regex_c_1 = calloc_2_into_context(g, WAVE_REGEX_TOTAL, sizeof(regex_t));
1419
1420 g->strace_ctx = &g->strace_windows[0]; /* arbitrarily point to first one */
1421
1422 return(g); /* what to do with ctx is at discretion of caller */
1423 }
1424
strcpy2_into_new_context(struct Global * g,char ** newstrref,char ** oldstrref)1425 void strcpy2_into_new_context(struct Global *g, char **newstrref, char **oldstrref)
1426 {
1427 char *o = *oldstrref;
1428 char *n;
1429
1430 if(o) /* only allocate + copy string if nonnull pointer */
1431 {
1432 n = calloc_2_into_context(g, 1, strlen(o) + 1);
1433 strcpy(n, o);
1434 *newstrref = n;
1435 }
1436 }
1437
1438
1439 /*
1440 * widget destruction functions
1441 */
widget_ungrab_destroy(GtkWidget ** wp)1442 static void widget_ungrab_destroy(GtkWidget **wp)
1443 {
1444 if(*wp)
1445 {
1446 wave_gtk_grab_remove(*wp);
1447 gtk_widget_destroy(*wp);
1448 *wp = NULL;
1449 }
1450 }
1451
widget_only_destroy(GtkWidget ** wp)1452 static void widget_only_destroy(GtkWidget **wp)
1453 {
1454 if(*wp)
1455 {
1456 gtk_widget_destroy(*wp);
1457 *wp = NULL;
1458 }
1459 }
1460
1461
1462 /*
1463 * setjump to avoid -Wclobbered issues
1464 */
handle_setjmp(void)1465 static int handle_setjmp(void)
1466 {
1467 struct Global *setjmp_globals;
1468 int load_was_success = 0;
1469
1470 GLOBALS->vcd_jmp_buf = calloc(1, sizeof(jmp_buf));
1471 setjmp_globals = calloc(1,sizeof(struct Global)); /* allocate yet another copy of viewer context */
1472 memcpy(setjmp_globals, GLOBALS, sizeof(struct Global)); /* clone */
1473 GLOBALS->alloc2_chain = NULL; /* will merge this in after load if successful */
1474 GLOBALS->outstanding = 0; /* zero out count of chunks in this ctx */
1475
1476 if(!setjmp(*(GLOBALS->vcd_jmp_buf))) /* loader exception handling */
1477 {
1478 switch(GLOBALS->loaded_file_type) /* on fail, longjmp called in these loaders */
1479 {
1480 case LXT_FILE: lxt_main(GLOBALS->loaded_file_name); break;
1481 case VCD_FILE: vcd_main(GLOBALS->loaded_file_name); break;
1482 case VCD_RECODER_FILE: vcd_recoder_main(GLOBALS->loaded_file_name); break;
1483 default: break;
1484 }
1485
1486 #ifdef _WAVE_HAVE_JUDY
1487 {
1488 Pvoid_t PJArray = (Pvoid_t)setjmp_globals->alloc2_chain;
1489 int rcValue;
1490 Word_t Index;
1491
1492 Index = 0;
1493 for (rcValue = Judy1First(PJArray, &Index, PJE0); rcValue != 0; rcValue = Judy1Next(PJArray, &Index, PJE0))
1494 {
1495 Judy1Set ((Pvoid_t)&GLOBALS->alloc2_chain, Index, PJE0);
1496 }
1497
1498 GLOBALS->outstanding += setjmp_globals->outstanding;
1499 Judy1FreeArray(&PJArray, PJE0);
1500 }
1501 #else
1502 {
1503 void **t, **t2;
1504
1505 t = (void **)setjmp_globals->alloc2_chain;
1506 while(t)
1507 {
1508 t2 = (void **) *(t+1);
1509 if(t2)
1510 {
1511 t = t2;
1512 }
1513 else
1514 {
1515 *(t+1) = GLOBALS->alloc2_chain;
1516 if(GLOBALS->alloc2_chain)
1517 {
1518 t2 = (void **)GLOBALS->alloc2_chain;
1519 *(t2+0) = t;
1520 }
1521 GLOBALS->alloc2_chain = setjmp_globals->alloc2_chain;
1522 GLOBALS->outstanding += setjmp_globals->outstanding;
1523 break;
1524 }
1525 }
1526 }
1527 #endif
1528 free(GLOBALS->vcd_jmp_buf); GLOBALS->vcd_jmp_buf = NULL;
1529 free(setjmp_globals); setjmp_globals = NULL;
1530
1531 load_was_success = 1;
1532 }
1533 else
1534 {
1535 free(GLOBALS->vcd_jmp_buf); GLOBALS->vcd_jmp_buf = NULL;
1536 if(GLOBALS->vcd_handle_vcd_c_1)
1537 {
1538 if(GLOBALS->vcd_is_compressed_vcd_c_1)
1539 {
1540 pclose(GLOBALS->vcd_handle_vcd_c_1);
1541 GLOBALS->vcd_handle_vcd_c_1 = NULL;
1542 }
1543 else
1544 {
1545 fclose(GLOBALS->vcd_handle_vcd_c_1);
1546 GLOBALS->vcd_handle_vcd_c_1 = NULL;
1547 }
1548 }
1549 if(GLOBALS->vcd_handle_vcd_recoder_c_2)
1550 {
1551 if(GLOBALS->vcd_is_compressed_vcd_recoder_c_2)
1552 {
1553 pclose(GLOBALS->vcd_handle_vcd_recoder_c_2);
1554 GLOBALS->vcd_handle_vcd_recoder_c_2 = NULL;
1555 }
1556 else
1557 {
1558 fclose(GLOBALS->vcd_handle_vcd_recoder_c_2);
1559 GLOBALS->vcd_handle_vcd_recoder_c_2 = NULL;
1560 }
1561 }
1562
1563
1564 if(GLOBALS->vlist_handle) { fclose(GLOBALS->vlist_handle); GLOBALS->vlist_handle = NULL; }
1565 if(GLOBALS->mm_lxt_mmap_addr)
1566 {
1567 munmap(GLOBALS->mm_lxt_mmap_addr, GLOBALS->mm_lxt_mmap_len);
1568 GLOBALS->mm_lxt_mmap_addr = NULL;
1569 }
1570 free_outstanding(); /* free anything allocated in loader ctx */
1571
1572 memcpy(GLOBALS, setjmp_globals, sizeof(struct Global)); /* copy over old ctx */
1573 free(setjmp_globals); /* remove cached old ctx */
1574 /* now try again, jump through recovery sequence below */
1575 }
1576
1577 return(load_was_success);
1578 }
1579
1580
1581 /*
1582 * reload from old into the new context
1583 */
reload_into_new_context_2(void)1584 void reload_into_new_context_2(void)
1585 {
1586 FILE *statefile;
1587 struct Global *new_globals;
1588 /* gint tree_frame_x = -1; */ /* scan-build */
1589 #if WAVE_USE_GTK2
1590 gint tree_frame_y = -1;
1591 gdouble tree_vadj_value = 0.0;
1592 gdouble tree_hadj_value = 0.0;
1593 gdouble treeview_vadj_value = 0.0;
1594 gdouble treeview_hadj_value = 0.0;
1595 #endif
1596 int fix_from_time = 0, fix_to_time = 0;
1597 TimeType from_time = LLDescriptor(0), to_time = LLDescriptor(0);
1598 char timestr[32];
1599 struct stringchain_t *hier_head = NULL, *hier_curr = NULL;
1600 int load_was_success = 0;
1601 int reload_fail_delay = 1;
1602 char *save_tmpfilename = NULL;
1603 char *reload_tmpfilename = NULL;
1604 int fd_dummy = -1;
1605 int s_ctx_iter;
1606
1607 /* save these in case we decide to write out the rc file later as a user option */
1608 char cached_ignore_savefile_pane_pos = GLOBALS->ignore_savefile_pane_pos;
1609 char cached_ignore_savefile_pos = GLOBALS->ignore_savefile_pos;
1610 char cached_ignore_savefile_size = GLOBALS->ignore_savefile_size;
1611 char cached_splash_disable = GLOBALS->splash_disable;
1612
1613 if((GLOBALS->loaded_file_type == MISSING_FILE)||(GLOBALS->is_optimized_stdin_vcd))
1614 {
1615 fprintf(stderr, "GTKWAVE | Nothing to reload!\n");
1616 return;
1617 }
1618
1619 logbox_reload();
1620
1621 /* kill any pending splash screens (e.g., from Tcl "wish") */
1622 splash_button_press_event(NULL, NULL);
1623
1624 /* fix problem where ungrab doesn't occur if button pressed + simultaneous reload accelerator key occurs */
1625 if(GLOBALS->in_button_press_wavewindow_c_1) { gdk_pointer_ungrab(GDK_CURRENT_TIME); }
1626
1627 /* let all GTK/X events spin through in order to keep menus from freezing open during reload */
1628 #ifndef MAC_INTEGRATION
1629 if(GLOBALS->text_status_c_2)
1630 {
1631 wave_gtk_grab_add(GLOBALS->text_status_c_2); /* grab focus to a known widget with no real side effects */
1632 gtkwave_main_iteration(); /* spin on GTK event loop */
1633 wave_gtk_grab_remove(GLOBALS->text_status_c_2); /* ungrab focus */
1634 }
1635 #endif
1636
1637 printf("GTKWAVE | Reloading waveform...\n");
1638 gtkwavetcl_setvar(WAVE_TCLCB_RELOAD_BEGIN, GLOBALS->loaded_file_name, WAVE_TCLCB_RELOAD_BEGIN_FLAGS);
1639
1640 /* Save state to file */
1641 save_tmpfilename = tmpnam_2(NULL, &fd_dummy);
1642 statefile = save_tmpfilename ? fopen(save_tmpfilename,"wb") : NULL;
1643 if(statefile == NULL) {
1644 fprintf(stderr, "Failed to create temp file required for file reload.\n");
1645 if(save_tmpfilename) { perror("Why"); free_2(save_tmpfilename); }
1646 gtkwavetcl_setvar_nonblocking(WAVE_TCLCB_ERROR,"reload failed",WAVE_TCLCB_ERROR_FLAGS);
1647 return;
1648 }
1649 if(fd_dummy >=0) close(fd_dummy);
1650 write_save_helper(save_tmpfilename, statefile);
1651 fclose(statefile);
1652
1653 reload_tmpfilename = strdup(save_tmpfilename);
1654 free_2(save_tmpfilename);
1655
1656 /* save off size of tree frame if active */
1657 #if WAVE_USE_GTK2
1658 if(GLOBALS->gtk2_tree_frame)
1659 {
1660 /* upper tree */
1661 GtkCList *cl = GTK_CLIST(GLOBALS->ctree_main);
1662 GtkAdjustment *vadj = gtk_clist_get_vadjustment(cl);
1663 GtkAdjustment *hadj = gtk_clist_get_hadjustment(cl);
1664
1665 if(vadj) tree_vadj_value = vadj->value;
1666 if(hadj) tree_hadj_value = hadj->value;
1667
1668 /* tree_frame_x = (GLOBALS->gtk2_tree_frame)->allocation.width; */ /* scan-build */
1669 tree_frame_y = (GLOBALS->gtk2_tree_frame)->allocation.height;
1670
1671 /* lower signal set */
1672 vadj = gtk_tree_view_get_vadjustment((GtkTreeView *)GLOBALS->dnd_sigview);
1673 hadj = gtk_tree_view_get_hadjustment((GtkTreeView *)GLOBALS->dnd_sigview);
1674
1675 if(vadj) treeview_vadj_value = vadj->value;
1676 if(hadj) treeview_hadj_value = hadj->value;
1677 }
1678 #endif
1679
1680 /* Kill any open processes */
1681 remove_all_proc_filters();
1682 remove_all_ttrans_filters();
1683
1684 /* Instantiate new global status */
1685 new_globals = initialize_globals();
1686 free(new_globals->gtk_context_bridge_ptr); /* don't need this one as we're copying over the old one... */
1687 new_globals->gtk_context_bridge_ptr = GLOBALS->gtk_context_bridge_ptr;
1688
1689 /* SMP */
1690 new_globals->num_cpus = GLOBALS->num_cpus;
1691
1692 /* tcl interpreter */
1693 #if defined(HAVE_LIBTCL)
1694 new_globals->interp = GLOBALS->interp;
1695 #endif
1696
1697 /* lxt.c */
1698 if(GLOBALS->fd_lxt_c_1 >= 0)
1699 {
1700 close(GLOBALS->fd_lxt_c_1);
1701 GLOBALS->fd_lxt_c_1 = -1;
1702 }
1703
1704
1705 /* Marker positions */
1706 memcpy(new_globals->named_markers, GLOBALS->named_markers, sizeof(GLOBALS->named_markers));
1707 new_globals->named_marker_lock_idx = GLOBALS->named_marker_lock_idx;
1708
1709 /* notebook page flipping */
1710 new_globals->num_notebook_pages = GLOBALS->num_notebook_pages;
1711 new_globals->num_notebook_pages_cumulative = GLOBALS->num_notebook_pages_cumulative;
1712 new_globals->this_context_page = GLOBALS->this_context_page;
1713 new_globals->contexts = GLOBALS->contexts; /* this value is a *** chameleon! malloc'd region is outside debug.c control! */
1714 new_globals->notebook = GLOBALS->notebook;
1715 new_globals->second_page_created = GLOBALS->second_page_created;
1716 (*new_globals->contexts)[new_globals->this_context_page] = new_globals;
1717 new_globals->dead_context = GLOBALS->dead_context; /* this value is a ** chameleon! malloc'd region is outside debug.c control! */
1718
1719 /* to cut down on temporary visual noise from incorrect zoom factor on reload */
1720 new_globals->pixelsperframe = GLOBALS->pixelsperframe;
1721 new_globals->nsperframe = GLOBALS->nsperframe;
1722 new_globals->pxns = GLOBALS->pxns;
1723 new_globals->nspx = GLOBALS->nspx;
1724 new_globals->nspx = GLOBALS->nspx;
1725 new_globals->zoom = GLOBALS->zoom;
1726
1727 /* Default colors, X contexts, pixmaps, drawables, etc from signalwindow.c and wavewindow.c */
1728 new_globals->possibly_use_rc_defaults = GLOBALS->possibly_use_rc_defaults;
1729
1730 new_globals->signalarea_event_box = GLOBALS->signalarea_event_box;
1731 new_globals->keypress_handler_id = GLOBALS->keypress_handler_id;
1732 new_globals->signalarea = GLOBALS->signalarea;
1733 new_globals->wavearea = GLOBALS->wavearea;
1734 new_globals->wavepixmap_wavewindow_c_1 = GLOBALS->wavepixmap_wavewindow_c_1;
1735 new_globals->signalpixmap = GLOBALS->signalpixmap;
1736 new_globals->wave_splash_pixmap = GLOBALS->wave_splash_pixmap;
1737 new_globals->wave_splash_mask = GLOBALS->wave_splash_mask;
1738
1739 new_globals->black_and_white = GLOBALS->black_and_white;
1740
1741 new_globals->gc_white = GLOBALS->gc_white;
1742 new_globals->gc_black = GLOBALS->gc_black;
1743 memcpy(&new_globals->gc, &GLOBALS->gc, sizeof(struct wave_gcmaster_t));
1744 new_globals->made_sgc_contexts_wavewindow_c_1 = GLOBALS->made_sgc_contexts_wavewindow_c_1;
1745 new_globals->made_gc_contexts_wavewindow_c_1 = GLOBALS->made_gc_contexts_wavewindow_c_1;
1746 memcpy(&new_globals->gccache, &GLOBALS->gccache, sizeof(struct wave_gcmaster_t));
1747 memcpy(&new_globals->gc_rainbow, &GLOBALS->gc_rainbow, 2 * WAVE_NUM_RAINBOW * sizeof(GdkGC *));
1748
1749 new_globals->mainwindow = GLOBALS->mainwindow;
1750 new_globals->signalwindow = GLOBALS->signalwindow;
1751 new_globals->wavewindow = GLOBALS->wavewindow;
1752 new_globals->toppanedwindow = GLOBALS->toppanedwindow;
1753 new_globals->panedwindow = GLOBALS->panedwindow;
1754 new_globals->sstpane = GLOBALS->sstpane;
1755 new_globals->sst_vpaned = GLOBALS->sst_vpaned;
1756 new_globals->expanderwindow = GLOBALS->expanderwindow;
1757 new_globals->signal_hslider = GLOBALS->signal_hslider;
1758 new_globals->wave_vslider = GLOBALS->wave_vslider;
1759 new_globals->wave_hslider = GLOBALS->wave_hslider;
1760 new_globals->hscroll_wavewindow_c_2 = GLOBALS->hscroll_wavewindow_c_2;
1761 new_globals->max_or_marker_label_currenttime_c_1 = GLOBALS->max_or_marker_label_currenttime_c_1;
1762 new_globals->maxtext_currenttime_c_1 = (char *) calloc_2_into_context(new_globals,1,40);
1763 memcpy(new_globals->maxtext_currenttime_c_1, GLOBALS->maxtext_currenttime_c_1,40);
1764 new_globals->maxtimewid_currenttime_c_1 = GLOBALS->maxtimewid_currenttime_c_1;
1765 new_globals->curtext_currenttime_c_1 = (char *) calloc_2_into_context(new_globals,1,40);
1766 memcpy(new_globals->curtext_currenttime_c_1, GLOBALS->curtext_currenttime_c_1, 40);
1767 new_globals->base_or_curtime_label_currenttime_c_1 = GLOBALS->base_or_curtime_label_currenttime_c_1;
1768 new_globals->curtimewid_currenttime_c_1 = GLOBALS->curtimewid_currenttime_c_1;
1769 new_globals->from_entry = GLOBALS->from_entry;
1770 new_globals->to_entry = GLOBALS->to_entry;
1771
1772 new_globals->fontheight = GLOBALS->fontheight;
1773 new_globals->wavecrosspiece = GLOBALS->wavecrosspiece;
1774
1775 new_globals->signalfont = calloc_2_into_context(new_globals, 1, sizeof(struct font_engine_font_t));
1776 memcpy(new_globals->signalfont, GLOBALS->signalfont, sizeof(struct font_engine_font_t));
1777
1778 new_globals->wavefont = calloc_2_into_context(new_globals, 1, sizeof(struct font_engine_font_t));
1779 memcpy(new_globals->wavefont, GLOBALS->wavefont, sizeof(struct font_engine_font_t));
1780
1781 new_globals->wavefont_smaller = calloc_2_into_context(new_globals, 1, sizeof(struct font_engine_font_t));
1782 memcpy(new_globals->wavefont_smaller, GLOBALS->wavefont_smaller, sizeof(struct font_engine_font_t));
1783
1784 #if defined(WAVE_USE_GTK2) && !defined(GTK_ENABLE_BROKEN) && GTK_CHECK_VERSION(2,8,0)
1785 new_globals->fonts_renderer = GLOBALS->fonts_renderer;
1786 new_globals->fonts_gc = GLOBALS->fonts_gc;
1787 new_globals->fonts_screen = GLOBALS->fonts_screen;
1788 new_globals->fonts_context = GLOBALS->fonts_context;
1789 new_globals->fonts_layout = GLOBALS->fonts_layout;
1790 #endif
1791 new_globals->use_pango_fonts = GLOBALS->use_pango_fonts;
1792
1793 new_globals->ruler_origin = GLOBALS->ruler_origin;
1794 new_globals->ruler_step = GLOBALS->ruler_step;
1795
1796 /* busy.c */
1797 new_globals->busycursor_busy_c_1 = GLOBALS->busycursor_busy_c_1;
1798 new_globals->busy_busy_c_1 = GLOBALS->busy_busy_c_1;
1799
1800 /* pixmaps.c */
1801 new_globals->redo_pixmap = GLOBALS->redo_pixmap;
1802 new_globals->larrow_pixmap = GLOBALS->larrow_pixmap;
1803 new_globals->rarrow_pixmap = GLOBALS->rarrow_pixmap;
1804 new_globals->zoomout_pixmap = GLOBALS->zoomout_pixmap;
1805 new_globals->zoomin_pixmap = GLOBALS->zoomin_pixmap;
1806 new_globals->zoomfit_pixmap = GLOBALS->zoomfit_pixmap;
1807 new_globals->zoomundo_pixmap = GLOBALS->zoomundo_pixmap;
1808 new_globals->zoom_larrow_pixmap = GLOBALS->zoom_larrow_pixmap;
1809 new_globals->zoom_rarrow_pixmap = GLOBALS->zoom_rarrow_pixmap;
1810 new_globals->prev_page_pixmap = GLOBALS->prev_page_pixmap;
1811 new_globals->next_page_pixmap = GLOBALS->next_page_pixmap;
1812 new_globals->wave_info_pixmap = GLOBALS->wave_info_pixmap;
1813 new_globals->wave_alert_pixmap = GLOBALS->wave_alert_pixmap;
1814
1815 clone_icon_pointers_across_contexts(new_globals, GLOBALS);
1816
1817 /* rc.c */
1818 new_globals->scale_to_time_dimension = GLOBALS->scale_to_time_dimension;
1819 new_globals->zoom_dyn = GLOBALS->zoom_dyn;
1820 new_globals->zoom_dyne = GLOBALS->zoom_dyne;
1821 new_globals->use_scrollwheel_as_y = GLOBALS->use_scrollwheel_as_y;
1822 new_globals->enable_slider_zoom = GLOBALS->enable_slider_zoom;
1823 new_globals->context_tabposition = GLOBALS->context_tabposition;
1824 new_globals->use_standard_clicking = GLOBALS->use_standard_clicking;
1825 new_globals->dragzoom_threshold = GLOBALS->dragzoom_threshold;
1826
1827 new_globals->ignore_savefile_pane_pos = 1; /* to keep window from resizing/jumping */
1828 new_globals->ignore_savefile_pos = 1; /* to keep window from resizing/jumping */
1829 new_globals->ignore_savefile_size = 1; /* to keep window from resizing/jumping */
1830
1831 new_globals->color_back = GLOBALS->color_back;
1832 new_globals->color_baseline = GLOBALS->color_baseline;
1833 new_globals->color_grid = GLOBALS->color_grid;
1834 new_globals->color_grid2 = GLOBALS->color_grid2;
1835 new_globals->color_high = GLOBALS->color_high;
1836 new_globals->color_highfill = GLOBALS->color_highfill;
1837 new_globals->color_low = GLOBALS->color_low;
1838 new_globals->color_1 = GLOBALS->color_1;
1839 new_globals->color_1fill = GLOBALS->color_1fill;
1840 new_globals->color_0 = GLOBALS->color_0;
1841 new_globals->color_mark = GLOBALS->color_mark;
1842 new_globals->color_mid = GLOBALS->color_mid;
1843 new_globals->color_time = GLOBALS->color_time;
1844 new_globals->color_timeb = GLOBALS->color_timeb;
1845 new_globals->color_trans = GLOBALS->color_trans;
1846 new_globals->color_umark = GLOBALS->color_umark;
1847 new_globals->color_value = GLOBALS->color_value;
1848 new_globals->color_vbox = GLOBALS->color_vbox;
1849 new_globals->color_vtrans = GLOBALS->color_vtrans;
1850 new_globals->color_x = GLOBALS->color_x;
1851 new_globals->color_xfill = GLOBALS->color_xfill;
1852 new_globals->color_u = GLOBALS->color_u;
1853 new_globals->color_ufill = GLOBALS->color_ufill;
1854 new_globals->color_w = GLOBALS->color_w;
1855 new_globals->color_wfill = GLOBALS->color_wfill;
1856 new_globals->color_dash = GLOBALS->color_dash;
1857 new_globals->color_dashfill = GLOBALS->color_dashfill;
1858 new_globals->color_white = GLOBALS->color_white;
1859 new_globals->color_black = GLOBALS->color_black;
1860 new_globals->color_ltgray = GLOBALS->color_ltgray;
1861 new_globals->color_normal = GLOBALS->color_normal;
1862 new_globals->color_mdgray = GLOBALS->color_mdgray;
1863 new_globals->color_dkgray = GLOBALS->color_dkgray;
1864 new_globals->color_dkblue = GLOBALS->color_dkblue;
1865 new_globals->color_brkred = GLOBALS->color_brkred;
1866 new_globals->color_ltblue = GLOBALS->color_ltblue;
1867 new_globals->color_gmstrd = GLOBALS->color_gmstrd;
1868
1869 new_globals->atomic_vectors = GLOBALS->atomic_vectors;
1870 new_globals->autoname_bundles = GLOBALS->autoname_bundles;
1871 new_globals->autocoalesce = GLOBALS->autocoalesce;
1872 new_globals->autocoalesce_reversal = GLOBALS->autocoalesce_reversal;
1873 new_globals->constant_marker_update = GLOBALS->constant_marker_update;
1874 new_globals->convert_to_reals = GLOBALS->convert_to_reals;
1875 new_globals->disable_mouseover = GLOBALS->disable_mouseover;
1876 new_globals->clipboard_mouseover = GLOBALS->clipboard_mouseover;
1877 new_globals->keep_xz_colors = GLOBALS->keep_xz_colors;
1878 new_globals->disable_tooltips = GLOBALS->disable_tooltips;
1879 new_globals->do_hier_compress = GLOBALS->do_hier_compress;
1880 new_globals->disable_auto_comphier = GLOBALS->disable_auto_comphier;
1881 new_globals->do_initial_zoom_fit = GLOBALS->do_initial_zoom_fit;
1882 new_globals->do_initial_zoom_fit_used = GLOBALS->do_initial_zoom_fit_used;
1883 new_globals->do_resize_signals = GLOBALS->do_resize_signals;
1884 new_globals->alt_wheel_mode = GLOBALS->alt_wheel_mode;
1885 new_globals->initial_signal_window_width = GLOBALS->initial_signal_window_width;
1886 new_globals->enable_fast_exit = GLOBALS->enable_fast_exit;
1887 new_globals->enable_ghost_marker = GLOBALS->enable_ghost_marker;
1888 new_globals->enable_horiz_grid = GLOBALS->enable_horiz_grid;
1889 new_globals->make_vcd_save_file = GLOBALS->make_vcd_save_file;
1890 new_globals->enable_vert_grid = GLOBALS->enable_vert_grid;
1891 new_globals->force_toolbars = GLOBALS->force_toolbars;
1892 new_globals->hide_sst = GLOBALS->hide_sst;
1893 new_globals->sst_expanded = GLOBALS->sst_expanded;
1894 new_globals->hier_grouping = GLOBALS->hier_grouping;
1895 new_globals->hier_max_level = GLOBALS->hier_max_level;
1896 new_globals->hier_max_level_shadow = GLOBALS->hier_max_level_shadow;
1897 new_globals->paned_pack_semantics = GLOBALS->paned_pack_semantics;
1898 new_globals->left_justify_sigs = GLOBALS->left_justify_sigs;
1899 new_globals->lxt_clock_compress_to_z = GLOBALS->lxt_clock_compress_to_z;
1900 new_globals->extload_max_tree = GLOBALS->extload_max_tree;
1901 new_globals->ps_maxveclen = GLOBALS->ps_maxveclen;
1902 new_globals->show_base = GLOBALS->show_base;
1903 new_globals->display_grid = GLOBALS->display_grid;
1904 new_globals->highlight_wavewindow = GLOBALS->highlight_wavewindow;
1905 new_globals->fill_waveform = GLOBALS->fill_waveform;
1906 new_globals->use_standard_trace_select = GLOBALS->use_standard_trace_select;
1907 new_globals->use_big_fonts = GLOBALS->use_big_fonts;
1908 new_globals->use_full_precision = GLOBALS->use_full_precision;
1909 new_globals->use_frequency_delta = GLOBALS->use_frequency_delta;
1910 new_globals->use_maxtime_display = GLOBALS->use_maxtime_display;
1911 new_globals->use_nonprop_fonts = GLOBALS->use_nonprop_fonts;
1912 new_globals->use_roundcaps = GLOBALS->use_roundcaps;
1913 new_globals->use_scrollbar_only = GLOBALS->use_scrollbar_only;
1914 new_globals->vcd_explicit_zero_subscripts = GLOBALS->vcd_explicit_zero_subscripts;
1915 new_globals->vcd_preserve_glitches = GLOBALS->vcd_preserve_glitches;
1916 new_globals->vcd_preserve_glitches_real = GLOBALS->vcd_preserve_glitches_real;
1917 new_globals->vcd_warning_filesize = GLOBALS->vcd_warning_filesize;
1918 new_globals->vector_padding = GLOBALS->vector_padding;
1919 new_globals->vlist_prepack = GLOBALS->vlist_prepack;
1920 new_globals->vlist_spill_to_disk = GLOBALS->vlist_spill_to_disk;
1921 new_globals->vlist_compression_depth = GLOBALS->vlist_compression_depth;
1922 new_globals->wave_scrolling = GLOBALS->wave_scrolling;
1923 new_globals->do_zoom_center = GLOBALS->do_zoom_center;
1924 new_globals->zoom_pow10_snap = GLOBALS->zoom_pow10_snap;
1925 new_globals->alt_hier_delimeter = GLOBALS->alt_hier_delimeter;
1926 new_globals->cursor_snap = GLOBALS->cursor_snap;
1927 new_globals->hier_delimeter = GLOBALS->hier_delimeter;
1928 new_globals->hier_was_explicitly_set = GLOBALS->hier_was_explicitly_set;
1929 new_globals->page_divisor = GLOBALS->page_divisor;
1930 new_globals->ps_maxveclen = GLOBALS->ps_maxveclen;
1931 new_globals->vector_padding = GLOBALS->vector_padding;
1932 new_globals->zoombase = GLOBALS->zoombase;
1933
1934 new_globals->disable_ae2_alias = GLOBALS->disable_ae2_alias;
1935 new_globals->hier_ignore_escapes = GLOBALS->hier_ignore_escapes;
1936
1937 new_globals->splash_disable = 1; /* to disable splash for reload */
1938 new_globals->strace_repeat_count = GLOBALS->strace_repeat_count; /* for edgebuttons and also strace */
1939
1940 new_globals->logfiles = GLOBALS->logfiles; /* this value is a ** chameleon! malloc'd region is outside debug.c control! */
1941 new_globals->sst_dbl_action_type = GLOBALS->sst_dbl_action_type;
1942 new_globals->save_on_exit = GLOBALS->save_on_exit;
1943
1944 strcpy2_into_new_context(new_globals, &new_globals->argvlist, &GLOBALS->argvlist);
1945 strcpy2_into_new_context(new_globals, &new_globals->editor_name, &GLOBALS->editor_name);
1946 strcpy2_into_new_context(new_globals, &new_globals->fontname_logfile, &GLOBALS->fontname_logfile);
1947 strcpy2_into_new_context(new_globals, &new_globals->fontname_signals, &GLOBALS->fontname_signals);
1948 strcpy2_into_new_context(new_globals, &new_globals->fontname_waves, &GLOBALS->fontname_waves);
1949 strcpy2_into_new_context(new_globals, &new_globals->cutcopylist, &GLOBALS->cutcopylist);
1950 strcpy2_into_new_context(new_globals, &new_globals->tcl_init_cmd, &GLOBALS->tcl_init_cmd);
1951 strcpy2_into_new_context(new_globals, &new_globals->repscript_name, &GLOBALS->repscript_name);
1952 new_globals->repscript_period = GLOBALS->repscript_period;
1953 #if GTK_CHECK_VERSION(2,4,0)
1954 strcpy2_into_new_context(new_globals, &new_globals->pFileChooseFilterName, &GLOBALS->pFileChooseFilterName);
1955 #endif
1956
1957 /* search.c */
1958 new_globals->regex_which_search_c_1 = GLOBALS->regex_which_search_c_1; /* preserve search type */
1959
1960 /* ttranslate.c */
1961 strcpy2_into_new_context(new_globals, &new_globals->ttranslate_args, &GLOBALS->ttranslate_args);
1962
1963 /* vlist.c */
1964 if(GLOBALS->vlist_handle)
1965 {
1966 vlist_kill_spillfile();
1967 new_globals->use_fastload = (GLOBALS->use_fastload != VCD_FSL_NONE) ? VCD_FSL_WRITE : VCD_FSL_NONE;
1968 }
1969
1970 /* lxt2.c / vzt.c / ae2.c */
1971 strcpy2_into_new_context(new_globals, &new_globals->skip_start, &GLOBALS->skip_start);
1972 strcpy2_into_new_context(new_globals, &new_globals->skip_end, &GLOBALS->skip_end);
1973
1974 /* main.c */
1975 new_globals->missing_file_toolbar = GLOBALS->missing_file_toolbar;
1976 new_globals->is_gtkw_save_file = GLOBALS->is_gtkw_save_file;
1977 new_globals->use_toolbutton_interface = GLOBALS->use_toolbutton_interface;
1978 new_globals->optimize_vcd = GLOBALS->optimize_vcd;
1979 strcpy2_into_new_context(new_globals, &new_globals->winname, &GLOBALS->winname); /* for page swapping */
1980
1981 /* menu.c */
1982 new_globals->wave_script_args = GLOBALS->wave_script_args;
1983 #ifndef WAVE_USE_MLIST_T
1984 new_globals->item_factory_menu_c_1 = GLOBALS->item_factory_menu_c_1;
1985 #endif
1986 strcpy2_into_new_context(new_globals, &new_globals->filesel_writesave, &GLOBALS->filesel_writesave);
1987 new_globals->save_success_menu_c_1 = GLOBALS->save_success_menu_c_1;
1988 new_globals->signal_popup_menu = GLOBALS->signal_popup_menu;
1989 new_globals->sst_signal_popup_menu = GLOBALS->sst_signal_popup_menu;
1990
1991 strcpy2_into_new_context(new_globals, &new_globals->filesel_vcd_writesave, &GLOBALS->filesel_vcd_writesave);
1992 strcpy2_into_new_context(new_globals, &new_globals->filesel_lxt_writesave, &GLOBALS->filesel_lxt_writesave);
1993 strcpy2_into_new_context(new_globals, &new_globals->filesel_tim_writesave, &GLOBALS->filesel_tim_writesave);
1994
1995 strcpy2_into_new_context(new_globals, &new_globals->stems_name, &GLOBALS->stems_name); /* remaining fileselbox() vars not handled elsewhere */
1996 strcpy2_into_new_context(new_globals, &new_globals->filesel_logfile_menu_c_1, &GLOBALS->filesel_logfile_menu_c_1);
1997 strcpy2_into_new_context(new_globals, &new_globals->filesel_scriptfile_menu, &GLOBALS->filesel_scriptfile_menu);
1998 strcpy2_into_new_context(new_globals, &new_globals->fcurr_ttranslate_c_1, &GLOBALS->fcurr_ttranslate_c_1);
1999 strcpy2_into_new_context(new_globals, &new_globals->fcurr_ptranslate_c_1, &GLOBALS->fcurr_ptranslate_c_1);
2000 strcpy2_into_new_context(new_globals, &new_globals->fcurr_translate_c_2, &GLOBALS->fcurr_translate_c_2);
2001
2002 strcpy2_into_new_context(new_globals, &new_globals->filesel_imagegrab, &GLOBALS->filesel_imagegrab);
2003
2004 /* renderopt.c */
2005 #ifdef WAVE_GTK_UNIX_PRINT
2006 new_globals->gprs = GLOBALS->gprs;
2007 new_globals->gps = GLOBALS->gps;
2008 #endif
2009
2010
2011 /* status.c */
2012 new_globals->text_status_c_2 = GLOBALS->text_status_c_2;
2013 #if defined(WAVE_USE_GTK2) && !defined(GTK_ENABLE_BROKEN)
2014 memcpy(&new_globals->iter_status_c_3, &GLOBALS->iter_status_c_3, sizeof(GtkTextIter));
2015 #endif
2016
2017 /* treesearch_gtk2.c */
2018 new_globals->do_dynamic_treefilter = GLOBALS->do_dynamic_treefilter;
2019 new_globals->treesearch_gtk2_window_vbox = GLOBALS->treesearch_gtk2_window_vbox;
2020 new_globals->window_treesearch_gtk2_c_12 = GLOBALS->window_treesearch_gtk2_c_12;
2021 new_globals->dnd_sigview = GLOBALS->dnd_sigview;
2022
2023 strcpy2_into_new_context(new_globals, &new_globals->filter_str_treesearch_gtk2_c_1, &GLOBALS->filter_str_treesearch_gtk2_c_1);
2024 strcpy2_into_new_context(new_globals, &new_globals->selected_hierarchy_name, &GLOBALS->selected_hierarchy_name);
2025 new_globals->filter_typ_treesearch_gtk2_c_1 = GLOBALS->filter_typ_treesearch_gtk2_c_1;
2026 new_globals->filter_matlen_treesearch_gtk2_c_1 = GLOBALS->filter_matlen_treesearch_gtk2_c_1;
2027 new_globals->filter_noregex_treesearch_gtk2_c_1 = GLOBALS->filter_noregex_treesearch_gtk2_c_1;
2028
2029 strcpy2_into_new_context(new_globals, &new_globals->sst_exclude_filename, &GLOBALS->sst_exclude_filename);
2030 if(GLOBALS->exclcompname)
2031 {
2032 jrb_free_tree(GLOBALS->exclcompname); /* strings get freed by automatic _2 mechanism */
2033 GLOBALS->exclcompname = NULL;
2034 }
2035 if(GLOBALS->exclinstname)
2036 {
2037 jrb_free_tree(GLOBALS->exclinstname); /* strings get freed by automatic _2 mechanism */
2038 GLOBALS->exclinstname = NULL;
2039 }
2040
2041 /* timeentry.c */
2042 new_globals->from_entry = GLOBALS->from_entry;
2043 new_globals->to_entry = GLOBALS->to_entry;
2044
2045 if(GLOBALS->tims.first != GLOBALS->min_time)
2046 {
2047 fix_from_time = 1;
2048 from_time = GLOBALS->tims.first;
2049 }
2050
2051 if(GLOBALS->tims.last != GLOBALS->max_time)
2052 {
2053 fix_to_time = 1;
2054 to_time = GLOBALS->tims.last;
2055 }
2056
2057 /* twinwave stuff */
2058 new_globals->dual_attach_id_main_c_1 = GLOBALS->dual_attach_id_main_c_1;
2059 new_globals->dual_id = GLOBALS->dual_id;
2060 #ifdef WAVE_USE_GTK2
2061 new_globals->socket_xid = GLOBALS->socket_xid;
2062 #endif
2063 new_globals->dual_ctx = GLOBALS->dual_ctx;
2064
2065 /* Times struct */
2066 memcpy(&(new_globals->tims), &(GLOBALS->tims), sizeof(Times));
2067
2068 /* File name and type */
2069 new_globals->loaded_file_type = GLOBALS->loaded_file_type;
2070
2071 strcpy2_into_new_context(new_globals, &new_globals->loaded_file_name, &GLOBALS->loaded_file_name);
2072
2073 if(new_globals->optimize_vcd) {
2074 strcpy2_into_new_context(new_globals, &new_globals->unoptimized_vcd_file_name, &GLOBALS->unoptimized_vcd_file_name);
2075 }
2076
2077
2078 /* fst.c, though might be others later */
2079 if(GLOBALS->subvar_jrb)
2080 {
2081 jrb_free_tree(GLOBALS->subvar_jrb);
2082 GLOBALS->subvar_jrb = NULL;
2083 GLOBALS->subvar_jrb_count = 0;
2084 }
2085
2086 if(GLOBALS->synclock_jrb)
2087 {
2088 jrb_free_tree(GLOBALS->synclock_jrb);
2089 GLOBALS->synclock_jrb = NULL;
2090 }
2091
2092 if(GLOBALS->enum_nptrs_jrb)
2093 {
2094 jrb_free_tree(GLOBALS->enum_nptrs_jrb);
2095 GLOBALS->enum_nptrs_jrb = NULL;
2096 }
2097
2098 #ifdef _WAVE_HAVE_JUDY
2099 if(GLOBALS->num_xl_enum_filter)
2100 {
2101 int ie;
2102 for(ie=0;ie<GLOBALS->num_xl_enum_filter;ie++)
2103 {
2104 JudyHSFreeArray(&GLOBALS->xl_enum_filter[ie], NULL);
2105 }
2106
2107 GLOBALS->num_xl_enum_filter = 0;
2108 }
2109 #endif
2110
2111 /* deallocate any loader-related stuff */
2112 switch(GLOBALS->loaded_file_type) {
2113 case LXT_FILE:
2114 if(GLOBALS->mm_lxt_mmap_addr)
2115 {
2116 munmap(GLOBALS->mm_lxt_mmap_addr, GLOBALS->mm_lxt_mmap_len);
2117 }
2118 break;
2119
2120 case LX2_FILE: lxt2_rd_close(GLOBALS->lx2_lx2_c_1); break;
2121 case VZT_FILE: vzt_rd_close(GLOBALS->vzt_vzt_c_1); break;
2122 case FST_FILE: fstReaderClose(GLOBALS->fst_fst_c_1); GLOBALS->fst_fst_c_1 = NULL; break;
2123 case AE2_FILE:
2124 #ifdef AET2_IS_PRESENT
2125 #ifdef AET2_ALIASDB_IS_PRESENT
2126 if(GLOBALS->adb) { adb_close_db(GLOBALS->adb); GLOBALS->adb = 0; }
2127 /* if(GLOBALS->m_alias_stream_file) { fclose(GLOBALS->m_alias_stream_file); GLOBALS->m_alias_stream_file = NULL; } */
2128 ae2_read_end(GLOBALS->ae2); fclose(GLOBALS->ae2_f);
2129 #endif
2130 #endif
2131 break;
2132
2133 #ifdef EXTLOAD_SUFFIX
2134 case EXTLOAD_FILE:
2135 if(GLOBALS->extload_ffr_ctx)
2136 {
2137 #ifdef WAVE_FSDB_READER_IS_PRESENT
2138 fsdbReaderClose(GLOBALS->extload_ffr_ctx);
2139 #endif
2140 GLOBALS->extload_ffr_ctx = NULL;
2141 }
2142 break;
2143 #endif
2144
2145 case MISSING_FILE:
2146 case DUMPLESS_FILE:
2147 case GHW_FILE:
2148 case VCD_FILE:
2149 case VCD_RECODER_FILE:
2150 default:
2151 /* do nothing */ break;
2152 }
2153
2154
2155 /* window destruction (of windows that aren't the parent window) */
2156
2157 #if !defined _MSC_VER
2158 kill_stems_browser(); /* for now, need to rework the stems browser dumpfile access routines to support this properly */
2159 new_globals->stems_type = GLOBALS->stems_type;
2160 strcpy2_into_new_context(new_globals, &new_globals->aet_name, &GLOBALS->aet_name);
2161 #endif
2162
2163 /* remaining windows which are completely destroyed and haven't migrated over */
2164 widget_only_destroy(&GLOBALS->window_ptranslate_c_5); /* ptranslate.c */
2165 WAVE_STRACE_ITERATOR(s_ctx_iter)
2166 {
2167 GLOBALS->strace_ctx = &GLOBALS->strace_windows[GLOBALS->strace_current_window = s_ctx_iter];
2168 widget_only_destroy(&GLOBALS->strace_ctx->window_strace_c_10); /* strace.c */
2169 }
2170 widget_only_destroy(&GLOBALS->window_translate_c_11); /* translate.c */
2171 widget_only_destroy(&GLOBALS->window_treesearch_gtk1_c); /* treesearch_gtk1.c */
2172 widget_only_destroy(&GLOBALS->window_help_c_2); /* help.c : reload is gated off during help so this should never execute */
2173
2174 /* windows which in theory should never destroy as they will have grab focus which means reload will not be called */
2175 widget_ungrab_destroy(&GLOBALS->window_entry_c_1); /* entry.c */
2176 widget_ungrab_destroy(&GLOBALS->window1_hiersearch_c_1); /* hiersearch.c */
2177 widget_ungrab_destroy(&GLOBALS->window_markerbox_c_4); /* markerbox.c */
2178 widget_ungrab_destroy(&GLOBALS->window1_search_c_2); /* search.c */
2179 widget_ungrab_destroy(&GLOBALS->window_showchange_c_8); /* showchange.c */
2180 widget_ungrab_destroy(&GLOBALS->window_simplereq_c_9); /* simplereq.c */
2181 widget_ungrab_destroy(&GLOBALS->window1_treesearch_gtk1_c); /* treesearch_gtk1.c */
2182 widget_ungrab_destroy(&GLOBALS->window1_treesearch_gtk2_c_3); /* treesearch_gtk2.c */
2183
2184 /* supported migration of window contexts... */
2185 if(GLOBALS->window_hiersearch_c_3)
2186 {
2187 struct treechain *tc = GLOBALS->treechain_hiersearch_c_1;
2188 while(tc)
2189 {
2190 char *tclname;
2191
2192 if(!hier_curr)
2193 {
2194 hier_head = hier_curr = calloc_2_into_context(new_globals,1,sizeof(struct stringchain_t));
2195 }
2196 else
2197 {
2198 hier_curr->next = calloc_2_into_context(new_globals,1,sizeof(struct stringchain_t));
2199 hier_curr = hier_curr->next;
2200 }
2201
2202 tclname = &tc->label->name[0];
2203 strcpy2_into_new_context(new_globals, &hier_curr->name, &tclname);
2204
2205 tc = tc->next;
2206 }
2207
2208 new_globals->window_hiersearch_c_3 = GLOBALS->window_hiersearch_c_3;
2209 new_globals->entry_main_hiersearch_c_1 = GLOBALS->entry_main_hiersearch_c_1;
2210 new_globals->clist_hiersearch_c_1 = GLOBALS->clist_hiersearch_c_1;
2211 new_globals->bundle_direction_hiersearch_c_1 = GLOBALS->bundle_direction_hiersearch_c_1;
2212 new_globals->cleanup_hiersearch_c_3 = GLOBALS->cleanup_hiersearch_c_3;
2213 new_globals->is_active_hiersearch_c_1 = GLOBALS->is_active_hiersearch_c_1;
2214 }
2215
2216 if(GLOBALS->mouseover_mouseover_c_1) /* mouseover regenerates as the pointer moves so no real context lost */
2217 {
2218 gtk_widget_destroy(GLOBALS->mouseover_mouseover_c_1); GLOBALS->mouseover_mouseover_c_1 = NULL;
2219 gdk_pixmap_unref(GLOBALS->mo_pixmap_mouseover_c_1); GLOBALS->mo_pixmap_mouseover_c_1 = NULL;
2220 }
2221
2222 if(GLOBALS->window_renderopt_c_6)
2223 {
2224 new_globals->is_active_renderopt_c_3 = GLOBALS->is_active_renderopt_c_3;
2225 new_globals->window_renderopt_c_6 = GLOBALS->window_renderopt_c_6;
2226
2227 memcpy(new_globals->target_mutex_renderopt_c_1, GLOBALS->target_mutex_renderopt_c_1, sizeof(GLOBALS->target_mutex_renderopt_c_1));
2228 memcpy(new_globals->page_mutex_renderopt_c_1, GLOBALS->page_mutex_renderopt_c_1, sizeof(GLOBALS->page_mutex_renderopt_c_1));
2229 memcpy(new_globals->render_mutex_renderopt_c_1, GLOBALS->render_mutex_renderopt_c_1, sizeof(GLOBALS->render_mutex_renderopt_c_1));
2230
2231 strcpy2_into_new_context(new_globals, &new_globals->filesel_print_pdf_renderopt_c_1, &GLOBALS->filesel_print_pdf_renderopt_c_1);
2232 strcpy2_into_new_context(new_globals, &new_globals->filesel_print_ps_renderopt_c_1, &GLOBALS->filesel_print_ps_renderopt_c_1);
2233 strcpy2_into_new_context(new_globals, &new_globals->filesel_print_mif_renderopt_c_1, &GLOBALS->filesel_print_mif_renderopt_c_1);
2234
2235 new_globals->page_size_type_renderopt_c_1 = GLOBALS->page_size_type_renderopt_c_1;
2236 }
2237
2238 if(GLOBALS->window_search_c_7)
2239 {
2240 int i;
2241
2242 new_globals->pdata = calloc_2_into_context(new_globals, 1, sizeof(SearchProgressData));
2243 memcpy(new_globals->pdata, GLOBALS->pdata, sizeof(SearchProgressData));
2244
2245 new_globals->is_active_search_c_4 = GLOBALS->is_active_search_c_4;
2246 new_globals->regex_which_search_c_1 = GLOBALS->regex_which_search_c_1;
2247 new_globals->window_search_c_7 = GLOBALS->window_search_c_7;
2248 new_globals->entry_search_c_3 = GLOBALS->entry_search_c_3;
2249 new_globals->clist_search_c_3 = GLOBALS->clist_search_c_3;
2250
2251 strcpy2_into_new_context(new_globals, &new_globals->searchbox_text_search_c_1, &GLOBALS->searchbox_text_search_c_1);
2252
2253 for(i=0;i<5;i++)
2254 {
2255 new_globals->menuitem_search[i] = GLOBALS->menuitem_search[i];
2256 new_globals->regex_mutex_search_c_1[i] = GLOBALS->regex_mutex_search_c_1[i];
2257 }
2258 }
2259
2260
2261 /* erase any old tabbed contexts if they exist... */
2262 dead_context_sweep();
2263
2264 /* let any destructors finalize on GLOBALS dereferences... (commented out for now) */
2265 /* gtkwave_main_iteration(); */
2266
2267 /* Free the old context */
2268 free_outstanding();
2269
2270 /* Free the old globals struct, memsetting it to zero in the hope of forcing crashes. */
2271 memset(GLOBALS, 0, sizeof(struct Global));
2272 free(GLOBALS);
2273 GLOBALS = NULL; /* valgrind fix */
2274
2275 /* Set the GLOBALS pointer to the newly allocated struct. */
2276 set_GLOBALS(new_globals);
2277 *(GLOBALS->gtk_context_bridge_ptr) = GLOBALS;
2278
2279 init_filetrans_data();
2280 init_proctrans_data();
2281 init_ttrans_data();
2282 /* load_all_fonts(); */
2283
2284 sst_exclusion_loader();
2285
2286 /* attempt to reload file and recover on loader errors until successful */
2287 for(;;)
2288 {
2289 set_window_busy(NULL);
2290
2291 /* Check to see if we need to reload a vcd file */
2292 #if !defined _MSC_VER && !defined __MINGW32__
2293 if(GLOBALS->optimize_vcd)
2294 {
2295 optimize_vcd_file();
2296 }
2297 #endif
2298 /* Load new file from disk, no reload on partial vcd or vcd from stdin. */
2299 switch(GLOBALS->loaded_file_type)
2300 {
2301 #ifdef EXTLOAD_SUFFIX
2302 case EXTLOAD_FILE:
2303 extload_main(GLOBALS->loaded_file_name, GLOBALS->skip_start, GLOBALS->skip_end);
2304 load_was_success = (GLOBALS->extload != NULL) && (!GLOBALS->extload_already_errored);
2305 GLOBALS->extload_already_errored = 0;
2306 GLOBALS->extload_lastmod = 0;
2307 break;
2308 #endif
2309
2310 case LX2_FILE:
2311 lx2_main(GLOBALS->loaded_file_name,GLOBALS->skip_start,GLOBALS->skip_end);
2312 load_was_success = (GLOBALS->lx2_lx2_c_1 != NULL);
2313 break;
2314
2315 case VZT_FILE:
2316 vzt_main(GLOBALS->loaded_file_name,GLOBALS->skip_start,GLOBALS->skip_end);
2317 load_was_success = (GLOBALS->vzt_vzt_c_1 != NULL);
2318 break;
2319
2320 case FST_FILE:
2321 fst_main(GLOBALS->loaded_file_name,GLOBALS->skip_start,GLOBALS->skip_end);
2322 load_was_success = (GLOBALS->fst_fst_c_1 != NULL);
2323 break;
2324
2325 case AE2_FILE:
2326 #ifdef AET2_IS_PRESENT
2327 ae2_main(GLOBALS->loaded_file_name,GLOBALS->skip_start,GLOBALS->skip_end);
2328 load_was_success = (GLOBALS->ae2 != NULL);
2329 #else
2330 load_was_success = 0; /* never executes as AE2_FILE won't be set */
2331 #endif
2332 break;
2333
2334 case GHW_FILE:
2335 load_was_success = (ghw_main(GLOBALS->loaded_file_name) != 0);
2336 break;
2337
2338 case LXT_FILE:
2339 case VCD_FILE:
2340 case VCD_RECODER_FILE:
2341 load_was_success = handle_setjmp();
2342 break;
2343 default:
2344 break;
2345 }
2346
2347 set_window_idle(NULL);
2348
2349 if(load_was_success)
2350 {
2351 break;
2352 }
2353 else
2354 {
2355 /* recovery sequence */
2356 printf("GTKWAVE | Reload failure, reattempt in %d second%s...\n", reload_fail_delay, (reload_fail_delay==1) ? "" : "s");
2357 fflush(stdout);
2358 sleep(reload_fail_delay);
2359 switch(reload_fail_delay)
2360 {
2361 case 1: reload_fail_delay = 2; break;
2362 case 2: reload_fail_delay = 5; break;
2363 case 5: reload_fail_delay = 10; break;
2364 case 10: reload_fail_delay = 30; break;
2365 case 30: reload_fail_delay = 60; break;
2366 default: break;
2367 }
2368 }
2369 }
2370
2371 /* deallocate the symbol hash table */
2372 sym_hash_destroy(GLOBALS);
2373
2374 /* Setup timings we probably need to redraw here */
2375 GLOBALS->tims.last=GLOBALS->max_time;
2376 GLOBALS->tims.first=GLOBALS->min_time;
2377
2378 if(fix_from_time)
2379 {
2380 if((from_time >= GLOBALS->min_time) && (from_time <= GLOBALS->max_time))
2381 {
2382 GLOBALS->tims.first = from_time;
2383 }
2384 }
2385
2386 if(fix_to_time)
2387 {
2388 if((to_time >= GLOBALS->min_time) && (to_time <= GLOBALS->max_time) && (to_time > GLOBALS->tims.first))
2389 {
2390 GLOBALS->tims.last = to_time;
2391 }
2392 }
2393
2394 if(GLOBALS->tims.start < GLOBALS->tims.first) { GLOBALS->tims.start = GLOBALS->tims.first; }
2395 if(GLOBALS->tims.end > GLOBALS->tims.last) { GLOBALS->tims.end = GLOBALS->tims.last; }
2396 if(GLOBALS->tims.marker < GLOBALS->tims.first) { GLOBALS->tims.marker = GLOBALS->tims.first; }
2397 if(GLOBALS->tims.marker > GLOBALS->tims.last) { GLOBALS->tims.marker = GLOBALS->tims.last; }
2398 if(GLOBALS->tims.prevmarker < GLOBALS->tims.first) { GLOBALS->tims.prevmarker = GLOBALS->tims.first; }
2399 if(GLOBALS->tims.prevmarker > GLOBALS->tims.last) { GLOBALS->tims.prevmarker = GLOBALS->tims.last; }
2400 if(GLOBALS->tims.laststart < GLOBALS->tims.first) { GLOBALS->tims.laststart = GLOBALS->tims.first; }
2401 if(GLOBALS->tims.laststart > GLOBALS->tims.last) { GLOBALS->tims.laststart = GLOBALS->tims.last; }
2402
2403 reformat_time(timestr, GLOBALS->tims.first + GLOBALS->global_time_offset, GLOBALS->time_dimension);
2404 gtk_entry_set_text(GTK_ENTRY(GLOBALS->from_entry),timestr);
2405 reformat_time(timestr, GLOBALS->tims.last + GLOBALS->global_time_offset, GLOBALS->time_dimension);
2406 gtk_entry_set_text(GTK_ENTRY(GLOBALS->to_entry),timestr);
2407
2408
2409 /* Change SST - if it exists */
2410 /* XXX need to destroy/free the old tree widgets. */
2411 #if GTK_CHECK_VERSION(2,4,0)
2412 if(!GLOBALS->hide_sst) {
2413 gint pane_pos = gtk_paned_get_position(GLOBALS->sst_vpaned);
2414 gtk_widget_hide(GLOBALS->expanderwindow);
2415 gtk_container_remove(GTK_CONTAINER(GLOBALS->expanderwindow), GLOBALS->sstpane);
2416 GLOBALS->sstpane = treeboxframe("SST", GTK_SIGNAL_FUNC(mkmenu_treesearch_cleanup));
2417 gtk_container_add(GTK_CONTAINER(GLOBALS->expanderwindow), GLOBALS->sstpane);
2418 gtk_paned_set_position(GLOBALS->sst_vpaned, pane_pos);
2419 gtk_widget_show(GLOBALS->expanderwindow);
2420 if(GLOBALS->dnd_sigview)
2421 {
2422 dnd_setup(GLOBALS->dnd_sigview, GLOBALS->signalarea, 0);
2423 }
2424
2425 if(GLOBALS->clist_search_c_3)
2426 {
2427 dnd_setup(GLOBALS->clist_search_c_3, GLOBALS->signalarea, 0);
2428 }
2429 }
2430 #endif
2431 #if WAVE_USE_GTK2
2432 if(GLOBALS->window_treesearch_gtk2_c_12)
2433 {
2434 gtk_container_remove(GTK_CONTAINER(GLOBALS->window_treesearch_gtk2_c_12), GLOBALS->treesearch_gtk2_window_vbox);
2435 treebox(NULL, GTK_SIGNAL_FUNC(mkmenu_treesearch_cleanup), GLOBALS->window_treesearch_gtk2_c_12);
2436 }
2437
2438 if((GLOBALS->filter_str_treesearch_gtk2_c_1) && (GLOBALS->filter_entry))
2439 {
2440 gtk_entry_set_text(GTK_ENTRY(GLOBALS->filter_entry), GLOBALS->filter_str_treesearch_gtk2_c_1);
2441 wave_regex_compile(GLOBALS->filter_str_treesearch_gtk2_c_1 + GLOBALS->filter_matlen_treesearch_gtk2_c_1, WAVE_REGEX_TREE);
2442 }
2443 #endif
2444
2445 /* Reload state from file */
2446 {
2447 char is_gtkw_save_file_cached = GLOBALS->is_gtkw_save_file;
2448 read_save_helper(reload_tmpfilename, NULL, NULL, NULL, NULL, NULL);
2449 GLOBALS->is_gtkw_save_file = is_gtkw_save_file_cached;
2450 }
2451
2452 /* again doing this here (read_save_helper does it) seems to be necessary in order to keep display in sync */
2453 GLOBALS->signalwindow_width_dirty=1;
2454 MaxSignalLength();
2455 signalarea_configure_event(GLOBALS->signalarea, NULL);
2456 wavearea_configure_event(GLOBALS->wavearea, NULL);
2457
2458 /* unlink temp */
2459 unlink(reload_tmpfilename);
2460 free(reload_tmpfilename); /* intentional use of free(), of strdup'd string from earlier */
2461
2462 /* part 2 of SST (which needs to be done after the tree is expanded from loading the savefile...) */
2463 #if WAVE_USE_GTK2
2464 if((!GLOBALS->hide_sst)||(GLOBALS->window_treesearch_gtk2_c_12)) {
2465 GtkCList *cl = GTK_CLIST(GLOBALS->ctree_main);
2466 char *hiername_cache = NULL; /* some strange race condition side effect in gtk selecting/deselecting blows this out so cache it */
2467
2468 if(GLOBALS->selected_hierarchy_name)
2469 {
2470 hiername_cache = strdup_2(GLOBALS->selected_hierarchy_name);
2471 select_tree_node(GLOBALS->selected_hierarchy_name);
2472 }
2473
2474 if(tree_vadj_value != 0.0)
2475 {
2476 GtkAdjustment *vadj = gtk_clist_get_vadjustment(cl);
2477
2478 if((vadj) && (tree_vadj_value >= vadj->lower) && (tree_vadj_value <= vadj->upper))
2479 {
2480 vadj->value = tree_vadj_value;
2481 gtk_clist_set_vadjustment(cl, vadj);
2482
2483 gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(vadj)), "changed");
2484 gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(vadj)), "value_changed");
2485 }
2486 }
2487
2488 if(tree_hadj_value != 0.0)
2489 {
2490 GtkAdjustment *hadj = gtk_clist_get_hadjustment(cl);
2491
2492 if((hadj) && (tree_hadj_value >= hadj->lower) && (tree_hadj_value <= hadj->upper))
2493 {
2494 hadj->value = tree_hadj_value;
2495 gtk_clist_set_hadjustment(cl, hadj);
2496
2497 gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(hadj)), "changed");
2498 gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(hadj)), "value_changed");
2499 }
2500 }
2501
2502 if(hiername_cache)
2503 {
2504 if(GLOBALS->selected_hierarchy_name)
2505 {
2506 free_2(GLOBALS->selected_hierarchy_name);
2507 }
2508 GLOBALS->selected_hierarchy_name = hiername_cache;
2509 }
2510
2511
2512 if(tree_frame_y != -1)
2513 {
2514 /* this doesn't work...this sets the *minimum* size */
2515 /* gtk_widget_set_size_request(GLOBALS->gtk2_tree_frame, -1, tree_frame_y); */
2516 }
2517
2518 if(GLOBALS->filter_entry) { gtk_signal_emit_by_name (GTK_OBJECT (GLOBALS->filter_entry), "activate"); }
2519 }
2520 #endif
2521
2522 /* part 2 of search (which needs to be done after the new dumpfile is loaded) */
2523 if(GLOBALS->window_search_c_7)
2524 {
2525 search_enter_callback(GLOBALS->entry_search_c_3, NULL);
2526 }
2527
2528 /* part 2 of hier search (which needs to be done after the new dumpfile is loaded) */
2529 if(GLOBALS->window_hiersearch_c_3)
2530 {
2531 if(!hier_curr)
2532 {
2533 GLOBALS->current_tree_hiersearch_c_1=GLOBALS->treeroot;
2534 GLOBALS->h_selectedtree_hiersearch_c_1=NULL;
2535 }
2536 else
2537 {
2538 struct tree *t = GLOBALS->treeroot;
2539 hier_curr = hier_head;
2540
2541 while((hier_curr)&&(t))
2542 {
2543 if(!strcmp(hier_curr->name, t->name))
2544 {
2545 if(t->child)
2546 {
2547 struct treechain *tc, *tc2;
2548
2549 tc=GLOBALS->treechain_hiersearch_c_1;
2550 if(tc)
2551 {
2552 while(tc->next) tc=tc->next;
2553
2554 tc2=calloc_2(1,sizeof(struct treechain));
2555 tc2->label=t;
2556 tc2->tree=GLOBALS->current_tree_hiersearch_c_1;
2557 tc->next=tc2;
2558 }
2559 else
2560 {
2561 GLOBALS->treechain_hiersearch_c_1=calloc_2(1,sizeof(struct treechain));
2562 GLOBALS->treechain_hiersearch_c_1->tree=GLOBALS->current_tree_hiersearch_c_1;
2563 GLOBALS->treechain_hiersearch_c_1->label=t;
2564 }
2565
2566 GLOBALS->current_tree_hiersearch_c_1=t->child;
2567 }
2568
2569 t = t->child;
2570 hier_curr = hier_curr->next;
2571 continue;
2572 }
2573 t = t->next;
2574 }
2575
2576 hier_curr = hier_head;
2577
2578 while(hier_head)
2579 {
2580 hier_head = hier_curr->next;
2581 free_2(hier_curr->name);
2582 free_2(hier_curr);
2583 hier_curr = hier_head;
2584 }
2585 }
2586
2587 refresh_hier_tree(GLOBALS->current_tree_hiersearch_c_1);
2588 }
2589
2590 /* restore these in case we decide to write out the rc file later as a user option */
2591 GLOBALS->ignore_savefile_pane_pos = cached_ignore_savefile_pane_pos;
2592 GLOBALS->ignore_savefile_pos = cached_ignore_savefile_pos;
2593 GLOBALS->ignore_savefile_size = cached_ignore_savefile_size;
2594 GLOBALS->splash_disable = cached_splash_disable;
2595
2596 printf("GTKWAVE | ...waveform reloaded\n");
2597 gtkwavetcl_setvar(WAVE_TCLCB_RELOAD_END, GLOBALS->loaded_file_name, WAVE_TCLCB_RELOAD_END_FLAGS);
2598
2599 /* update lower signal set in SST to correct position */
2600 #if WAVE_USE_GTK2
2601 if((GLOBALS->dnd_sigview) && ((treeview_vadj_value != 0.0) || (treeview_hadj_value != 0.0)))
2602 {
2603 struct Global *G2 = GLOBALS;
2604 gtk_events_pending_gtk_main_iteration();
2605
2606 if((G2 == GLOBALS)&&(GLOBALS->dnd_sigview))
2607 {
2608 if(treeview_vadj_value != 0.0)
2609 {
2610 GtkAdjustment *vadj = gtk_tree_view_get_vadjustment((GtkTreeView *)GLOBALS->dnd_sigview);
2611
2612 if((vadj) && (treeview_vadj_value >= vadj->lower) && (treeview_vadj_value <= vadj->upper))
2613 {
2614 vadj->value = treeview_vadj_value;
2615 gtk_tree_view_set_vadjustment((GtkTreeView *)GLOBALS->dnd_sigview, vadj);
2616
2617 gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(vadj)), "changed");
2618 gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(vadj)), "value_changed");
2619 }
2620 }
2621
2622 if(treeview_hadj_value != 0.0)
2623 {
2624 GtkAdjustment *hadj = gtk_tree_view_get_hadjustment((GtkTreeView *)GLOBALS->dnd_sigview);
2625
2626 if((hadj) && (treeview_hadj_value >= hadj->lower) && (treeview_hadj_value <= hadj->upper))
2627 {
2628 hadj->value = treeview_hadj_value;
2629 gtk_tree_view_set_hadjustment((GtkTreeView *)GLOBALS->dnd_sigview, hadj);
2630
2631 gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(hadj)), "changed");
2632 gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(hadj)), "value_changed");
2633 }
2634 }
2635 }
2636 }
2637 #endif
2638 }
2639
2640
reload_into_new_context(void)2641 void reload_into_new_context(void)
2642 {
2643 static int reloading = 0;
2644
2645 if(!reloading)
2646 {
2647 #ifdef MAC_INTEGRATION
2648 osx_menu_sensitivity(FALSE);
2649 #endif
2650 reload_into_new_context_2();
2651 reloading = 0;
2652 #ifdef MAC_INTEGRATION
2653 if(GLOBALS->loaded_file_type != MISSING_FILE)
2654 {
2655 osx_menu_sensitivity(TRUE);
2656 }
2657 #endif
2658 }
2659 }
2660
2661
2662 /*
2663 * for notebook page closing
2664 */
free_and_destroy_page_context(void)2665 void free_and_destroy_page_context(void)
2666 {
2667 int s_ctx_iter;
2668
2669 /* deallocate any loader-related stuff */
2670 switch(GLOBALS->loaded_file_type) {
2671 case LXT_FILE:
2672 if(GLOBALS->mm_lxt_mmap_addr)
2673 {
2674 munmap(GLOBALS->mm_lxt_mmap_addr, GLOBALS->mm_lxt_mmap_len);
2675 }
2676 break;
2677
2678 case LX2_FILE: lxt2_rd_close(GLOBALS->lx2_lx2_c_1); break;
2679 case VZT_FILE: vzt_rd_close(GLOBALS->vzt_vzt_c_1); break;
2680 case FST_FILE: fstReaderClose(GLOBALS->fst_fst_c_1); GLOBALS->fst_fst_c_1 = NULL; break;
2681 case AE2_FILE:
2682 #ifdef AET2_IS_PRESENT
2683 #ifdef AET2_ALIASDB_IS_PRESENT
2684 if(GLOBALS->adb) { adb_close_db(GLOBALS->adb); GLOBALS->adb = 0; }
2685 /* if(GLOBALS->adb_alias_stream_file) { fclose(GLOBALS->adb_alias_stream_file); GLOBALS->adb_alias_stream_file = NULL; } */
2686 ae2_read_end(GLOBALS->ae2); fclose(GLOBALS->ae2_f);
2687 #endif
2688 #endif
2689 break;
2690
2691 #ifdef EXTLOAD_SUFFIX
2692 case EXTLOAD_FILE:
2693 if(GLOBALS->extload_ffr_ctx)
2694 {
2695 #ifdef WAVE_FSDB_READER_IS_PRESENT
2696 fsdbReaderClose(GLOBALS->extload_ffr_ctx);
2697 #endif
2698 GLOBALS->extload_ffr_ctx = NULL;
2699 }
2700 break;
2701 #endif
2702
2703 case MISSING_FILE:
2704 case DUMPLESS_FILE:
2705 case GHW_FILE:
2706 case VCD_FILE:
2707 case VCD_RECODER_FILE:
2708 default:
2709 /* do nothing */ break;
2710 }
2711
2712 /* window destruction (of windows that aren't the parent window) */
2713
2714 widget_only_destroy(&GLOBALS->window_ptranslate_c_5); /* ptranslate.c */
2715
2716 WAVE_STRACE_ITERATOR(s_ctx_iter)
2717 {
2718 GLOBALS->strace_ctx = &GLOBALS->strace_windows[GLOBALS->strace_current_window = s_ctx_iter];
2719 widget_only_destroy(&GLOBALS->strace_ctx->window_strace_c_10); /* strace.c */
2720 }
2721 widget_only_destroy(&GLOBALS->window_translate_c_11); /* translate.c */
2722 widget_only_destroy(&GLOBALS->window_treesearch_gtk1_c); /* treesearch_gtk1.c */
2723 widget_only_destroy(&GLOBALS->window_treesearch_gtk2_c_12); /* treesearch_gtk2.c */
2724 widget_only_destroy(&GLOBALS->window_help_c_2); /* help.c : reload is gated off during help so this should never execute */
2725
2726 /* windows which in theory should never destroy as they will have grab focus which means reload will not be called */
2727 widget_ungrab_destroy(&GLOBALS->window_entry_c_1); /* entry.c */
2728 widget_ungrab_destroy(&GLOBALS->window1_hiersearch_c_1); /* hiersearch.c */
2729 widget_ungrab_destroy(&GLOBALS->window_markerbox_c_4); /* markerbox.c */
2730 widget_ungrab_destroy(&GLOBALS->window1_search_c_2); /* search.c */
2731 widget_ungrab_destroy(&GLOBALS->window_showchange_c_8); /* showchange.c */
2732 widget_ungrab_destroy(&GLOBALS->window_simplereq_c_9); /* simplereq.c */
2733 widget_ungrab_destroy(&GLOBALS->window1_treesearch_gtk1_c); /* treesearch_gtk1.c */
2734 widget_ungrab_destroy(&GLOBALS->window1_treesearch_gtk2_c_3); /* treesearch_gtk2.c */
2735
2736 /* supported migration of window contexts... */
2737 widget_only_destroy(&GLOBALS->window_hiersearch_c_3);
2738
2739 if(GLOBALS->mouseover_mouseover_c_1) /* mouseover regenerates as the pointer moves so no real context lost */
2740 {
2741 gtk_widget_destroy(GLOBALS->mouseover_mouseover_c_1); GLOBALS->mouseover_mouseover_c_1 = NULL;
2742 gdk_pixmap_unref(GLOBALS->mo_pixmap_mouseover_c_1); GLOBALS->mo_pixmap_mouseover_c_1 = NULL;
2743 }
2744
2745 widget_only_destroy(&GLOBALS->window_renderopt_c_6);
2746 widget_only_destroy(&GLOBALS->window_search_c_7);
2747
2748 (*GLOBALS->dead_context)[0] = GLOBALS;
2749
2750 /* let any destructors finalize on GLOBALS dereferences... */
2751 gtkwave_main_iteration();
2752 }
2753
2754
2755 /*
2756 * part 2 of free_and_destroy_page_context() as some context data seems to be used later by
2757 * gtk (i.e., the destroys might be deferred slightly causing corruption)
2758 */
dead_context_sweep(void)2759 void dead_context_sweep(void)
2760 {
2761 struct Global *gp = (*GLOBALS->dead_context)[0];
2762 struct Global *g_curr;
2763
2764 if(gp)
2765 {
2766 g_curr = GLOBALS;
2767
2768 set_GLOBALS(gp);
2769 (*GLOBALS->dead_context)[0] = NULL;
2770
2771 /* remove the bridge pointer */
2772 if(GLOBALS->gtk_context_bridge_ptr) { free(GLOBALS->gtk_context_bridge_ptr); GLOBALS->gtk_context_bridge_ptr = NULL; }
2773
2774 /* Free all gcs */
2775 dealloc_all_gcs();
2776
2777 /* Free the context */
2778 free_outstanding();
2779
2780 /* Free the old globals struct, memsetting it to zero in the hope of forcing crashes. */
2781 memset(GLOBALS, 0, sizeof(struct Global));
2782 free(GLOBALS);
2783 GLOBALS = NULL; /* valgrind fix */
2784
2785 set_GLOBALS(g_curr);
2786 }
2787 }
2788
2789
2790
2791 /*
2792 * focus directed context switching of GLOBALS in multiple tabs mode
2793 */
context_swapper(GtkWindow * w,GdkEvent * event,void * data)2794 static gint context_swapper(GtkWindow *w, GdkEvent *event, void *data)
2795 {
2796 GdkEventType type;
2797
2798 if(ignore_context_swap()) /* block context swap if explicitly directed (e.g., during loading) */
2799 {
2800 return(FALSE);
2801 }
2802
2803 type = event->type;
2804
2805 /* printf("Window: %08x GtkEvent: %08x gpointer: %08x, type: %d\n", w, event, data, type); */
2806
2807 switch(type)
2808 {
2809 case GDK_ENTER_NOTIFY:
2810 case GDK_FOCUS_CHANGE:
2811 if(GLOBALS->num_notebook_pages >= 2)
2812 {
2813 unsigned int i;
2814 void **vp;
2815 GtkWindow *wcmp;
2816
2817 for(i=0;i<GLOBALS->num_notebook_pages;i++)
2818 {
2819 struct Global *test_g = (*GLOBALS->contexts)[i];
2820
2821 vp = (void **)(((char *)test_g) + (intptr_t)data);
2822 wcmp = (GtkWindow *)(*vp);
2823
2824 if(wcmp != NULL)
2825 {
2826 if(wcmp == w)
2827 {
2828 if(i!=GLOBALS->this_context_page)
2829 {
2830 struct Global *g_old = GLOBALS;
2831
2832 /* printf("Switching to: %d %08x\n", i, GTK_WINDOW(wcmp)); */
2833
2834 set_GLOBALS((*GLOBALS->contexts)[i]);
2835
2836 GLOBALS->lxt_clock_compress_to_z = g_old->lxt_clock_compress_to_z;
2837 GLOBALS->autoname_bundles = g_old->autoname_bundles;
2838 GLOBALS->autocoalesce_reversal = g_old->autocoalesce_reversal;
2839 GLOBALS->autocoalesce = g_old->autocoalesce;
2840 GLOBALS->hier_grouping = g_old->hier_grouping;
2841 GLOBALS->wave_scrolling = g_old->wave_scrolling;
2842 GLOBALS->constant_marker_update = g_old->constant_marker_update;
2843 GLOBALS->do_zoom_center = g_old->do_zoom_center;
2844 GLOBALS->use_roundcaps = g_old->use_roundcaps;
2845 GLOBALS->do_resize_signals = g_old->do_resize_signals;
2846 GLOBALS->alt_wheel_mode = g_old->alt_wheel_mode;
2847 GLOBALS->initial_signal_window_width = g_old->initial_signal_window_width;
2848 GLOBALS->use_full_precision = g_old->use_full_precision;
2849 GLOBALS->show_base = g_old->show_base;
2850 GLOBALS->display_grid = g_old->display_grid;
2851 GLOBALS->highlight_wavewindow = g_old->highlight_wavewindow;
2852 GLOBALS->fill_waveform = g_old->fill_waveform;
2853 GLOBALS->use_standard_trace_select = g_old->use_standard_trace_select;
2854 GLOBALS->disable_mouseover = g_old->disable_mouseover;
2855 GLOBALS->clipboard_mouseover = g_old->clipboard_mouseover;
2856 GLOBALS->keep_xz_colors = g_old->keep_xz_colors;
2857 GLOBALS->zoom_pow10_snap = g_old->zoom_pow10_snap;
2858
2859 GLOBALS->scale_to_time_dimension = g_old->scale_to_time_dimension;
2860 GLOBALS->zoom_dyn = g_old->zoom_dyn;
2861 GLOBALS->zoom_dyne = g_old->zoom_dyne;
2862
2863 GLOBALS->ignore_savefile_pane_pos = g_old->ignore_savefile_pane_pos;
2864 GLOBALS->ignore_savefile_pos = g_old->ignore_savefile_pos;
2865 GLOBALS->ignore_savefile_size = g_old->ignore_savefile_size;
2866
2867 GLOBALS->hier_ignore_escapes = g_old->hier_ignore_escapes;
2868 GLOBALS->sst_dbl_action_type = g_old->sst_dbl_action_type;
2869 GLOBALS->save_on_exit = g_old->save_on_exit;
2870
2871 gtk_notebook_set_current_page(GTK_NOTEBOOK(GLOBALS->notebook), GLOBALS->this_context_page);
2872 }
2873
2874 return(FALSE);
2875 }
2876 }
2877 }
2878 }
2879 break;
2880
2881 default:
2882 break;
2883 }
2884
2885 return(FALSE);
2886 }
2887
install_focus_cb(GtkWidget * w,intptr_t ptr_offset)2888 void install_focus_cb(GtkWidget *w, intptr_t ptr_offset)
2889 {
2890 gtk_signal_connect (GTK_OBJECT(w), "enter_notify_event", GTK_SIGNAL_FUNC(context_swapper), (void *)ptr_offset);
2891 gtk_signal_connect (GTK_OBJECT(w), "focus_in_event", GTK_SIGNAL_FUNC(context_swapper), (void *)ptr_offset);
2892 }
2893
2894
2895 /*
2896 * wrapped gtk_signal_connect/gtk_signal_connect_object functions for context watchdog monitoring...
2897 * note that this false triggers on configure_event as gtk sends events to multiple tabs and not
2898 * just the visible one!
2899 */
ctx_swap_watchdog(struct Global ** w)2900 static gint ctx_swap_watchdog(struct Global **w)
2901 {
2902 struct Global *watch = *w;
2903
2904 if(GLOBALS->gtk_context_bridge_ptr != w)
2905 {
2906 #ifdef GTKWAVE_SIGNAL_CONNECT_DEBUG
2907 fprintf(stderr, "GTKWAVE | WARNING: globals change caught by ctx_swap_watchdog()! %p vs %p, session %d vs %d\n",
2908 (void *)GLOBALS->gtk_context_bridge_ptr,(void *)w, (*GLOBALS->gtk_context_bridge_ptr)->this_context_page, watch->this_context_page);
2909 #endif
2910
2911 set_GLOBALS(watch);
2912 }
2913
2914 return(0);
2915 }
2916
ctx_prints(char * s)2917 static gint ctx_prints(char *s)
2918 {
2919 printf(">>> %s\n", s);
2920 return(0);
2921 }
ctx_printd(int d)2922 static gint ctx_printd(int d)
2923 {
2924 printf(">>>\t%d\n", d);
2925 return(0);
2926 }
2927
gtkwave_signal_connect_x(GtkObject * object,const gchar * name,GtkSignalFunc func,gpointer data,char * f,intptr_t line)2928 gulong gtkwave_signal_connect_x(GtkObject *object, const gchar *name, GtkSignalFunc func, gpointer data, char *f, intptr_t line)
2929 {
2930 gulong rc;
2931
2932 if(f)
2933 {
2934 gtk_signal_connect_object(object, name, (GtkSignalFunc)ctx_prints, (GtkObject *)f);
2935 gtk_signal_connect_object(object, name, (GtkSignalFunc)ctx_printd, (GtkObject *)line);
2936 }
2937
2938 gtk_signal_connect_object(object, name, (GtkSignalFunc)ctx_swap_watchdog, (GtkObject *)GLOBALS->gtk_context_bridge_ptr);
2939 rc = gtk_signal_connect(object, name, func, data);
2940
2941 return(rc);
2942 }
2943
2944
gtkwave_signal_connect_object_x(GtkObject * object,const gchar * name,GtkSignalFunc func,gpointer data,char * f,intptr_t line)2945 gulong gtkwave_signal_connect_object_x(GtkObject *object, const gchar *name, GtkSignalFunc func, gpointer data, char *f, intptr_t line)
2946 {
2947 gulong rc;
2948
2949 if(f)
2950 {
2951 gtk_signal_connect_object(object, name, (GtkSignalFunc)ctx_prints, (GtkObject *)f);
2952 gtk_signal_connect_object(object, name, (GtkSignalFunc)ctx_printd, (GtkObject *)line);
2953 }
2954
2955 gtk_signal_connect_object(object, name, (GtkSignalFunc)ctx_swap_watchdog, (GtkObject *)GLOBALS->gtk_context_bridge_ptr);
2956 rc = gtk_signal_connect_object(object, name, func, data);
2957
2958 return(rc);
2959 }
2960
2961
set_GLOBALS_x(struct Global * g,const char * file,int line)2962 void set_GLOBALS_x(struct Global *g, const char *file, int line)
2963 {
2964 char sstr[32];
2965
2966 if(line)
2967 {
2968 printf("Globals old %p -> new %p (%s: %d)\n", (void *)GLOBALS, (void *)g, file, line);
2969 }
2970
2971 if(GLOBALS != g)
2972 {
2973 /* fix problem where ungrab doesn't occur if button pressed + simultaneous context swap occurs */
2974 if(GLOBALS && GLOBALS->in_button_press_wavewindow_c_1) { gdk_pointer_ungrab(GDK_CURRENT_TIME); }
2975
2976 GLOBALS = g;
2977 sprintf(sstr, "%d", GLOBALS->this_context_page);
2978 gtkwavetcl_setvar(WAVE_TCLCB_CURRENT_ACTIVE_TAB, sstr, WAVE_TCLCB_CURRENT_ACTIVE_TAB_FLAGS);
2979 }
2980 }
2981
2982
2983 /*
2984 * for ensuring continuity of pixmap/mask pointers
2985 */
clone_icon_pointers_across_contexts(struct Global * a,struct Global * b)2986 void clone_icon_pointers_across_contexts(struct Global *a, struct Global *b)
2987 {
2988 if(!a || !b) return;
2989
2990 a->hiericon_module_pixmap = b->hiericon_module_pixmap;
2991 a->hiericon_module_mask = b->hiericon_module_mask;
2992 a->hiericon_task_pixmap = b->hiericon_task_pixmap;
2993 a->hiericon_task_mask = b->hiericon_task_mask;
2994 a->hiericon_function_pixmap = b->hiericon_function_pixmap;
2995 a->hiericon_function_mask = b->hiericon_function_mask;
2996 a->hiericon_begin_pixmap = b->hiericon_begin_pixmap;
2997 a->hiericon_begin_mask = b->hiericon_begin_mask;
2998 a->hiericon_fork_pixmap = b->hiericon_fork_pixmap;
2999 a->hiericon_fork_mask = b->hiericon_fork_mask;
3000 a->hiericon_interface_pixmap = b->hiericon_interface_pixmap;
3001 a->hiericon_interface_mask = b->hiericon_interface_mask;
3002 a->hiericon_svpackage_pixmap = b->hiericon_svpackage_pixmap;
3003 a->hiericon_svpackage_mask = b->hiericon_svpackage_mask;
3004 a->hiericon_program_pixmap = b->hiericon_program_pixmap;
3005 a->hiericon_program_mask = b->hiericon_program_mask;
3006 a->hiericon_class_pixmap = b->hiericon_class_pixmap;
3007 a->hiericon_class_mask = b->hiericon_class_mask;
3008 a->hiericon_record_pixmap = b->hiericon_record_pixmap;
3009 a->hiericon_record_mask = b->hiericon_record_mask;
3010 a->hiericon_generate_pixmap = b->hiericon_generate_pixmap;
3011 a->hiericon_generate_mask = b->hiericon_generate_mask;
3012 a->hiericon_design_pixmap = b->hiericon_design_pixmap;
3013 a->hiericon_design_mask = b->hiericon_design_mask;
3014 a->hiericon_block_pixmap = b->hiericon_block_pixmap;
3015 a->hiericon_block_mask = b->hiericon_block_mask;
3016 a->hiericon_generateif_pixmap = b->hiericon_generateif_pixmap;
3017 a->hiericon_generateif_mask = b->hiericon_generateif_mask;
3018 a->hiericon_generatefor_pixmap = b->hiericon_generatefor_pixmap;
3019 a->hiericon_generatefor_mask = b->hiericon_generatefor_mask;
3020 a->hiericon_instance_pixmap = b->hiericon_instance_pixmap;
3021 a->hiericon_instance_mask = b->hiericon_instance_mask;
3022 a->hiericon_package_pixmap = b->hiericon_package_pixmap;
3023 a->hiericon_package_mask = b->hiericon_package_mask;
3024
3025 a->hiericon_signal_pixmap = b->hiericon_signal_pixmap;
3026 a->hiericon_signal_mask = b->hiericon_signal_mask;
3027 a->hiericon_portin_pixmap = b->hiericon_portin_pixmap;
3028 a->hiericon_portin_mask = b->hiericon_portin_mask;
3029 a->hiericon_portout_pixmap = b->hiericon_portout_pixmap;
3030 a->hiericon_portout_mask = b->hiericon_portout_mask;
3031 a->hiericon_portinout_pixmap = b->hiericon_portinout_pixmap;
3032 a->hiericon_portinout_mask = b->hiericon_portinout_mask;
3033 a->hiericon_buffer_pixmap = b->hiericon_buffer_pixmap;
3034 a->hiericon_buffer_mask = b->hiericon_buffer_mask;
3035 a->hiericon_linkage_pixmap = b->hiericon_linkage_pixmap;
3036 a->hiericon_linkage_mask = b->hiericon_linkage_mask;
3037 }
3038
3039