Imported Upstream version 3.3.101
أحمد المحمودي (Ahmed El-Mahmoudy)
4 years ago
1700 | 1700 | Ensure Show-Change regenerates analog traces. |
1701 | 1701 | Added braces inside Tcl source command to allow spaces in |
1702 | 1702 | filenames for Tcl scripts. |
1703 | 3.3.101 08may19 Added gtkwave::getFacDir, gtkwave::getFacVtype, and | |
1704 | gtkwave::getFacDtype Tcl accessor functions that function | |
1705 | similar to gtkwave::getFacName. | |
1706 | Pair $end with $dumpvars in VCD writers. | |
1707 | Make %.16g printing in baseconvert.c more resistant to power | |
1708 | of 10 roundoff errors. | |
1709 | Remove register keyword where applicable as is deprecated. | |
1710 | Added --saveonexit gtkwave command line option. |
0 | 0 | ########################################################################## |
1 | 1 | |
2 | GTKWave 3.3.100 Wave Viewer is Copyright (C) 1999-2019 Tony Bybell. | |
2 | GTKWave 3.3.101 Wave Viewer is Copyright (C) 1999-2019 Tony Bybell. | |
3 | 3 | Portions of GTKWave are Copyright (C) 1999-2019 Udi Finkelstein. |
4 | 4 | Context support is Copyright (C) 2007-2019 Kermin Elliott Fleming. |
5 | 5 | Trace group support is Copyright (C) 2009-2019 Donald Baltus. |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for gtkwave 3.3.100. | |
2 | # Generated by GNU Autoconf 2.69 for gtkwave 3.3.101. | |
3 | 3 | # |
4 | 4 | # Report bugs to <bybell@rocketmail.com>. |
5 | 5 | # |
579 | 579 | # Identity of this package. |
580 | 580 | PACKAGE_NAME='gtkwave' |
581 | 581 | PACKAGE_TARNAME='gtkwave' |
582 | PACKAGE_VERSION='3.3.100' | |
583 | PACKAGE_STRING='gtkwave 3.3.100' | |
582 | PACKAGE_VERSION='3.3.101' | |
583 | PACKAGE_STRING='gtkwave 3.3.101' | |
584 | 584 | PACKAGE_BUGREPORT='bybell@rocketmail.com' |
585 | 585 | PACKAGE_URL='' |
586 | 586 | |
1404 | 1404 | # Omit some internal or obsolete options to make the list less imposing. |
1405 | 1405 | # This message is too long to be a string in the A/UX 3.1 sh. |
1406 | 1406 | cat <<_ACEOF |
1407 | \`configure' configures gtkwave 3.3.100 to adapt to many kinds of systems. | |
1407 | \`configure' configures gtkwave 3.3.101 to adapt to many kinds of systems. | |
1408 | 1408 | |
1409 | 1409 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1410 | 1410 | |
1470 | 1470 | |
1471 | 1471 | if test -n "$ac_init_help"; then |
1472 | 1472 | case $ac_init_help in |
1473 | short | recursive ) echo "Configuration of gtkwave 3.3.100:";; | |
1473 | short | recursive ) echo "Configuration of gtkwave 3.3.101:";; | |
1474 | 1474 | esac |
1475 | 1475 | cat <<\_ACEOF |
1476 | 1476 | |
1629 | 1629 | test -n "$ac_init_help" && exit $ac_status |
1630 | 1630 | if $ac_init_version; then |
1631 | 1631 | cat <<\_ACEOF |
1632 | gtkwave configure 3.3.100 | |
1632 | gtkwave configure 3.3.101 | |
1633 | 1633 | generated by GNU Autoconf 2.69 |
1634 | 1634 | |
1635 | 1635 | Copyright (C) 2012 Free Software Foundation, Inc. |
2273 | 2273 | This file contains any messages produced by compilers while |
2274 | 2274 | running configure, to aid debugging if configure makes a mistake. |
2275 | 2275 | |
2276 | It was created by gtkwave $as_me 3.3.100, which was | |
2276 | It was created by gtkwave $as_me 3.3.101, which was | |
2277 | 2277 | generated by GNU Autoconf 2.69. Invocation command line was |
2278 | 2278 | |
2279 | 2279 | $ $0 $@ |
3140 | 3140 | |
3141 | 3141 | # Define the identity of the package. |
3142 | 3142 | PACKAGE='gtkwave' |
3143 | VERSION='3.3.100' | |
3143 | VERSION='3.3.101' | |
3144 | 3144 | |
3145 | 3145 | |
3146 | 3146 | cat >>confdefs.h <<_ACEOF |
11498 | 11498 | # report actual input values of CONFIG_FILES etc. instead of their |
11499 | 11499 | # values after options handling. |
11500 | 11500 | ac_log=" |
11501 | This file was extended by gtkwave $as_me 3.3.100, which was | |
11501 | This file was extended by gtkwave $as_me 3.3.101, which was | |
11502 | 11502 | generated by GNU Autoconf 2.69. Invocation command line was |
11503 | 11503 | |
11504 | 11504 | CONFIG_FILES = $CONFIG_FILES |
11564 | 11564 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
11565 | 11565 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
11566 | 11566 | ac_cs_version="\\ |
11567 | gtkwave config.status 3.3.100 | |
11567 | gtkwave config.status 3.3.101 | |
11568 | 11568 | configured by $0, generated by GNU Autoconf 2.69, |
11569 | 11569 | with options \\"\$ac_cs_config\\" |
11570 | 11570 |
1 | 1 | # Process this file with autoconf to produce a configure script. |
2 | 2 | |
3 | 3 | AC_PREREQ(2.59) |
4 | AC_INIT(gtkwave, 3.3.100, bybell@rocketmail.com) | |
4 | AC_INIT(gtkwave, 3.3.101, bybell@rocketmail.com) | |
5 | 5 | AC_CONFIG_SRCDIR([src/vcd.c]) |
6 | 6 | AM_INIT_AUTOMAKE |
7 | 7 | AC_CONFIG_HEADER([config.h]) |
7 | 7 | <key>CFBundleExecutable</key> |
8 | 8 | <string>gtkwave</string> |
9 | 9 | <key>CFBundleGetInfoString</key> |
10 | <string>3.3.100, (C) 1999-2019 Tony Bybell http://gtkwave.sourceforge.net</string> | |
10 | <string>3.3.101, (C) 1999-2019 Tony Bybell http://gtkwave.sourceforge.net</string> | |
11 | 11 | <key>CFBundleIconFile</key> |
12 | 12 | <string>gtkwave.icns</string> |
13 | 13 | <key>CFBundleIdentifier</key> |
17 | 17 | <key>CFBundlePackageType</key> |
18 | 18 | <string>APPL</string> |
19 | 19 | <key>CFBundleShortVersionString</key> |
20 | <string>3.3.100</string> | |
20 | <string>3.3.101</string> | |
21 | 21 | <key>CFBundleSignature</key> |
22 | 22 | <string>????</string> |
23 | 23 | <key>CFBundleVersion</key> |
24 | <string>3.3.100</string> | |
24 | <string>3.3.101</string> | |
25 | 25 | <key>NSHumanReadableCopyright</key> |
26 | 26 | <string>Copyright 1999 - 2019 Tony Bybell, GNU General Public License.</string> |
27 | 27 | <key>LSMinimumSystemVersion</key> |
Binary diff not shown
18 | 18 | |
19 | 19 | for {set i 0} {$i < $nfacs } {incr i} { |
20 | 20 | set facname [ gtkwave::getFacName $i ] |
21 | ||
22 | # set facdir [ gtkwave::getFacDir $i ] | |
23 | # set facvtype [ gtkwave::getFacVtype $i ] | |
24 | # set facdtype [ gtkwave::getFacDtype $i ] | |
25 | # puts "facname: $facname, facdir: $facdir, facvtype: $facvtype, facdtype: $facdtype" | |
26 | ||
21 | 27 | set indx [ string first "\[1:48\]" $facname ] |
22 | 28 | if {$indx == -1} { |
23 | 29 | set indx [ string first clk $facname ] |
0 | .TH "GTKWAVE" "1" "3.3.98" "Anthony Bybell" "Simulation Wave Viewer" | |
0 | .TH "GTKWAVE" "1" "3.3.101" "Anthony Bybell" "Simulation Wave Viewer" | |
1 | 1 | .SH "NAME" |
2 | 2 | .LP |
3 | 3 | gtkwave \- Visualization tool for VCD, LXT, LXT2, VZT, FST, and GHW files |
116 | 116 | \fB\-5\fR,\fB\-\-sstexclude\fR |
117 | 117 | Specify sst exclusion filter filename. |
118 | 118 | .TP |
119 | \fB\-7\fR,\fB\-\-saveonexit\fR | |
120 | At exit, a requester is brought up to prompt user to write a save file. Canceling the requester prevents from writing the file. | |
121 | .TP | |
119 | 122 | \fB\-I\fR,\fB\-\-interactive\fR |
120 | 123 | Specifies that "interactive" VCD mode is to be used which allows a viewer to navigate a VCD trace while GTKWave is processing the VCD file. |
121 | 124 | When this option is used, the filename is overloaded such that it is the hexadecimal value for the shared memory ID of a writer. |
647 | 647 | void ClearTraces(void); |
648 | 648 | void ClearGroupTraces(Trptr t); |
649 | 649 | |
650 | #endif | |
651 | ||
650 | char *varxt_fix(char *s); | |
651 | ||
652 | #endif |
167 | 167 | } |
168 | 168 | |
169 | 169 | |
170 | static void dpr_e16(char *str, double d) | |
171 | { | |
172 | char *buf16; | |
173 | char buf15[24]; | |
174 | int l16; | |
175 | int l15; | |
176 | ||
177 | buf16 = str; | |
178 | buf16[23] = 0; | |
179 | l16 = snprintf(buf16, 24, "%.16g", d); | |
180 | if(l16 >= 18) | |
181 | { | |
182 | buf15[23] = 0; | |
183 | l15 = snprintf(buf15, 24, "%.15g", d); | |
184 | if((l16-l15) > 3) | |
185 | { | |
186 | strcpy(str, buf15); | |
187 | } | |
188 | } | |
189 | } | |
190 | ||
191 | ||
170 | 192 | static void cvt_fpsdec(Trptr t, TimeType val, char *os, int len, int nbits) |
171 | 193 | { |
172 | 194 | (void)nbits; /* number of bits shouldn't be relevant here as we're going through a fraction */ |
203 | 225 | rfrac = 0.0; |
204 | 226 | } |
205 | 227 | |
206 | sprintf(dbuf, "%.16g", rfrac); | |
228 | dpr_e16(dbuf, rfrac); /* sprintf(dbuf, "%.16g", rfrac); */ | |
207 | 229 | char *dot = strchr(dbuf, '.'); |
208 | 230 | |
209 | 231 | if(dot && (dbuf[0] == '0')) |
237 | 259 | rfrac = 0.0; |
238 | 260 | } |
239 | 261 | |
240 | sprintf(dbuf, "%.16g", rfrac); | |
262 | dpr_e16(dbuf, rfrac); /* sprintf(dbuf, "%.16g", rfrac); */ | |
241 | 263 | char *dot = strchr(dbuf, '.'); |
242 | 264 | if(dot && (dbuf[0] == '0')) |
243 | 265 | { |
747 | 769 | if(nbits==64) |
748 | 770 | { |
749 | 771 | memcpy(&d, &utt, sizeof(double)); |
750 | sprintf(os, "%.16g", d); | |
772 | dpr_e16(os, d); /* sprintf(os, "%.16g", d); */ | |
751 | 773 | } |
752 | 774 | else |
753 | 775 | { |
865 | 887 | |
866 | 888 | if(d) |
867 | 889 | { |
868 | sprintf(rv,"%.16g",*d); | |
890 | dpr_e16(rv, *d); /* sprintf(rv,"%.16g",*d); */ | |
869 | 891 | } |
870 | 892 | else |
871 | 893 | { |
1496 | 1518 | if(nbits==64) |
1497 | 1519 | { |
1498 | 1520 | memcpy(&d, &utt, sizeof(double)); |
1499 | sprintf(os, "%.16g", d); | |
1521 | dpr_e16(os, d); /* sprintf(os, "%.16g", d); */ | |
1500 | 1522 | } |
1501 | 1523 | else |
1502 | 1524 | { |
1380 | 1380 | 0, /* ruler_origin */ |
1381 | 1381 | 0, /* ruler_step */ |
1382 | 1382 | 0, /* fill_waveform */ |
1383 | FALSE, /*save_on_exit */ | |
1383 | 1384 | |
1384 | 1385 | |
1385 | 1386 | /* |
1936 | 1937 | |
1937 | 1938 | new_globals->logfiles = GLOBALS->logfiles; /* this value is a ** chameleon! malloc'd region is outside debug.c control! */ |
1938 | 1939 | new_globals->sst_dbl_action_type = GLOBALS->sst_dbl_action_type; |
1940 | new_globals->save_on_exit = GLOBALS->save_on_exit; | |
1939 | 1941 | |
1940 | 1942 | strcpy2_into_new_context(new_globals, &new_globals->argvlist, &GLOBALS->argvlist); |
1941 | 1943 | strcpy2_into_new_context(new_globals, &new_globals->editor_name, &GLOBALS->editor_name); |
2862 | 2864 | |
2863 | 2865 | GLOBALS->hier_ignore_escapes = g_old->hier_ignore_escapes; |
2864 | 2866 | GLOBALS->sst_dbl_action_type = g_old->sst_dbl_action_type; |
2867 | GLOBALS->save_on_exit = g_old->save_on_exit; | |
2865 | 2868 | |
2866 | 2869 | gtk_notebook_set_current_page(GTK_NOTEBOOK(GLOBALS->notebook), GLOBALS->this_context_page); |
2867 | 2870 | } |
1369 | 1369 | TimeType ruler_origin; |
1370 | 1370 | TimeType ruler_step; |
1371 | 1371 | char fill_waveform; |
1372 | gboolean save_on_exit; | |
1372 | 1373 | |
1373 | 1374 | |
1374 | 1375 | /* |
660 | 660 | } |
661 | 661 | |
662 | 662 | |
663 | #ifndef FST_DYNAMIC_ALIAS2_DISABLE | |
663 | 664 | static int fstWriterSVarint(FILE *handle, int64_t v) |
664 | 665 | { |
665 | 666 | unsigned char buf[15]; /* ceil(64/7) = 10 + sign byte padded way up */ |
685 | 686 | fstFwrite(buf, len, 1, handle); |
686 | 687 | return(len); |
687 | 688 | } |
689 | #endif | |
688 | 690 | |
689 | 691 | |
690 | 692 | /***********************/ |
4807 | 4809 | int packtype; |
4808 | 4810 | unsigned char *mc_mem = NULL; |
4809 | 4811 | uint32_t mc_mem_len; /* corresponds to largest value encountered in chain_table_lengths[i] */ |
4812 | int dumpvars_state = 0; | |
4810 | 4813 | |
4811 | 4814 | if(!xc) return(0); |
4812 | 4815 | |
4816 | 4819 | |
4817 | 4820 | if(fv) |
4818 | 4821 | { |
4819 | fprintf(fv, "$dumpvars\n"); | |
4820 | 4822 | #ifndef FST_WRITEX_DISABLE |
4821 | 4823 | fflush(fv); |
4822 | 4824 | setvbuf(fv, (char *) NULL, _IONBF, 0); /* even buffered IO is slow so disable it and use our own routines that don't need seeking */ |
4963 | 4965 | |
4964 | 4966 | if(beg_tim) |
4965 | 4967 | { |
4968 | if(dumpvars_state == 1) { wx_len = sprintf(wx_buf, "$end\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 2; } | |
4966 | 4969 | wx_len = sprintf(wx_buf, "#%" PRIu64 "\n", beg_tim); |
4967 | 4970 | fstWritex(xc, wx_buf, wx_len); |
4971 | if(!dumpvars_state) { wx_len = sprintf(wx_buf, "$dumpvars\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 1; } | |
4968 | 4972 | } |
4969 | 4973 | if((xc->num_blackouts)&&(cur_blackout != xc->num_blackouts)) |
4970 | 4974 | { |
5397 | 5401 | } |
5398 | 5402 | } |
5399 | 5403 | |
5404 | if(dumpvars_state == 1) { wx_len = sprintf(wx_buf, "$end\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 2; } | |
5400 | 5405 | wx_len = sprintf(wx_buf, "#%" PRIu64 "\n", time_table[i]); |
5401 | 5406 | fstWritex(xc, wx_buf, wx_len); |
5407 | if(!dumpvars_state) { wx_len = sprintf(wx_buf, "$dumpvars\n"); fstWritex(xc, wx_buf, wx_len); dumpvars_state = 1; } | |
5402 | 5408 | |
5403 | 5409 | if((xc->num_blackouts)&&(cur_blackout != xc->num_blackouts)) |
5404 | 5410 | { |
247 | 247 | /************************************** |
248 | 248 | * Common functions |
249 | 249 | **************************************/ |
250 | static unsigned LZ4_NbCommonBytes (register size_t val) | |
250 | static unsigned LZ4_NbCommonBytes (size_t val) | |
251 | 251 | { |
252 | 252 | if (LZ4_isLittleEndian()) |
253 | 253 | { |
35 | 35 | int flat_earth = 0; |
36 | 36 | int notruncate = 0; |
37 | 37 | static FILE *fv = NULL; |
38 | int dumpvars_state = 0; | |
38 | 39 | |
39 | 40 | extern void free_hier(void); |
40 | 41 | extern char *fv_output_hier(FILE *fv, char *name); |
126 | 127 | } |
127 | 128 | |
128 | 129 | vcd_prevtime = *pnt_time; |
130 | if(dumpvars_state == 1) { fprintf(fv, "$end\n"); dumpvars_state = 2; } | |
129 | 131 | fprintf(fv, "#"LXT2_RD_LLD"\n", *pnt_time); |
132 | if(!dumpvars_state) { fprintf(fv, "$dumpvars\n"); dumpvars_state = 1; } | |
130 | 133 | } |
131 | 134 | |
132 | 135 | if(!(*pnt_value)[0]) |
289 | 292 | } |
290 | 293 | |
291 | 294 | fprintf(fv, "$enddefinitions $end\n"); |
292 | fprintf(fv, "$dumpvars\n"); | |
293 | 295 | |
294 | 296 | vcd_prevtime = lxt2_rd_get_start_time(lt)-1; |
295 | 297 | |
297 | 299 | |
298 | 300 | if(vcd_prevtime!=lxt2_rd_get_end_time(lt)) |
299 | 301 | { |
302 | if(dumpvars_state == 1) { fprintf(fv, "$end\n"); dumpvars_state = 2; } | |
300 | 303 | fprintf(fv, "#"LXT2_RD_LLD"\n", lxt2_rd_get_end_time(lt)); |
301 | 304 | } |
302 | 305 |
36 | 36 | static int vectorize = 0; |
37 | 37 | static int notruncate = 0; |
38 | 38 | static FILE *fv = NULL; |
39 | int dumpvars_state = 0; | |
39 | 40 | |
40 | 41 | extern void free_hier(void); |
41 | 42 | extern char *fv_output_hier(FILE *fv, char *name); |
119 | 120 | if(vcd_prevtime != *pnt_time) |
120 | 121 | { |
121 | 122 | vcd_prevtime = *pnt_time; |
123 | if(dumpvars_state == 1) { fprintf(fv, "$end\n"); dumpvars_state = 2; } | |
122 | 124 | fprintf(fv, "#"VZT_RD_LLD"\n", *pnt_time); |
125 | if(!dumpvars_state) { fprintf(fv, "$dumpvars\n"); dumpvars_state = 1; } | |
123 | 126 | } |
124 | 127 | |
125 | 128 | if(!(*pnt_value)[0]) |
289 | 292 | } |
290 | 293 | |
291 | 294 | fprintf(fv, "$enddefinitions $end\n"); |
292 | fprintf(fv, "$dumpvars\n"); | |
293 | 295 | |
294 | 296 | vcd_prevtime = vzt_rd_get_start_time(lt)-1; |
295 | 297 | |
297 | 299 | |
298 | 300 | if(vcd_prevtime!=vzt_rd_get_end_time(lt)) |
299 | 301 | { |
302 | if(dumpvars_state == 1) { fprintf(fv, "$end\n"); dumpvars_state = 2; } | |
300 | 303 | fprintf(fv, "#"VZT_RD_LLD"\n", vzt_rd_get_end_time(lt)); |
301 | 304 | } |
302 | 305 |
125 | 125 | GLOBALS->zoom_dyne = g_old->zoom_dyne; |
126 | 126 | GLOBALS->hier_ignore_escapes = g_old->hier_ignore_escapes; |
127 | 127 | GLOBALS->sst_dbl_action_type = g_old->sst_dbl_action_type; |
128 | GLOBALS->save_on_exit = g_old->save_on_exit; | |
128 | 129 | |
129 | 130 | reformat_time(timestr, GLOBALS->tims.first + GLOBALS->global_time_offset, GLOBALS->time_dimension); |
130 | 131 | gtk_entry_set_text(GTK_ENTRY(GLOBALS->from_entry),timestr); |
706 | 707 | GLOBALS->do_hier_compress = old_g->do_hier_compress; |
707 | 708 | GLOBALS->disable_auto_comphier = old_g->disable_auto_comphier; |
708 | 709 | GLOBALS->sst_dbl_action_type = old_g->sst_dbl_action_type; |
710 | GLOBALS->save_on_exit = old_g->save_on_exit; | |
709 | 711 | |
710 | 712 | strcpy2_into_new_context(GLOBALS, &GLOBALS->sst_exclude_filename, &old_g->sst_exclude_filename); |
711 | 713 | |
830 | 832 | {"restore", 0, 0, '3'}, |
831 | 833 | {"rcvar", 1, 0, '4'}, |
832 | 834 | {"sstexclude", 1, 0, '5'}, |
835 | {"saveonexit", 0, 0, '7'}, | |
833 | 836 | {0, 0, 0, 0} |
834 | 837 | }; |
835 | 838 | |
836 | c = getopt_long (argc, argv, "zf:Fon:a:Ar:dl:s:e:c:t:NS:vVhxX:MD:IgCLR:P:O:WT:1:2:34:5:", long_options, | |
839 | c = getopt_long (argc, argv, "zf:Fon:a:Ar:dl:s:e:c:t:NS:vVhxX:MD:IgCLR:P:O:WT:1:2:34:5:7", long_options, | |
837 | 840 | &option_index); |
838 | 841 | |
839 | 842 | if (c == -1) break; /* no more args */ |
1055 | 1058 | } |
1056 | 1059 | GLOBALS->sst_exclude_filename = strdup_2(optarg); |
1057 | 1060 | } |
1061 | break; | |
1062 | ||
1063 | case '7': | |
1064 | GLOBALS->save_on_exit = TRUE; | |
1058 | 1065 | break; |
1059 | 1066 | |
1060 | 1067 | case 's': |
2357 | 2357 | ); |
2358 | 2358 | return; |
2359 | 2359 | } |
2360 | ||
2361 | if(GLOBALS->save_on_exit) { menu_write_save_file(NULL, 0, NULL); } | |
2360 | 2362 | |
2361 | 2363 | if(!GLOBALS->enable_fast_exit) |
2362 | 2364 | { |
8491 | 8493 | (void)widget; |
8492 | 8494 | (void)data; |
8493 | 8495 | |
8496 | if(GLOBALS->save_on_exit) { menu_write_save_file(NULL, 0, NULL); } | |
8497 | ||
8494 | 8498 | if(!GLOBALS->enable_fast_exit) |
8495 | 8499 | { |
8496 | 8500 | simplereqbox("Quit Program",300,"Do you really want to quit?","Yes", "No", GTK_SIGNAL_FUNC(menu_quit_callback), 1); |
239 | 239 | aobj = Tcl_NewStringObj(hfacname, -1); |
240 | 240 | Tcl_SetObjResult(interp, aobj); |
241 | 241 | if(was_packed) free_2(hfacname); |
242 | } | |
243 | } | |
244 | else | |
245 | { | |
246 | return(gtkwavetcl_badNumArgs(clientData, interp, objc, objv, 1)); | |
247 | } | |
248 | ||
249 | return(TCL_OK); | |
250 | } | |
251 | ||
252 | static int gtkwavetcl_getFacDir(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) | |
253 | { | |
254 | Tcl_Obj *aobj; | |
255 | ||
256 | if(objc == 2) | |
257 | { | |
258 | char *s = get_Tcl_string(objv[1]); | |
259 | int which = atoi(s); | |
260 | ||
261 | if((which >= 0) && (which < GLOBALS->numfacs)) | |
262 | { | |
263 | WAVE_NODEVARDIR_STR | |
264 | int vardir = GLOBALS->facs[which]->n->vardir; /* two bit already chops down to 0..3, but this doesn't hurt */ | |
265 | if((vardir < 0) || (vardir > ND_DIR_MAX)) | |
266 | { | |
267 | vardir = 0; | |
268 | } | |
269 | ||
270 | aobj = Tcl_NewStringObj(vardir_strings[vardir], -1); | |
271 | Tcl_SetObjResult(interp, aobj); | |
272 | } | |
273 | } | |
274 | else | |
275 | { | |
276 | return(gtkwavetcl_badNumArgs(clientData, interp, objc, objv, 1)); | |
277 | } | |
278 | ||
279 | return(TCL_OK); | |
280 | } | |
281 | ||
282 | ||
283 | #ifndef WAVE_USE_GTK2 | |
284 | /* truncate VHDL types to string directly after final '.' */ | |
285 | char *varxt_fix(char *s) | |
286 | { | |
287 | char *pnt = strrchr(s, '.'); | |
288 | return(pnt ? (pnt+1) : s); | |
289 | } | |
290 | #endif | |
291 | ||
292 | static int gtkwavetcl_getFacVtype(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) | |
293 | { | |
294 | Tcl_Obj *aobj; | |
295 | ||
296 | if(objc == 2) | |
297 | { | |
298 | char *s = get_Tcl_string(objv[1]); | |
299 | int which = atoi(s); | |
300 | ||
301 | if((which >= 0) && (which < GLOBALS->numfacs)) | |
302 | { | |
303 | WAVE_NODEVARTYPE_STR | |
304 | WAVE_NODEVARDATATYPE_STR | |
305 | unsigned int varxt; | |
306 | char *varxt_pnt; | |
307 | int vartype; | |
308 | int vardt; | |
309 | ||
310 | varxt = GLOBALS->facs[which]->n->varxt; | |
311 | varxt_pnt = varxt ? varxt_fix(GLOBALS->subvar_pnt[varxt]) : NULL; | |
312 | ||
313 | vartype = GLOBALS->facs[which]->n->vartype; | |
314 | if((vartype < 0) || (vartype > ND_VARTYPE_MAX)) | |
315 | { | |
316 | vartype = 0; | |
317 | } | |
318 | ||
319 | vardt = GLOBALS->facs[which]->n->vardt; | |
320 | if((vardt < 0) || (vardt > ND_VDT_MAX)) | |
321 | { | |
322 | vardt = 0; | |
323 | } | |
324 | ||
325 | aobj = Tcl_NewStringObj( (((GLOBALS->supplemental_datatypes_encountered) && (!GLOBALS->supplemental_vartypes_encountered)) ? | |
326 | (varxt ? varxt_pnt : vardatatype_strings[vardt]) : vartype_strings[vartype]), -1); | |
327 | Tcl_SetObjResult(interp, aobj); | |
328 | } | |
329 | } | |
330 | else | |
331 | { | |
332 | return(gtkwavetcl_badNumArgs(clientData, interp, objc, objv, 1)); | |
333 | } | |
334 | ||
335 | return(TCL_OK); | |
336 | } | |
337 | ||
338 | static int gtkwavetcl_getFacDtype(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) | |
339 | { | |
340 | Tcl_Obj *aobj; | |
341 | ||
342 | if(objc == 2) | |
343 | { | |
344 | char *s = get_Tcl_string(objv[1]); | |
345 | int which = atoi(s); | |
346 | ||
347 | if((which >= 0) && (which < GLOBALS->numfacs)) | |
348 | { | |
349 | WAVE_NODEVARTYPE_STR | |
350 | WAVE_NODEVARDATATYPE_STR | |
351 | unsigned int varxt; | |
352 | char *varxt_pnt; | |
353 | int vardt; | |
354 | ||
355 | varxt = GLOBALS->facs[which]->n->varxt; | |
356 | varxt_pnt = varxt ? varxt_fix(GLOBALS->subvar_pnt[varxt]) : NULL; | |
357 | ||
358 | vardt = GLOBALS->facs[which]->n->vardt; | |
359 | if((vardt < 0) || (vardt > ND_VDT_MAX)) | |
360 | { | |
361 | vardt = 0; | |
362 | } | |
363 | ||
364 | aobj = Tcl_NewStringObj( varxt ? varxt_pnt : vardatatype_strings[vardt], -1); | |
365 | Tcl_SetObjResult(interp, aobj); | |
242 | 366 | } |
243 | 367 | } |
244 | 368 | else |
2130 | 2254 | {"getDisplayedSignals", gtkwavetcl_getDisplayedSignals}, |
2131 | 2255 | {"getDumpFileName", gtkwavetcl_getDumpFileName}, |
2132 | 2256 | {"getDumpType", gtkwavetcl_getDumpType}, |
2257 | {"getFacDir", gtkwavetcl_getFacDir}, | |
2258 | {"getFacDtype", gtkwavetcl_getFacDtype}, | |
2133 | 2259 | {"getFacName", gtkwavetcl_getFacName}, |
2260 | {"getFacVtype", gtkwavetcl_getFacVtype}, | |
2134 | 2261 | {"getFontHeight", gtkwavetcl_getFontHeight}, |
2135 | 2262 | {"getFromEntry", gtkwavetcl_getFromEntry}, |
2136 | 2263 | {"getHierMaxLevel", gtkwavetcl_getHierMaxLevel}, |
147 | 147 | */ |
148 | 148 | static int tclFindElement(const char* list, const char** elementPtr, |
149 | 149 | const char** nextPtr, int* sizePtr, int *bracePtr) { |
150 | register const char *p; | |
150 | const char *p; | |
151 | 151 | int openBraces = 0; |
152 | 152 | int inQuotes = 0; |
153 | 153 | int size; |
281 | 281 | */ |
282 | 282 | static void tclCopyAndCollapse(int count, const char *src, char *dst) |
283 | 283 | { |
284 | register char c; | |
284 | char c; | |
285 | 285 | int numRead; |
286 | 286 | |
287 | 287 | for (c = *src; count > 0; src++, c = *src, count--) { |
321 | 321 | char** zSplitTclList(const char* list, int* argcPtr) { |
322 | 322 | char** argv; |
323 | 323 | const char* l; |
324 | register char* p; | |
324 | char* p; | |
325 | 325 | int size, i, ok, elSize, brace; |
326 | 326 | const char *element; |
327 | 327 | |
421 | 421 | #define BRACES_UNMATCHED 4 |
422 | 422 | |
423 | 423 | static int tclScanElement(const char* string, int* flagPtr) { |
424 | register const char *p; | |
424 | const char *p; | |
425 | 425 | int nestingLevel = 0; |
426 | 426 | int flags = 0; |
427 | 427 | |
501 | 501 | */ |
502 | 502 | static int tclConvertElement(const char* src, char* dst, int flags) |
503 | 503 | { |
504 | register char *p = dst; | |
504 | char *p = dst; | |
505 | 505 | |
506 | 506 | if ((src == NULL) || (*src == 0)) { |
507 | 507 | p[0] = '{'; |
363 | 363 | struct lt_trace *lt = NULL; |
364 | 364 | int lxt = (export_typ == WAVE_EXPORT_LXT); |
365 | 365 | int is_trans = (export_typ == WAVE_EXPORT_TRANS); |
366 | int dumpvars_state = 0; | |
366 | 367 | |
367 | 368 | if(export_typ == WAVE_EXPORT_TIM) |
368 | 369 | { |
636 | 637 | free_hier(); |
637 | 638 | |
638 | 639 | w32redirect_fprintf(is_trans, GLOBALS->f_vcd_saver_c_1, "$enddefinitions $end\n"); |
639 | w32redirect_fprintf(is_trans, GLOBALS->f_vcd_saver_c_1, "$dumpvars\n"); | |
640 | 640 | } |
641 | 641 | |
642 | 642 | /* value changes */ |
667 | 667 | } |
668 | 668 | else |
669 | 669 | { |
670 | if(dumpvars_state == 1) { w32redirect_fprintf(is_trans, GLOBALS->f_vcd_saver_c_1, "$end\n"); dumpvars_state = 2; } | |
670 | 671 | w32redirect_fprintf(is_trans, GLOBALS->f_vcd_saver_c_1, "#"TTFormat"\n", tnorm); |
672 | if(!dumpvars_state) { w32redirect_fprintf(is_trans, GLOBALS->f_vcd_saver_c_1, "$dumpvars\n"); dumpvars_state = 1; } | |
671 | 673 | } |
672 | 674 | prevtime = GLOBALS->hp_vcd_saver_c_1[0]->hist->time; |
673 | 675 | } |
785 | 787 | } |
786 | 788 | else |
787 | 789 | { |
790 | if(dumpvars_state == 1) { w32redirect_fprintf(is_trans, GLOBALS->f_vcd_saver_c_1, "$end\n"); dumpvars_state = 2; } | |
788 | 791 | w32redirect_fprintf(is_trans, GLOBALS->f_vcd_saver_c_1, "#"TTFormat"\n", GLOBALS->max_time / GLOBALS->time_scale); |
789 | 792 | } |
790 | 793 | } |