eval_expr.y: fix eval_expr_clear_table, remove unneeded unistd.h

This commit is contained in:
stefan schippers 2025-02-14 02:15:03 +01:00
parent afac3f7620
commit 9fe67cd242
10 changed files with 2043 additions and 1970 deletions

View File

@ -254,6 +254,7 @@
<ClCompile Include="..\src\verilog_netlist.c" />
<ClCompile Include="..\src\vhdl_netlist.c" />
<ClCompile Include="..\src\xinit.c" />
<ClCompile Include="eval_expr.c" />
<ClCompile Include="expandlabel.c" />
<ClCompile Include="parselabel.c" />
</ItemGroup>
@ -261,6 +262,7 @@
<ClInclude Include="..\src\cairo_jpg.h" />
<ClInclude Include="..\src\xschem.h" />
<ClInclude Include="config.h" />
<ClInclude Include="eval_expr.h" />
<ClInclude Include="expandlabel.h" />
</ItemGroup>
<ItemGroup>
@ -284,6 +286,11 @@
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\eval_expr.y">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">bison -p kk -o eval_expr.c ..\src\eval_expr.y </Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">eval_expr.c</Outputs>
</CustomBuild>
<None Include="..\src\xschem.tcl" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -254,6 +254,7 @@
<ClCompile Include="..\src\verilog_netlist.c" />
<ClCompile Include="..\src\vhdl_netlist.c" />
<ClCompile Include="..\src\xinit.c" />
<ClCompile Include="eval_expr.c" />
<ClCompile Include="expandlabel.c" />
<ClCompile Include="parselabel.c" />
</ItemGroup>
@ -261,6 +262,7 @@
<ClInclude Include="..\src\cairo_jpg.h" />
<ClInclude Include="..\src\xschem.h" />
<ClInclude Include="config.h" />
<ClInclude Include="eval_expr.h" />
<ClInclude Include="expandlabel.h" />
</ItemGroup>
<ItemGroup>
@ -284,6 +286,11 @@
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\src\eval_expr.y">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">bison -p kk -o eval_expr.c ..\src\eval_expr.y </Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">eval_expr.c</Outputs>
</CustomBuild>
<None Include="..\src\xschem.tcl" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -250,10 +250,7 @@
<Component Id="CMPPLACESYMPINS">
<File Id="PLACESYMPINS" KeyPath="yes" Source="../../src/place_sym_pins.tcl" />
</Component>
<Component Id="CMPCREATESYMBOL">
<File Id="CREATESYMBOL" KeyPath="yes" Source="../../src/create_symbol.tcl" />
</Component>
<Directory Id="SYSTEMLIBFOLDER" Name="systemlib">
<Component Id="CMPSYSTEMLIBFONTSCH">
<File Id="FONTSCH" KeyPath="yes" Source="../../src/systemlib/font.sch" />
@ -374,7 +371,6 @@
<ComponentRef Id="CMPTRADUCIAWK" />
<ComponentRef Id="CMPPLACEPLINS" />
<ComponentRef Id="CMPPLACESYMPINS" />
<ComponentRef Id="CMPCREATESYMBOL" />
<ComponentRef Id="CMPVERILOGAWK" />
<ComponentRef Id="CMPVHDLAWK" />
<ComponentRef Id="CMPXSCHEMHELP" />

File diff suppressed because it is too large Load Diff

View File

@ -293,6 +293,9 @@
<Component Id="cmpC76DA8327344C4B4AB04EF665B72B736" Guid="{2ACADB68-D803-40D4-BCA3-ECA604ED7AE9}">
<File Id="filCC0547DA9E32AACF4F88B5E7AD58DEC0" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\devices\sqwsource.sym" />
</Component>
<Component Id="cmp57911CE62A560E61564C339A78C10282" Guid="{62F8D0F6-D4FF-4255-8B5B-FC912F25C3BB}">
<File Id="fil4085D9852FFDBCA1DA05DFA41B6B63A2" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\devices\stop.sym" />
</Component>
<Component Id="cmpA4CE7D272C69DDD6A95DF0D02AC0D3C0" Guid="{C1242779-E7D6-43A3-B210-D631DEFDF56B}">
<File Id="filEB57C82FF4DA64043A496E5A9ABF6802" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\devices\switch.sym" />
</Component>
@ -457,6 +460,7 @@
<ComponentRef Id="cmpC0CDD9987356F9D8308F1F96CAA35403" />
<ComponentRef Id="cmp530072B273A8627AFC7F2E628B5116CE" />
<ComponentRef Id="cmpC76DA8327344C4B4AB04EF665B72B736" />
<ComponentRef Id="cmp57911CE62A560E61564C339A78C10282" />
<ComponentRef Id="cmpA4CE7D272C69DDD6A95DF0D02AC0D3C0" />
<ComponentRef Id="cmp92D378095B64443F3454801FDB1FBF50" />
<ComponentRef Id="cmpB88C8475423DC9A430B279627C98B455" />

View File

@ -171,8 +171,14 @@
#### this is the default:
# set initial_geometry {900x600}
#### initial geometry of load /save / insert component file selector
# set file_dialog_default_geometry 800x600
#### initial size of the load_file_dialog (the file selector) dialog box
# set file_dialog_default_geometry 700x680+100+40
#### load_file_dialog directory list (+ recent if shown) X width in pixels
# set file_dialog_sp0 350
#### load_file_dialog recent components list X width in pixels
# set file_dialog_sp1 100
#### load_file_dialog components list Y height in pixels
# set file_dialog_v_sp0 420
#### display full path (1) or only name (0) for component directories. Default: 1
# set load_file_dialog_fullpath 1
@ -195,6 +201,11 @@
#### default: 0
# set persistent_command 1
#### if set to 0 users must click a point after hitting a command key
#### like 'w(ire)', 'l(ine)' and so on.
#### default is 1 (hitting the command key sets also the first point).
# set infix_interface 0
#### if set to 1 allow click & drag objects in the schematic
#### to move them without keyboard commands ('m')
#### default: enabled (1)
@ -256,8 +267,24 @@
#### enable drawing crosshairs at mouse coordinates. Default: disabled (0)
# set draw_crosshair 1
#### set crosshair layer; Default 3 (TEXTLAYER)
# set crosshair_layer 3
#### set crosshair layer; Default 8 (Yellow)
# set crosshair_layer 8
#### set crosshair size; Default: 0 (full screen spanning crosshair)
# set crosshair_size 5
#### enable drawing a diamond-shaped cursor at the closest circuit endpoint. Default: disabled (0)
# set snap_cursor 1
#### set snap_cursor_size; Default: 6 (Diamond-shaped cursor that snaps to nearest circuit endpoint)
# set snap_cursor_size 6
#### set cadence_compat; Default: 0 (Cadence-style keybinds are not used by default)
# set cadence_compat 1
#### if set, then, when cursor (regardless of style) is on an object, and user clicks (though mouse pointer is not on the object),
#### the object is selected. Default: 0
# set use_cursor_for_selection 1
#### enable to scale grid point size as done with lines at close zoom, default: 0
# set big_grid_points 0
@ -510,7 +537,10 @@ set editor {notepad.exe}
# }
# }
###########################################################################
#### TCL COMMANDS TO BE EXECUTED AFTER GENERATING NETLIST
###########################################################################
# set netlist_postprocess {textfile $netlist_dir/[xschem get netlist_name fallback]}
###########################################################################
#### WEB URL DOWNLOAD HELPER APPLICATION
@ -553,6 +583,14 @@ set editor {notepad.exe}
#### default: 0 (not set)
# set show_hidden_texts 1
###########################################################################
#### USE CTRL MODIFIER TO OPERATE ON GRAPHS WITH MOUSE & KEYBOARD
###########################################################################
#### if enabled forces to hold Control key pressed to operate on graphs
#### to prevent "graph event stealing to schematic"
#### Default: 0 (not set)
# set graph_use_ctrl_key 1
###########################################################################
#### HIDE GRAPHS IF NO SPICE DATA LOADED
###########################################################################
@ -560,6 +598,16 @@ set editor {notepad.exe}
#### default: not enabled (0)
# set hide_empty_graphs 0
###########################################################################
#### ATTACH HOOK FUNCTION TO CURSOR 2 MOVEMENT
###########################################################################
#### if enabled whenever the cursor2 is moved the specified script is
#### executed. Examples:
#### set cursor_2_hook {conducting_devices 10e-3 nodraw}
#### set cursor_2_hook {hilight_high_nets 0 1.8 nodraw}
#### this can be used to add backannotation actions.
###########################################################################
#### LIVE BACKANNOTATION OF DATA AT CURSOR 2 (B) POSITION
###########################################################################
@ -591,3 +639,6 @@ set editor {notepad.exe}
#### Default: not enabled (0)
# set fix_mouse_coord 0
#### redefine some variables to emulate Cadence UI / bindkeys
# source /home/schippes/share/xschem/cadence_style_rc

View File

@ -2,7 +2,6 @@
#include <stdio.h>
#include <math.h> /* For math functions, cos(), sin(), etc. */
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include "xschem.h"
@ -193,13 +192,15 @@ void eval_expr_init_table(void) /* puts arithmetic functions in table. */
void eval_expr_clear_table(void)
{
symrec *ptr;
for (ptr = sym_table; ptr; ptr = ptr->next) {
symrec *ptr = sym_table;
while(ptr) {
symrec *tmp = ptr;
ptr = ptr->next;
my_free(_ALLOC_ID_, &(tmp->name));
my_free(_ALLOC_ID_, &tmp);
}
}
static int kklex()
{

View File

@ -696,7 +696,7 @@ static int bus_search(const char*s)
}
#ifndef __unix__
static int win_regexec(const char *options, const char *pattern, const char *name)
int win_regexec(const char *options, const char *pattern, const char *name)
{
if (options!=NULL)
tclvareval("regexp {", options,"} {", pattern, "} {", name, "}", NULL);
@ -754,7 +754,7 @@ int search(const char *tok, const char *val, int sub, int sel, int match_case)
if(regcomp(&re, val , cflags)) return TCL_ERROR;
#else
if(!match_case) {
regexp_options = "-nocase";
my_strdup(_ALLOC_ID_, &regexp_options, "-nocase");
}
#endif
dbg(1, "search():val=%s\n", val);
@ -1014,6 +1014,8 @@ int search(const char *tok, const char *val, int sub, int sel, int match_case)
}
#ifdef __unix__
regfree(&re);
#else
my_free(_ALLOC_ID_, &regexp_options);
#endif
xctx->draw_window = save_draw;
my_free(_ALLOC_ID_, &tmpname);

View File

@ -4167,7 +4167,7 @@ const char *translate(int inst, const char* s)
#ifdef __unix__
else if(!regexec(get_sp_cur, token, 0 , NULL, 0) )
# else
else if(0) /* FIXME: windows workaround for missing regex* functions */
else if ((win_regexec(NULL/*options*/, "^@spice_get_(current|modelparam|modelvoltage)([_a-zA-Z][a-zA-Z0-9_]*)*\\(", token)))
#endif
{
int start_level; /* hierarchy level where waves were loaded */

View File

@ -1764,4 +1764,5 @@ extern const char *create_tmpdir(char *prefix);
extern FILE *open_tmpfile(char *prefix, char *suffix, char **filename);
extern void create_ps(char** psfile, int what, int fullzoom, int eps);
extern void MyXCopyArea(Display* display, Drawable src, Drawable dest, GC gc, int src_x, int src_y, unsigned int width, unsigned int height, int dest_x, int dest_y);
extern int win_regexec(const char *options, const char *pattern, const char *name);
#endif /*CADGLOBALS */