remove my*() allocation routines unique IDs and replace with _ALLOC_ID_ macro, to be substituted in debug sessions with create_alloc_ids.awk
This commit is contained in:
parent
5c59b69865
commit
1da5e47d4a
164
src/actions.c
164
src/actions.c
|
|
@ -51,7 +51,7 @@ unsigned int hash_file(const char *f, int skip_path_lines)
|
|||
/* skip lines of type: '** sch_path: ...' or '-- sch_path: ...' or '// sym_path: ...' */
|
||||
if(skip_path_lines && strlen(line) > 14) {
|
||||
if(!strncmp(line+2, " sch_path: ", 11) || !strncmp(line+2, " sym_path: ", 11) ) {
|
||||
my_free(1388, &line);
|
||||
my_free(_ALLOC_ID_, &line);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -60,7 +60,7 @@ unsigned int hash_file(const char *f, int skip_path_lines)
|
|||
/* skip CRs so hashes will match on unix / windows */
|
||||
if(line[i] == '\r') {
|
||||
cr = 1;
|
||||
my_free(1519, &line);
|
||||
my_free(_ALLOC_ID_, &line);
|
||||
continue;
|
||||
} else if(line[i] == '\n' && cr) {
|
||||
cr = 0;
|
||||
|
|
@ -70,7 +70,7 @@ unsigned int hash_file(const char *f, int skip_path_lines)
|
|||
}
|
||||
h += (h << 5) + (unsigned char)line[i];
|
||||
}
|
||||
my_free(1545, &line);
|
||||
my_free(_ALLOC_ID_, &line);
|
||||
}
|
||||
if(cr) h += (h << 5) + '\r'; /* file ends with \r not followed by \n: keep it */
|
||||
fclose(fd);
|
||||
|
|
@ -461,7 +461,7 @@ void ask_new_file(void)
|
|||
remove_symbols();
|
||||
load_schematic(1, f,1); /* 20180925.1 */
|
||||
tclvareval("update_recent_file {", f, "}", NULL);
|
||||
my_strdup(1, &xctx->sch_path[xctx->currsch],".");
|
||||
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch],".");
|
||||
xctx->sch_path_hash[xctx->currsch] = 0;
|
||||
xctx->sch_inst_number[xctx->currsch] = 1;
|
||||
zoom_full(1, 0, 1, 0.97);
|
||||
|
|
@ -479,60 +479,60 @@ void remove_symbol(int j)
|
|||
xSymbol save;
|
||||
|
||||
dbg(1,"clearing symbol %s\n", xctx->sym[j].name);
|
||||
my_free(666, &xctx->sym[j].prop_ptr);
|
||||
my_free(667, &xctx->sym[j].templ);
|
||||
my_free(668, &xctx->sym[j].type);
|
||||
my_free(684, &xctx->sym[j].name);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].templ);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].type);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].name);
|
||||
/* /20150409 */
|
||||
for(c=0;c<cadlayers;c++) {
|
||||
for(i=0;i<xctx->sym[j].polygons[c];i++) {
|
||||
if(xctx->sym[j].poly[c][i].prop_ptr != NULL) {
|
||||
my_free(669, &xctx->sym[j].poly[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].poly[c][i].prop_ptr);
|
||||
}
|
||||
my_free(670, &xctx->sym[j].poly[c][i].x);
|
||||
my_free(671, &xctx->sym[j].poly[c][i].y);
|
||||
my_free(672, &xctx->sym[j].poly[c][i].selected_point);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].poly[c][i].x);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].poly[c][i].y);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].poly[c][i].selected_point);
|
||||
}
|
||||
my_free(673, &xctx->sym[j].poly[c]);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].poly[c]);
|
||||
xctx->sym[j].polygons[c] = 0;
|
||||
|
||||
for(i=0;i<xctx->sym[j].lines[c];i++) {
|
||||
if(xctx->sym[j].line[c][i].prop_ptr != NULL) {
|
||||
my_free(674, &xctx->sym[j].line[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].line[c][i].prop_ptr);
|
||||
}
|
||||
}
|
||||
my_free(675, &xctx->sym[j].line[c]);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].line[c]);
|
||||
xctx->sym[j].lines[c] = 0;
|
||||
|
||||
for(i=0;i<xctx->sym[j].arcs[c];i++) {
|
||||
if(xctx->sym[j].arc[c][i].prop_ptr != NULL) {
|
||||
my_free(676, &xctx->sym[j].arc[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].arc[c][i].prop_ptr);
|
||||
}
|
||||
}
|
||||
my_free(677, &xctx->sym[j].arc[c]);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].arc[c]);
|
||||
xctx->sym[j].arcs[c] = 0;
|
||||
|
||||
for(i=0;i<xctx->sym[j].rects[c];i++) {
|
||||
if(xctx->sym[j].rect[c][i].prop_ptr != NULL) {
|
||||
my_free(678, &xctx->sym[j].rect[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].rect[c][i].prop_ptr);
|
||||
}
|
||||
set_rect_extraptr(0, &xctx->sym[j].rect[c][i]);
|
||||
}
|
||||
my_free(679, &xctx->sym[j].rect[c]);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].rect[c]);
|
||||
xctx->sym[j].rects[c] = 0;
|
||||
}
|
||||
for(i=0;i<xctx->sym[j].texts;i++) {
|
||||
if(xctx->sym[j].text[i].prop_ptr != NULL) {
|
||||
my_free(680, &xctx->sym[j].text[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].text[i].prop_ptr);
|
||||
}
|
||||
if(xctx->sym[j].text[i].txt_ptr != NULL) {
|
||||
my_free(681, &xctx->sym[j].text[i].txt_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].text[i].txt_ptr);
|
||||
}
|
||||
if(xctx->sym[j].text[i].font != NULL) {
|
||||
my_free(682, &xctx->sym[j].text[i].font);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].text[i].font);
|
||||
}
|
||||
}
|
||||
my_free(683, &xctx->sym[j].text);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[j].text);
|
||||
xctx->sym[j].texts = 0;
|
||||
|
||||
save = xctx->sym[j]; /* save cleared symbol slot */
|
||||
|
|
@ -592,7 +592,7 @@ int set_rect_extraptr(int what, xRect *drptr)
|
|||
if(drptr->flags & 1024) { /* embedded image */
|
||||
if(!drptr->extraptr) {
|
||||
xEmb_image *d;
|
||||
d = my_malloc(1465, sizeof(xEmb_image));
|
||||
d = my_malloc(_ALLOC_ID_, sizeof(xEmb_image));
|
||||
d->image = NULL;
|
||||
drptr->extraptr = d;
|
||||
}
|
||||
|
|
@ -602,7 +602,7 @@ int set_rect_extraptr(int what, xRect *drptr)
|
|||
if(drptr->extraptr) {
|
||||
xEmb_image *d = drptr->extraptr;
|
||||
if(d->image) cairo_surface_destroy(d->image);
|
||||
my_free(1476, &drptr->extraptr);
|
||||
my_free(_ALLOC_ID_, &drptr->extraptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -616,55 +616,55 @@ void clear_drawing(void)
|
|||
xctx->graph_lastsel = -1;
|
||||
del_inst_table();
|
||||
del_wire_table();
|
||||
my_free(685, &xctx->schtedaxprop);
|
||||
my_free(686, &xctx->schsymbolprop);
|
||||
my_free(687, &xctx->schprop);
|
||||
my_free(688, &xctx->schvhdlprop);
|
||||
my_free(689, &xctx->version_string);
|
||||
if(xctx->header_text) my_free(1654, &xctx->header_text);
|
||||
my_free(690, &xctx->schverilogprop);
|
||||
my_free(_ALLOC_ID_, &xctx->schtedaxprop);
|
||||
my_free(_ALLOC_ID_, &xctx->schsymbolprop);
|
||||
my_free(_ALLOC_ID_, &xctx->schprop);
|
||||
my_free(_ALLOC_ID_, &xctx->schvhdlprop);
|
||||
my_free(_ALLOC_ID_, &xctx->version_string);
|
||||
if(xctx->header_text) my_free(_ALLOC_ID_, &xctx->header_text);
|
||||
my_free(_ALLOC_ID_, &xctx->schverilogprop);
|
||||
for(i=0;i<xctx->wires;i++)
|
||||
{
|
||||
my_free(691, &xctx->wire[i].prop_ptr);
|
||||
my_free(692, &xctx->wire[i].node);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].node);
|
||||
}
|
||||
xctx->wires = 0;
|
||||
for(i=0;i<xctx->instances;i++)
|
||||
{
|
||||
my_free(693, &xctx->inst[i].prop_ptr);
|
||||
my_free(694, &xctx->inst[i].name);
|
||||
my_free(695, &xctx->inst[i].instname);
|
||||
my_free(874, &xctx->inst[i].lab);
|
||||
my_free(_ALLOC_ID_, &xctx->inst[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->inst[i].name);
|
||||
my_free(_ALLOC_ID_, &xctx->inst[i].instname);
|
||||
my_free(_ALLOC_ID_, &xctx->inst[i].lab);
|
||||
delete_inst_node(i);
|
||||
}
|
||||
xctx->instances = 0;
|
||||
for(i=0;i<xctx->texts;i++)
|
||||
{
|
||||
my_free(696, &xctx->text[i].font);
|
||||
my_free(697, &xctx->text[i].prop_ptr);
|
||||
my_free(698, &xctx->text[i].txt_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->text[i].font);
|
||||
my_free(_ALLOC_ID_, &xctx->text[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->text[i].txt_ptr);
|
||||
}
|
||||
xctx->texts = 0;
|
||||
for(i=0;i<cadlayers;i++)
|
||||
{
|
||||
for(j=0;j<xctx->lines[i];j++)
|
||||
{
|
||||
my_free(699, &xctx->line[i][j].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->line[i][j].prop_ptr);
|
||||
}
|
||||
for(j=0;j<xctx->rects[i];j++)
|
||||
{
|
||||
my_free(700, &xctx->rect[i][j].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->rect[i][j].prop_ptr);
|
||||
set_rect_extraptr(0, &xctx->rect[i][j]);
|
||||
}
|
||||
for(j=0;j<xctx->arcs[i];j++)
|
||||
{
|
||||
my_free(701, &xctx->arc[i][j].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->arc[i][j].prop_ptr);
|
||||
}
|
||||
for(j=0;j<xctx->polygons[i]; j++) {
|
||||
my_free(702, &xctx->poly[i][j].x);
|
||||
my_free(703, &xctx->poly[i][j].y);
|
||||
my_free(704, &xctx->poly[i][j].prop_ptr);
|
||||
my_free(705, &xctx->poly[i][j].selected_point);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[i][j].x);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[i][j].y);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[i][j].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[i][j].selected_point);
|
||||
}
|
||||
xctx->lines[i] = 0;
|
||||
xctx->arcs[i] = 0;
|
||||
|
|
@ -799,8 +799,8 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
|
|||
int use_label_prefix;
|
||||
int found=0;
|
||||
|
||||
my_strdup(1611, &symname_pin, tcleval("rel_sym_path [find_file lab_pin.sym]"));
|
||||
my_strdup(1607, &symname_wire, tcleval("rel_sym_path [find_file lab_wire.sym]"));
|
||||
my_strdup(_ALLOC_ID_, &symname_pin, tcleval("rel_sym_path [find_file lab_pin.sym]"));
|
||||
my_strdup(_ALLOC_ID_, &symname_wire, tcleval("rel_sym_path [find_file lab_wire.sym]"));
|
||||
if(symname_pin && symname_wire) {
|
||||
rebuild_selected_array();
|
||||
k = xctx->lastsel;
|
||||
|
|
@ -808,7 +808,7 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
|
|||
prepare_netlist_structs(0);
|
||||
for(j=0;j<k;j++) if(xctx->sel_array[j].type==ELEMENT) {
|
||||
found=1;
|
||||
my_strdup(5, &prop, xctx->inst[xctx->sel_array[j].n].instname);
|
||||
my_strdup(_ALLOC_ID_, &prop, xctx->inst[xctx->sel_array[j].n].instname);
|
||||
my_strcat(6, &prop, "_");
|
||||
tclsetvar("custom_label_prefix",prop);
|
||||
|
||||
|
|
@ -817,7 +817,7 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
|
|||
tcleval("attach_labels_to_inst");
|
||||
if(!strcmp(tclgetvar("rcode"),"") ) {
|
||||
bbox(END, 0., 0., 0., 0.);
|
||||
my_free(706, &prop);
|
||||
my_free(_ALLOC_ID_, &prop);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -831,7 +831,7 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
|
|||
use_label_prefix = atoi(tclgetvar("use_label_prefix"));
|
||||
rot_txt = tclgetvar("rotated_text");
|
||||
if(strcmp(rot_txt,"")) rotated_text=atoi(rot_txt);
|
||||
my_strdup(7, &type,(xctx->inst[xctx->sel_array[j].n].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[xctx->sel_array[j].n].ptr+ xctx->sym)->type);
|
||||
if( type && IS_LABEL_OR_PIN(type) ) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -851,7 +851,7 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
|
|||
rct=symbol->rect[PINLAYER];
|
||||
|
||||
for(i=0;i<npin;i++) {
|
||||
my_strdup(8, &labname,get_tok_value(rct[i].prop_ptr,"name",1));
|
||||
my_strdup(_ALLOC_ID_, &labname,get_tok_value(rct[i].prop_ptr,"name",1));
|
||||
dbg(1,"attach_labels_to_inst(): 2 --> labname=%s\n", labname);
|
||||
|
||||
pinx0 = (rct[i].x1+rct[i].x2)/2;
|
||||
|
|
@ -895,7 +895,7 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
|
|||
wptr = wptr->next;
|
||||
}
|
||||
if(!skip) {
|
||||
my_strdup(9, &prop, "name=p1 lab=");
|
||||
my_strdup(_ALLOC_ID_, &prop, "name=p1 lab=");
|
||||
if(use_label_prefix) {
|
||||
my_strcat(10, &prop, (char *)tclgetvar("custom_label_prefix"));
|
||||
}
|
||||
|
|
@ -920,9 +920,9 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
|
|||
dbg(1, "attach_labels_to_inst(): %d %.16g %.16g %s\n", i, pinx0, piny0,labname);
|
||||
}
|
||||
}
|
||||
my_free(707, &prop);
|
||||
my_free(708, &labname);
|
||||
my_free(709, &type);
|
||||
my_free(_ALLOC_ID_, &prop);
|
||||
my_free(_ALLOC_ID_, &labname);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
if(!found) return;
|
||||
/* draw things */
|
||||
bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
|
|
@ -932,8 +932,8 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
|
|||
fprintf(errfp, "attach_labels_to_inst(): location of schematic labels not found\n");
|
||||
tcleval("alert_ {attach_labels_to_inst(): location of schematic labels not found} {}");
|
||||
}
|
||||
my_free(1609, &symname_pin);
|
||||
my_free(1610, &symname_wire);
|
||||
my_free(_ALLOC_ID_, &symname_pin);
|
||||
my_free(_ALLOC_ID_, &symname_wire);
|
||||
}
|
||||
|
||||
void delete_files(void)
|
||||
|
|
@ -1012,7 +1012,7 @@ int place_symbol(int pos, const char *symbol_name, double x, double y, short rot
|
|||
xctx->inst[n].instname=NULL;
|
||||
xctx->inst[n].lab=NULL;
|
||||
dbg(1, "place_symbol(): entering my_strdup: name=%s\n",name); /* 03-02-2000 */
|
||||
my_strdup2(12, &xctx->inst[n].name ,name);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[n].name ,name);
|
||||
dbg(1, "place_symbol(): done my_strdup: name=%s\n",name); /* 03-02-2000 */
|
||||
/* xctx->inst[n].x0=symbol_name ? x : xctx->mousex_snap; */
|
||||
/* xctx->inst[n].y0=symbol_name ? y : xctx->mousey_snap; */
|
||||
|
|
@ -1041,7 +1041,7 @@ int place_symbol(int pos, const char *symbol_name, double x, double y, short rot
|
|||
type = xctx->sym[xctx->inst[n].ptr].type;
|
||||
cond= !type || !IS_LABEL_SH_OR_PIN(type);
|
||||
if(cond) xctx->inst[n].flags|=2;
|
||||
else my_strdup(145, &xctx->inst[n].lab, get_tok_value(xctx->inst[n].prop_ptr,"lab",0));
|
||||
else my_strdup(_ALLOC_ID_, &xctx->inst[n].lab, get_tok_value(xctx->inst[n].prop_ptr,"lab",0));
|
||||
xctx->inst[n].embed = !strcmp(get_tok_value(xctx->inst[n].prop_ptr, "embed", 2), "true");
|
||||
if(first_call && (draw_sym & 3) ) bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
xctx->instances++; /* must be updated before calling symbol_bbox() */
|
||||
|
|
@ -1190,25 +1190,25 @@ void get_sch_from_sym(char *filename, xSymbol *sym)
|
|||
strstr(xctx->current_dirname, "https://") == xctx->current_dirname) {
|
||||
web_url = 1;
|
||||
}
|
||||
my_strdup2(1646, &str_tmp, get_tok_value(sym->prop_ptr, "schematic", 2));
|
||||
my_strdup2(_ALLOC_ID_, &str_tmp, get_tok_value(sym->prop_ptr, "schematic", 2));
|
||||
if(str_tmp[0]) {
|
||||
/* @symname in schematic attribute will be replaced with symbol name */
|
||||
if( (ptr = strstr(str_tmp, "@symname"))) {
|
||||
*ptr = '\0';
|
||||
my_strdup2(1648, &sch, str_tmp);
|
||||
my_strdup2(_ALLOC_ID_, &sch, str_tmp);
|
||||
my_strcat(1649, &sch, sym->name);
|
||||
ptr += 8;
|
||||
my_strcat(1650, &sch, ptr);
|
||||
} else {
|
||||
my_strdup2(1252, &sch, str_tmp);
|
||||
my_strdup2(_ALLOC_ID_, &sch, str_tmp);
|
||||
}
|
||||
dbg(1, "get_sch_from_sym(): sch=%s\n", sch);
|
||||
my_strdup2(1651, &sch, tcl_hook2(&sch));
|
||||
my_strdup2(_ALLOC_ID_, &sch, tcl_hook2(&sch));
|
||||
dbg(1, "get_sch_from_sym(): after tcl_hook2 sch=%s\n", sch);
|
||||
/* for schematics referenced from web symbols do not build absolute path */
|
||||
if(web_url) my_strncpy(filename, sch, PATH_MAX);
|
||||
else my_strncpy(filename, abs_sym_path(sch, ""), PATH_MAX);
|
||||
my_free(1253, &sch);
|
||||
my_free(_ALLOC_ID_, &sch);
|
||||
} else {
|
||||
if(tclgetboolvar("search_schematic")) {
|
||||
/* for schematics referenced from web symbols do not build absolute path */
|
||||
|
|
@ -1220,7 +1220,7 @@ void get_sch_from_sym(char *filename, xSymbol *sym)
|
|||
else my_strncpy(filename, add_ext(abs_sym_path(sym->name, ""), ".sch"), PATH_MAX);
|
||||
}
|
||||
}
|
||||
my_free(1647, &str_tmp);
|
||||
my_free(_ALLOC_ID_, &str_tmp);
|
||||
dbg(1, "get_sch_from_sym(): sym->name=%s, filename=%s\n", sym->name, filename);
|
||||
}
|
||||
|
||||
|
|
@ -1293,11 +1293,11 @@ int descend_schematic(int instnumber)
|
|||
str = "";
|
||||
inst_mult = 1;
|
||||
}
|
||||
my_strdup(14, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
xctx->sch_path_hash[xctx->currsch+1] =0;
|
||||
my_strdup(1516, &xctx->hier_attr[xctx->currsch].prop_ptr,
|
||||
my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].prop_ptr,
|
||||
xctx->inst[n].prop_ptr);
|
||||
my_strdup(1613, &xctx->hier_attr[xctx->currsch].templ,
|
||||
my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].templ,
|
||||
get_tok_value((xctx->inst[n].ptr+ xctx->sym)->prop_ptr, "template", 0));
|
||||
inst_number = 1;
|
||||
if(inst_mult > 1) { /* on multiple instances ask where to descend, to correctly evaluate
|
||||
|
|
@ -1311,7 +1311,7 @@ int descend_schematic(int instnumber)
|
|||
inum = tclresult();
|
||||
dbg(1, "descend_schematic(): inum=%s\n", inum);
|
||||
if(!inum[0]) {
|
||||
my_free(710, &xctx->sch_path[xctx->currsch+1]);
|
||||
my_free(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1]);
|
||||
xctx->sch_path_hash[xctx->currsch+1] =0;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2088,7 +2088,7 @@ void change_layer()
|
|||
if(xctx->rectcolor != xctx->text[n].layer) {
|
||||
char *p;
|
||||
set_modify(1);
|
||||
my_strdup(1386, &xctx->text[n].prop_ptr,
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[n].prop_ptr,
|
||||
subst_token(xctx->text[n].prop_ptr, "layer", dtoa(xctx->rectcolor) ));
|
||||
xctx->text[n].layer = xctx->rectcolor;
|
||||
p = xctx->text[n].prop_ptr;
|
||||
|
|
@ -2312,8 +2312,8 @@ void new_polygon(int what)
|
|||
|
||||
if(xctx->nl_points >= xctx->nl_maxpoints-1) { /* check storage for 2 xctx->nl_points */
|
||||
xctx->nl_maxpoints = (1+xctx->nl_points / CADCHUNKALLOC) * CADCHUNKALLOC;
|
||||
my_realloc(17, &xctx->nl_polyx, sizeof(double)*xctx->nl_maxpoints);
|
||||
my_realloc(18, &xctx->nl_polyy, sizeof(double)*xctx->nl_maxpoints);
|
||||
my_realloc(_ALLOC_ID_, &xctx->nl_polyx, sizeof(double)*xctx->nl_maxpoints);
|
||||
my_realloc(_ALLOC_ID_, &xctx->nl_polyy, sizeof(double)*xctx->nl_maxpoints);
|
||||
}
|
||||
if( what & PLACE )
|
||||
{
|
||||
|
|
@ -2360,8 +2360,8 @@ void new_polygon(int what)
|
|||
drawtemppolygon(xctx->gc[xctx->rectcolor], NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points);
|
||||
xctx->ui_state &= ~STARTPOLYGON;
|
||||
drawpolygon(xctx->rectcolor, NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points, 0, 0);
|
||||
my_free(711, &xctx->nl_polyx);
|
||||
my_free(712, &xctx->nl_polyy);
|
||||
my_free(_ALLOC_ID_, &xctx->nl_polyx);
|
||||
my_free(_ALLOC_ID_, &xctx->nl_polyy);
|
||||
xctx->nl_maxpoints = xctx->nl_points = 0;
|
||||
}
|
||||
if(what & RUBBER)
|
||||
|
|
@ -2400,7 +2400,7 @@ int text_bbox(const char *str, double xscale, double yscale,
|
|||
ww=0.; hh=1.;
|
||||
c=0;
|
||||
*cairo_lines=1;
|
||||
my_strdup2(1158, &s, str);
|
||||
my_strdup2(_ALLOC_ID_, &s, str);
|
||||
str_ptr = s;
|
||||
while( s && s[c] ) {
|
||||
if(s[c] == '\n') {
|
||||
|
|
@ -2423,7 +2423,7 @@ int text_bbox(const char *str, double xscale, double yscale,
|
|||
maxw = ext.x_advance > ext.width ? ext.x_advance : ext.width;
|
||||
if(maxw > ww) ww= maxw;
|
||||
}
|
||||
my_free(1159, &s);
|
||||
my_free(_ALLOC_ID_, &s);
|
||||
hh = hh*fext.height * cairo_font_line_spacing;
|
||||
*cairo_longest_line = ww;
|
||||
|
||||
|
|
@ -2580,7 +2580,7 @@ int place_text(int draw_text, double mx, double my)
|
|||
t->txt_ptr=NULL;
|
||||
t->prop_ptr=NULL; /* 20111006 added missing initialization of pointer */
|
||||
t->font=NULL;
|
||||
my_strdup(19, &t->txt_ptr, txt);
|
||||
my_strdup(_ALLOC_ID_, &t->txt_ptr, txt);
|
||||
t->x0=mx;
|
||||
t->y0=my;
|
||||
t->rot=0;
|
||||
|
|
@ -2588,7 +2588,7 @@ int place_text(int draw_text, double mx, double my)
|
|||
t->sel=0;
|
||||
t->xscale= atof(tclgetvar("hsize"));
|
||||
t->yscale= atof(tclgetvar("vsize"));
|
||||
my_strdup(20, &t->prop_ptr, (char *)tclgetvar("props"));
|
||||
my_strdup(_ALLOC_ID_, &t->prop_ptr, (char *)tclgetvar("props"));
|
||||
/* debug ... */
|
||||
/* t->prop_ptr=NULL; */
|
||||
dbg(1, "place_text(): done text input\n");
|
||||
|
|
@ -2611,7 +2611,7 @@ int place_text(int draw_text, double mx, double my)
|
|||
str = get_tok_value(t->prop_ptr, "hide", 0);
|
||||
t->flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
|
||||
|
||||
my_strdup(21, &t->font, get_tok_value(t->prop_ptr, "font", 0));
|
||||
my_strdup(_ALLOC_ID_, &t->font, get_tok_value(t->prop_ptr, "font", 0));
|
||||
textlayer = t->layer;
|
||||
if(textlayer < 0 || textlayer >= cadlayers) textlayer = TEXTLAYER;
|
||||
#if HAS_CAIRO==1
|
||||
|
|
|
|||
124
src/callback.c
124
src/callback.c
|
|
@ -575,8 +575,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
if(fabs(xctx->my_double_save - xctx->mousey_snap) > fabs(gr->dcy * delta) * delta_threshold) {
|
||||
yy1 = gr->ypos1 + (xctx->my_double_save - xctx->mousey_snap) / gr->dcy;
|
||||
yy2 = gr->ypos2 + (xctx->my_double_save - xctx->mousey_snap) / gr->dcy;
|
||||
my_strdup(1424, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
|
||||
my_strdup(1425, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
|
||||
xctx->my_double_save = xctx->mousey_snap;
|
||||
need_redraw = 1;
|
||||
}
|
||||
|
|
@ -586,8 +586,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
if(fabs(xctx->my_double_save - xctx->mousey_snap) > fabs(gr->cy * delta) * delta_threshold) {
|
||||
yy1 = gr->gy1 + (xctx->my_double_save - xctx->mousey_snap) / gr->cy;
|
||||
yy2 = gr->gy2 + (xctx->my_double_save - xctx->mousey_snap) / gr->cy;
|
||||
my_strdup(1435, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(1437, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
xctx->my_double_save = xctx->mousey_snap;
|
||||
need_redraw = 1;
|
||||
}
|
||||
|
|
@ -603,8 +603,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
if(fabs(xctx->mx_double_save - xctx->mousex_snap) > fabs(gr->cx * delta) * delta_threshold) {
|
||||
xx1 = gr->gx1 + (xctx->mx_double_save - xctx->mousex_snap) / gr->cx;
|
||||
xx2 = gr->gx2 + (xctx->mx_double_save - xctx->mousex_snap) / gr->cx;
|
||||
my_strdup(1410, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1411, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -618,16 +618,16 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
delta = gr->posh * 0.05;
|
||||
yy1 = gr->ypos1 + delta;
|
||||
yy2 = gr->ypos2 + delta;
|
||||
my_strdup(1456, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
|
||||
my_strdup(1457, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
|
||||
need_redraw = 1;
|
||||
} else {
|
||||
delta = gr->gh/ gr->divy;
|
||||
delta_threshold = 1.0;
|
||||
yy1 = gr->gy1 + delta * delta_threshold;
|
||||
yy2 = gr->gy2 + delta * delta_threshold;
|
||||
my_strdup(1420, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(1421, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -638,8 +638,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
delta_threshold = 0.05;
|
||||
xx1 = gr->gx1 - delta * delta_threshold;
|
||||
xx2 =gr->gx2 - delta * delta_threshold;
|
||||
my_strdup(1428, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1429, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -649,7 +649,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
const char *unlocked = strstr(get_tok_value(r->prop_ptr, "flags", 0), "unlocked");
|
||||
if(i == xctx->graph_master || !unlocked) {
|
||||
gr->dataset = track_dset;
|
||||
my_strdup(1448, &r->prop_ptr, subst_token(r->prop_ptr, "dataset", my_itoa(track_dset)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "dataset", my_itoa(track_dset)));
|
||||
}
|
||||
if((xctx->graph_flags & 4) && tclgetboolvar("live_cursor2_backannotate")) {
|
||||
if(i == xctx->graph_master) backannotate_at_cursor_b_pos(r, gr);
|
||||
|
|
@ -671,8 +671,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
double var = delta * 0.2;
|
||||
yy2 = gr->gy2 + var * b / delta;
|
||||
yy1 = gr->gy1 - var * a / delta;
|
||||
my_strdup(1451, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(1517, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -680,8 +680,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
delta_threshold = 0.05;
|
||||
xx1 = gr->gx1 - delta * delta_threshold;
|
||||
xx2 = gr->gx2 - delta * delta_threshold;
|
||||
my_strdup(1395, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1396, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -693,16 +693,16 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
delta = gr->posh * 0.05;
|
||||
yy1 = gr->ypos1 - delta;
|
||||
yy2 = gr->ypos2 - delta;
|
||||
my_strdup(1416, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
|
||||
my_strdup(1417, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
|
||||
need_redraw = 1;
|
||||
} else {
|
||||
delta = gr->gh / gr->divy;
|
||||
delta_threshold = 1.0;
|
||||
yy1 = gr->gy1 - delta * delta_threshold;
|
||||
yy2 = gr->gy2 - delta * delta_threshold;
|
||||
my_strdup(1458, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(1434, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -713,8 +713,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
delta_threshold = 0.05;
|
||||
xx1 = gr->gx1 + delta * delta_threshold;
|
||||
xx2 = gr->gx2 + delta * delta_threshold;
|
||||
my_strdup(1397, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1398, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -730,8 +730,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
double var = delta * 0.2;
|
||||
yy2 = gr->gy2 - var * b / delta;
|
||||
yy1 = gr->gy1 + var * a / delta;
|
||||
my_strdup(1433, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(1439, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -739,8 +739,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
delta_threshold = 0.05;
|
||||
xx1 = gr->gx1 + delta * delta_threshold;
|
||||
xx2 = gr->gx2 + delta * delta_threshold;
|
||||
my_strdup(1430, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1431, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -755,8 +755,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
double var = delta * 0.05;
|
||||
yy2 = gr->ypos2 + var * b / delta;
|
||||
yy1 = gr->ypos1 - var * a / delta;
|
||||
my_strdup(1461, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
|
||||
my_strdup(1459, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
|
||||
need_redraw = 1;
|
||||
|
||||
} else {
|
||||
|
|
@ -767,8 +767,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
double var = delta * 0.2;
|
||||
yy2 = gr->gy2 + var * b / delta;
|
||||
yy1 = gr->gy1 - var * a / delta;
|
||||
my_strdup(1460, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(1438, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -778,8 +778,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
double var = 0.2 * gr->gw;
|
||||
xx2 = gr->gx2 + var * (1 - zoom_m);
|
||||
xx1 = gr->gx1 - var * zoom_m;
|
||||
my_strdup(1399, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1400, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -791,8 +791,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
double var = 0.2 * gr->gw;
|
||||
xx2 = gr->gx2 + var * (1 - zoom_m);
|
||||
xx1 = gr->gx1 - var * zoom_m;
|
||||
my_strdup(1418, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1432, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -808,8 +808,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
double var = delta * 0.05;
|
||||
yy2 = gr->ypos2 - var * b / delta;
|
||||
yy1 = gr->ypos1 + var * a / delta;
|
||||
my_strdup(1447, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
|
||||
my_strdup(1436, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
|
||||
need_redraw = 1;
|
||||
} else {
|
||||
double m = G_Y(xctx->mousey);
|
||||
|
|
@ -819,8 +819,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
double var = delta * 0.2;
|
||||
yy2 = gr->gy2 - var * b / delta;
|
||||
yy1 = gr->gy1 + var * a / delta;
|
||||
my_strdup(1419, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(1444, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -830,8 +830,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
double var = 0.2 * gr->gw;
|
||||
xx2 = gr->gx2 - var * (1 - zoom_m);
|
||||
xx1 = gr->gx1 + var * zoom_m;
|
||||
my_strdup(1449, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1450, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -843,8 +843,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
double var = 0.2 * gr->gw;
|
||||
xx2 = gr->gx2 - var * (1 - zoom_m);
|
||||
xx1 = gr->gx1 + var * zoom_m;
|
||||
my_strdup(1445, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1446, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -862,8 +862,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
double min=0.0, max=0.0;
|
||||
int first = 1;
|
||||
char *saves, *sptr, *stok, *sweep = NULL, *saven, *nptr, *ntok, *node = NULL;
|
||||
my_strdup2(1426, &node, get_tok_value(r->prop_ptr,"node",0));
|
||||
my_strdup2(542, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
|
||||
my_strdup2(_ALLOC_ID_, &node, get_tok_value(r->prop_ptr,"node",0));
|
||||
my_strdup2(_ALLOC_ID_, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
|
||||
nptr = node;
|
||||
sptr = sweep;
|
||||
start = (gr->gx1 <= gr->gx2) ? gr->gx1 : gr->gx2;
|
||||
|
|
@ -881,9 +881,9 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
if(!bus_msb) {
|
||||
char *express = NULL;
|
||||
if(strstr(ntok, ";")) {
|
||||
my_strdup2(1505, &express, find_nth(ntok, ";", 2));
|
||||
my_strdup2(_ALLOC_ID_, &express, find_nth(ntok, ";", 2));
|
||||
} else {
|
||||
my_strdup2(1506, &express, ntok);
|
||||
my_strdup2(_ALLOC_ID_, &express, ntok);
|
||||
}
|
||||
if(strpbrk(express, " \n\t")) {
|
||||
/* just probe a single point to get the index. custom data column already calculated */
|
||||
|
|
@ -891,7 +891,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
} else {
|
||||
j = get_raw_index(express);
|
||||
}
|
||||
my_free(1507, &express);
|
||||
my_free(_ALLOC_ID_, &express);
|
||||
}
|
||||
if(j >= 0) {
|
||||
int ofs = 0;
|
||||
|
|
@ -918,15 +918,15 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
if(max == min) max += 0.01;
|
||||
min = floor_to_n_digits(min, 2);
|
||||
max = ceil_to_n_digits(max, 2);
|
||||
my_free(1427, &node);
|
||||
my_free(573, &sweep);
|
||||
my_strdup(1422, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(min)));
|
||||
my_strdup(1423, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(max)));
|
||||
my_free(_ALLOC_ID_, &node);
|
||||
my_free(_ALLOC_ID_, &sweep);
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(min)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(max)));
|
||||
need_redraw = 1;
|
||||
} else { /* digital plot */
|
||||
my_strdup(1497, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1",
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1",
|
||||
get_tok_value(r->prop_ptr, "y1", 0) ));
|
||||
my_strdup(1498, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2",
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2",
|
||||
get_tok_value(r->prop_ptr, "y2", 0) ));
|
||||
need_redraw = 1;
|
||||
}
|
||||
|
|
@ -943,8 +943,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
xx1 = mylog10(xx1);
|
||||
xx2 = mylog10(xx2);
|
||||
}
|
||||
my_strdup(1409, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1412, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -979,8 +979,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
xx2 = pp + delta / 2.0;
|
||||
*/
|
||||
|
||||
my_strdup(1442, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1443, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1008,8 +1008,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
if(xx1 == xx2) xx2 += 1e-6;
|
||||
*/
|
||||
|
||||
my_strdup(1440, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(1441, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
|
||||
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
|
||||
need_redraw = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -2051,11 +2051,11 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
|
|||
if(!tool) {
|
||||
tool = atoi(tclgetvar("sim(spicewave,default)"));
|
||||
my_snprintf(str, S(str), "sim(spicewave,%d,name)", tool);
|
||||
my_strdup(1271, &tool_name, tclgetvar(str));
|
||||
my_strdup(_ALLOC_ID_, &tool_name, tclgetvar(str));
|
||||
dbg(1,"callback(): tool_name=%s\n", tool_name);
|
||||
if(strstr(tool_name, "Gaw")) tool=GAW;
|
||||
else if(strstr(tool_name, "Bespice")) tool=BESPICE;
|
||||
my_free(1272, &tool_name);
|
||||
my_free(_ALLOC_ID_, &tool_name);
|
||||
}
|
||||
}
|
||||
if(tool) {
|
||||
|
|
|
|||
24
src/check.c
24
src/check.c
|
|
@ -189,14 +189,14 @@ void trim_wires(void)
|
|||
xctx->wire[xctx->wires].y2=y0;
|
||||
xctx->wire[xctx->wires].sel=0;
|
||||
xctx->wire[xctx->wires].prop_ptr=NULL;
|
||||
my_strdup(27, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[j].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[j].prop_ptr);
|
||||
if(!strcmp(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0), "true"))
|
||||
xctx->wire[xctx->wires].bus=1;
|
||||
else
|
||||
xctx->wire[xctx->wires].bus=0;
|
||||
xctx->wire[xctx->wires].node=NULL;
|
||||
|
||||
my_strdup(28, &xctx->wire[xctx->wires].node, xctx->wire[j].node);
|
||||
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].node, xctx->wire[j].node);
|
||||
xctx->wire[j].x1 = x0;
|
||||
xctx->wire[j].y1 = y0;
|
||||
hash_wire(XINSERT, xctx->wires, 0);
|
||||
|
|
@ -212,7 +212,7 @@ void trim_wires(void)
|
|||
}
|
||||
/* dbg(1, "trim_wires(): break: %g\n", timer(1)); */
|
||||
/* reduce included wires */
|
||||
my_realloc(29, &wireflag, xctx->wires*sizeof(unsigned short));
|
||||
my_realloc(_ALLOC_ID_, &wireflag, xctx->wires*sizeof(unsigned short));
|
||||
memset(wireflag, 0, xctx->wires*sizeof(unsigned short));
|
||||
for(i=0;i<xctx->wires;i++) {
|
||||
if(wireflag[i]) continue;
|
||||
|
|
@ -255,8 +255,8 @@ void trim_wires(void)
|
|||
if(wireflag[i]) {
|
||||
j++;
|
||||
/* hash_wire(XDELETE, i, 0);*/ /* can not be done since wire deletions change wire idexes in array */
|
||||
my_free(114, &xctx->wire[i].prop_ptr);
|
||||
my_free(368, &xctx->wire[i].node);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].node);
|
||||
continue;
|
||||
}
|
||||
if(j) {
|
||||
|
|
@ -273,7 +273,7 @@ void trim_wires(void)
|
|||
/* after wire deletions full rehash is needed */
|
||||
hash_wires();
|
||||
|
||||
my_realloc(30, &wireflag, xctx->wires*sizeof(unsigned short));
|
||||
my_realloc(_ALLOC_ID_, &wireflag, xctx->wires*sizeof(unsigned short));
|
||||
memset(wireflag, 0, xctx->wires*sizeof(unsigned short));
|
||||
/* dbg(1, "trim_wires(): hash_wires_2: %g\n", timer(1)); */
|
||||
|
||||
|
|
@ -351,8 +351,8 @@ void trim_wires(void)
|
|||
if(wireflag[i]) {
|
||||
j++;
|
||||
/* hash_wire(XDELETE, i, 0);*/ /* can not be done since wire deletions change wire idexes in array */
|
||||
my_free(116, &xctx->wire[i].prop_ptr);
|
||||
my_free(331, &xctx->wire[i].node);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].node);
|
||||
continue;
|
||||
}
|
||||
if(j) {
|
||||
|
|
@ -374,7 +374,7 @@ void trim_wires(void)
|
|||
}
|
||||
} while(changed);
|
||||
dbg(1, "trim_wires(): doloops=%d changed=%d\n", doloops, changed);
|
||||
my_free(115, &wireflag);
|
||||
my_free(_ALLOC_ID_, &wireflag);
|
||||
update_conn_cues(WIRELAYER, 0, 0);
|
||||
}
|
||||
|
||||
|
|
@ -413,14 +413,14 @@ void break_wires_at_pins(void)
|
|||
xctx->wire[xctx->wires].y2=y0;
|
||||
xctx->wire[xctx->wires].sel=0;
|
||||
xctx->wire[xctx->wires].prop_ptr=NULL;
|
||||
my_strdup(31, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
|
||||
if(!strcmp(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0), "true"))
|
||||
xctx->wire[xctx->wires].bus=1;
|
||||
else
|
||||
xctx->wire[xctx->wires].bus=0;
|
||||
xctx->wire[xctx->wires].node=NULL;
|
||||
hash_wire(XINSERT, xctx->wires, 0); /* insertion happens at beginning of list */
|
||||
my_strdup(32, &xctx->wire[xctx->wires].node, xctx->wire[i].node);
|
||||
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].node, xctx->wire[i].node);
|
||||
xctx->need_reb_sel_arr=1;
|
||||
xctx->wires++;
|
||||
xctx->wire[i].x1 = x0;
|
||||
|
|
@ -469,7 +469,7 @@ void break_wires_at_pins(void)
|
|||
xctx->wire[xctx->wires].y2=y0;
|
||||
xctx->wire[xctx->wires].sel=0;
|
||||
xctx->wire[xctx->wires].prop_ptr=NULL;
|
||||
my_strdup(33, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
|
||||
if(!strcmp(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0), "true"))
|
||||
xctx->wire[xctx->wires].bus=1;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/gawk -f
|
||||
# replaces _ALLOC_ID_ in all source files with unique ID for memory tracking
|
||||
|
||||
BEGIN{
|
||||
|
||||
if(ARGC <= 1) {
|
||||
print "Usage: " ENVIRON["_"] " create|reset"
|
||||
exit
|
||||
}
|
||||
create_id = 0
|
||||
if(ARGV[1] == "create") create_id = 1
|
||||
ARGC = 1
|
||||
cnt = 0;
|
||||
while("ls *.[chyl]" |getline) {
|
||||
if($0 ~ /expandlabel\.c/) continue
|
||||
if($0 ~ /expandlabel\.h/) continue
|
||||
if($0 ~ /parselabel\.c/) continue
|
||||
filename = $0
|
||||
f = ""
|
||||
start = 1
|
||||
changed = 0
|
||||
while(getline < filename) {
|
||||
if(create_id == 0) {
|
||||
if(!start) f = f "\n"
|
||||
start = 0
|
||||
str = gensub(/(my_(malloc|calloc|realloc|free|strdup|strdup2))\([0-9]+,/, "\\1(_ALLOC_ID_,", "G")
|
||||
if(str != $0) changed = 1
|
||||
f = f str
|
||||
} else {
|
||||
if(!start) f = f "\n"
|
||||
start = 0
|
||||
if($0 !~ /^#define *_ALLOC_ID_/) {
|
||||
while(sub(/_ALLOC_ID_/, cnt)) {
|
||||
changed = 1
|
||||
cnt++
|
||||
}
|
||||
}
|
||||
f = f $0
|
||||
}
|
||||
}
|
||||
close(filename)
|
||||
if(changed) {
|
||||
print f > filename
|
||||
close(filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
142
src/draw.c
142
src/draw.c
|
|
@ -304,7 +304,7 @@ void draw_string(int layer, int what, const char *str, short rot, short flip, in
|
|||
dbg(1, "draw_string(): size * mooz=%g height=%g ascent=%g descent=%g\n",
|
||||
size * xctx->mooz, fext.height, fext.ascent, fext.descent);
|
||||
llength=0;
|
||||
my_strdup2(73, &sss, str);
|
||||
my_strdup2(_ALLOC_ID_, &sss, str);
|
||||
tt=ss=sss;
|
||||
for(;;) {
|
||||
c=*ss;
|
||||
|
|
@ -325,7 +325,7 @@ void draw_string(int layer, int what, const char *str, short rot, short flip, in
|
|||
}
|
||||
ss++;
|
||||
}
|
||||
my_free(1157, &sss);
|
||||
my_free(_ALLOC_ID_, &sss);
|
||||
}
|
||||
|
||||
#else /* !HAS_CAIRO */
|
||||
|
|
@ -504,16 +504,16 @@ void draw_symbol(int what,int c, int n,int layer,short tmp_flip, short rot,
|
|||
for(j=0;j< symptr->polygons[layer];j++)
|
||||
{
|
||||
polygon = &(symptr->poly[layer])[j];
|
||||
x = my_malloc(34, sizeof(double) * polygon->points);
|
||||
y = my_malloc(35, sizeof(double) * polygon->points);
|
||||
x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
|
||||
y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
|
||||
for(k=0;k<polygon->points;k++) {
|
||||
ROTATION(rot, flip, 0.0,0.0,polygon->x[k],polygon->y[k],x[k],y[k]);
|
||||
x[k]+= x0;
|
||||
y[k] += y0;
|
||||
}
|
||||
drawpolygon(c, NOW, x, y, polygon->points, polygon->fill, polygon->dash); /* added fill */
|
||||
my_free(718, &x);
|
||||
my_free(719, &y);
|
||||
my_free(_ALLOC_ID_, &x);
|
||||
my_free(_ALLOC_ID_, &y);
|
||||
}
|
||||
for(j=0;j< symptr->arcs[layer];j++)
|
||||
{
|
||||
|
|
@ -683,16 +683,16 @@ void draw_temp_symbol(int what, GC gc, int n,int layer,short tmp_flip, short rot
|
|||
|
||||
{ /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */
|
||||
int k;
|
||||
double *x = my_malloc(36, sizeof(double) * polygon->points);
|
||||
double *y = my_malloc(37, sizeof(double) * polygon->points);
|
||||
double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
|
||||
double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
|
||||
for(k=0;k<polygon->points;k++) {
|
||||
ROTATION(rot, flip, 0.0,0.0,polygon->x[k],polygon->y[k],x[k],y[k]);
|
||||
x[k] += x0;
|
||||
y[k] += y0;
|
||||
}
|
||||
drawtemppolygon(gc, NOW, x, y, polygon->points);
|
||||
my_free(720, &x);
|
||||
my_free(721, &y);
|
||||
my_free(_ALLOC_ID_, &x);
|
||||
my_free(_ALLOC_ID_, &y);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1504,7 +1504,7 @@ void drawpolygon(int c, int what, double *x, double *y, int points, int poly_fil
|
|||
return;
|
||||
}
|
||||
if(!xctx->only_probes && (x2-x1)<1.0 && (y2-y1)<1.0) return;
|
||||
p = my_malloc(38, sizeof(XPoint) * points);
|
||||
p = my_malloc(_ALLOC_ID_, sizeof(XPoint) * points);
|
||||
if(what) {
|
||||
for(i=0;i<points; i++) {
|
||||
clip_xy_to_short(X_TO_SCREEN(x[i]), Y_TO_SCREEN(y[i]), &sx, &sy);
|
||||
|
|
@ -1536,7 +1536,7 @@ void drawpolygon(int c, int what, double *x, double *y, int points, int poly_fil
|
|||
if(dash) {
|
||||
XSetLineAttributes (display, xctx->gc[c], INT_WIDTH(xctx->lw) ,LineSolid, LINECAP , LINEJOIN);
|
||||
}
|
||||
my_free(722, &p);
|
||||
my_free(_ALLOC_ID_, &p);
|
||||
}
|
||||
|
||||
void drawtemppolygon(GC g, int what, double *x, double *y, int points)
|
||||
|
|
@ -1551,7 +1551,7 @@ void drawtemppolygon(GC g, int what, double *x, double *y, int points)
|
|||
y1=Y_TO_SCREEN(y1);
|
||||
x2=X_TO_SCREEN(x2);
|
||||
y2=Y_TO_SCREEN(y2);
|
||||
p = my_malloc(39, sizeof(XPoint) * points);
|
||||
p = my_malloc(_ALLOC_ID_, sizeof(XPoint) * points);
|
||||
if( rectclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,&x1,&y1,&x2,&y2) ) {
|
||||
for(i=0;i<points; i++) {
|
||||
clip_xy_to_short(X_TO_SCREEN(x[i]), Y_TO_SCREEN(y[i]), &sx, &sy);
|
||||
|
|
@ -1560,7 +1560,7 @@ void drawtemppolygon(GC g, int what, double *x, double *y, int points)
|
|||
}
|
||||
XDrawLines(display, xctx->window, g, p, points, CoordModeOrigin);
|
||||
}
|
||||
my_free(723, &p);
|
||||
my_free(_ALLOC_ID_, &p);
|
||||
}
|
||||
|
||||
void drawrect(int c, int what, double rectx1,double recty1,double rectx2,double recty2, int dash)
|
||||
|
|
@ -1834,9 +1834,9 @@ static SPICE_DATA **get_bus_idx_array(const char *ntok, int *n_bits)
|
|||
*n_bits = count_items(ntok, ";,", "") - 1;
|
||||
/* dbg(0, "get_bus_idx_array(): ntok=%s\n", ntok); */
|
||||
/* dbg(0, "get_bus_idx_array(): *n_bits=%d\n", *n_bits); */
|
||||
idx_arr = my_malloc(1454, (*n_bits) * sizeof(SPICE_DATA *));
|
||||
idx_arr = my_malloc(_ALLOC_ID_, (*n_bits) * sizeof(SPICE_DATA *));
|
||||
p = 0;
|
||||
my_strdup2(1402, &ntok_copy, ntok);
|
||||
my_strdup2(_ALLOC_ID_, &ntok_copy, ntok);
|
||||
nptr = ntok_copy;
|
||||
my_strtok_r(nptr, ";,", "", &saven); /*strip off bus name (1st field) */
|
||||
while( (bit_name = my_strtok_r(NULL, ";,", "", &saven)) ) {
|
||||
|
|
@ -1850,7 +1850,7 @@ static SPICE_DATA **get_bus_idx_array(const char *ntok, int *n_bits)
|
|||
/* dbg(0, "get_bus_idx_array(): bit_name=%s, p=%d\n", bit_name, p); */
|
||||
p++;
|
||||
}
|
||||
my_free(1404, &ntok_copy);
|
||||
my_free(_ALLOC_ID_, &ntok_copy);
|
||||
return idx_arr;
|
||||
}
|
||||
|
||||
|
|
@ -2333,18 +2333,18 @@ static void draw_graph_variables(int wcnt, int wave_color, int n_nodes, int swee
|
|||
char *ntok_ptr = NULL;
|
||||
char *alias_ptr = NULL;
|
||||
if(strstr(ntok, ";")) {
|
||||
my_strdup2(646, &alias_ptr, find_nth(ntok, ";", 1));
|
||||
my_strdup2(665, &ntok_ptr, find_nth(ntok, ";", 2));
|
||||
my_strdup2(_ALLOC_ID_, &alias_ptr, find_nth(ntok, ";", 1));
|
||||
my_strdup2(_ALLOC_ID_, &ntok_ptr, find_nth(ntok, ";", 2));
|
||||
}
|
||||
else {
|
||||
my_strdup2(925, &alias_ptr, ntok);
|
||||
my_strdup2(1155, &ntok_ptr, ntok);
|
||||
my_strdup2(_ALLOC_ID_, &alias_ptr, ntok);
|
||||
my_strdup2(_ALLOC_ID_, &ntok_ptr, ntok);
|
||||
}
|
||||
|
||||
if(gr->unity != 1.0) my_snprintf(tmpstr, S(tmpstr), "%s[%c]", alias_ptr, gr->unity_suffix);
|
||||
else my_snprintf(tmpstr, S(tmpstr), "%s", alias_ptr);
|
||||
my_free(1188, &alias_ptr);
|
||||
my_free(1189, &ntok_ptr);
|
||||
my_free(_ALLOC_ID_, &alias_ptr);
|
||||
my_free(_ALLOC_ID_, &ntok_ptr);
|
||||
}
|
||||
if(gr->digital) {
|
||||
double xt = gr->x1 - 15 * gr->txtsizelab;
|
||||
|
|
@ -2474,8 +2474,8 @@ int embed_rawfile(const char *rawfile)
|
|||
xctx->push_undo();
|
||||
set_modify(1);
|
||||
ptr = base64_from_file(rawfile, &len);
|
||||
my_strdup2(1466, &i->prop_ptr, subst_token(i->prop_ptr, "spice_data", ptr));
|
||||
my_free(1481, &ptr);
|
||||
my_strdup2(_ALLOC_ID_, &i->prop_ptr, subst_token(i->prop_ptr, "spice_data", ptr));
|
||||
my_free(_ALLOC_ID_, &ptr);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
@ -2499,9 +2499,9 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
|
|||
xRect *r = &xctx->rect[GRIDLAYER][i];
|
||||
|
||||
/* get plot data */
|
||||
my_strdup2(1491, &node, get_tok_value(r->prop_ptr,"node",0));
|
||||
my_strdup2(1492, &color, get_tok_value(r->prop_ptr,"color",0));
|
||||
my_strdup2(1493, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
|
||||
my_strdup2(_ALLOC_ID_, &node, get_tok_value(r->prop_ptr,"node",0));
|
||||
my_strdup2(_ALLOC_ID_, &color, get_tok_value(r->prop_ptr,"color",0));
|
||||
my_strdup2(_ALLOC_ID_, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
|
||||
nptr = node;
|
||||
cptr = color;
|
||||
sptr = sweep;
|
||||
|
|
@ -2539,10 +2539,10 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
|
|||
} else {
|
||||
if(gr->hilight_wave == wcnt) {
|
||||
gr->hilight_wave = -1;
|
||||
my_strdup2(1522, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
|
||||
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
|
||||
} else {
|
||||
gr->hilight_wave = wcnt;
|
||||
my_strdup2(1525, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
|
||||
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2564,19 +2564,19 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
|
|||
} else {
|
||||
if(gr->hilight_wave == wcnt) {
|
||||
gr->hilight_wave = -1;
|
||||
my_strdup2(1538, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
|
||||
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
|
||||
} else {
|
||||
gr->hilight_wave = wcnt;
|
||||
my_strdup2(1539, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
|
||||
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
wcnt++;
|
||||
} /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", &saven)) ) */
|
||||
my_free(1494, &node);
|
||||
my_free(1495, &color);
|
||||
my_free(1496, &sweep);
|
||||
my_free(_ALLOC_ID_, &node);
|
||||
my_free(_ALLOC_ID_, &color);
|
||||
my_free(_ALLOC_ID_, &sweep);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2663,8 +2663,8 @@ int find_closest_wave(int i, Graph_ctx *gr)
|
|||
yval = G_Y(xctx->mousey);
|
||||
xval = G_X(xctx->mousex);
|
||||
/* get data to plot */
|
||||
my_strdup2(474, &node, get_tok_value(r->prop_ptr,"node",0));
|
||||
my_strdup2(1012, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
|
||||
my_strdup2(_ALLOC_ID_, &node, get_tok_value(r->prop_ptr,"node",0));
|
||||
my_strdup2(_ALLOC_ID_, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
|
||||
nptr = node;
|
||||
sptr = sweep;
|
||||
/* process each node given in "node" attribute, get also associated sweep var if any*/
|
||||
|
|
@ -2686,9 +2686,9 @@ int find_closest_wave(int i, Graph_ctx *gr)
|
|||
expression = 0;
|
||||
if(xctx->graph_values) {
|
||||
if(strstr(ntok, ";")) {
|
||||
my_strdup2(1191, &express, find_nth(ntok, ";", 2));
|
||||
my_strdup2(_ALLOC_ID_, &express, find_nth(ntok, ";", 2));
|
||||
} else {
|
||||
my_strdup2(1192, &express, ntok);
|
||||
my_strdup2(_ALLOC_ID_, &express, ntok);
|
||||
}
|
||||
if(strpbrk(express, " \n\t")) {
|
||||
expression = 1;
|
||||
|
|
@ -2767,9 +2767,9 @@ int find_closest_wave(int i, Graph_ctx *gr)
|
|||
wcnt++;
|
||||
} /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", &saven)) ) */
|
||||
dbg(0, "closest dataset=%d\n", closest_dataset);
|
||||
if(express) my_free(1487, &express);
|
||||
my_free(478, &node);
|
||||
my_free(1262, &sweep);
|
||||
if(express) my_free(_ALLOC_ID_, &express);
|
||||
my_free(_ALLOC_ID_, &node);
|
||||
my_free(_ALLOC_ID_, &sweep);
|
||||
return closest_dataset;
|
||||
}
|
||||
|
||||
|
|
@ -2820,9 +2820,9 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
|
|||
/* graph box, gridlines and axes */
|
||||
draw_graph_grid(gr, ct);
|
||||
/* get data to plot */
|
||||
my_strdup2(1389, &node, get_tok_value(r->prop_ptr,"node",0));
|
||||
my_strdup2(1390, &color, get_tok_value(r->prop_ptr,"color",0));
|
||||
my_strdup2(1407, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
|
||||
my_strdup2(_ALLOC_ID_, &node, get_tok_value(r->prop_ptr,"node",0));
|
||||
my_strdup2(_ALLOC_ID_, &color, get_tok_value(r->prop_ptr,"color",0));
|
||||
my_strdup2(_ALLOC_ID_, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
|
||||
nptr = node;
|
||||
cptr = color;
|
||||
sptr = sweep;
|
||||
|
|
@ -2830,7 +2830,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
|
|||
/* process each node given in "node" attribute, get also associated color/sweep var if any*/
|
||||
while( (ntok = my_strtok_r(nptr, "\n\t ", "\"", &saven)) ) {
|
||||
if(strstr(ntok, ",")) {
|
||||
my_strdup2(1452, &bus_msb, find_nth(ntok, ";,", 2));
|
||||
my_strdup2(_ALLOC_ID_, &bus_msb, find_nth(ntok, ";,", 2));
|
||||
}
|
||||
ctok = my_strtok_r(cptr, " ", "", &savec);
|
||||
stok = my_strtok_r(sptr, "\t\n ", "\"", &saves);
|
||||
|
|
@ -2851,9 +2851,9 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
|
|||
expression = 0;
|
||||
if(xctx->graph_values && !bus_msb) {
|
||||
if(strstr(ntok, ";")) {
|
||||
my_strdup2(460, &express, find_nth(ntok, ";", 2));
|
||||
my_strdup2(_ALLOC_ID_, &express, find_nth(ntok, ";", 2));
|
||||
} else {
|
||||
my_strdup2(473, &express, ntok);
|
||||
my_strdup2(_ALLOC_ID_, &express, ntok);
|
||||
}
|
||||
if(strpbrk(express, " \n\t")) {
|
||||
expression = 1;
|
||||
|
|
@ -2892,7 +2892,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
|
|||
else wave_color = wc;
|
||||
first = -1;
|
||||
poly_npoints = 0;
|
||||
my_realloc(1401, &point, xctx->graph_npoints[dset] * sizeof(XPoint));
|
||||
my_realloc(_ALLOC_ID_, &point, xctx->graph_npoints[dset] * sizeof(XPoint));
|
||||
/* Process "npoints" simulation items
|
||||
* p loop split repeated 2 timed (for x and y points) to preserve cache locality */
|
||||
prev_prev_x = prev_x = 0;
|
||||
|
|
@ -2966,16 +2966,16 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
|
|||
if(measure_p != -1) show_node_measures(measure_p, measure_x, measure_prev_x, bus_msb, wave_color,
|
||||
idx, idx_arr, n_bits, n_nodes, ntok, wcnt, gr);
|
||||
|
||||
my_free(1403, &point);
|
||||
if(idx_arr) my_free(1455, &idx_arr);
|
||||
my_free(_ALLOC_ID_, &point);
|
||||
if(idx_arr) my_free(_ALLOC_ID_, &idx_arr);
|
||||
} /* if( expression || (idx = get_raw_index(bus_msb ? bus_msb : express)) != -1 ) */
|
||||
wcnt++;
|
||||
if(bus_msb) my_free(1453, &bus_msb);
|
||||
if(bus_msb) my_free(_ALLOC_ID_, &bus_msb);
|
||||
} /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", &saven)) ) */
|
||||
if(express) my_free(1520, &express);
|
||||
my_free(1391, &node);
|
||||
my_free(1392, &color);
|
||||
my_free(1408, &sweep);
|
||||
if(express) my_free(_ALLOC_ID_, &express);
|
||||
my_free(_ALLOC_ID_, &node);
|
||||
my_free(_ALLOC_ID_, &color);
|
||||
my_free(_ALLOC_ID_, &sweep);
|
||||
} /* if(flags & 8) */
|
||||
bbox(START, 0.0, 0.0, 0.0, 0.0);
|
||||
bbox(ADD, gr->rx1, gr->ry1, gr->rx2, gr->ry2);
|
||||
|
|
@ -3075,7 +3075,7 @@ static cairo_status_t png_writer(void *in_closure, const unsigned char *in_data,
|
|||
png_to_byte_closure_t *closure = (png_to_byte_closure_t *) in_closure;
|
||||
if(!in_data) return CAIRO_STATUS_WRITE_ERROR;
|
||||
if(closure->pos + length > closure->size) {
|
||||
my_realloc(1472, &closure->buffer, closure->pos + length + 65536);
|
||||
my_realloc(_ALLOC_ID_, &closure->buffer, closure->pos + length + 65536);
|
||||
closure->size = closure->pos + length + 65536;
|
||||
}
|
||||
memcpy(closure->buffer + closure->pos, in_data, length);
|
||||
|
|
@ -3122,7 +3122,7 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
|
|||
cairo_save(xctx->cairo_save_ctx);
|
||||
}
|
||||
my_strncpy(filename, get_tok_value(r->prop_ptr, "image", 0), S(filename));
|
||||
my_strdup(1484, &filter, get_tok_value(r->prop_ptr, "filter", 0));
|
||||
my_strdup(_ALLOC_ID_, &filter, get_tok_value(r->prop_ptr, "filter", 0));
|
||||
|
||||
/* read PNG from in-memory buffer ... */
|
||||
if(emb_ptr && emb_ptr->image) {
|
||||
|
|
@ -3137,7 +3137,7 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
|
|||
closure.buffer = NULL;
|
||||
filterdata = (char *)base64_decode(attr, strlen(attr), &filtersize);
|
||||
filter_data(filterdata, filtersize, (char **)&closure.buffer, &data_size, filter);
|
||||
my_free(1488, &filterdata);
|
||||
my_free(_ALLOC_ID_, &filterdata);
|
||||
} else {
|
||||
closure.buffer = base64_decode(attr, strlen(attr), &data_size);
|
||||
}
|
||||
|
|
@ -3145,7 +3145,7 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
|
|||
closure.size = data_size; /* should not be necessary */
|
||||
emb_ptr->image = cairo_image_surface_create_from_png_stream(png_reader, &closure);
|
||||
if(closure.buffer == NULL) dbg(0, "draw_image(): image creation failed\n");
|
||||
my_free(1467, &closure.buffer);
|
||||
my_free(_ALLOC_ID_, &closure.buffer);
|
||||
dbg(1, "draw_image(): length2 = %d\n", closure.pos);
|
||||
/* ... or read PNG from file (image attribute) */
|
||||
} else if(filename[0] && !stat(filename, &buf)) {
|
||||
|
|
@ -3161,7 +3161,7 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
|
|||
if(filtersize) {
|
||||
fd = fopen(filename, "r");
|
||||
if(fd) {
|
||||
filterdata = my_malloc(1490, filtersize);
|
||||
filterdata = my_malloc(_ALLOC_ID_, filtersize);
|
||||
fread(filterdata, filtersize, 1, fd);
|
||||
fclose(fd);
|
||||
}
|
||||
|
|
@ -3172,7 +3172,7 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
|
|||
closure.pos = 0;
|
||||
emb_ptr->image = cairo_image_surface_create_from_png_stream(png_reader, &closure);
|
||||
image_data = base64_encode((unsigned char *)filterdata, filtersize, &olength, 0);
|
||||
my_free(1489, &filterdata);
|
||||
my_free(_ALLOC_ID_, &filterdata);
|
||||
} else {
|
||||
closure.buffer = NULL;
|
||||
closure.size = 0;
|
||||
|
|
@ -3181,25 +3181,25 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
|
|||
/* write PNG to in-memory buffer */
|
||||
cairo_surface_write_to_png_stream(emb_ptr->image, png_writer, &closure);
|
||||
image_data = base64_encode(closure.buffer, closure.pos, &olength, 0);
|
||||
my_free(1468, &closure.buffer);
|
||||
my_free(_ALLOC_ID_, &closure.buffer);
|
||||
}
|
||||
/* put base64 encoded data to rect image_data attrinute */
|
||||
my_strdup2(1473, &r->prop_ptr, subst_token(r->prop_ptr, "image_data", image_data));
|
||||
my_free(1474, &image_data);
|
||||
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "image_data", image_data));
|
||||
my_free(_ALLOC_ID_, &image_data);
|
||||
if(cairo_surface_status(emb_ptr->image) != CAIRO_STATUS_SUCCESS) {
|
||||
my_free(442, &filter);
|
||||
my_free(_ALLOC_ID_, &filter);
|
||||
return;
|
||||
}
|
||||
dbg(1, "draw_image(): length3 = %d\n", closure.pos);
|
||||
} else {
|
||||
my_free(453, &filter);
|
||||
my_free(_ALLOC_ID_, &filter);
|
||||
return;
|
||||
}
|
||||
if(cairo_surface_status(emb_ptr->image) != CAIRO_STATUS_SUCCESS) {
|
||||
my_free(434, &filter);
|
||||
my_free(_ALLOC_ID_, &filter);
|
||||
return;
|
||||
}
|
||||
my_free(1485, &filter);
|
||||
my_free(_ALLOC_ID_, &filter);
|
||||
ptr = get_tok_value(r->prop_ptr, "alpha", 0);
|
||||
alpha = 1.0;
|
||||
if(ptr[0]) alpha = atof(ptr);
|
||||
|
|
@ -3334,7 +3334,7 @@ void svg_embedded_graph(FILE *fd, xRect *r, double rx1, double ry1, double rx2,
|
|||
closure.pos = 0;
|
||||
cairo_surface_write_to_png_stream(png_sfc, png_writer, &closure);
|
||||
ptr = base64_encode(closure.buffer, closure.pos, &olength, 1);
|
||||
my_free(1547, &closure.buffer);
|
||||
my_free(_ALLOC_ID_, &closure.buffer);
|
||||
cairo_surface_destroy(png_sfc);
|
||||
xctx->draw_pixmap=1;
|
||||
xctx->draw_window=save_draw_window;
|
||||
|
|
@ -3357,7 +3357,7 @@ void svg_embedded_graph(FILE *fd, xRect *r, double rx1, double ry1, double rx2,
|
|||
"xlink:href=\"data:image/png;base64,%s\"/>\n",
|
||||
0.0, 0.0, w, h, transform, ptr);
|
||||
}
|
||||
my_free(1546, &ptr);
|
||||
my_free(_ALLOC_ID_, &ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
114
src/editprop.c
114
src/editprop.c
|
|
@ -126,7 +126,7 @@ size_t my_strdup(int id, char **dest, const char *src) /* empty source string --
|
|||
dbg(3,"my_strdup(%d,): duplicated string %s\n", id, src);
|
||||
return len-1;
|
||||
} else if(*dest) {
|
||||
my_free(1146, dest);
|
||||
my_free(_ALLOC_ID_, dest);
|
||||
dbg(3,"my_strdup(%d,): freed destination ptr\n", id);
|
||||
}
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ void my_strndup(int id, char **dest, const char *src, size_t n) /* empty source
|
|||
{
|
||||
if(*dest!=NULL) {
|
||||
dbg(3," my_strndup: calling my_free\n");
|
||||
my_free(1147, dest);
|
||||
my_free(_ALLOC_ID_, dest);
|
||||
}
|
||||
if(src!=NULL && src[0]!='\0')
|
||||
{
|
||||
|
|
@ -303,7 +303,7 @@ size_t my_strdup2(int id, char **dest, const char *src) /* 20150409 duplicates a
|
|||
dbg(3,"my_strdup2(%d,): duplicated string %s\n", id, src);
|
||||
return len-1;
|
||||
} else if(*dest) {
|
||||
my_free(1148, dest);
|
||||
my_free(_ALLOC_ID_, dest);
|
||||
dbg(3,"my_strdup2(%d,): freed destination ptr\n", id);
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -584,12 +584,12 @@ void set_inst_prop(int i)
|
|||
ptr = (xctx->inst[i].ptr+ xctx->sym)->templ;
|
||||
dbg(1, "set_inst_prop(): i=%d, name=%s, prop_ptr = %s, template=%s\n",
|
||||
i, xctx->inst[i].name, xctx->inst[i].prop_ptr, ptr);
|
||||
my_strdup(69, &xctx->inst[i].prop_ptr, ptr);
|
||||
my_strdup2(70, &xctx->inst[i].instname, get_tok_value(ptr, "name",0));
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, ptr);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[i].instname, get_tok_value(ptr, "name",0));
|
||||
if(xctx->inst[i].instname[0]) {
|
||||
my_strdup(101, &tmp, xctx->inst[i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &tmp, xctx->inst[i].prop_ptr);
|
||||
new_prop_string(i, tmp, 0, tclgetboolvar("disable_unique_names"));
|
||||
my_free(724, &tmp);
|
||||
my_free(_ALLOC_ID_, &tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -600,7 +600,7 @@ static void edit_rect_property(int x)
|
|||
const char *dash, *fill;
|
||||
int preserve;
|
||||
char *oldprop=NULL;
|
||||
my_strdup(67, &oldprop, xctx->rect[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &oldprop, xctx->rect[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
|
||||
if(oldprop && oldprop[0]) {
|
||||
tclsetvar("retval",oldprop);
|
||||
} else {
|
||||
|
|
@ -629,7 +629,7 @@ static void edit_rect_property(int x)
|
|||
set_different_token(&xctx->rect[c][n].prop_ptr,
|
||||
(char *) tclgetvar("retval"), oldprop, 0, 0);
|
||||
} else {
|
||||
my_strdup(99, &xctx->rect[c][n].prop_ptr,
|
||||
my_strdup(_ALLOC_ID_, &xctx->rect[c][n].prop_ptr,
|
||||
(char *) tclgetvar("retval"));
|
||||
}
|
||||
set_rect_flags(&xctx->rect[c][n]); /* set cached .flags bitmask from on attributes */
|
||||
|
|
@ -665,7 +665,7 @@ static void edit_rect_property(int x)
|
|||
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
}
|
||||
}
|
||||
my_free(725, &oldprop);
|
||||
my_free(_ALLOC_ID_, &oldprop);
|
||||
}
|
||||
|
||||
static void edit_line_property(void)
|
||||
|
|
@ -674,7 +674,7 @@ static void edit_line_property(void)
|
|||
const char *dash;
|
||||
int preserve;
|
||||
char *oldprop=NULL;
|
||||
my_strdup(46, &oldprop, xctx->line[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &oldprop, xctx->line[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
|
||||
if(oldprop && oldprop[0]) {
|
||||
tclsetvar("retval", oldprop);
|
||||
} else {
|
||||
|
|
@ -698,7 +698,7 @@ static void edit_line_property(void)
|
|||
set_different_token(&xctx->line[c][n].prop_ptr,
|
||||
(char *) tclgetvar("retval"), oldprop, 0, 0);
|
||||
} else {
|
||||
my_strdup(102, &xctx->line[c][n].prop_ptr,
|
||||
my_strdup(_ALLOC_ID_, &xctx->line[c][n].prop_ptr,
|
||||
(char *) tclgetvar("retval"));
|
||||
}
|
||||
xctx->line[c][n].bus = !strcmp(get_tok_value(xctx->line[c][n].prop_ptr,"bus",0), "true");
|
||||
|
|
@ -719,7 +719,7 @@ static void edit_line_property(void)
|
|||
draw();
|
||||
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
}
|
||||
my_free(726, &oldprop);
|
||||
my_free(_ALLOC_ID_, &oldprop);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -730,7 +730,7 @@ static void edit_wire_property(void)
|
|||
char *oldprop=NULL;
|
||||
const char *bus_ptr;
|
||||
|
||||
my_strdup(47, &oldprop, xctx->wire[xctx->sel_array[0].n].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &oldprop, xctx->wire[xctx->sel_array[0].n].prop_ptr);
|
||||
if(oldprop && oldprop[0]) {
|
||||
tclsetvar("retval", oldprop);
|
||||
} else {
|
||||
|
|
@ -758,7 +758,7 @@ static void edit_wire_property(void)
|
|||
set_different_token(&xctx->wire[k].prop_ptr,
|
||||
(char *) tclgetvar("retval"), oldprop, 0, 0);
|
||||
} else {
|
||||
my_strdup(100, &xctx->wire[k].prop_ptr,(char *) tclgetvar("retval"));
|
||||
my_strdup(_ALLOC_ID_, &xctx->wire[k].prop_ptr,(char *) tclgetvar("retval"));
|
||||
}
|
||||
bus_ptr = get_tok_value(xctx->wire[k].prop_ptr,"bus",0);
|
||||
if(!strcmp(bus_ptr, "true")) {
|
||||
|
|
@ -783,7 +783,7 @@ static void edit_wire_property(void)
|
|||
draw();
|
||||
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
}
|
||||
my_free(727, &oldprop);
|
||||
my_free(_ALLOC_ID_, &oldprop);
|
||||
}
|
||||
|
||||
static void edit_arc_property(void)
|
||||
|
|
@ -795,7 +795,7 @@ static void edit_arc_property(void)
|
|||
const char *dash;
|
||||
int preserve;
|
||||
|
||||
my_strdup(98, &oldprop, xctx->arc[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &oldprop, xctx->arc[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
|
||||
if(oldprop && oldprop[0]) {
|
||||
tclsetvar("retval", oldprop);
|
||||
} else {
|
||||
|
|
@ -819,7 +819,7 @@ static void edit_arc_property(void)
|
|||
set_different_token(&xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval"), oldprop, 0, 0);
|
||||
|
||||
} else {
|
||||
my_strdup(156, &xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval"));
|
||||
my_strdup(_ALLOC_ID_, &xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval"));
|
||||
}
|
||||
old_fill = xctx->arc[c][i].fill;
|
||||
if( !strcmp(get_tok_value(xctx->arc[c][i].prop_ptr,"fill",0),"true") )
|
||||
|
|
@ -864,7 +864,7 @@ static void edit_polygon_property(void)
|
|||
int preserve;
|
||||
|
||||
dbg(1, "edit_property(): input property:\n");
|
||||
my_strdup(112, &oldprop, xctx->poly[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &oldprop, xctx->poly[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
|
||||
if(oldprop && oldprop[0]) {
|
||||
tclsetvar("retval", oldprop);
|
||||
} else {
|
||||
|
|
@ -887,7 +887,7 @@ static void edit_polygon_property(void)
|
|||
if(oldprop && preserve == 1) {
|
||||
set_different_token(&xctx->poly[c][i].prop_ptr, (char *) tclgetvar("retval"), oldprop, 0, 0);
|
||||
} else {
|
||||
my_strdup(113, &xctx->poly[c][i].prop_ptr, (char *) tclgetvar("retval"));
|
||||
my_strdup(_ALLOC_ID_, &xctx->poly[c][i].prop_ptr, (char *) tclgetvar("retval"));
|
||||
}
|
||||
old_fill = xctx->poly[c][i].fill;
|
||||
old_dash = xctx->poly[c][i].dash;
|
||||
|
|
@ -942,7 +942,7 @@ static void edit_text_property(int x)
|
|||
|
||||
dbg(1, "edit_text_property(): entering\n");
|
||||
sel = xctx->sel_array[0].n;
|
||||
my_strdup(656, &oldprop, xctx->text[sel].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &oldprop, xctx->text[sel].prop_ptr);
|
||||
if(oldprop && oldprop[0])
|
||||
tclsetvar("props", oldprop);
|
||||
else
|
||||
|
|
@ -1035,24 +1035,24 @@ static void edit_text_property(int x)
|
|||
(fabs(yy1 - pcy) < cg*3 || fabs(yy2 - pcy) < cg*3) )
|
||||
) {
|
||||
if(x==0)
|
||||
my_strdup(71, &xctx->rect[PINLAYER][l].prop_ptr,
|
||||
my_strdup(_ALLOC_ID_, &xctx->rect[PINLAYER][l].prop_ptr,
|
||||
subst_token(xctx->rect[PINLAYER][l].prop_ptr, "name",
|
||||
(char *) tclgetvar("retval")) );
|
||||
else
|
||||
my_strdup(72, &xctx->rect[PINLAYER][l].prop_ptr,
|
||||
my_strdup(_ALLOC_ID_, &xctx->rect[PINLAYER][l].prop_ptr,
|
||||
subst_token(xctx->rect[PINLAYER][l].prop_ptr, "name",
|
||||
(char *) tclgetvar("retval")) );
|
||||
}
|
||||
}
|
||||
}
|
||||
my_strdup(74, &xctx->text[sel].txt_ptr, (char *) tclgetvar("retval"));
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[sel].txt_ptr, (char *) tclgetvar("retval"));
|
||||
}
|
||||
if(x==0 && props_changed) {
|
||||
if(oldprop && preserve)
|
||||
set_different_token(&xctx->text[sel].prop_ptr, (char *) tclgetvar("props"), oldprop, 0, 0);
|
||||
else
|
||||
my_strdup(75, &xctx->text[sel].prop_ptr,(char *) tclgetvar("props"));
|
||||
my_strdup(76, &xctx->text[sel].font, get_tok_value(xctx->text[sel].prop_ptr, "font", 0));
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[sel].prop_ptr,(char *) tclgetvar("props"));
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[sel].font, get_tok_value(xctx->text[sel].prop_ptr, "font", 0));
|
||||
str = get_tok_value(xctx->text[sel].prop_ptr, "hcenter", 0);
|
||||
xctx->text[sel].hcenter = strcmp(str, "true") ? 0 : 1;
|
||||
str = get_tok_value(xctx->text[sel].prop_ptr, "vcenter", 0);
|
||||
|
|
@ -1093,7 +1093,7 @@ static void edit_text_property(int x)
|
|||
draw();
|
||||
bbox(END,0.0,0.0,0.0,0.0);
|
||||
}
|
||||
my_free(890, &oldprop);
|
||||
my_free(_ALLOC_ID_, &oldprop);
|
||||
}
|
||||
|
||||
/* x=0 use text widget x=1 use vim editor */
|
||||
|
|
@ -1116,19 +1116,19 @@ static void update_symbol(const char *result, int x)
|
|||
*ii=xctx->sel_array[0].n;
|
||||
if(!result) {
|
||||
dbg(1, "update_symbol(): edit symbol prop aborted\n");
|
||||
my_free(1289, &xctx->old_prop);
|
||||
my_free(_ALLOC_ID_, &xctx->old_prop);
|
||||
return;
|
||||
}
|
||||
/* create new_prop updated attribute string */
|
||||
if(*netl_com && x==1) {
|
||||
my_strdup(79, &new_prop,
|
||||
my_strdup(_ALLOC_ID_, &new_prop,
|
||||
subst_token(xctx->old_prop, "value", (char *) tclgetvar("retval") )
|
||||
);
|
||||
dbg(1, "update_symbol(): new_prop=%s\n", new_prop);
|
||||
dbg(1, "update_symbol(): tcl retval==%s\n", tclgetvar("retval"));
|
||||
}
|
||||
else {
|
||||
my_strdup(80, &new_prop, (char *) tclgetvar("retval"));
|
||||
my_strdup(_ALLOC_ID_, &new_prop, (char *) tclgetvar("retval"));
|
||||
dbg(1, "update_symbol(): new_prop=%s\n", new_prop);
|
||||
}
|
||||
my_strncpy(symbol, (char *) tclgetvar("symbol") , S(symbol));
|
||||
|
|
@ -1169,7 +1169,7 @@ static void update_symbol(const char *result, int x)
|
|||
delete_inst_node(*ii); /* 20180208 fix crashing bug: delete node info if changing symbol */
|
||||
/* if number of pins is different we must delete these data *before* */
|
||||
/* changing ysmbol, otherwise *ii might end up deleting non allocated data. */
|
||||
my_strdup2(82, &xctx->inst[*ii].name, rel_sym_path(symbol));
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[*ii].name, rel_sym_path(symbol));
|
||||
xctx->inst[*ii].ptr=sym_number; /* update instance to point to new symbol */
|
||||
}
|
||||
bbox(ADD, xctx->inst[*ii].x1, xctx->inst[*ii].y1,
|
||||
|
|
@ -1181,13 +1181,13 @@ static void update_symbol(const char *result, int x)
|
|||
dbg(1, "update_symbol(): no_change_props=%d\n", no_change_props);
|
||||
if(only_different) {
|
||||
char * ss=NULL;
|
||||
my_strdup(119, &ss, xctx->inst[*ii].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &ss, xctx->inst[*ii].prop_ptr);
|
||||
if( set_different_token(&ss, new_prop, xctx->old_prop, 0, 0) ) {
|
||||
if(!pushed) { xctx->push_undo(); pushed=1;}
|
||||
my_strdup(111, &xctx->inst[*ii].prop_ptr, ss);
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, ss);
|
||||
set_modify(1);
|
||||
}
|
||||
my_free(729, &ss);
|
||||
my_free(_ALLOC_ID_, &ss);
|
||||
}
|
||||
else {
|
||||
if(new_prop) {
|
||||
|
|
@ -1195,39 +1195,39 @@ static void update_symbol(const char *result, int x)
|
|||
dbg(1, "update_symbol(): changing prop: |%s| -> |%s|\n",
|
||||
xctx->inst[*ii].prop_ptr, new_prop);
|
||||
if(!pushed) { xctx->push_undo(); pushed=1;}
|
||||
my_strdup(84, &xctx->inst[*ii].prop_ptr, new_prop);
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, new_prop);
|
||||
set_modify(1);
|
||||
}
|
||||
} else {
|
||||
if(!pushed) { xctx->push_undo(); pushed=1;}
|
||||
my_strdup(86, &xctx->inst[*ii].prop_ptr, "");
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, "");
|
||||
set_modify(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* if symbol changed ensure instance name (with new prefix char) is unique */
|
||||
/* preserve backslashes in name ----------------------------------->. */
|
||||
my_strdup(152, &name, get_tok_value(xctx->inst[*ii].prop_ptr, "name", 1));
|
||||
my_strdup(_ALLOC_ID_, &name, get_tok_value(xctx->inst[*ii].prop_ptr, "name", 1));
|
||||
if(name && name[0] ) {
|
||||
dbg(1, "update_symbol(): prefix!='\\0', name=%s\n", name);
|
||||
/* 20110325 only modify prefix if prefix not NUL */
|
||||
if(prefix) name[0]=(char)prefix; /* change prefix if changing symbol type; */
|
||||
dbg(1, "update_symbol(): name=%s, inst[*ii].prop_ptr=%s\n",
|
||||
name, xctx->inst[*ii].prop_ptr);
|
||||
my_strdup(89, &ptr,subst_token(xctx->inst[*ii].prop_ptr, "name", name) );
|
||||
my_strdup(_ALLOC_ID_, &ptr,subst_token(xctx->inst[*ii].prop_ptr, "name", name) );
|
||||
/* set name of current inst */
|
||||
if(!pushed) { xctx->push_undo(); pushed=1;}
|
||||
if(!k) hash_all_names();
|
||||
new_prop_string(*ii, ptr, k, tclgetboolvar("disable_unique_names")); /* set new prop_ptr */
|
||||
} else {
|
||||
my_strdup2(367, &xctx->inst[*ii].instname, "");
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[*ii].instname, "");
|
||||
}
|
||||
type=xctx->sym[xctx->inst[*ii].ptr].type;
|
||||
cond= !type || !IS_LABEL_SH_OR_PIN(type);
|
||||
if(cond) xctx->inst[*ii].flags |= 2; /* bit 1: flag for different textlayer for pin/labels */
|
||||
else {
|
||||
xctx->inst[*ii].flags &= ~2;
|
||||
my_strdup(880, &xctx->inst[*ii].lab,
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[*ii].lab,
|
||||
get_tok_value(xctx->inst[*ii].prop_ptr, "lab",0));
|
||||
}
|
||||
if(!strcmp(get_tok_value(xctx->inst[*ii].prop_ptr,"highlight",0), "true"))
|
||||
|
|
@ -1251,10 +1251,10 @@ static void update_symbol(const char *result, int x)
|
|||
dbg(1, "update_symbol(): redrawing inst_ptr.txtprop string\n");
|
||||
draw();
|
||||
bbox(END,0.0,0.0,0.0,0.0);
|
||||
my_free(731, &name);
|
||||
my_free(732, &ptr);
|
||||
my_free(733, &new_prop);
|
||||
my_free(734, &xctx->old_prop);
|
||||
my_free(_ALLOC_ID_, &name);
|
||||
my_free(_ALLOC_ID_, &ptr);
|
||||
my_free(_ALLOC_ID_, &new_prop);
|
||||
my_free(_ALLOC_ID_, &xctx->old_prop);
|
||||
}
|
||||
|
||||
/* x=0 use text widget x=1 use vim editor */
|
||||
|
|
@ -1279,12 +1279,12 @@ static void edit_symbol_property(int x)
|
|||
else {
|
||||
tclsetvar("retval","");
|
||||
}
|
||||
my_strdup(91, &xctx->old_prop, xctx->inst[*ii].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->old_prop, xctx->inst[*ii].prop_ptr);
|
||||
tclsetvar("symbol",xctx->inst[*ii].name);
|
||||
|
||||
if(x==0) {
|
||||
tcleval("edit_prop {Input property:}");
|
||||
my_strdup(77, &result, tclresult());
|
||||
my_strdup(_ALLOC_ID_, &result, tclresult());
|
||||
}
|
||||
else {
|
||||
/* edit_vi_netlist_prop will replace \" with " before editing,
|
||||
|
|
@ -1293,11 +1293,11 @@ static void edit_symbol_property(int x)
|
|||
if(*netl_com && x==1) tcleval("edit_vi_netlist_prop {Input property:}");
|
||||
else if(x==1) tcleval("edit_vi_prop {Input property:}");
|
||||
else if(x==2) tcleval("viewdata $::retval");
|
||||
my_strdup(78, &result, tclresult());
|
||||
my_strdup(_ALLOC_ID_, &result, tclresult());
|
||||
}
|
||||
dbg(1, "edit_symbol_property(): before update_symbol, modified=%d\n", xctx->modified);
|
||||
update_symbol(result, x);
|
||||
my_free(728, &result);
|
||||
my_free(_ALLOC_ID_, &result);
|
||||
dbg(1, "edit_symbol_property(): done update_symbol, modified=%d\n", xctx->modified);
|
||||
*ii=-1;
|
||||
}
|
||||
|
|
@ -1370,7 +1370,7 @@ char *str_replace(const char *s, const char *rep, const char *with)
|
|||
size_t with_len;
|
||||
|
||||
if(s==NULL || rep == NULL || with == NULL || rep[0] == '\0') {
|
||||
my_free(1244, &result);
|
||||
my_free(_ALLOC_ID_, &result);
|
||||
size = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -1379,7 +1379,7 @@ char *str_replace(const char *s, const char *rep, const char *with)
|
|||
dbg(1, "str_replace(): %s, %s, %s\n", s, rep, with);
|
||||
if( size == 0 ) {
|
||||
size = CADCHUNKALLOC;
|
||||
my_realloc(1245, &result, size);
|
||||
my_realloc(_ALLOC_ID_, &result, size);
|
||||
}
|
||||
while(*s) {
|
||||
STR_ALLOC(&result, result_pos + with_len + 1, &size);
|
||||
|
|
@ -1451,9 +1451,9 @@ void edit_property(int x)
|
|||
dbg(1, "edit_property(): done executing edit_vi_prop, result=%s\n",tclresult());
|
||||
dbg(1, "edit_property(): rcode=%s\n",tclgetvar("rcode") );
|
||||
|
||||
my_strdup(650, &new_prop, (char *) tclgetvar("retval"));
|
||||
my_strdup(_ALLOC_ID_, &new_prop, (char *) tclgetvar("retval"));
|
||||
tclsetvar("retval", new_prop);
|
||||
my_free(893, &new_prop);
|
||||
my_free(_ALLOC_ID_, &new_prop);
|
||||
|
||||
|
||||
if(strcmp(tclgetvar("rcode"),"") )
|
||||
|
|
@ -1461,27 +1461,27 @@ void edit_property(int x)
|
|||
if(xctx->netlist_type==CAD_SYMBOL_ATTRS &&
|
||||
(!xctx->schsymbolprop || strcmp(xctx->schsymbolprop, tclgetvar("retval") ) ) ) {
|
||||
set_modify(1); xctx->push_undo();
|
||||
my_strdup(422, &xctx->schsymbolprop, (char *) tclgetvar("retval"));
|
||||
my_strdup(_ALLOC_ID_, &xctx->schsymbolprop, (char *) tclgetvar("retval"));
|
||||
|
||||
} else if(xctx->netlist_type==CAD_VERILOG_NETLIST &&
|
||||
(!xctx->schverilogprop || strcmp(xctx->schverilogprop, tclgetvar("retval") ) ) ) {
|
||||
set_modify(1); xctx->push_undo();
|
||||
my_strdup(94, &xctx->schverilogprop, (char *) tclgetvar("retval"));
|
||||
my_strdup(_ALLOC_ID_, &xctx->schverilogprop, (char *) tclgetvar("retval"));
|
||||
|
||||
} else if(xctx->netlist_type==CAD_SPICE_NETLIST &&
|
||||
(!xctx->schprop || strcmp(xctx->schprop, tclgetvar("retval") ) ) ) {
|
||||
set_modify(1); xctx->push_undo();
|
||||
my_strdup(95, &xctx->schprop, (char *) tclgetvar("retval"));
|
||||
my_strdup(_ALLOC_ID_, &xctx->schprop, (char *) tclgetvar("retval"));
|
||||
|
||||
} else if(xctx->netlist_type==CAD_TEDAX_NETLIST &&
|
||||
(!xctx->schtedaxprop || strcmp(xctx->schtedaxprop, tclgetvar("retval") ) ) ) {
|
||||
set_modify(1); xctx->push_undo();
|
||||
my_strdup(96, &xctx->schtedaxprop, (char *) tclgetvar("retval"));
|
||||
my_strdup(_ALLOC_ID_, &xctx->schtedaxprop, (char *) tclgetvar("retval"));
|
||||
|
||||
} else if(xctx->netlist_type==CAD_VHDL_NETLIST &&
|
||||
(!xctx->schvhdlprop || strcmp(xctx->schvhdlprop, tclgetvar("retval") ) ) ) {
|
||||
set_modify(1); xctx->push_undo();
|
||||
my_strdup(97, &xctx->schvhdlprop, (char *) tclgetvar("retval"));
|
||||
my_strdup(_ALLOC_ID_, &xctx->schvhdlprop, (char *) tclgetvar("retval"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,13 +69,13 @@ static char *expandlabel_strdup(char *src)
|
|||
char *ptr;
|
||||
if(src==NULL || src[0]=='\0') {
|
||||
ptr=NULL;
|
||||
my_strdup(121, &ptr,"");
|
||||
my_strdup(_ALLOC_ID_, &ptr,"");
|
||||
return ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr=NULL;
|
||||
my_strdup(122, &ptr,src);
|
||||
my_strdup(_ALLOC_ID_, &ptr,src);
|
||||
dbg(3, "expandlabel_strdup(): duplicated %lu string %s\n",(unsigned long)ptr,src);
|
||||
return ptr;
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ static char *expandlabel_strcat(char *s1, char *s2)
|
|||
|
||||
if(s1) l1=strlen(s1);
|
||||
if(s2) l2=strlen(s2);
|
||||
res=my_malloc(730, l1+l2+1); /* 2 strings plus '\0' */
|
||||
res=my_malloc(_ALLOC_ID_, l1+l2+1); /* 2 strings plus '\0' */
|
||||
if(s1) memcpy(res, s1, l1);
|
||||
if(s2) memcpy(res + l1 , s2, l2+1);
|
||||
else memcpy(res + l1 , "", 1);
|
||||
|
|
@ -104,7 +104,7 @@ static char *expandlabel_strcat_char(char *s1, char c, char *s2)
|
|||
|
||||
if(s1) l1=strlen(s1);
|
||||
if(s2) l2=strlen(s2);
|
||||
res=my_malloc(123, l1+l2+2); /* 2 strings plus 'c' and '\0' */
|
||||
res=my_malloc(_ALLOC_ID_, l1+l2+2); /* 2 strings plus 'c' and '\0' */
|
||||
if(s1) memcpy(res, s1, l1);
|
||||
res[l1] = c;
|
||||
if(s2) memcpy(res + l1 + 1, s2, l2+1);
|
||||
|
|
@ -127,7 +127,7 @@ static char *expandlabel_strmult2(int n, char *s)
|
|||
if(n==0) return expandlabel_strdup("");
|
||||
len=strlen(s);
|
||||
prev=s;
|
||||
ss = str=my_malloc(124, (len+1)*n);
|
||||
ss = str=my_malloc(_ALLOC_ID_, (len+1)*n);
|
||||
str[0]='\0';
|
||||
for(pos=s;pos<=s+len;pos++) {
|
||||
if(*pos==',' || *pos=='\0') {
|
||||
|
|
@ -161,7 +161,7 @@ static char *expandlabel_strmult(int n, char *s)
|
|||
|
||||
if(n==0) return expandlabel_strdup("");
|
||||
len=strlen(s);
|
||||
str=pos=my_malloc(125, (len+1)*n);
|
||||
str=pos=my_malloc(_ALLOC_ID_, (len+1)*n);
|
||||
for(i=1;i<=n;i++)
|
||||
{
|
||||
/* strcpy(pos,s); */
|
||||
|
|
@ -179,8 +179,8 @@ static char *expandlabel_strbus(char *s, int *n)
|
|||
int tmplen;
|
||||
char *res=NULL;
|
||||
char *tmp=NULL;
|
||||
my_realloc(126, &res, n[0]*(strlen(s)+20));
|
||||
my_realloc(127, &tmp, strlen(s)+30);
|
||||
my_realloc(_ALLOC_ID_, &res, n[0]*(strlen(s)+20));
|
||||
my_realloc(_ALLOC_ID_, &tmp, strlen(s)+30);
|
||||
l=0;
|
||||
for(i=1;i<n[0];i++)
|
||||
{
|
||||
|
|
@ -189,7 +189,7 @@ static char *expandlabel_strbus(char *s, int *n)
|
|||
memcpy(res+l,tmp, tmplen+1); /* 20180923 */
|
||||
l+=tmplen;
|
||||
}
|
||||
my_free(735, &tmp);
|
||||
my_free(_ALLOC_ID_, &tmp);
|
||||
sprintf(res+l, "%s[%d]", s, n[i]);
|
||||
return res;
|
||||
}
|
||||
|
|
@ -200,7 +200,7 @@ static void check_idx(int **ptr,int n)
|
|||
{
|
||||
idxsize*=2;
|
||||
dbg(3, "check_idx(): reallocating idx array: size=%d\n",idxsize);
|
||||
my_realloc(128, ptr, idxsize*sizeof(int));
|
||||
my_realloc(_ALLOC_ID_, ptr, idxsize*sizeof(int));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -210,8 +210,8 @@ static char *expandlabel_strbus_nobracket(char *s, int *n)
|
|||
int tmplen;
|
||||
char *res=NULL;
|
||||
char *tmp=NULL;
|
||||
my_realloc(107, &res, n[0]*(strlen(s)+20));
|
||||
my_realloc(108, &tmp, strlen(s)+30);
|
||||
my_realloc(_ALLOC_ID_, &res, n[0]*(strlen(s)+20));
|
||||
my_realloc(_ALLOC_ID_, &tmp, strlen(s)+30);
|
||||
l=0;
|
||||
for(i=1;i<n[0];i++)
|
||||
{
|
||||
|
|
@ -220,7 +220,7 @@ static char *expandlabel_strbus_nobracket(char *s, int *n)
|
|||
memcpy(res+l,tmp, tmplen+1);
|
||||
l+=tmplen;
|
||||
}
|
||||
my_free(736, &tmp);
|
||||
my_free(_ALLOC_ID_, &tmp);
|
||||
sprintf(res+l, "%s%d", s, n[i]);
|
||||
return res;
|
||||
}
|
||||
|
|
@ -261,29 +261,29 @@ int *idx; /* for bus index & bus index ranges */
|
|||
|
||||
line: /* empty */
|
||||
| list {
|
||||
my_strdup(129, &(dest_string.str),$1.str);
|
||||
my_free(737, &$1.str);
|
||||
my_strdup(_ALLOC_ID_, &(dest_string.str),$1.str);
|
||||
my_free(_ALLOC_ID_, &$1.str);
|
||||
dest_string.m=$1.m;
|
||||
}
|
||||
;
|
||||
list: B_NAME {
|
||||
dbg(3, "yyparse(): B_NAME, $1=%s\n", $1);
|
||||
$$.str = expandlabel_strdup($1);
|
||||
my_free(738, &$1);
|
||||
my_free(_ALLOC_ID_, &$1);
|
||||
$$.m = 1;
|
||||
}
|
||||
| B_LINE {
|
||||
dbg(3, "yyparse(): B_LINE\n");
|
||||
$$.str = expandlabel_strdup($1); /* prima era =$1 */
|
||||
my_free(739, &$1);
|
||||
my_free(_ALLOC_ID_, &$1);
|
||||
$$.m = 1;
|
||||
}
|
||||
|
||||
| list B_NAME {
|
||||
dbg(3, "yyparse(): list B_NAME, $2=%s\n", $2);
|
||||
$$.str = expandlabel_strcat($1.str, $2);
|
||||
my_free(1208, &$1.str);
|
||||
my_free(452, &$2);
|
||||
my_free(_ALLOC_ID_, &$1.str);
|
||||
my_free(_ALLOC_ID_, &$2);
|
||||
$$.m = $1.m;
|
||||
}
|
||||
|
||||
|
|
@ -294,37 +294,37 @@ list: B_NAME {
|
|||
$$.str=expandlabel_strmult2($3,$1.str);
|
||||
dbg(3, "yyparse(): |%s|\n",$$.str);
|
||||
$$.m = $3 * $1.m;
|
||||
my_free(740, &$1.str);
|
||||
my_free(_ALLOC_ID_, &$1.str);
|
||||
}
|
||||
| B_NUM '*' list
|
||||
{
|
||||
dbg(3, "yyparse(): B_NUM * list\n");
|
||||
$$.str=expandlabel_strmult($1,$3.str);
|
||||
$$.m = $1 * $3.m;
|
||||
my_free(741, &$3.str);
|
||||
my_free(_ALLOC_ID_, &$3.str);
|
||||
}
|
||||
| B_NAME '*' list
|
||||
{
|
||||
dbg(3, "yyparse(): B_NAME * list\n");
|
||||
$$.str=expandlabel_strcat_char($1, '*', $3.str);
|
||||
$$.m = 1;
|
||||
my_free(883, &$1);
|
||||
my_free(158, &$3.str);
|
||||
my_free(_ALLOC_ID_, &$1);
|
||||
my_free(_ALLOC_ID_, &$3.str);
|
||||
}
|
||||
| list ',' list {
|
||||
dbg(3, "yyparse(): list , list\n");
|
||||
$$.str=expandlabel_strcat_char($1.str, ',', $3.str);
|
||||
$$.m = $1.m + $3.m;
|
||||
my_free(742, &$1.str);
|
||||
my_free(743, &$3.str);
|
||||
my_free(_ALLOC_ID_, &$1.str);
|
||||
my_free(_ALLOC_ID_, &$3.str);
|
||||
}
|
||||
| list B_CAR list
|
||||
{
|
||||
dbg(3, "yyparse(): list B_CAR list\n");
|
||||
$$.str=expandlabel_strcat_char($1.str, (char)$2, $3.str);
|
||||
$$.m = $1.m + $3.m;
|
||||
my_free(744, &$1.str);
|
||||
my_free(745, &$3.str);
|
||||
my_free(_ALLOC_ID_, &$1.str);
|
||||
my_free(_ALLOC_ID_, &$3.str);
|
||||
}
|
||||
| '(' list ')' {
|
||||
dbg(3, "yyparse(): ( list )\n");
|
||||
|
|
@ -333,31 +333,31 @@ list: B_NAME {
|
|||
| B_NAME '[' B_NAME ']'
|
||||
{
|
||||
size_t size = strlen($1) + strlen($3) + 3;
|
||||
$$.str = my_malloc(81, size);
|
||||
$$.str = my_malloc(_ALLOC_ID_, size);
|
||||
$$.m=-1;
|
||||
my_snprintf($$.str, size, "%s[%s]", $1, $3);
|
||||
my_free(746, &$1);
|
||||
my_free(747, &$3);
|
||||
my_free(_ALLOC_ID_, &$1);
|
||||
my_free(_ALLOC_ID_, &$3);
|
||||
}
|
||||
| B_NAME '[' index ']'
|
||||
{
|
||||
dbg(3, "yyparse(): making bus: n=%d\n",$3[0]);
|
||||
dbg(3, "yyparse(): B_NAME[ index ] , $1=%s $3=%d\n", $1, *$3);
|
||||
$$.str=expandlabel_strbus($1,$3);
|
||||
my_free(748, &$1);
|
||||
my_free(_ALLOC_ID_, &$1);
|
||||
dbg(3, "yyparse(): done making bus: n=%d\n",$3[0]);
|
||||
$$.m=$3[0];
|
||||
my_free(749, &$3);
|
||||
my_free(_ALLOC_ID_, &$3);
|
||||
idxsize=INITIALIDXSIZE;
|
||||
}
|
||||
| B_NAME '[' index_nobracket ']'
|
||||
{
|
||||
dbg(3, "yyparse(): making nobracket bus: n=%d\n",$3[0]);
|
||||
$$.str=expandlabel_strbus_nobracket($1,$3);
|
||||
my_free(750, &$1);
|
||||
my_free(_ALLOC_ID_, &$1);
|
||||
dbg(3, "yyparse(): done making nobracket bus: n=%d\n",$3[0]);
|
||||
$$.m=$3[0];
|
||||
my_free(751, &$3);
|
||||
my_free(_ALLOC_ID_, &$3);
|
||||
idxsize=INITIALIDXSIZE;
|
||||
}
|
||||
;
|
||||
|
|
@ -366,7 +366,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
|
|||
/* start : end : extend : repetitions */
|
||||
int r, i, sign, offset;
|
||||
sign = XSIGN($3-$1);
|
||||
$$=my_malloc(1580, INITIALIDXSIZE*sizeof(int));
|
||||
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
|
||||
$$[0]=0;
|
||||
offset = 0;
|
||||
for(r=0; r < $7; r++) {
|
||||
|
|
@ -384,7 +384,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
|
|||
int sign;
|
||||
|
||||
sign = XSIGN($3-$1);
|
||||
$$=my_malloc(130, INITIALIDXSIZE*sizeof(int));
|
||||
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
|
||||
$$[0]=0;
|
||||
dbg(3, "yyparse(): parsing first idx range\n");
|
||||
for(i=$1;;i+=sign*$5)
|
||||
|
|
@ -399,7 +399,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
|
|||
| B_IDXNUM ':' B_IDXNUM
|
||||
{
|
||||
int i;
|
||||
$$=my_malloc(131, INITIALIDXSIZE*sizeof(int));
|
||||
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
|
||||
$$[0]=0;
|
||||
dbg(3, "yyparse(): parsing first idx range\n");
|
||||
for(i=$1;;i+=XSIGN($3-$1))
|
||||
|
|
@ -411,7 +411,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
|
|||
}
|
||||
| B_IDXNUM {
|
||||
dbg(3, "yyparse(): parsing first idx item\n");
|
||||
$$=my_malloc(132, INITIALIDXSIZE*sizeof(int));
|
||||
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
|
||||
$$[0]=0;
|
||||
check_idx(&$$, ++$$[0]);
|
||||
$$[$$[0]]=$1;
|
||||
|
|
@ -467,7 +467,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
|
|||
index_nobracket: B_IDXNUM B_DOUBLEDOT B_IDXNUM
|
||||
{
|
||||
int i;
|
||||
$$=my_malloc(85, INITIALIDXSIZE*sizeof(int));
|
||||
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
|
||||
$$[0]=0;
|
||||
dbg(3, "yyparse(): doubledot\n");
|
||||
for(i=$1;;i+=XSIGN($3-$1))
|
||||
|
|
@ -483,7 +483,7 @@ index_nobracket: B_IDXNUM B_DOUBLEDOT B_IDXNUM
|
|||
int sign;
|
||||
|
||||
sign = XSIGN($3-$1);
|
||||
$$=my_malloc(109, INITIALIDXSIZE*sizeof(int));
|
||||
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
|
||||
$$[0]=0;
|
||||
dbg(3, "yyparse(): parsing first idx range\n");
|
||||
for(i=$1;;i+=sign*$5)
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ void find_closest_net_or_symbol_pin(double mx,double my, double *x, double *y)
|
|||
y0=xctx->inst[i].y0;
|
||||
rot = xctx->inst[i].rot;
|
||||
flip = xctx->inst[i].flip;
|
||||
my_strdup(133, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if(!type) continue;
|
||||
|
||||
no_of_pin_rects = (xctx->inst[i].ptr+ xctx->sym)->rects[PINLAYER];
|
||||
|
|
@ -169,7 +169,7 @@ void find_closest_net_or_symbol_pin(double mx,double my, double *x, double *y)
|
|||
}
|
||||
*x = min_dist_x;
|
||||
*y = min_dist_y;
|
||||
my_free(752, &type);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
}
|
||||
|
||||
static void find_closest_arc(double mx,double my)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ void compile_font(void)
|
|||
select_inside(code*FONTOFFSET-1,-FONTHEIGHT-1,
|
||||
code*FONTOFFSET+FONTWIDTH+1,FONTWHITESPACE + FONTDESCENT+1, 1);
|
||||
rebuild_selected_array();
|
||||
character[code] = my_calloc(134, xctx->lastsel*4+1, sizeof(double));
|
||||
character[code] = my_calloc(_ALLOC_ID_, xctx->lastsel*4+1, sizeof(double));
|
||||
character[code][0] = (double)xctx->lastsel;
|
||||
dbg(2, "compile_font(): character[%d][]={%.16g",code,character[code][0]);
|
||||
for(i=0;i<xctx->lastsel;i++)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ void init_inst_iterator(Iterator_ctx *ctx, double x1, double y1, double x2, doub
|
|||
dbg(3, "init_inst_iterator(): instances=%d\n", xctx->instances);
|
||||
|
||||
if(xctx->instances) {
|
||||
my_realloc(135, &ctx->instflag, xctx->instances*sizeof(unsigned short));
|
||||
my_realloc(_ALLOC_ID_, &ctx->instflag, xctx->instances*sizeof(unsigned short));
|
||||
memset(ctx->instflag, 0, xctx->instances*sizeof(unsigned short));
|
||||
}
|
||||
/* calculate square 4 1st corner of drawing area */
|
||||
|
|
@ -72,7 +72,7 @@ Instentry *inst_iterator_next(Iterator_ctx *ctx)
|
|||
ctx->tmpj = ctx->j % NBOXES; if(ctx->tmpj < 0) ctx->tmpj += NBOXES;
|
||||
ctx->instanceptr = xctx->inst_spatial_table[ctx->tmpi][ctx->tmpj];
|
||||
} else {
|
||||
my_free(753, &ctx->instflag);
|
||||
my_free(_ALLOC_ID_, &ctx->instflag);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ void init_wire_iterator(Iterator_ctx *ctx, double x1, double y1, double x2, doub
|
|||
ctx->wireflag = NULL;
|
||||
dbg(3, "init_wire_iterator(): wires=%d\n", xctx->wires);
|
||||
if(xctx->wires) {
|
||||
my_realloc(136, &ctx->wireflag, xctx->wires*sizeof(unsigned short));
|
||||
my_realloc(_ALLOC_ID_, &ctx->wireflag, xctx->wires*sizeof(unsigned short));
|
||||
memset(ctx->wireflag, 0, xctx->wires*sizeof(unsigned short));
|
||||
}
|
||||
/* calculate square 4 1st corner of drawing area */
|
||||
|
|
@ -127,7 +127,7 @@ Wireentry *wire_iterator_next(Iterator_ctx *ctx)
|
|||
ctx->tmpj = ctx->j % NBOXES; if(ctx->tmpj < 0) ctx->tmpj += NBOXES;
|
||||
ctx->wireptr = xctx->wire_spatial_table[ctx->tmpi][ctx->tmpj];
|
||||
} else {
|
||||
my_free(754, &ctx->wireflag);
|
||||
my_free(_ALLOC_ID_, &ctx->wireflag);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
176
src/hilight.c
176
src/hilight.c
|
|
@ -48,9 +48,9 @@ static void hilight_hash_free_entry(Hilight_hashentry *entry)
|
|||
Hilight_hashentry *tmp;
|
||||
while(entry) {
|
||||
tmp = entry->next;
|
||||
my_free(1287, &entry->token);
|
||||
my_free(1288, &entry->path);
|
||||
my_free(757, &entry);
|
||||
my_free(_ALLOC_ID_, &entry->token);
|
||||
my_free(_ALLOC_ID_, &entry->path);
|
||||
my_free(_ALLOC_ID_, &entry);
|
||||
entry = tmp;
|
||||
}
|
||||
}
|
||||
|
|
@ -92,11 +92,11 @@ static Hilight_hashentry *hilight_hash_lookup(const char *token, int value, int
|
|||
size_t lenp = strlen(xctx->sch_path[xctx->currsch]) + 1;
|
||||
if( what==XINSERT || what == XINSERT_NOREPLACE) { /* insert data */
|
||||
s=sizeof( Hilight_hashentry );
|
||||
entry= (Hilight_hashentry *)my_malloc(137, s );
|
||||
entry= (Hilight_hashentry *)my_malloc(_ALLOC_ID_, s );
|
||||
entry->next = NULL;
|
||||
entry->token = my_malloc(778, lent);
|
||||
entry->token = my_malloc(_ALLOC_ID_, lent);
|
||||
memcpy(entry->token, token, lent);
|
||||
entry->path = my_malloc(779, lenp);
|
||||
entry->path = my_malloc(_ALLOC_ID_, lenp);
|
||||
memcpy(entry->path, xctx->sch_path[xctx->currsch], lenp);
|
||||
entry->oldvalue = value-1000; /* no old value, set different value anyway*/
|
||||
entry->value = value;
|
||||
|
|
@ -111,9 +111,9 @@ static Hilight_hashentry *hilight_hash_lookup(const char *token, int value, int
|
|||
!strcmp(xctx->sch_path[xctx->currsch], entry->path) ) { /* found matching tok */
|
||||
if(what==XDELETE) { /* remove token from the hash table ... */
|
||||
saveptr=entry->next;
|
||||
my_free(1145, &entry->token);
|
||||
my_free(1198, &entry->path);
|
||||
my_free(764, &entry);
|
||||
my_free(_ALLOC_ID_, &entry->token);
|
||||
my_free(_ALLOC_ID_, &entry->path);
|
||||
my_free(_ALLOC_ID_, &entry);
|
||||
*preventry=saveptr;
|
||||
} else if(what == XINSERT ) {
|
||||
entry->oldvalue = entry->value;
|
||||
|
|
@ -134,11 +134,11 @@ Hilight_hashentry *inst_hilight_hash_lookup(const char *token, int value, int wh
|
|||
size_t len = strlen(token) + 2; /* token plus one more character and \0 */
|
||||
Hilight_hashentry *entry;
|
||||
dbg(1, "inst_hilight_hash_lookup: token=%s value=%d what=%d\n", token, value, what);
|
||||
inst_tok = my_malloc(1568, len);
|
||||
inst_tok = my_malloc(_ALLOC_ID_, len);
|
||||
/* instance name uglyfication: add a space at beginning so it will never match a valid net name */
|
||||
my_snprintf(inst_tok, len, " %s", token);
|
||||
entry = hilight_hash_lookup(inst_tok, value, what);
|
||||
my_free(1569, &inst_tok);
|
||||
my_free(_ALLOC_ID_, &inst_tok);
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int wha
|
|||
ptr1=hilight_hash_lookup(token, value, what);
|
||||
return ptr1;
|
||||
}
|
||||
my_strdup(141, &string, expandlabel(token,&mult));
|
||||
my_strdup(_ALLOC_ID_, &string, expandlabel(token,&mult));
|
||||
if(string==NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -179,7 +179,7 @@ Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int wha
|
|||
string_ptr++;
|
||||
}
|
||||
/* if something found return first pointer */
|
||||
my_free(765, &string);
|
||||
my_free(_ALLOC_ID_, &string);
|
||||
return ptr2;
|
||||
}
|
||||
|
||||
|
|
@ -271,12 +271,12 @@ void create_plot_cmd(void)
|
|||
if(exists) {
|
||||
viewer = atoi(tclgetvar("sim(spicewave,default)"));
|
||||
my_snprintf(tcl_str, S(tcl_str), "sim(spicewave,%d,name)", viewer);
|
||||
my_strdup(1269, &viewer_name, tclgetvar(tcl_str));
|
||||
my_strdup(_ALLOC_ID_, &viewer_name, tclgetvar(tcl_str));
|
||||
dbg(1,"create_plot_cmd(): viewer_name=%s\n", viewer_name);
|
||||
if(strstr(viewer_name, "Gaw")) viewer=GAW;
|
||||
else if(strstr(viewer_name, "Bespice")) viewer=BESPICE;
|
||||
else if(strstr(viewer_name, "Ngspice")) viewer=NGSPICE;
|
||||
my_free(1270, &viewer_name);
|
||||
my_free(_ALLOC_ID_, &viewer_name);
|
||||
}
|
||||
if(!exists || !viewer) return;
|
||||
my_snprintf(plotfile, S(plotfile), "%s/xplot", tclgetvar("netlist_dir"));
|
||||
|
|
@ -310,7 +310,7 @@ void create_plot_cmd(void)
|
|||
fprintf(fd, "%s", str);
|
||||
fprintf(fd, "\n");
|
||||
first = 1;
|
||||
my_free(758, &str);
|
||||
my_free(_ALLOC_ID_, &str);
|
||||
}
|
||||
fprintf(fd, "set color%d=rgb:%s\n", idx, color_str);
|
||||
if(first) {
|
||||
|
|
@ -326,8 +326,8 @@ void create_plot_cmd(void)
|
|||
char *t=NULL, *p=NULL;
|
||||
sprintf(color_str, "%02x%02x%02x",
|
||||
xctx->xcolor_array[c].red>>8, xctx->xcolor_array[c].green>>8, xctx->xcolor_array[c].blue>>8);
|
||||
my_strdup(1273, &t, tok);
|
||||
my_strdup2(1274, &p, (entry->path)+1);
|
||||
my_strdup(_ALLOC_ID_, &t, tok);
|
||||
my_strdup2(_ALLOC_ID_, &p, (entry->path)+1);
|
||||
if(simtype == 0 ) { /* spice */
|
||||
tclvareval("puts $gaw_fd {copyvar v(", strtolower(p), strtolower(t),
|
||||
") sel #", color_str, "}\nvwait gaw_fd\n", NULL);
|
||||
|
|
@ -340,15 +340,15 @@ void create_plot_cmd(void)
|
|||
tclvareval("puts $gaw_fd {copyvar ", strtoupper(p), strtoupper(t),
|
||||
" sel #", color_str, "}\nvwait gaw_fd\n", NULL);
|
||||
}
|
||||
my_free(1275, &p);
|
||||
my_free(1276, &t);
|
||||
my_free(_ALLOC_ID_, &p);
|
||||
my_free(_ALLOC_ID_, &t);
|
||||
}
|
||||
if(viewer == BESPICE) {
|
||||
char *t=NULL, *p=NULL;
|
||||
sprintf(color_str, "%d %d %d",
|
||||
xctx->xcolor_array[c].red>>8, xctx->xcolor_array[c].green>>8, xctx->xcolor_array[c].blue>>8);
|
||||
my_strdup(241, &t, tok);
|
||||
my_strdup2(245, &p, (entry->path)+1);
|
||||
my_strdup(_ALLOC_ID_, &t, tok);
|
||||
my_strdup2(_ALLOC_ID_, &p, (entry->path)+1);
|
||||
|
||||
if(simtype == 0 ) { /* spice */
|
||||
tclvareval(
|
||||
|
|
@ -384,8 +384,8 @@ void create_plot_cmd(void)
|
|||
"\" \"\"}",
|
||||
NULL);
|
||||
}
|
||||
my_free(759, &p);
|
||||
my_free(760, &t);
|
||||
my_free(_ALLOC_ID_, &p);
|
||||
my_free(_ALLOC_ID_, &t);
|
||||
}
|
||||
}
|
||||
entry = entry->next;
|
||||
|
|
@ -394,7 +394,7 @@ void create_plot_cmd(void)
|
|||
if(viewer == NGSPICE) {
|
||||
fprintf(fd, "%s", str);
|
||||
fprintf(fd, "\nremcirc\n.endc\n");
|
||||
my_free(761, &str);
|
||||
my_free(_ALLOC_ID_, &str);
|
||||
fclose(fd);
|
||||
}
|
||||
if(viewer == GAW) {
|
||||
|
|
@ -434,16 +434,16 @@ void hilight_net_pin_mismatches(void)
|
|||
for(k=0; k<xctx->lastsel; k++) {
|
||||
if(xctx->sel_array[k].type!=ELEMENT) continue;
|
||||
j = xctx->sel_array[k].n ;
|
||||
my_strdup(23, &type,(xctx->inst[j].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[j].ptr+ xctx->sym)->type);
|
||||
if( type && IS_LABEL_SH_OR_PIN(type)) break;
|
||||
symbol = xctx->sym + xctx->inst[j].ptr;
|
||||
npin = symbol->rects[PINLAYER];
|
||||
rct=symbol->rect[PINLAYER];
|
||||
dbg(1, "hilight_net_pin_mismatches(): \n");
|
||||
for(i=0;i<npin;i++) {
|
||||
my_strdup(24, &labname,get_tok_value(rct[i].prop_ptr,"name",0));
|
||||
my_strdup(25, &lab, expandlabel(labname, &mult));
|
||||
my_strdup(26, &netname, net_name(j,i, &mult, 0, 0));
|
||||
my_strdup(_ALLOC_ID_, &labname,get_tok_value(rct[i].prop_ptr,"name",0));
|
||||
my_strdup(_ALLOC_ID_, &lab, expandlabel(labname, &mult));
|
||||
my_strdup(_ALLOC_ID_, &netname, net_name(j,i, &mult, 0, 0));
|
||||
dbg(1, "hilight_net_pin_mismatches(): i=%d labname=%s explabname = %s net = %s\n", i, labname, lab, netname);
|
||||
if(netname && strcmp(lab, netname)) {
|
||||
dbg(1, "hilight_net_pin_mismatches(): hilight: %s\n", netname);
|
||||
|
|
@ -452,10 +452,10 @@ void hilight_net_pin_mismatches(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
my_free(713, &type);
|
||||
my_free(714, &labname);
|
||||
my_free(715, &lab);
|
||||
my_free(716, &netname);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
my_free(_ALLOC_ID_, &labname);
|
||||
my_free(_ALLOC_ID_, &lab);
|
||||
my_free(_ALLOC_ID_, &netname);
|
||||
if(xctx->hilight_nets) propagate_hilights(1, 0, XINSERT_NOREPLACE);
|
||||
redraw_hilights(0);
|
||||
}
|
||||
|
|
@ -481,11 +481,11 @@ void hilight_parent_pins(void)
|
|||
for(j=0;j<rects;j++)
|
||||
{
|
||||
if(!xctx->inst[i].node[j]) continue;
|
||||
my_strdup(445, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult));
|
||||
my_strdup(_ALLOC_ID_, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult));
|
||||
dbg(1, "hilight_parent_pins(): net_node=%s\n", net_node);
|
||||
pin_name = get_tok_value((xctx->inst[i].ptr+ xctx->sym)->rect[PINLAYER][j].prop_ptr,"name",0);
|
||||
if(!pin_name[0]) continue;
|
||||
my_strdup(450, &pin_node, expandlabel(pin_name, &mult));
|
||||
my_strdup(_ALLOC_ID_, &pin_node, expandlabel(pin_name, &mult));
|
||||
dbg(1, "hilight_parent_pins(): pin_node=%s\n", pin_node);
|
||||
|
||||
for(k = 1; k<=mult; k++) {
|
||||
|
|
@ -504,8 +504,8 @@ void hilight_parent_pins(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
my_free(767, &pin_node);
|
||||
my_free(768, &net_node);
|
||||
my_free(_ALLOC_ID_, &pin_node);
|
||||
my_free(_ALLOC_ID_, &net_node);
|
||||
}
|
||||
|
||||
void hilight_child_pins(void)
|
||||
|
|
@ -527,11 +527,11 @@ void hilight_child_pins(void)
|
|||
dbg(1, "hilight_child_pins(): inst_number=%d\n", inst_number);
|
||||
|
||||
if(!xctx->inst[i].node[j]) continue;
|
||||
my_strdup(508, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult));
|
||||
my_strdup(_ALLOC_ID_, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult));
|
||||
dbg(1, "hilight_child_pins(): net_node=%s\n", net_node);
|
||||
pin_name = get_tok_value((xctx->inst[i].ptr+ xctx->sym)->rect[PINLAYER][j].prop_ptr,"name",0);
|
||||
if(!pin_name[0]) continue;
|
||||
my_strdup(521, &pin_node, expandlabel(pin_name, &mult));
|
||||
my_strdup(_ALLOC_ID_, &pin_node, expandlabel(pin_name, &mult));
|
||||
dbg(1, "hilight_child_pins(): pin_node=%s\n", pin_node);
|
||||
for(k = 1; k<=mult; k++) {
|
||||
dbg(1, "hilight_child_pins(): looking nth net:%d, k=%d, inst_number=%d, mult=%d\n",
|
||||
|
|
@ -552,8 +552,8 @@ void hilight_child_pins(void)
|
|||
}
|
||||
} /* for(k..) */
|
||||
}
|
||||
my_free(769, &pin_node);
|
||||
my_free(770, &net_node);
|
||||
my_free(_ALLOC_ID_, &pin_node);
|
||||
my_free(_ALLOC_ID_, &net_node);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -615,7 +615,7 @@ int search(const char *tok, const char *val, int sub, int sel)
|
|||
} else if(!strcmp(tok,"cell::propstring")) {
|
||||
has_token = (str = (xctx->inst[i].ptr+ xctx->sym)->prop_ptr) ? 1 : 0;
|
||||
} else if(!strncmp(tok,"cell::", 6)) { /* cell::xxx looks for xxx in global symbol attributes */
|
||||
my_strdup(142, &tmpname,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,tok+6,0));
|
||||
my_strdup(_ALLOC_ID_, &tmpname,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,tok+6,0));
|
||||
has_token = xctx->tok_size;
|
||||
if(tmpname) {
|
||||
str = tmpname;
|
||||
|
|
@ -768,7 +768,7 @@ int search(const char *tok, const char *val, int sub, int sel)
|
|||
regfree(&re);
|
||||
#endif
|
||||
xctx->draw_window = save_draw;
|
||||
my_free(771, &tmpname);
|
||||
my_free(_ALLOC_ID_, &tmpname);
|
||||
return found;
|
||||
}
|
||||
|
||||
|
|
@ -796,7 +796,7 @@ static void drill_hilight(int mode)
|
|||
hilight_connected_inst = en_hi &&
|
||||
((xctx->inst[i].flags & HILIGHT_CONN) || (symbol->flags & HILIGHT_CONN));
|
||||
for(j=0; j<npin;j++) {
|
||||
my_strdup2(143, &netname, net_name(i, j, &mult, 1, 0));
|
||||
my_strdup2(_ALLOC_ID_, &netname, net_name(i, j, &mult, 1, 0));
|
||||
expandlabel(netname, &mult);
|
||||
dbg(1, "inst=%s, pin=%d, netname=%s, mult=%d\n", xctx->inst[i].instname, j, netname, mult);
|
||||
for(k = 1; k <= mult; k++) {
|
||||
|
|
@ -807,7 +807,7 @@ static void drill_hilight(int mode)
|
|||
xctx->inst[i].color = entry->value;
|
||||
inst_hilight_hash_lookup(xctx->inst[i].instname, entry->value, XINSERT_NOREPLACE);
|
||||
}
|
||||
my_strdup(1225, &propagate_str, get_tok_value(rct[j].prop_ptr, "propag", 0));
|
||||
my_strdup(_ALLOC_ID_, &propagate_str, get_tok_value(rct[j].prop_ptr, "propag", 0));
|
||||
if(propagate_str) {
|
||||
int n = 1;
|
||||
const char *propag;
|
||||
|
|
@ -822,7 +822,7 @@ static void drill_hilight(int mode)
|
|||
}
|
||||
/* expandlabel(rct[propagate].name, &pinmult); */
|
||||
/* get net to propagate hilight to...*/
|
||||
my_strdup2(144, &propagated_net, net_name(i, propagate, &mult2, 1, 0));
|
||||
my_strdup2(_ALLOC_ID_, &propagated_net, net_name(i, propagate, &mult2, 1, 0));
|
||||
netbitname = find_nth(propagated_net, ",", k);
|
||||
dbg(1, "netbitname=%s\n", netbitname);
|
||||
/* add net to highlight list */
|
||||
|
|
@ -837,9 +837,9 @@ static void drill_hilight(int mode)
|
|||
} /* for(i...) */
|
||||
if(!found) break;
|
||||
} /* while(1) */
|
||||
my_free(772, &netname);
|
||||
if(propagated_net) my_free(773, &propagated_net);
|
||||
if(propagate_str) my_free(1226, &propagate_str);
|
||||
my_free(_ALLOC_ID_, &netname);
|
||||
if(propagated_net) my_free(_ALLOC_ID_, &propagated_net);
|
||||
if(propagate_str) my_free(_ALLOC_ID_, &propagate_str);
|
||||
}
|
||||
|
||||
int hilight_netname(const char *name)
|
||||
|
|
@ -879,9 +879,9 @@ static void send_net_to_bespice(int simtype, const char *node)
|
|||
sprintf(color_str, "%d %d %d", xctx->xcolor_array[c].red>>8, xctx->xcolor_array[c].green>>8,
|
||||
xctx->xcolor_array[c].blue>>8);
|
||||
expanded_tok = expandlabel(tok, &tok_mult);
|
||||
my_strdup2(1278, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
for(k=1; k<=tok_mult; k++) {
|
||||
my_strdup(1277, &t, find_nth(expanded_tok, ",", k));
|
||||
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
|
||||
if(simtype == 0 ) { /* spice */
|
||||
tclvareval(
|
||||
"puts $bespice_server_getdata(sock) ",
|
||||
|
|
@ -917,8 +917,8 @@ static void send_net_to_bespice(int simtype, const char *node)
|
|||
NULL);
|
||||
}
|
||||
}
|
||||
my_free(1279, &p);
|
||||
my_free(1280, &t);
|
||||
my_free(_ALLOC_ID_, &p);
|
||||
my_free(_ALLOC_ID_, &t);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -939,7 +939,7 @@ static void send_net_to_graph(char **s, int simtype, const char *node)
|
|||
int start_level;
|
||||
c = get_color(xctx->hilight_color);
|
||||
expanded_tok = expandlabel(tok, &tok_mult);
|
||||
my_strdup2(1499, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
path = p;
|
||||
start_level = sch_waves_loaded();
|
||||
if(path) {
|
||||
|
|
@ -952,7 +952,7 @@ static void send_net_to_graph(char **s, int simtype, const char *node)
|
|||
}
|
||||
strtolower(path);
|
||||
for(k=1; k<=tok_mult; k++) {
|
||||
my_strdup(1503, &t, find_nth(expanded_tok, ",", k));
|
||||
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
|
||||
strtolower(t);
|
||||
if(simtype == 0 ) { /* ngspice */
|
||||
dbg(1, "%s%s color=%d\n", path, t, c);
|
||||
|
|
@ -964,8 +964,8 @@ static void send_net_to_graph(char **s, int simtype, const char *node)
|
|||
}
|
||||
|
||||
}
|
||||
my_free(1500, &p);
|
||||
my_free(1501, &t);
|
||||
my_free(_ALLOC_ID_, &p);
|
||||
my_free(_ALLOC_ID_, &t);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -990,11 +990,11 @@ static void send_net_to_gaw(int simtype, const char *node)
|
|||
expanded_tok = expandlabel(tok, &tok_mult);
|
||||
tcleval("setup_tcp_gaw");
|
||||
if(tclresult()[0] == '0') return;
|
||||
my_strdup2(254, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
path = p;
|
||||
strtolower(path);
|
||||
for(k=1; k<=tok_mult; k++) {
|
||||
my_strdup(246, &t, find_nth(expanded_tok, ",", k));
|
||||
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
|
||||
strtolower(t);
|
||||
if(simtype == 0 ) { /* ngspice */
|
||||
tclvareval("puts $gaw_fd {copyvar v(", path, t,
|
||||
|
|
@ -1004,8 +1004,8 @@ static void send_net_to_gaw(int simtype, const char *node)
|
|||
") sel #", color_str, "}\nvwait gaw_fd\n", NULL);
|
||||
}
|
||||
}
|
||||
my_free(774, &p);
|
||||
my_free(775, &t);
|
||||
my_free(_ALLOC_ID_, &p);
|
||||
my_free(_ALLOC_ID_, &t);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1028,9 +1028,9 @@ static void send_current_to_bespice(int simtype, const char *node)
|
|||
sprintf(color_str, "%d %d %d", xctx->xcolor_array[c].red>>8, xctx->xcolor_array[c].green>>8,
|
||||
xctx->xcolor_array[c].blue>>8);
|
||||
expanded_tok = expandlabel(tok, &tok_mult);
|
||||
my_strdup2(1282, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
for(k=1; k<=tok_mult; k++) {
|
||||
my_strdup(1281, &t, find_nth(expanded_tok, ",", k));
|
||||
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
|
||||
if(!simtype) { /* spice */
|
||||
tclvareval(
|
||||
"puts $bespice_server_getdata(sock) ",
|
||||
|
|
@ -1071,8 +1071,8 @@ static void send_current_to_bespice(int simtype, const char *node)
|
|||
NULL);
|
||||
}
|
||||
}
|
||||
my_free(1283, &p);
|
||||
my_free(1284, &t);
|
||||
my_free(_ALLOC_ID_, &p);
|
||||
my_free(_ALLOC_ID_, &t);
|
||||
}
|
||||
|
||||
static void send_current_to_graph(char **s, int simtype, const char *node)
|
||||
|
|
@ -1087,7 +1087,7 @@ static void send_current_to_graph(char **s, int simtype, const char *node)
|
|||
tok = node;
|
||||
c = get_color(xctx->hilight_color);
|
||||
expanded_tok = expandlabel(tok, &tok_mult);
|
||||
my_strdup2(523, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
path = p;
|
||||
start_level = sch_waves_loaded();
|
||||
if(path) {
|
||||
|
|
@ -1101,7 +1101,7 @@ static void send_current_to_graph(char **s, int simtype, const char *node)
|
|||
strtolower(path);
|
||||
there_is_hierarchy = (strstr(path, ".") != NULL);
|
||||
for(k=1; k<=tok_mult; k++) {
|
||||
my_strdup(376, &t, find_nth(expanded_tok, ",", k));
|
||||
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
|
||||
strtolower(t);
|
||||
if(!simtype) { /* ngspice */
|
||||
my_snprintf(ss, S(ss), "i(%s%s%s) %d", there_is_hierarchy ? "v." : "", path, t, c);
|
||||
|
|
@ -1115,8 +1115,8 @@ static void send_current_to_graph(char **s, int simtype, const char *node)
|
|||
my_strcat(535, s, ss);
|
||||
}
|
||||
}
|
||||
my_free(533, &p);
|
||||
my_free(662, &t);
|
||||
my_free(_ALLOC_ID_, &p);
|
||||
my_free(_ALLOC_ID_, &t);
|
||||
}
|
||||
|
||||
static void send_current_to_gaw(int simtype, const char *node)
|
||||
|
|
@ -1136,12 +1136,12 @@ static void send_current_to_gaw(int simtype, const char *node)
|
|||
expanded_tok = expandlabel(tok, &tok_mult);
|
||||
tcleval("setup_tcp_gaw");
|
||||
if(tclresult()[0] == '0') return;
|
||||
my_strdup2(1180, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
|
||||
path = p;
|
||||
strtolower(path);
|
||||
there_is_hierarchy = (xctx->currsch > 0);
|
||||
for(k=1; k<=tok_mult; k++) {
|
||||
my_strdup(1179, &t, find_nth(expanded_tok, ",", k));
|
||||
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
|
||||
strtolower(t);
|
||||
if(!simtype) { /* spice */
|
||||
tclvareval("puts $gaw_fd {copyvar i(", there_is_hierarchy ? "v." : "", path, t,
|
||||
|
|
@ -1161,8 +1161,8 @@ static void send_current_to_gaw(int simtype, const char *node)
|
|||
" sel #", color_str, "}\nvwait gaw_fd\n", NULL);
|
||||
}
|
||||
}
|
||||
my_free(1181, &p);
|
||||
my_free(1182, &t);
|
||||
my_free(_ALLOC_ID_, &p);
|
||||
my_free(_ALLOC_ID_, &t);
|
||||
}
|
||||
|
||||
/* hilight/clear pin/label instances attached to hilight nets, or instances with "hilight=true"
|
||||
|
|
@ -1438,21 +1438,21 @@ static void create_simdata(void)
|
|||
int i, j;
|
||||
const char *str;
|
||||
free_simdata();
|
||||
my_realloc(60, &xctx->simdata, xctx->instances * sizeof(Simdata));
|
||||
my_realloc(_ALLOC_ID_, &xctx->simdata, xctx->instances * sizeof(Simdata));
|
||||
xctx->simdata_ninst = xctx->instances;
|
||||
for(i = 0; i < xctx->instances; i++) {
|
||||
xSymbol *symbol = xctx->inst[i].ptr + xctx->sym;
|
||||
int npin = symbol->rects[PINLAYER];
|
||||
xctx->simdata[i].pin = NULL;
|
||||
if(npin) my_realloc(61, &xctx->simdata[i].pin, npin * sizeof(Simdata_pin));
|
||||
if(npin) my_realloc(_ALLOC_ID_, &xctx->simdata[i].pin, npin * sizeof(Simdata_pin));
|
||||
xctx->simdata[i].npin = npin;
|
||||
for(j = 0; j < npin; j++) {
|
||||
char function[20];
|
||||
xctx->simdata[i].pin[j].function=NULL;
|
||||
xctx->simdata[i].pin[j].go_to=NULL;
|
||||
my_snprintf(function, S(function), "function%d", j);
|
||||
my_strdup(717, &xctx->simdata[i].pin[j].function, get_tok_value(symbol->prop_ptr, function, 0));
|
||||
my_strdup(963, &xctx->simdata[i].pin[j].go_to,
|
||||
my_strdup(_ALLOC_ID_, &xctx->simdata[i].pin[j].function, get_tok_value(symbol->prop_ptr, function, 0));
|
||||
my_strdup(_ALLOC_ID_, &xctx->simdata[i].pin[j].go_to,
|
||||
get_tok_value(symbol->rect[PINLAYER][j].prop_ptr, "goto", 0));
|
||||
str = get_tok_value(symbol->rect[PINLAYER][j].prop_ptr, "clock", 0);
|
||||
xctx->simdata[i].pin[j].clock = str[0] ? str[0] - '0' : -1;
|
||||
|
|
@ -1468,12 +1468,12 @@ void free_simdata(void)
|
|||
for(i = 0; i < xctx->simdata_ninst; i++) { /* can not use xctx->instances if a new sch is loaded */
|
||||
int npin = xctx->simdata[i].npin;
|
||||
for(j = 0; j < npin; j++) {
|
||||
my_free(1219, &xctx->simdata[i].pin[j].function);
|
||||
my_free(1220, &xctx->simdata[i].pin[j].go_to);
|
||||
my_free(_ALLOC_ID_, &xctx->simdata[i].pin[j].function);
|
||||
my_free(_ALLOC_ID_, &xctx->simdata[i].pin[j].go_to);
|
||||
}
|
||||
if(npin) my_free(1221, &xctx->simdata[i].pin);
|
||||
if(npin) my_free(_ALLOC_ID_, &xctx->simdata[i].pin);
|
||||
}
|
||||
my_free(1222, &xctx->simdata);
|
||||
my_free(_ALLOC_ID_, &xctx->simdata);
|
||||
}
|
||||
xctx->simdata_ninst = 0;
|
||||
}
|
||||
|
|
@ -1594,7 +1594,7 @@ static void propagate_logic()
|
|||
if( tclresult()[0] == '1') break;
|
||||
iter++;
|
||||
} /* while(1) */
|
||||
/* my_free(1222, &propagated_net); */
|
||||
/* my_free(_ALLOC_ID_, &propagated_net); */
|
||||
}
|
||||
|
||||
void logic_set(int value, int num)
|
||||
|
|
@ -1715,7 +1715,7 @@ void hilight_net(int viewer)
|
|||
}
|
||||
if( viewer == XSCHEM_GRAPH && s) {
|
||||
tclvareval("graph_add_nodes_from_list {", s, "}", NULL);
|
||||
my_free(1504, &s);
|
||||
my_free(_ALLOC_ID_, &s);
|
||||
}
|
||||
if(!incr_hi) incr_hilight_color();
|
||||
if(xctx->hilight_nets) propagate_hilights(1, 0, XINSERT_NOREPLACE);
|
||||
|
|
@ -1947,14 +1947,14 @@ void print_hilight_net(int show)
|
|||
fprintf(errfp, "print_hilight_net(): can not create tmpfile %s\n", filename_ptr);
|
||||
return;
|
||||
}
|
||||
my_strdup(147, &filetmp2, filename_ptr);
|
||||
my_strdup(_ALLOC_ID_, &filetmp2, filename_ptr);
|
||||
fclose(fd);
|
||||
if(!(fd = open_tmpfile("hilight1_", &filename_ptr))) {
|
||||
fprintf(errfp, "print_hilight_net(): can not create tmpfile %s\n", filename_ptr);
|
||||
my_free(776, &filetmp2);
|
||||
my_free(_ALLOC_ID_, &filetmp2);
|
||||
return;
|
||||
}
|
||||
my_strdup(148, &filetmp1, filename_ptr);
|
||||
my_strdup(_ALLOC_ID_, &filetmp1, filename_ptr);
|
||||
my_snprintf(cmd, S(cmd), "awk -f \"%s/order_labels.awk\"", tclgetvar("XSCHEM_SHAREDIR"));
|
||||
my_snprintf(cmd2, S(cmd2), "%s %s > %s", cmd, filetmp1, filetmp2);
|
||||
my_snprintf(cmd3, S(cmd3), "awk -f \"%s/sort_labels.awk\" %s", tclgetvar("XSCHEM_SHAREDIR"), filetmp1);
|
||||
|
|
@ -2027,8 +2027,8 @@ void print_hilight_net(int show)
|
|||
xctx->prep_hi_structs=0;
|
||||
xctx->prep_net_structs=0;
|
||||
|
||||
my_free(781, &filetmp1);
|
||||
my_free(782, &filetmp2);
|
||||
my_free(_ALLOC_ID_, &filetmp1);
|
||||
my_free(_ALLOC_ID_, &filetmp2);
|
||||
}
|
||||
|
||||
void list_hilights(void)
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ static void free_undo_lines(int slot)
|
|||
|
||||
for(c = 0;c<cadlayers; c++) {
|
||||
for(i = 0;i<xctx->uslot[slot].lines[c]; i++) {
|
||||
my_free(783, &xctx->uslot[slot].lptr[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].lptr[c][i].prop_ptr);
|
||||
}
|
||||
my_free(784, &xctx->uslot[slot].lptr[c]);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].lptr[c]);
|
||||
xctx->uslot[slot].lines[c] = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -41,9 +41,9 @@ static void free_undo_rects(int slot)
|
|||
|
||||
for(c = 0;c<cadlayers; c++) {
|
||||
for(i = 0;i<xctx->uslot[slot].rects[c]; i++) {
|
||||
my_free(785, &xctx->uslot[slot].bptr[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].bptr[c][i].prop_ptr);
|
||||
}
|
||||
my_free(786, &xctx->uslot[slot].bptr[c]);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].bptr[c]);
|
||||
xctx->uslot[slot].rects[c] = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -54,12 +54,12 @@ static void free_undo_polygons(int slot)
|
|||
|
||||
for(c = 0;c<cadlayers; c++) {
|
||||
for(i = 0;i<xctx->uslot[slot].polygons[c]; i++) {
|
||||
my_free(787, &xctx->uslot[slot].pptr[c][i].prop_ptr);
|
||||
my_free(788, &xctx->uslot[slot].pptr[c][i].x);
|
||||
my_free(789, &xctx->uslot[slot].pptr[c][i].y);
|
||||
my_free(790, &xctx->uslot[slot].pptr[c][i].selected_point);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c][i].x);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c][i].y);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c][i].selected_point);
|
||||
}
|
||||
my_free(791, &xctx->uslot[slot].pptr[c]);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c]);
|
||||
xctx->uslot[slot].polygons[c] = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -70,9 +70,9 @@ static void free_undo_arcs(int slot)
|
|||
|
||||
for(c = 0;c<cadlayers; c++) {
|
||||
for(i = 0;i<xctx->uslot[slot].arcs[c]; i++) {
|
||||
my_free(792, &xctx->uslot[slot].aptr[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].aptr[c][i].prop_ptr);
|
||||
}
|
||||
my_free(793, &xctx->uslot[slot].aptr[c]);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].aptr[c]);
|
||||
xctx->uslot[slot].arcs[c] = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -82,9 +82,9 @@ static void free_undo_wires(int slot)
|
|||
int i;
|
||||
|
||||
for(i = 0;i<xctx->uslot[slot].wires; i++) {
|
||||
my_free(794, &xctx->uslot[slot].wptr[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].wptr[i].prop_ptr);
|
||||
}
|
||||
my_free(795, &xctx->uslot[slot].wptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].wptr);
|
||||
xctx->uslot[slot].wires = 0;
|
||||
}
|
||||
|
||||
|
|
@ -93,11 +93,11 @@ static void free_undo_texts(int slot)
|
|||
int i;
|
||||
|
||||
for(i = 0;i<xctx->uslot[slot].texts; i++) {
|
||||
my_free(796, &xctx->uslot[slot].tptr[i].prop_ptr);
|
||||
my_free(797, &xctx->uslot[slot].tptr[i].txt_ptr);
|
||||
my_free(798, &xctx->uslot[slot].tptr[i].font);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].txt_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].font);
|
||||
}
|
||||
my_free(799, &xctx->uslot[slot].tptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].tptr);
|
||||
xctx->uslot[slot].texts = 0;
|
||||
}
|
||||
|
||||
|
|
@ -106,12 +106,12 @@ static void free_undo_instances(int slot)
|
|||
int i;
|
||||
|
||||
for(i = 0;i<xctx->uslot[slot].instances; i++) {
|
||||
my_free(800, &xctx->uslot[slot].iptr[i].name);
|
||||
my_free(801, &xctx->uslot[slot].iptr[i].prop_ptr);
|
||||
my_free(802, &xctx->uslot[slot].iptr[i].instname);
|
||||
my_free(104, &xctx->uslot[slot].iptr[i].lab);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].name);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].instname);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].lab);
|
||||
}
|
||||
my_free(803, &xctx->uslot[slot].iptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].iptr);
|
||||
xctx->uslot[slot].instances = 0;
|
||||
}
|
||||
|
||||
|
|
@ -123,70 +123,70 @@ static void free_undo_symbols(int slot)
|
|||
symbols = xctx->uslot[slot].symbols;
|
||||
for(i = 0;i < symbols; i++) {
|
||||
sym = &xctx->uslot[slot].symptr[i];
|
||||
my_free(354, &sym->name);
|
||||
my_free(355, &sym->prop_ptr);
|
||||
my_free(373, &sym->type);
|
||||
my_free(660, &sym->templ);
|
||||
my_free(_ALLOC_ID_, &sym->name);
|
||||
my_free(_ALLOC_ID_, &sym->prop_ptr);
|
||||
my_free(_ALLOC_ID_, &sym->type);
|
||||
my_free(_ALLOC_ID_, &sym->templ);
|
||||
|
||||
for(c = 0;c<cadlayers;c++) {
|
||||
for(j = 0;j<sym->polygons[c];j++) {
|
||||
if(sym->poly[c][j].prop_ptr != NULL) {
|
||||
my_free(892, &sym->poly[c][j].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &sym->poly[c][j].prop_ptr);
|
||||
}
|
||||
my_free(914, &sym->poly[c][j].x);
|
||||
my_free(915, &sym->poly[c][j].y);
|
||||
my_free(918, &sym->poly[c][j].selected_point);
|
||||
my_free(_ALLOC_ID_, &sym->poly[c][j].x);
|
||||
my_free(_ALLOC_ID_, &sym->poly[c][j].y);
|
||||
my_free(_ALLOC_ID_, &sym->poly[c][j].selected_point);
|
||||
}
|
||||
my_free(1137, &sym->poly[c]);
|
||||
my_free(_ALLOC_ID_, &sym->poly[c]);
|
||||
sym->polygons[c] = 0;
|
||||
|
||||
for(j = 0;j<sym->lines[c];j++) {
|
||||
if(sym->line[c][j].prop_ptr != NULL) {
|
||||
my_free(1142, &sym->line[c][j].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &sym->line[c][j].prop_ptr);
|
||||
}
|
||||
}
|
||||
my_free(1290, &sym->line[c]);
|
||||
my_free(_ALLOC_ID_, &sym->line[c]);
|
||||
sym->lines[c] = 0;
|
||||
|
||||
for(j = 0;j<sym->arcs[c];j++) {
|
||||
if(sym->arc[c][j].prop_ptr != NULL) {
|
||||
my_free(1291, &sym->arc[c][j].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &sym->arc[c][j].prop_ptr);
|
||||
}
|
||||
}
|
||||
my_free(1292, &sym->arc[c]);
|
||||
my_free(_ALLOC_ID_, &sym->arc[c]);
|
||||
sym->arcs[c] = 0;
|
||||
|
||||
for(j = 0;j<sym->rects[c];j++) {
|
||||
if(sym->rect[c][j].prop_ptr != NULL) {
|
||||
my_free(1293, &sym->rect[c][j].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &sym->rect[c][j].prop_ptr);
|
||||
}
|
||||
}
|
||||
my_free(1294, &sym->rect[c]);
|
||||
my_free(_ALLOC_ID_, &sym->rect[c]);
|
||||
sym->rects[c] = 0;
|
||||
}
|
||||
for(j = 0;j<sym->texts;j++) {
|
||||
if(sym->text[j].prop_ptr != NULL) {
|
||||
my_free(1297, &sym->text[j].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &sym->text[j].prop_ptr);
|
||||
}
|
||||
if(sym->text[j].txt_ptr != NULL) {
|
||||
my_free(1298, &sym->text[j].txt_ptr);
|
||||
my_free(_ALLOC_ID_, &sym->text[j].txt_ptr);
|
||||
}
|
||||
if(sym->text[j].font != NULL) {
|
||||
my_free(1299, &sym->text[j].font);
|
||||
my_free(_ALLOC_ID_, &sym->text[j].font);
|
||||
}
|
||||
}
|
||||
my_free(1300, &sym->text);
|
||||
my_free(_ALLOC_ID_, &sym->text);
|
||||
sym->texts = 0;
|
||||
my_free(1301, &sym->line);
|
||||
my_free(1302, &sym->rect);
|
||||
my_free(1303, &sym->poly);
|
||||
my_free(1304, &sym->arc);
|
||||
my_free(1305, &sym->lines);
|
||||
my_free(1306, &sym->rects);
|
||||
my_free(1307, &sym->polygons);
|
||||
my_free(1308, &sym->arcs);
|
||||
my_free(_ALLOC_ID_, &sym->line);
|
||||
my_free(_ALLOC_ID_, &sym->rect);
|
||||
my_free(_ALLOC_ID_, &sym->poly);
|
||||
my_free(_ALLOC_ID_, &sym->arc);
|
||||
my_free(_ALLOC_ID_, &sym->lines);
|
||||
my_free(_ALLOC_ID_, &sym->rects);
|
||||
my_free(_ALLOC_ID_, &sym->polygons);
|
||||
my_free(_ALLOC_ID_, &sym->arcs);
|
||||
}
|
||||
my_free(48, &xctx->uslot[slot].symptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].symptr);
|
||||
xctx->uslot[slot].symbols = 0;
|
||||
}
|
||||
|
||||
|
|
@ -197,14 +197,14 @@ static void mem_init_undo(void)
|
|||
dbg(1, "mem_init_undo(): undo_initialized = %d\n", xctx->undo_initialized);
|
||||
if(!xctx->undo_initialized) {
|
||||
for(slot = 0;slot<MAX_UNDO; slot++) {
|
||||
xctx->uslot[slot].lines = my_calloc(165, cadlayers, sizeof(int));
|
||||
xctx->uslot[slot].rects = my_calloc(166, cadlayers, sizeof(int));
|
||||
xctx->uslot[slot].arcs = my_calloc(167, cadlayers, sizeof(int));
|
||||
xctx->uslot[slot].polygons = my_calloc(168, cadlayers, sizeof(int));
|
||||
xctx->uslot[slot].lptr = my_calloc(169, cadlayers, sizeof(xLine *));
|
||||
xctx->uslot[slot].bptr = my_calloc(170, cadlayers, sizeof(xRect *));
|
||||
xctx->uslot[slot].aptr = my_calloc(171, cadlayers, sizeof(xArc *));
|
||||
xctx->uslot[slot].pptr = my_calloc(172, cadlayers, sizeof(xPoly *));
|
||||
xctx->uslot[slot].lines = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->uslot[slot].rects = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->uslot[slot].arcs = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->uslot[slot].polygons = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->uslot[slot].lptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
|
||||
xctx->uslot[slot].bptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
|
||||
xctx->uslot[slot].aptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
|
||||
xctx->uslot[slot].pptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
|
||||
}
|
||||
xctx->undo_initialized = 1;
|
||||
}
|
||||
|
|
@ -239,14 +239,14 @@ void mem_delete_undo(void)
|
|||
if(!xctx->undo_initialized) return;
|
||||
mem_clear_undo();
|
||||
for(slot = 0;slot<MAX_UNDO; slot++) {
|
||||
my_free(804, &xctx->uslot[slot].lines);
|
||||
my_free(805, &xctx->uslot[slot].rects);
|
||||
my_free(806, &xctx->uslot[slot].arcs);
|
||||
my_free(807, &xctx->uslot[slot].polygons);
|
||||
my_free(808, &xctx->uslot[slot].lptr);
|
||||
my_free(809, &xctx->uslot[slot].bptr);
|
||||
my_free(810, &xctx->uslot[slot].aptr);
|
||||
my_free(811, &xctx->uslot[slot].pptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].lines);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].rects);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].arcs);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].polygons);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].lptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].bptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].aptr);
|
||||
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr);
|
||||
}
|
||||
xctx->undo_initialized = 0;
|
||||
}
|
||||
|
|
@ -261,11 +261,11 @@ void mem_push_undo(void)
|
|||
mem_init_undo();
|
||||
slot = xctx->cur_undo_ptr%MAX_UNDO;
|
||||
|
||||
my_strdup(173, &xctx->uslot[slot].gptr, xctx->schvhdlprop);
|
||||
my_strdup(174, &xctx->uslot[slot].vptr, xctx->schverilogprop);
|
||||
my_strdup(175, &xctx->uslot[slot].sptr, xctx->schprop);
|
||||
my_strdup(359, &xctx->uslot[slot].kptr, xctx->schsymbolprop);
|
||||
my_strdup(176, &xctx->uslot[slot].eptr, xctx->schtedaxprop);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].gptr, xctx->schvhdlprop);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].vptr, xctx->schverilogprop);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].sptr, xctx->schprop);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].kptr, xctx->schsymbolprop);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].eptr, xctx->schtedaxprop);
|
||||
|
||||
free_undo_lines(slot);
|
||||
free_undo_rects(slot);
|
||||
|
|
@ -281,15 +281,15 @@ void mem_push_undo(void)
|
|||
memcpy(xctx->uslot[slot].arcs, xctx->arcs, sizeof(xctx->arcs[0]) * cadlayers);
|
||||
memcpy(xctx->uslot[slot].polygons, xctx->polygons, sizeof(xctx->polygons[0]) * cadlayers);
|
||||
for(c = 0;c<cadlayers;c++) {
|
||||
xctx->uslot[slot].lptr[c] = my_calloc(177, xctx->lines[c], sizeof(xLine));
|
||||
xctx->uslot[slot].bptr[c] = my_calloc(178, xctx->rects[c], sizeof(xRect));
|
||||
xctx->uslot[slot].pptr[c] = my_calloc(179, xctx->polygons[c], sizeof(xPoly));
|
||||
xctx->uslot[slot].aptr[c] = my_calloc(180, xctx->arcs[c], sizeof(xArc));
|
||||
xctx->uslot[slot].lptr[c] = my_calloc(_ALLOC_ID_, xctx->lines[c], sizeof(xLine));
|
||||
xctx->uslot[slot].bptr[c] = my_calloc(_ALLOC_ID_, xctx->rects[c], sizeof(xRect));
|
||||
xctx->uslot[slot].pptr[c] = my_calloc(_ALLOC_ID_, xctx->polygons[c], sizeof(xPoly));
|
||||
xctx->uslot[slot].aptr[c] = my_calloc(_ALLOC_ID_, xctx->arcs[c], sizeof(xArc));
|
||||
}
|
||||
xctx->uslot[slot].wptr = my_calloc(181, xctx->wires, sizeof(xWire));
|
||||
xctx->uslot[slot].tptr = my_calloc(182, xctx->texts, sizeof(xText));
|
||||
xctx->uslot[slot].iptr = my_calloc(183, xctx->instances, sizeof(xInstance));
|
||||
xctx->uslot[slot].symptr = my_calloc(353, xctx->symbols, sizeof(xSymbol));
|
||||
xctx->uslot[slot].wptr = my_calloc(_ALLOC_ID_, xctx->wires, sizeof(xWire));
|
||||
xctx->uslot[slot].tptr = my_calloc(_ALLOC_ID_, xctx->texts, sizeof(xText));
|
||||
xctx->uslot[slot].iptr = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(xInstance));
|
||||
xctx->uslot[slot].symptr = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(xSymbol));
|
||||
xctx->uslot[slot].texts = xctx->texts;
|
||||
xctx->uslot[slot].instances = xctx->instances;
|
||||
xctx->uslot[slot].symbols = xctx->symbols;
|
||||
|
|
@ -300,34 +300,34 @@ void mem_push_undo(void)
|
|||
for(i = 0;i<xctx->lines[c];i++) {
|
||||
xctx->uslot[slot].lptr[c][i] = xctx->line[c][i];
|
||||
xctx->uslot[slot].lptr[c][i].prop_ptr = NULL;
|
||||
my_strdup(184, &xctx->uslot[slot].lptr[c][i].prop_ptr, xctx->line[c][i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].lptr[c][i].prop_ptr, xctx->line[c][i].prop_ptr);
|
||||
}
|
||||
/* rects */
|
||||
for(i = 0;i<xctx->rects[c];i++) {
|
||||
xctx->uslot[slot].bptr[c][i] = xctx->rect[c][i];
|
||||
xctx->uslot[slot].bptr[c][i].prop_ptr = NULL;
|
||||
xctx->uslot[slot].bptr[c][i].extraptr = NULL;
|
||||
my_strdup(185, &xctx->uslot[slot].bptr[c][i].prop_ptr, xctx->rect[c][i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].bptr[c][i].prop_ptr, xctx->rect[c][i].prop_ptr);
|
||||
}
|
||||
/* arcs */
|
||||
for(i = 0;i<xctx->arcs[c];i++) {
|
||||
xctx->uslot[slot].aptr[c][i] = xctx->arc[c][i];
|
||||
xctx->uslot[slot].aptr[c][i].prop_ptr = NULL;
|
||||
my_strdup(186, &xctx->uslot[slot].aptr[c][i].prop_ptr, xctx->arc[c][i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].aptr[c][i].prop_ptr, xctx->arc[c][i].prop_ptr);
|
||||
}
|
||||
/*polygons */
|
||||
for(i = 0;i<xctx->polygons[c];i++) {
|
||||
int points = xctx->poly[c][i].points;
|
||||
xctx->uslot[slot].pptr[c][i] = xctx->poly[c][i];
|
||||
xctx->uslot[slot].pptr[c][i].prop_ptr = NULL;
|
||||
xctx->uslot[slot].pptr[c][i].x = my_malloc(187, points * sizeof(double));
|
||||
xctx->uslot[slot].pptr[c][i].y = my_malloc(188, points * sizeof(double));
|
||||
xctx->uslot[slot].pptr[c][i].selected_point = my_malloc(189, points * sizeof(unsigned short));
|
||||
xctx->uslot[slot].pptr[c][i].x = my_malloc(_ALLOC_ID_, points * sizeof(double));
|
||||
xctx->uslot[slot].pptr[c][i].y = my_malloc(_ALLOC_ID_, points * sizeof(double));
|
||||
xctx->uslot[slot].pptr[c][i].selected_point = my_malloc(_ALLOC_ID_, points * sizeof(unsigned short));
|
||||
memcpy(xctx->uslot[slot].pptr[c][i].x, xctx->poly[c][i].x, points * sizeof(double));
|
||||
memcpy(xctx->uslot[slot].pptr[c][i].y, xctx->poly[c][i].y, points * sizeof(double));
|
||||
memcpy(xctx->uslot[slot].pptr[c][i].selected_point, xctx->poly[c][i].selected_point,
|
||||
points * sizeof(unsigned short));
|
||||
my_strdup(190, &xctx->uslot[slot].pptr[c][i].prop_ptr, xctx->poly[c][i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].pptr[c][i].prop_ptr, xctx->poly[c][i].prop_ptr);
|
||||
}
|
||||
}
|
||||
/* instances */
|
||||
|
|
@ -338,10 +338,10 @@ void mem_push_undo(void)
|
|||
xctx->uslot[slot].iptr[i].instname = NULL;
|
||||
xctx->uslot[slot].iptr[i].lab = NULL;
|
||||
xctx->uslot[slot].iptr[i].node = NULL;
|
||||
my_strdup(330, &xctx->uslot[slot].iptr[i].lab, xctx->inst[i].lab);
|
||||
my_strdup2(191, &xctx->uslot[slot].iptr[i].instname, xctx->inst[i].instname);
|
||||
my_strdup(192, &xctx->uslot[slot].iptr[i].prop_ptr, xctx->inst[i].prop_ptr);
|
||||
my_strdup2(193, &xctx->uslot[slot].iptr[i].name, xctx->inst[i].name);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].lab, xctx->inst[i].lab);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].instname, xctx->inst[i].instname);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].prop_ptr, xctx->inst[i].prop_ptr);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].name, xctx->inst[i].name);
|
||||
}
|
||||
|
||||
/* symbols */
|
||||
|
|
@ -352,19 +352,19 @@ void mem_push_undo(void)
|
|||
sym->prop_ptr = NULL;
|
||||
sym->type = NULL;
|
||||
sym->templ = NULL;
|
||||
my_strdup2(1316, &sym->name, xctx->sym[i].name);
|
||||
my_strdup2(1317, &sym->type, xctx->sym[i].type);
|
||||
my_strdup2(1318, &sym->templ, xctx->sym[i].templ);
|
||||
my_strdup2(1319, &sym->prop_ptr, xctx->sym[i].prop_ptr);
|
||||
sym->line = my_calloc(1309, cadlayers, sizeof(xLine *));
|
||||
sym->poly = my_calloc(1324, cadlayers, sizeof(xPoly *));
|
||||
sym->arc = my_calloc(1310, cadlayers, sizeof(xArc *));
|
||||
sym->rect = my_calloc(1311, cadlayers, sizeof(xRect *));
|
||||
sym->lines = my_calloc(1312, cadlayers, sizeof(int));
|
||||
sym->rects = my_calloc(1313, cadlayers, sizeof(int));
|
||||
sym->arcs = my_calloc(1314, cadlayers, sizeof(int));
|
||||
sym->polygons = my_calloc(1315, cadlayers, sizeof(int));
|
||||
sym->text = my_calloc(1320, xctx->sym[i].texts, sizeof(xText));
|
||||
my_strdup2(_ALLOC_ID_, &sym->name, xctx->sym[i].name);
|
||||
my_strdup2(_ALLOC_ID_, &sym->type, xctx->sym[i].type);
|
||||
my_strdup2(_ALLOC_ID_, &sym->templ, xctx->sym[i].templ);
|
||||
my_strdup2(_ALLOC_ID_, &sym->prop_ptr, xctx->sym[i].prop_ptr);
|
||||
sym->line = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
|
||||
sym->poly = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
|
||||
sym->arc = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
|
||||
sym->rect = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
|
||||
sym->lines = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
sym->rects = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
sym->arcs = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
sym->polygons = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
sym->text = my_calloc(_ALLOC_ID_, xctx->sym[i].texts, sizeof(xText));
|
||||
|
||||
memcpy(sym->lines, xctx->sym[i].lines, sizeof(sym->lines[0]) * cadlayers);
|
||||
memcpy(sym->rects, xctx->sym[i].rects, sizeof(sym->rects[0]) * cadlayers);
|
||||
|
|
@ -372,37 +372,37 @@ void mem_push_undo(void)
|
|||
memcpy(sym->polygons, xctx->sym[i].polygons, sizeof(sym->polygons[0]) * cadlayers);
|
||||
for(c = 0;c<cadlayers;c++) {
|
||||
/* symbol lines */
|
||||
sym->line[c] = my_calloc(1359, xctx->sym[i].lines[c], sizeof(xLine));
|
||||
sym->line[c] = my_calloc(_ALLOC_ID_, xctx->sym[i].lines[c], sizeof(xLine));
|
||||
for(j = 0; j < xctx->sym[i].lines[c]; j++) {
|
||||
sym->line[c][j] = xctx->sym[i].line[c][j];
|
||||
sym->line[c][j].prop_ptr = NULL;
|
||||
my_strdup(1358, &sym->line[c][j].prop_ptr, xctx->sym[i].line[c][j].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &sym->line[c][j].prop_ptr, xctx->sym[i].line[c][j].prop_ptr);
|
||||
}
|
||||
/* symbol rects */
|
||||
sym->rect[c] = my_calloc(1360, xctx->sym[i].rects[c], sizeof(xRect));
|
||||
sym->rect[c] = my_calloc(_ALLOC_ID_, xctx->sym[i].rects[c], sizeof(xRect));
|
||||
for(j = 0; j < xctx->sym[i].rects[c]; j++) {
|
||||
sym->rect[c][j] = xctx->sym[i].rect[c][j];
|
||||
sym->rect[c][j].prop_ptr = NULL;
|
||||
sym->rect[c][j].extraptr = NULL;
|
||||
my_strdup(1362, &sym->rect[c][j].prop_ptr, xctx->sym[i].rect[c][j].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &sym->rect[c][j].prop_ptr, xctx->sym[i].rect[c][j].prop_ptr);
|
||||
}
|
||||
/* symbol arcs */
|
||||
sym->arc[c] = my_calloc(1361, xctx->sym[i].arcs[c], sizeof(xArc));
|
||||
sym->arc[c] = my_calloc(_ALLOC_ID_, xctx->sym[i].arcs[c], sizeof(xArc));
|
||||
for(j = 0; j < xctx->sym[i].arcs[c]; j++) {
|
||||
sym->arc[c][j] = xctx->sym[i].arc[c][j];
|
||||
sym->arc[c][j].prop_ptr = NULL;
|
||||
my_strdup(1375, &sym->arc[c][j].prop_ptr, xctx->sym[i].arc[c][j].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &sym->arc[c][j].prop_ptr, xctx->sym[i].arc[c][j].prop_ptr);
|
||||
}
|
||||
/* symbol polygons */
|
||||
sym->poly[c] = my_calloc(1363, xctx->sym[i].polygons[c], sizeof(xPoly));
|
||||
sym->poly[c] = my_calloc(_ALLOC_ID_, xctx->sym[i].polygons[c], sizeof(xPoly));
|
||||
for(j = 0; j < xctx->sym[i].polygons[c]; j++) {
|
||||
int points = xctx->sym[i].poly[c][j].points;
|
||||
sym->poly[c][j] = xctx->sym[i].poly[c][j];
|
||||
sym->poly[c][j].prop_ptr = NULL;
|
||||
sym->poly[c][j].x = my_malloc(1365, points * sizeof(double));
|
||||
sym->poly[c][j].y = my_malloc(1366, points * sizeof(double));
|
||||
sym->poly[c][j].selected_point = my_malloc(1367, points * sizeof(unsigned short));
|
||||
my_strdup(1364, &sym->poly[c][j].prop_ptr, xctx->sym[i].poly[c][j].prop_ptr);
|
||||
sym->poly[c][j].x = my_malloc(_ALLOC_ID_, points * sizeof(double));
|
||||
sym->poly[c][j].y = my_malloc(_ALLOC_ID_, points * sizeof(double));
|
||||
sym->poly[c][j].selected_point = my_malloc(_ALLOC_ID_, points * sizeof(unsigned short));
|
||||
my_strdup(_ALLOC_ID_, &sym->poly[c][j].prop_ptr, xctx->sym[i].poly[c][j].prop_ptr);
|
||||
memcpy(sym->poly[c][j].x, xctx->sym[i].poly[c][j].x, points * sizeof(double));
|
||||
memcpy(sym->poly[c][j].y, xctx->sym[i].poly[c][j].y, points * sizeof(double));
|
||||
memcpy(sym->poly[c][j].selected_point, xctx->sym[i].poly[c][j].selected_point,
|
||||
|
|
@ -415,9 +415,9 @@ void mem_push_undo(void)
|
|||
sym->text[j].prop_ptr = NULL;
|
||||
sym->text[j].txt_ptr = NULL;
|
||||
sym->text[j].font = NULL;
|
||||
my_strdup(1321, &sym->text[j].prop_ptr, xctx->sym[i].text[j].prop_ptr);
|
||||
my_strdup(1322, &sym->text[j].txt_ptr, xctx->sym[i].text[j].txt_ptr);
|
||||
my_strdup(1323, &sym->text[j].font, xctx->sym[i].text[j].font);
|
||||
my_strdup(_ALLOC_ID_, &sym->text[j].prop_ptr, xctx->sym[i].text[j].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &sym->text[j].txt_ptr, xctx->sym[i].text[j].txt_ptr);
|
||||
my_strdup(_ALLOC_ID_, &sym->text[j].font, xctx->sym[i].text[j].font);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -427,9 +427,9 @@ void mem_push_undo(void)
|
|||
xctx->uslot[slot].tptr[i].prop_ptr = NULL;
|
||||
xctx->uslot[slot].tptr[i].txt_ptr = NULL;
|
||||
xctx->uslot[slot].tptr[i].font = NULL;
|
||||
my_strdup(194, &xctx->uslot[slot].tptr[i].prop_ptr, xctx->text[i].prop_ptr);
|
||||
my_strdup(195, &xctx->uslot[slot].tptr[i].txt_ptr, xctx->text[i].txt_ptr);
|
||||
my_strdup(196, &xctx->uslot[slot].tptr[i].font, xctx->text[i].font);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].prop_ptr, xctx->text[i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].txt_ptr, xctx->text[i].txt_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].font, xctx->text[i].font);
|
||||
}
|
||||
|
||||
/* wires */
|
||||
|
|
@ -437,7 +437,7 @@ void mem_push_undo(void)
|
|||
xctx->uslot[slot].wptr[i] = xctx->wire[i];
|
||||
xctx->uslot[slot].wptr[i].prop_ptr = NULL;
|
||||
xctx->uslot[slot].wptr[i].node = NULL;
|
||||
my_strdup(197, &xctx->uslot[slot].wptr[i].prop_ptr, xctx->wire[i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].wptr[i].prop_ptr, xctx->wire[i].prop_ptr);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -480,78 +480,78 @@ void mem_pop_undo(int redo, int set_modify_status)
|
|||
slot = xctx->cur_undo_ptr%MAX_UNDO;
|
||||
clear_drawing();
|
||||
unselect_all(1);
|
||||
my_free(1345, &xctx->wire);
|
||||
my_free(1346, &xctx->text);
|
||||
my_free(1347, &xctx->inst);
|
||||
my_free(_ALLOC_ID_, &xctx->wire);
|
||||
my_free(_ALLOC_ID_, &xctx->text);
|
||||
my_free(_ALLOC_ID_, &xctx->inst);
|
||||
|
||||
for(i = 0;i<cadlayers;i++) {
|
||||
my_free(1348, &xctx->rect[i]);
|
||||
my_free(1342, &xctx->line[i]);
|
||||
my_free(1343, &xctx->poly[i]);
|
||||
my_free(1344, &xctx->arc[i]);
|
||||
my_free(_ALLOC_ID_, &xctx->rect[i]);
|
||||
my_free(_ALLOC_ID_, &xctx->line[i]);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[i]);
|
||||
my_free(_ALLOC_ID_, &xctx->arc[i]);
|
||||
}
|
||||
|
||||
remove_symbols();
|
||||
|
||||
|
||||
for(i = 0;i<xctx->maxs;i++) {
|
||||
my_free(1349, &xctx->sym[i].line);
|
||||
my_free(1350, &xctx->sym[i].rect);
|
||||
my_free(1351, &xctx->sym[i].arc);
|
||||
my_free(1352, &xctx->sym[i].poly);
|
||||
my_free(1353, &xctx->sym[i].lines);
|
||||
my_free(1354, &xctx->sym[i].polygons);
|
||||
my_free(1355, &xctx->sym[i].arcs);
|
||||
my_free(1356, &xctx->sym[i].rects);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].line);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].rect);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].arc);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].poly);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].lines);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].polygons);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].arcs);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].rects);
|
||||
}
|
||||
|
||||
|
||||
my_free(0, &xctx->sym);
|
||||
my_free(_ALLOC_ID_, &xctx->sym);
|
||||
|
||||
|
||||
my_strdup(198, &xctx->schvhdlprop, xctx->uslot[slot].gptr);
|
||||
my_strdup(199, &xctx->schverilogprop, xctx->uslot[slot].vptr);
|
||||
my_strdup(200, &xctx->schprop, xctx->uslot[slot].sptr);
|
||||
my_strdup(389, &xctx->schsymbolprop, xctx->uslot[slot].kptr);
|
||||
my_strdup(201, &xctx->schtedaxprop, xctx->uslot[slot].eptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->schvhdlprop, xctx->uslot[slot].gptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->schverilogprop, xctx->uslot[slot].vptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->schprop, xctx->uslot[slot].sptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->schsymbolprop, xctx->uslot[slot].kptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->schtedaxprop, xctx->uslot[slot].eptr);
|
||||
|
||||
for(c = 0;c<cadlayers;c++) {
|
||||
/* lines */
|
||||
xctx->maxl[c] = xctx->lines[c] = xctx->uslot[slot].lines[c];
|
||||
xctx->line[c] = my_calloc(202, xctx->lines[c], sizeof(xLine));
|
||||
xctx->line[c] = my_calloc(_ALLOC_ID_, xctx->lines[c], sizeof(xLine));
|
||||
for(i = 0;i<xctx->lines[c];i++) {
|
||||
xctx->line[c][i] = xctx->uslot[slot].lptr[c][i];
|
||||
xctx->line[c][i].prop_ptr = NULL;
|
||||
my_strdup(203, &xctx->line[c][i].prop_ptr, xctx->uslot[slot].lptr[c][i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->line[c][i].prop_ptr, xctx->uslot[slot].lptr[c][i].prop_ptr);
|
||||
}
|
||||
/* rects */
|
||||
xctx->maxr[c] = xctx->rects[c] = xctx->uslot[slot].rects[c];
|
||||
xctx->rect[c] = my_calloc(204, xctx->rects[c], sizeof(xRect));
|
||||
xctx->rect[c] = my_calloc(_ALLOC_ID_, xctx->rects[c], sizeof(xRect));
|
||||
for(i = 0;i<xctx->rects[c];i++) {
|
||||
xctx->rect[c][i] = xctx->uslot[slot].bptr[c][i];
|
||||
xctx->rect[c][i].prop_ptr = NULL;
|
||||
xctx->rect[c][i].extraptr = NULL;
|
||||
my_strdup(205, &xctx->rect[c][i].prop_ptr, xctx->uslot[slot].bptr[c][i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->rect[c][i].prop_ptr, xctx->uslot[slot].bptr[c][i].prop_ptr);
|
||||
}
|
||||
/* arcs */
|
||||
xctx->maxa[c] = xctx->arcs[c] = xctx->uslot[slot].arcs[c];
|
||||
xctx->arc[c] = my_calloc(206, xctx->arcs[c], sizeof(xArc));
|
||||
xctx->arc[c] = my_calloc(_ALLOC_ID_, xctx->arcs[c], sizeof(xArc));
|
||||
for(i = 0;i<xctx->arcs[c];i++) {
|
||||
xctx->arc[c][i] = xctx->uslot[slot].aptr[c][i];
|
||||
xctx->arc[c][i].prop_ptr = NULL;
|
||||
my_strdup(207, &xctx->arc[c][i].prop_ptr, xctx->uslot[slot].aptr[c][i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->arc[c][i].prop_ptr, xctx->uslot[slot].aptr[c][i].prop_ptr);
|
||||
}
|
||||
/* polygons */
|
||||
xctx->maxp[c] = xctx->polygons[c] = xctx->uslot[slot].polygons[c];
|
||||
xctx->poly[c] = my_calloc(208, xctx->polygons[c], sizeof(xPoly));
|
||||
xctx->poly[c] = my_calloc(_ALLOC_ID_, xctx->polygons[c], sizeof(xPoly));
|
||||
for(i = 0;i<xctx->polygons[c];i++) {
|
||||
int points = xctx->uslot[slot].pptr[c][i].points;
|
||||
xctx->poly[c][i] = xctx->uslot[slot].pptr[c][i];
|
||||
xctx->poly[c][i].prop_ptr = NULL;
|
||||
my_strdup(209, &xctx->poly[c][i].prop_ptr, xctx->uslot[slot].pptr[c][i].prop_ptr);
|
||||
xctx->poly[c][i].x = my_malloc(210, points * sizeof(double));
|
||||
xctx->poly[c][i].y = my_malloc(211, points * sizeof(double));
|
||||
xctx->poly[c][i].selected_point = my_malloc(212, points * sizeof(unsigned short));
|
||||
my_strdup(_ALLOC_ID_, &xctx->poly[c][i].prop_ptr, xctx->uslot[slot].pptr[c][i].prop_ptr);
|
||||
xctx->poly[c][i].x = my_malloc(_ALLOC_ID_, points * sizeof(double));
|
||||
xctx->poly[c][i].y = my_malloc(_ALLOC_ID_, points * sizeof(double));
|
||||
xctx->poly[c][i].selected_point = my_malloc(_ALLOC_ID_, points * sizeof(unsigned short));
|
||||
memcpy(xctx->poly[c][i].x, xctx->uslot[slot].pptr[c][i].x, points * sizeof(double));
|
||||
memcpy(xctx->poly[c][i].y, xctx->uslot[slot].pptr[c][i].y, points * sizeof(double));
|
||||
memcpy(xctx->poly[c][i].selected_point, xctx->uslot[slot].pptr[c][i].selected_point,
|
||||
|
|
@ -561,22 +561,22 @@ void mem_pop_undo(int redo, int set_modify_status)
|
|||
|
||||
/* instances */
|
||||
xctx->maxi = xctx->instances = xctx->uslot[slot].instances;
|
||||
xctx->inst = my_calloc(213, xctx->instances, sizeof(xInstance));
|
||||
xctx->inst = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(xInstance));
|
||||
for(i = 0;i<xctx->instances;i++) {
|
||||
xctx->inst[i] = xctx->uslot[slot].iptr[i];
|
||||
xctx->inst[i].prop_ptr = NULL;
|
||||
xctx->inst[i].name = NULL;
|
||||
xctx->inst[i].instname = NULL;
|
||||
xctx->inst[i].lab = NULL;
|
||||
my_strdup(214, &xctx->inst[i].prop_ptr, xctx->uslot[slot].iptr[i].prop_ptr);
|
||||
my_strdup2(215, &xctx->inst[i].name, xctx->uslot[slot].iptr[i].name);
|
||||
my_strdup2(216, &xctx->inst[i].instname, xctx->uslot[slot].iptr[i].instname);
|
||||
my_strdup(766, &xctx->inst[i].lab, xctx->uslot[slot].iptr[i].lab);
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, xctx->uslot[slot].iptr[i].prop_ptr);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[i].name, xctx->uslot[slot].iptr[i].name);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[i].instname, xctx->uslot[slot].iptr[i].instname);
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[i].lab, xctx->uslot[slot].iptr[i].lab);
|
||||
}
|
||||
|
||||
/* symbols */
|
||||
xctx->maxs = xctx->symbols = xctx->uslot[slot].symbols;
|
||||
xctx->sym = my_calloc(1325, xctx->symbols, sizeof(xSymbol));
|
||||
xctx->sym = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(xSymbol));
|
||||
|
||||
for(i = 0;i<xctx->symbols;i++) {
|
||||
sym = &xctx->uslot[slot].symptr[i];
|
||||
|
|
@ -585,20 +585,20 @@ void mem_pop_undo(int redo, int set_modify_status)
|
|||
xctx->sym[i].prop_ptr = NULL;
|
||||
xctx->sym[i].type = NULL;
|
||||
xctx->sym[i].templ = NULL;
|
||||
my_strdup2(1326, &xctx->sym[i].name, sym->name);
|
||||
my_strdup2(1327, &xctx->sym[i].type, sym->type);
|
||||
my_strdup2(1328, &xctx->sym[i].templ, sym->templ);
|
||||
my_strdup2(1329, &xctx->sym[i].prop_ptr, sym->prop_ptr);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->sym[i].name, sym->name);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->sym[i].type, sym->type);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->sym[i].templ, sym->templ);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->sym[i].prop_ptr, sym->prop_ptr);
|
||||
|
||||
xctx->sym[i].line = my_calloc(1330, cadlayers, sizeof(xLine *));
|
||||
xctx->sym[i].poly = my_calloc(1331, cadlayers, sizeof(xPoly *));
|
||||
xctx->sym[i].arc = my_calloc(1332, cadlayers, sizeof(xArc *));
|
||||
xctx->sym[i].rect = my_calloc(1333, cadlayers, sizeof(xRect *));
|
||||
xctx->sym[i].lines = my_calloc(1334, cadlayers, sizeof(int));
|
||||
xctx->sym[i].rects = my_calloc(1335, cadlayers, sizeof(int));
|
||||
xctx->sym[i].arcs = my_calloc(1336, cadlayers, sizeof(int));
|
||||
xctx->sym[i].polygons = my_calloc(1337, cadlayers, sizeof(int));
|
||||
xctx->sym[i].text = my_calloc(1338, xctx->sym[i].texts, sizeof(xText));
|
||||
xctx->sym[i].line = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
|
||||
xctx->sym[i].poly = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
|
||||
xctx->sym[i].arc = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
|
||||
xctx->sym[i].rect = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
|
||||
xctx->sym[i].lines = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->sym[i].rects = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->sym[i].arcs = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->sym[i].polygons = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->sym[i].text = my_calloc(_ALLOC_ID_, xctx->sym[i].texts, sizeof(xText));
|
||||
|
||||
memcpy(xctx->sym[i].lines, sym->lines, sizeof(sym->lines[0]) * cadlayers);
|
||||
memcpy(xctx->sym[i].rects, sym->rects, sizeof(sym->rects[0]) * cadlayers);
|
||||
|
|
@ -607,41 +607,41 @@ void mem_pop_undo(int redo, int set_modify_status)
|
|||
|
||||
for(c = 0;c<cadlayers;c++) {
|
||||
/* symbol lines */
|
||||
xctx->sym[i].line[c] = my_calloc(1371, sym->lines[c], sizeof(xLine));
|
||||
xctx->sym[i].line[c] = my_calloc(_ALLOC_ID_, sym->lines[c], sizeof(xLine));
|
||||
for(j = 0; j < xctx->sym[i].lines[c]; j++) {
|
||||
xctx->sym[i].line[c][j] = sym->line[c][j];
|
||||
xctx->sym[i].line[c][j].prop_ptr = NULL;
|
||||
my_strdup(1368, & xctx->sym[i].line[c][j].prop_ptr, sym->line[c][j].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, & xctx->sym[i].line[c][j].prop_ptr, sym->line[c][j].prop_ptr);
|
||||
}
|
||||
/* symbol rects */
|
||||
xctx->sym[i].rect[c] = my_calloc(1372, sym->rects[c], sizeof(xRect));
|
||||
xctx->sym[i].rect[c] = my_calloc(_ALLOC_ID_, sym->rects[c], sizeof(xRect));
|
||||
for(j = 0; j < xctx->sym[i].rects[c]; j++) {
|
||||
xctx->sym[i].rect[c][j] = sym->rect[c][j];
|
||||
xctx->sym[i].rect[c][j].prop_ptr = NULL;
|
||||
xctx->sym[i].rect[c][j].extraptr = NULL;
|
||||
my_strdup(1369, & xctx->sym[i].rect[c][j].prop_ptr, sym->rect[c][j].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, & xctx->sym[i].rect[c][j].prop_ptr, sym->rect[c][j].prop_ptr);
|
||||
}
|
||||
/* symbol arcs */
|
||||
xctx->sym[i].arc[c] = my_calloc(1373, sym->arcs[c], sizeof(xArc));
|
||||
xctx->sym[i].arc[c] = my_calloc(_ALLOC_ID_, sym->arcs[c], sizeof(xArc));
|
||||
for(j = 0; j < xctx->sym[i].arcs[c]; j++) {
|
||||
xctx->sym[i].arc[c][j] = sym->arc[c][j];
|
||||
xctx->sym[i].arc[c][j].prop_ptr = NULL;
|
||||
my_strdup(1370, & xctx->sym[i].arc[c][j].prop_ptr, sym->arc[c][j].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, & xctx->sym[i].arc[c][j].prop_ptr, sym->arc[c][j].prop_ptr);
|
||||
}
|
||||
/* symbol polygons */
|
||||
xctx->sym[i].poly[c] = my_calloc(1374, sym->polygons[c], sizeof(xPoly));
|
||||
xctx->sym[i].poly[c] = my_calloc(_ALLOC_ID_, sym->polygons[c], sizeof(xPoly));
|
||||
for(j = 0; j < xctx->sym[i].polygons[c]; j++) {
|
||||
int points = sym->poly[c][j].points;
|
||||
xctx->sym[i].poly[c][j] = sym->poly[c][j];
|
||||
xctx->sym[i].poly[c][j].prop_ptr = NULL;
|
||||
xctx->sym[i].poly[c][j].x = my_malloc(1376, points * sizeof(double));
|
||||
xctx->sym[i].poly[c][j].y = my_malloc(1377, points * sizeof(double));
|
||||
xctx->sym[i].poly[c][j].selected_point = my_malloc(1378, points * sizeof(unsigned short));
|
||||
xctx->sym[i].poly[c][j].x = my_malloc(_ALLOC_ID_, points * sizeof(double));
|
||||
xctx->sym[i].poly[c][j].y = my_malloc(_ALLOC_ID_, points * sizeof(double));
|
||||
xctx->sym[i].poly[c][j].selected_point = my_malloc(_ALLOC_ID_, points * sizeof(unsigned short));
|
||||
memcpy(xctx->sym[i].poly[c][j].x, sym->poly[c][j].x, points * sizeof(double));
|
||||
memcpy(xctx->sym[i].poly[c][j].y, sym->poly[c][j].y, points * sizeof(double));
|
||||
memcpy(xctx->sym[i].poly[c][j].selected_point, sym->poly[c][j].selected_point,
|
||||
points * sizeof(unsigned short));
|
||||
my_strdup(1357, & xctx->sym[i].poly[c][j].prop_ptr, sym->poly[c][j].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, & xctx->sym[i].poly[c][j].prop_ptr, sym->poly[c][j].prop_ptr);
|
||||
}
|
||||
}
|
||||
/* symbol texts */
|
||||
|
|
@ -650,33 +650,33 @@ void mem_pop_undo(int redo, int set_modify_status)
|
|||
xctx->sym[i].text[j].prop_ptr = NULL;
|
||||
xctx->sym[i].text[j].txt_ptr = NULL;
|
||||
xctx->sym[i].text[j].font = NULL;
|
||||
my_strdup(1339, &xctx->sym[i].text[j].prop_ptr, sym->text[j].prop_ptr);
|
||||
my_strdup(1340, &xctx->sym[i].text[j].txt_ptr, sym->text[j].txt_ptr);
|
||||
my_strdup(1341, &xctx->sym[i].text[j].font, sym->text[j].font);
|
||||
my_strdup(_ALLOC_ID_, &xctx->sym[i].text[j].prop_ptr, sym->text[j].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->sym[i].text[j].txt_ptr, sym->text[j].txt_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->sym[i].text[j].font, sym->text[j].font);
|
||||
}
|
||||
}
|
||||
|
||||
/* texts */
|
||||
xctx->maxt = xctx->texts = xctx->uslot[slot].texts;
|
||||
xctx->text = my_calloc(217, xctx->texts, sizeof(xText));
|
||||
xctx->text = my_calloc(_ALLOC_ID_, xctx->texts, sizeof(xText));
|
||||
for(i = 0;i<xctx->texts;i++) {
|
||||
xctx->text[i] = xctx->uslot[slot].tptr[i];
|
||||
xctx->text[i].txt_ptr = NULL;
|
||||
xctx->text[i].font = NULL;
|
||||
xctx->text[i].prop_ptr = NULL;
|
||||
my_strdup(218, &xctx->text[i].prop_ptr, xctx->uslot[slot].tptr[i].prop_ptr);
|
||||
my_strdup(219, &xctx->text[i].txt_ptr, xctx->uslot[slot].tptr[i].txt_ptr);
|
||||
my_strdup(220, &xctx->text[i].font, xctx->uslot[slot].tptr[i].font);
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[i].prop_ptr, xctx->uslot[slot].tptr[i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[i].txt_ptr, xctx->uslot[slot].tptr[i].txt_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[i].font, xctx->uslot[slot].tptr[i].font);
|
||||
}
|
||||
|
||||
/* wires */
|
||||
xctx->maxw = xctx->wires = xctx->uslot[slot].wires;
|
||||
xctx->wire = my_calloc(221, xctx->wires, sizeof(xWire));
|
||||
xctx->wire = my_calloc(_ALLOC_ID_, xctx->wires, sizeof(xWire));
|
||||
for(i = 0;i<xctx->wires;i++) {
|
||||
xctx->wire[i] = xctx->uslot[slot].wptr[i];
|
||||
xctx->wire[i].prop_ptr = NULL;
|
||||
xctx->wire[i].node = NULL;
|
||||
my_strdup(222, &xctx->wire[i].prop_ptr, xctx->uslot[slot].wptr[i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->wire[i].prop_ptr, xctx->uslot[slot].wptr[i].prop_ptr);
|
||||
}
|
||||
/* unnecessary since in_memory_undo saves all symbols */
|
||||
/* link_symbols_to_instances(-1); */
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ static void child_handler(int signum)
|
|||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
my_strdup(45, &xschem_executable, argv[0]);
|
||||
my_strdup(_ALLOC_ID_, &xschem_executable, argv[0]);
|
||||
signal(SIGINT, sig_handler);
|
||||
signal(SIGSEGV, sig_handler);
|
||||
signal(SIGILL, sig_handler);
|
||||
|
|
@ -94,10 +94,10 @@ int main(int argc, char **argv)
|
|||
|
||||
|
||||
cli_opt_argc = argc;
|
||||
cli_opt_argv = my_malloc(291, cli_opt_argc * sizeof(char *));
|
||||
cli_opt_argv = my_malloc(_ALLOC_ID_, cli_opt_argc * sizeof(char *));
|
||||
for(i = 0; i < cli_opt_argc; i++) {
|
||||
cli_opt_argv[i] = NULL;
|
||||
my_strdup(374, &cli_opt_argv[i], argv[i]);
|
||||
my_strdup(_ALLOC_ID_, &cli_opt_argv[i], argv[i]);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
46
src/move.c
46
src/move.c
|
|
@ -104,8 +104,8 @@ void check_collapsing_objects()
|
|||
{
|
||||
if(xctx->wire[i].x1==xctx->wire[i].x2 && xctx->wire[i].y1 == xctx->wire[i].y2)
|
||||
{
|
||||
my_free(812, &xctx->wire[i].prop_ptr);
|
||||
my_free(813, &xctx->wire[i].node);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].node);
|
||||
found=1;
|
||||
j++;
|
||||
continue;
|
||||
|
|
@ -125,7 +125,7 @@ void check_collapsing_objects()
|
|||
{
|
||||
if(xctx->line[c][i].x1==xctx->line[c][i].x2 && xctx->line[c][i].y1 == xctx->line[c][i].y2)
|
||||
{
|
||||
my_free(814, &xctx->line[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->line[c][i].prop_ptr);
|
||||
found=1;
|
||||
j++;
|
||||
continue;
|
||||
|
|
@ -144,7 +144,7 @@ void check_collapsing_objects()
|
|||
{
|
||||
if(xctx->rect[c][i].x1==xctx->rect[c][i].x2 || xctx->rect[c][i].y1 == xctx->rect[c][i].y2)
|
||||
{
|
||||
my_free(815, &xctx->rect[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->rect[c][i].prop_ptr);
|
||||
set_rect_extraptr(0, &xctx->rect[c][i]);
|
||||
found=1;
|
||||
j++;
|
||||
|
|
@ -296,8 +296,8 @@ void draw_selection(GC g, int interruptable)
|
|||
break;
|
||||
case POLYGON:
|
||||
{
|
||||
double *x = my_malloc(223, sizeof(double) *xctx->poly[c][n].points);
|
||||
double *y = my_malloc(224, sizeof(double) *xctx->poly[c][n].points);
|
||||
double *x = my_malloc(_ALLOC_ID_, sizeof(double) *xctx->poly[c][n].points);
|
||||
double *y = my_malloc(_ALLOC_ID_, sizeof(double) *xctx->poly[c][n].points);
|
||||
if(xctx->poly[c][n].sel==SELECTED || xctx->poly[c][n].sel==SELECTED1) {
|
||||
for(k=0;k<xctx->poly[c][n].points; k++) {
|
||||
if( xctx->poly[c][n].sel==SELECTED || xctx->poly[c][n].selected_point[k]) {
|
||||
|
|
@ -317,8 +317,8 @@ void draw_selection(GC g, int interruptable)
|
|||
}
|
||||
drawtemppolygon(g, NOW, x, y, xctx->poly[c][n].points);
|
||||
}
|
||||
my_free(816, &x);
|
||||
my_free(817, &y);
|
||||
my_free(_ALLOC_ID_, &x);
|
||||
my_free(_ALLOC_ID_, &y);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -497,7 +497,7 @@ void find_inst_to_be_redrawn(int what)
|
|||
|
||||
dbg(1,"find_inst_to_be_redrawn(): what=%d\n", what);
|
||||
if(what & 16) {
|
||||
my_free(1202, &xctx->inst_redraw_table);
|
||||
my_free(_ALLOC_ID_, &xctx->inst_redraw_table);
|
||||
xctx->inst_redraw_table_size = 0;
|
||||
if((s_pnetname || xctx->hilight_nets)) int_hash_free(&xctx->node_redraw_table);
|
||||
return;
|
||||
|
|
@ -530,7 +530,7 @@ void find_inst_to_be_redrawn(int what)
|
|||
} /* if(!(what & 8)) */
|
||||
|
||||
if(!xctx->inst_redraw_table || xctx->instances > xctx->inst_redraw_table_size) {
|
||||
my_realloc(1203, &xctx->inst_redraw_table, xctx->instances * sizeof(unsigned char));
|
||||
my_realloc(_ALLOC_ID_, &xctx->inst_redraw_table, xctx->instances * sizeof(unsigned char));
|
||||
xctx->inst_redraw_table_size = xctx->instances;
|
||||
}
|
||||
for(i=0; i < xctx->instances; i++) {
|
||||
|
|
@ -632,11 +632,11 @@ void copy_objects(int what)
|
|||
xctx->move_rot = xctx->move_flip = 0;
|
||||
xctx->deltax = xctx->deltay = 0.;
|
||||
xctx->ui_state&=~STARTCOPY;
|
||||
my_strdup(225, &str, user_conf_dir);
|
||||
my_strdup(_ALLOC_ID_, &str, user_conf_dir);
|
||||
my_strcat(226, &str, "/.selection.sch");
|
||||
xunlink(str);
|
||||
update_symbol_bboxes(0, 0);
|
||||
my_free(818, &str);
|
||||
my_free(_ALLOC_ID_, &str);
|
||||
}
|
||||
if(what & RUBBER) /* draw objects while moving */
|
||||
{
|
||||
|
|
@ -796,8 +796,8 @@ void copy_objects(int what)
|
|||
{
|
||||
xPoly *p = &xctx->poly[c][n];
|
||||
double bx1 = 0.0, by1 = 0.0, bx2 = 0.0, by2 = 0.0;
|
||||
double *x = my_malloc(227, sizeof(double) *p->points);
|
||||
double *y = my_malloc(228, sizeof(double) *p->points);
|
||||
double *x = my_malloc(_ALLOC_ID_, sizeof(double) *p->points);
|
||||
double *y = my_malloc(_ALLOC_ID_, sizeof(double) *p->points);
|
||||
int j;
|
||||
for(j=0; j<p->points; j++) {
|
||||
if( p->sel==SELECTED || p->selected_point[j]) {
|
||||
|
|
@ -821,8 +821,8 @@ void copy_objects(int what)
|
|||
xctx->sel_array[i].n=xctx->polygons[c];
|
||||
store_poly(-1, x, y, p->points, c, p->sel, p->prop_ptr);
|
||||
p->sel=0;
|
||||
my_free(819, &x);
|
||||
my_free(820, &y);
|
||||
my_free(_ALLOC_ID_, &x);
|
||||
my_free(_ALLOC_ID_, &y);
|
||||
}
|
||||
break;
|
||||
case ARC:
|
||||
|
|
@ -894,7 +894,7 @@ void copy_objects(int what)
|
|||
xctx->text[n].x0, xctx->text[n].y0, xctx->rx1,xctx->ry1);
|
||||
}
|
||||
xctx->text[xctx->texts].txt_ptr=NULL;
|
||||
my_strdup(229, &xctx->text[xctx->texts].txt_ptr,xctx->text[n].txt_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[xctx->texts].txt_ptr,xctx->text[n].txt_ptr);
|
||||
xctx->text[n].sel=0;
|
||||
dbg(2, "copy_objects(): current str=%s\n",
|
||||
xctx->text[xctx->texts].txt_ptr);
|
||||
|
|
@ -906,8 +906,8 @@ void copy_objects(int what)
|
|||
xctx->text[xctx->texts].sel=SELECTED;
|
||||
xctx->text[xctx->texts].prop_ptr=NULL;
|
||||
xctx->text[xctx->texts].font=NULL;
|
||||
my_strdup(230, &xctx->text[xctx->texts].prop_ptr, xctx->text[n].prop_ptr);
|
||||
my_strdup(231, &xctx->text[xctx->texts].font, get_tok_value(xctx->text[xctx->texts].prop_ptr, "font", 0));
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[xctx->texts].prop_ptr, xctx->text[n].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[xctx->texts].font, get_tok_value(xctx->text[xctx->texts].prop_ptr, "font", 0));
|
||||
|
||||
str = get_tok_value(xctx->text[xctx->texts].prop_ptr, "hcenter", 0);
|
||||
xctx->text[xctx->texts].hcenter = strcmp(str, "true") ? 0 : 1;
|
||||
|
|
@ -981,13 +981,13 @@ void copy_objects(int what)
|
|||
xctx->inst[xctx->instances].lab=NULL;
|
||||
xctx->inst[xctx->instances].node=NULL;
|
||||
xctx->inst[xctx->instances].name=NULL;
|
||||
my_strdup2(232, &xctx->inst[xctx->instances].name, xctx->inst[n].name);
|
||||
my_strdup(233, &xctx->inst[xctx->instances].prop_ptr, xctx->inst[n].prop_ptr);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[xctx->instances].name, xctx->inst[n].name);
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[xctx->instances].prop_ptr, xctx->inst[n].prop_ptr);
|
||||
/*
|
||||
* my_strdup2(234, &xctx->inst[xctx->instances].instname, get_tok_value(xctx->inst[n].prop_ptr, "name",0));
|
||||
* my_strdup2(_ALLOC_ID_, &xctx->inst[xctx->instances].instname, get_tok_value(xctx->inst[n].prop_ptr, "name",0));
|
||||
*/
|
||||
xctx->inst[xctx->instances].instname = NULL; /* will be set in new_prop_string() */
|
||||
my_strdup(312, &xctx->inst[xctx->instances].lab, xctx->inst[n].lab);
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[xctx->instances].lab, xctx->inst[n].lab);
|
||||
xctx->inst[n].sel=0;
|
||||
xctx->inst[xctx->instances].embed = xctx->inst[n].embed;
|
||||
xctx->inst[xctx->instances].flags = xctx->inst[n].flags;
|
||||
|
|
|
|||
136
src/netlist.c
136
src/netlist.c
|
|
@ -30,7 +30,7 @@ static void instdelete(int n, int x, int y)
|
|||
prevptr = &xctx->inst_spatial_table[x][y];
|
||||
while( (*prevptr)->n != n) prevptr = &(*prevptr)->next;
|
||||
saveptr = (*prevptr)->next;
|
||||
my_free(821, prevptr);
|
||||
my_free(_ALLOC_ID_, prevptr);
|
||||
*prevptr = saveptr;
|
||||
}
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ static void instinsert(int n, int x, int y)
|
|||
{
|
||||
Instentry *ptr, *newptr;
|
||||
ptr=xctx->inst_spatial_table[x][y];
|
||||
newptr=my_malloc(236, sizeof(Instentry));
|
||||
newptr=my_malloc(_ALLOC_ID_, sizeof(Instentry));
|
||||
newptr->next=ptr;
|
||||
newptr->n=n;
|
||||
xctx->inst_spatial_table[x][y]=newptr;
|
||||
|
|
@ -50,7 +50,7 @@ static Instentry *delinstentry(Instentry *t)
|
|||
Instentry *tmp;
|
||||
while( t ) {
|
||||
tmp = t->next;
|
||||
my_free(822, &t);
|
||||
my_free(_ALLOC_ID_, &t);
|
||||
t = tmp;
|
||||
}
|
||||
return NULL;
|
||||
|
|
@ -132,7 +132,7 @@ static void instpindelete(int n,int pin, int x, int y)
|
|||
while(ptr) {
|
||||
if(ptr->n == n && ptr->pin == pin) {
|
||||
saveptr = ptr->next;
|
||||
my_free(823, &ptr);
|
||||
my_free(_ALLOC_ID_, &ptr);
|
||||
*prevptr = saveptr;
|
||||
return;
|
||||
}
|
||||
|
|
@ -147,7 +147,7 @@ static void instpininsert(int n,int pin, double x0, double y0, int x, int y)
|
|||
Instpinentry *ptr, *newptr;
|
||||
|
||||
ptr=xctx->instpin_spatial_table[x][y];
|
||||
newptr=my_malloc(237, sizeof(Instpinentry));
|
||||
newptr=my_malloc(_ALLOC_ID_, sizeof(Instpinentry));
|
||||
newptr->next=ptr;
|
||||
newptr->n=n;
|
||||
newptr->x0=x0;
|
||||
|
|
@ -164,7 +164,7 @@ static Instpinentry *delinstpinentry(Instpinentry *t)
|
|||
|
||||
while(t) {
|
||||
tmp = t->next;
|
||||
my_free(824, &t);
|
||||
my_free(_ALLOC_ID_, &t);
|
||||
t = tmp;
|
||||
}
|
||||
return NULL;
|
||||
|
|
@ -187,7 +187,7 @@ static void wiredelete(int n, int x, int y)
|
|||
prevptr = &xctx->wire_spatial_table[x][y];
|
||||
while( (*prevptr)->n != n) prevptr = &(*prevptr)->next;
|
||||
saveptr = (*prevptr)->next;
|
||||
my_free(825, prevptr);
|
||||
my_free(_ALLOC_ID_, prevptr);
|
||||
*prevptr = saveptr;
|
||||
}
|
||||
|
||||
|
|
@ -196,7 +196,7 @@ static void wireinsert(int n, int x, int y)
|
|||
Wireentry *ptr, *newptr;
|
||||
|
||||
ptr=xctx->wire_spatial_table[x][y];
|
||||
newptr=my_malloc(238, sizeof(Wireentry));
|
||||
newptr=my_malloc(_ALLOC_ID_, sizeof(Wireentry));
|
||||
newptr->next=ptr;
|
||||
newptr->n=n;
|
||||
xctx->wire_spatial_table[x][y]=newptr;
|
||||
|
|
@ -209,7 +209,7 @@ static Wireentry *delwireentry(Wireentry *t)
|
|||
|
||||
while( t ) {
|
||||
tmp = t->next;
|
||||
my_free(826, &t);
|
||||
my_free(_ALLOC_ID_, &t);
|
||||
t = tmp;
|
||||
}
|
||||
return NULL;
|
||||
|
|
@ -487,18 +487,18 @@ int record_global_node(int what, FILE *fp, char *node)
|
|||
if(what == 3) return 0; /* node is not a global */
|
||||
if(max_globals>=size_globals) {
|
||||
size_globals+=CADCHUNKALLOC;
|
||||
my_realloc(243, &globals, size_globals*sizeof(char *) );
|
||||
my_realloc(_ALLOC_ID_, &globals, size_globals*sizeof(char *) );
|
||||
}
|
||||
globals[max_globals]=NULL;
|
||||
my_strdup(244, &globals[max_globals], node);
|
||||
my_strdup(_ALLOC_ID_, &globals[max_globals], node);
|
||||
max_globals++;
|
||||
} else if(what == 0 || what == 2) {
|
||||
for(i=0;i<max_globals;i++) {
|
||||
if(what == 0 && xctx->netlist_type == CAD_SPICE_NETLIST) fprintf(fp, ".GLOBAL %s\n", globals[i]);
|
||||
if(what == 0 && xctx->netlist_type == CAD_TEDAX_NETLIST) fprintf(fp, "__GLOBAL__ %s\n", globals[i]);
|
||||
my_free(829, &globals[i]);
|
||||
my_free(_ALLOC_ID_, &globals[i]);
|
||||
}
|
||||
my_free(830, &globals);
|
||||
my_free(_ALLOC_ID_, &globals);
|
||||
size_globals=max_globals=0;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -535,7 +535,7 @@ int get_unnamed_node(int what, int mult,int node)
|
|||
dbg(2, "get_unnamed_node(): what=%d mult=%d node=%d\n", what, mult, node);
|
||||
if(what==0) { /* initialize unnamed node data structures */
|
||||
xctx->new_node=0;
|
||||
my_free(828, &xctx->node_mult);
|
||||
my_free(_ALLOC_ID_, &xctx->node_mult);
|
||||
xctx->node_mult_size=0;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -549,7 +549,7 @@ int get_unnamed_node(int what, int mult,int node)
|
|||
if(xctx->new_node >= xctx->node_mult_size) { /* enlarge array and zero it */
|
||||
int oldsize = xctx->node_mult_size;
|
||||
xctx->node_mult_size = xctx->new_node + CADCHUNKALLOC;
|
||||
my_realloc(242, &xctx->node_mult, sizeof(xctx->node_mult[0]) * xctx->node_mult_size );
|
||||
my_realloc(_ALLOC_ID_, &xctx->node_mult, sizeof(xctx->node_mult[0]) * xctx->node_mult_size );
|
||||
memset(xctx->node_mult + oldsize, 0, (xctx->node_mult_size - oldsize) * sizeof(xctx->node_mult[0]));
|
||||
}
|
||||
xctx->node_mult[xctx->new_node]=mult;
|
||||
|
|
@ -585,7 +585,7 @@ static void name_generics()
|
|||
dbg(2, "prepare_netlist_structs(): naming generics from attached labels\n");
|
||||
if(for_netlist) for (i=0;i<instances;i++) { /* ... assign node fields on all (non label) instances */
|
||||
if(inst[i].ptr<0) continue;
|
||||
my_strdup(267, &type,(inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(inst[i].ptr+ xctx->sym)->type);
|
||||
if(type && !IS_LABEL_OR_PIN(type) ) {
|
||||
if((generic_rects = (inst[i].ptr+ xctx->sym)->rects[GENERICLAYER]) > 0) {
|
||||
rects = (inst[i].ptr+ xctx->sym)->rects[PINLAYER];
|
||||
|
|
@ -609,12 +609,12 @@ static void name_generics()
|
|||
if((inst[n].ptr+ xctx->sym)->type && inst[n].node[p] != NULL &&
|
||||
!strcmp((inst[n].ptr+ xctx->sym)->type, "label")) {
|
||||
dbg(2, "prepare_netlist_structs(): naming generic %s\n", inst[n].node[p]);
|
||||
my_strdup(268, &inst[i].node[j], get_tok_value(inst[n].prop_ptr,"value",0) );
|
||||
my_strdup(_ALLOC_ID_, &inst[i].node[j], get_tok_value(inst[n].prop_ptr,"value",0) );
|
||||
if(!for_netlist) {
|
||||
my_strdup(270, &sig_type,"");
|
||||
my_strdup(_ALLOC_ID_, &sig_type,"");
|
||||
bus_node_hash_lookup(inst[n].node[p],"", XINSERT, 1, sig_type,"", "","");
|
||||
} else {
|
||||
my_strdup(271, &sig_type,get_tok_value(
|
||||
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(
|
||||
(inst[i].ptr+ xctx->sym)->rect[GENERICLAYER][j-rects].prop_ptr, "sig_type",0));
|
||||
/* insert generic label in hash table as a port so it will not */
|
||||
/* be declared as a signal in the vhdl netlist. this is a workaround */
|
||||
|
|
@ -630,7 +630,7 @@ static void name_generics()
|
|||
} /* end if( rects=...>0) */
|
||||
} /* end if(type not a label nor pin)... */
|
||||
} /* end for(i...) */
|
||||
if(type) my_free(973, &type);
|
||||
if(type) my_free(_ALLOC_ID_, &type);
|
||||
}
|
||||
|
||||
static void signal_short( const char *tag, const char *n1, const char *n2)
|
||||
|
|
@ -659,7 +659,7 @@ static void set_inst_node(int i, int j, const char *node)
|
|||
|
||||
dbg(1, "set_inst_node(): inst %s pin %d <-- %s\n", inst[i].instname, j, node);
|
||||
expandlabel(inst[i].instname, &inst_mult);
|
||||
my_strdup(275, &inst[i].node[j], node);
|
||||
my_strdup(_ALLOC_ID_, &inst[i].node[j], node);
|
||||
if(!for_netlist) {
|
||||
bus_node_hash_lookup(inst[i].node[j],"", XINSERT, 0,"","","","");
|
||||
} else {
|
||||
|
|
@ -741,8 +741,8 @@ static void wirecheck(int k) /* recursive routine */
|
|||
touch(wire[n].x1, wire[n].y1, wire[n].x2, wire[n].y2, wire[k].x2, wire[k].y2);
|
||||
if( touches ) {
|
||||
if(!wire[n].node) {
|
||||
my_strdup(239, &wire[n].node, wire[k].node);
|
||||
my_strdup(240, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", wire[n].node));
|
||||
my_strdup(_ALLOC_ID_, &wire[n].node, wire[k].node);
|
||||
my_strdup(_ALLOC_ID_, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", wire[n].node));
|
||||
name_attached_inst_to_net(n, tmpi, tmpj);
|
||||
wirecheck(n); /* recursive check */
|
||||
} else {
|
||||
|
|
@ -762,8 +762,8 @@ static void name_attached_nets(double x0, double y0, int sqx, int sqy, const cha
|
|||
int n = wptr->n;
|
||||
if(touch(wire[n].x1, wire[n].y1, wire[n].x2, wire[n].y2, x0,y0)) {
|
||||
if(!wire[n].node) {
|
||||
my_strdup(263, &wire[n].node, node);
|
||||
my_strdup(264, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", wire[n].node));
|
||||
my_strdup(_ALLOC_ID_, &wire[n].node, node);
|
||||
my_strdup(_ALLOC_ID_, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", wire[n].node));
|
||||
wirecheck(n);
|
||||
} else {
|
||||
if(for_netlist>0) signal_short("Net", wire[n].node, node);
|
||||
|
|
@ -812,8 +812,8 @@ static int find_pass_through_symbols(int what, int ninst)
|
|||
int *symtable = NULL;
|
||||
|
||||
if(what == 0 ) { /* initialize */
|
||||
pt_symbol = my_calloc(272, xctx->symbols, sizeof(int));
|
||||
symtable = my_calloc(1581, xctx->symbols, sizeof(int));
|
||||
pt_symbol = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(int));
|
||||
symtable = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(int));
|
||||
for(i = 0; i < instances; i++) {
|
||||
k = inst[i].ptr;
|
||||
if( k < 0 || symtable[k] ) continue;
|
||||
|
|
@ -829,13 +829,13 @@ static int find_pass_through_symbols(int what, int ninst)
|
|||
int_hash_free(&table);
|
||||
if(pt_symbol[k]) dbg(1, "duplicated pins: %s\n", xctx->sym[i].name);
|
||||
}
|
||||
my_free(831, &symtable);
|
||||
my_free(_ALLOC_ID_, &symtable);
|
||||
} else if(what ==1) { /* query */
|
||||
k = inst[ninst].ptr;
|
||||
if(k >=0 && pt_symbol[k]) return 1;
|
||||
return 0;
|
||||
} else if(what ==2) { /* cleanup */
|
||||
my_free(832, &pt_symbol);
|
||||
my_free(_ALLOC_ID_, &pt_symbol);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -855,7 +855,7 @@ static void instcheck(int n, int p)
|
|||
int k = inst[n].ptr;
|
||||
int rects = xctx->sym[k].rects[PINLAYER];
|
||||
char *pin_name = NULL;
|
||||
my_strdup(833, &pin_name, get_tok_value(xctx->sym[k].rect[PINLAYER][p].prop_ptr, "name", 0));
|
||||
my_strdup(_ALLOC_ID_, &pin_name, get_tok_value(xctx->sym[k].rect[PINLAYER][p].prop_ptr, "name", 0));
|
||||
if(p >= rects) return;
|
||||
for(j = 0; j < rects; j++) {
|
||||
const char *other_pin;
|
||||
|
|
@ -875,7 +875,7 @@ static void instcheck(int n, int p)
|
|||
}
|
||||
}
|
||||
}
|
||||
my_free(834, &pin_name);
|
||||
my_free(_ALLOC_ID_, &pin_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -911,7 +911,7 @@ static void name_nodes_of_pins_labels_and_propagate()
|
|||
/* name ipin opin label node fields from prop_ptr attributes */
|
||||
if(inst[i].ptr<0) continue;
|
||||
|
||||
my_strdup(248, &type,(inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(inst[i].ptr+ xctx->sym)->type);
|
||||
if(print_erc && (!inst[i].instname || !inst[i].instname[0]) &&
|
||||
!get_tok_value((inst[i].ptr+ xctx->sym)->templ, "name", 0)[0]
|
||||
) {
|
||||
|
|
@ -950,28 +950,28 @@ static void name_nodes_of_pins_labels_and_propagate()
|
|||
strcmp(get_tok_value(inst[i].prop_ptr,"tedax_ignore",0),"true")==0 ) continue;
|
||||
}
|
||||
port=0;
|
||||
my_strdup2(249, &dir, "");
|
||||
my_strdup2(_ALLOC_ID_, &dir, "");
|
||||
if(strcmp(type,"label")) { /* instance is a port (not a label) */
|
||||
port=1;
|
||||
/* 20071204 only define a dir property if instance is not a label */
|
||||
if(for_netlist)
|
||||
my_strdup2(250, &dir, get_tok_value( (inst[i].ptr+ xctx->sym)->rect[PINLAYER][0].prop_ptr, "dir",0));
|
||||
my_strdup2(_ALLOC_ID_, &dir, get_tok_value( (inst[i].ptr+ xctx->sym)->rect[PINLAYER][0].prop_ptr, "dir",0));
|
||||
}
|
||||
else {
|
||||
/* handle global nodes (global=1 set as symbol property) 28032003 */
|
||||
my_strdup(251, &global_node,get_tok_value((inst[i].ptr+ xctx->sym)->prop_ptr,"global",0));
|
||||
my_strdup(_ALLOC_ID_, &global_node,get_tok_value((inst[i].ptr+ xctx->sym)->prop_ptr,"global",0));
|
||||
/*20071204 if instance is a label dont define a dir property for more precise erc checking */
|
||||
}
|
||||
/* obtain ipin/opin/label signal type (default: std_logic) */
|
||||
if(for_netlist) {
|
||||
my_strdup(258, &sig_type,get_tok_value(inst[i].prop_ptr,"sig_type",0));
|
||||
my_strdup(259, &verilog_type,get_tok_value(inst[i].prop_ptr,"verilog_type",0));
|
||||
my_strdup(260, &value,get_tok_value(inst[i].prop_ptr,"value",0));
|
||||
my_strdup(261, &class,get_tok_value(inst[i].prop_ptr,"class",0));
|
||||
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(inst[i].prop_ptr,"sig_type",0));
|
||||
my_strdup(_ALLOC_ID_, &verilog_type,get_tok_value(inst[i].prop_ptr,"verilog_type",0));
|
||||
my_strdup(_ALLOC_ID_, &value,get_tok_value(inst[i].prop_ptr,"value",0));
|
||||
my_strdup(_ALLOC_ID_, &class,get_tok_value(inst[i].prop_ptr,"class",0));
|
||||
}
|
||||
my_strdup(262, &inst[i].node[0], inst[i].lab);
|
||||
my_strdup(_ALLOC_ID_, &inst[i].node[0], inst[i].lab);
|
||||
if(!(inst[i].node[0])) {
|
||||
my_strdup(65, &inst[i].node[0], get_tok_value((inst[i].ptr+ xctx->sym)->templ, "lab",0));
|
||||
my_strdup(_ALLOC_ID_, &inst[i].node[0], get_tok_value((inst[i].ptr+ xctx->sym)->templ, "lab",0));
|
||||
dbg(1, "prepare_netlist_structs(): no lab attr on instance, pick from symbol: %s\n", inst[i].node[0]);
|
||||
}
|
||||
/* handle global nodes (global=1 set as symbol property) 28032003 */
|
||||
|
|
@ -992,14 +992,14 @@ static void name_nodes_of_pins_labels_and_propagate()
|
|||
name_attached_inst(i, x0, y0, sqx, sqy, inst[i].node[0]);
|
||||
} /* if(type && ... */
|
||||
} /* for(i=0;i<instances... */
|
||||
my_free(835, &dir);
|
||||
my_free(836, &type);
|
||||
my_free(841, &global_node);
|
||||
my_free(_ALLOC_ID_, &dir);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
my_free(_ALLOC_ID_, &global_node);
|
||||
if(for_netlist) {
|
||||
my_free(837, &sig_type);
|
||||
my_free(838, &verilog_type);
|
||||
my_free(839, &value);
|
||||
my_free(840, &class);
|
||||
my_free(_ALLOC_ID_, &sig_type);
|
||||
my_free(_ALLOC_ID_, &verilog_type);
|
||||
my_free(_ALLOC_ID_, &value);
|
||||
my_free(_ALLOC_ID_, &class);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1007,8 +1007,8 @@ static void set_unnamed_net(int i)
|
|||
{
|
||||
char tmp_str[30];
|
||||
my_snprintf(tmp_str, S(tmp_str), "#net%d", get_unnamed_node(1,0,0));
|
||||
my_strdup(265, &xctx->wire[i].node, tmp_str);
|
||||
my_strdup(266, &xctx->wire[i].prop_ptr, subst_token(xctx->wire[i].prop_ptr, "lab", tmp_str));
|
||||
my_strdup(_ALLOC_ID_, &xctx->wire[i].node, tmp_str);
|
||||
my_strdup(_ALLOC_ID_, &xctx->wire[i].prop_ptr, subst_token(xctx->wire[i].prop_ptr, "lab", tmp_str));
|
||||
/* insert unnamed wire name in hash table */
|
||||
bus_node_hash_lookup(tmp_str, "", XINSERT, 0,"","","","");
|
||||
wirecheck(i);
|
||||
|
|
@ -1081,7 +1081,7 @@ static void reset_node_data_and_rehash()
|
|||
(inst[i].ptr+ xctx->sym)->rects[GENERICLAYER];
|
||||
if(rects > 0)
|
||||
{
|
||||
inst[i].node = my_malloc(247, sizeof(char *) * rects);
|
||||
inst[i].node = my_malloc(_ALLOC_ID_, sizeof(char *) * rects);
|
||||
for (j=0;j<rects;j++)
|
||||
{
|
||||
inst[i].node[j]=NULL;
|
||||
|
|
@ -1135,8 +1135,8 @@ void delete_inst_node(int i)
|
|||
if( rects > 0 )
|
||||
{
|
||||
for(j=0;j< rects ;j++)
|
||||
my_free(849, &xctx->inst[i].node[j]);
|
||||
my_free(850, &xctx->inst[i].node );
|
||||
my_free(_ALLOC_ID_, &xctx->inst[i].node[j]);
|
||||
my_free(_ALLOC_ID_, &xctx->inst[i].node );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1151,7 +1151,7 @@ void delete_netlist_structs(void)
|
|||
}
|
||||
for(i=0;i<xctx->wires;i++)
|
||||
{
|
||||
my_free(851, &xctx->wire[i].node);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].node);
|
||||
}
|
||||
/* erase inst and wire topological hash tables */
|
||||
del_inst_pin_table();
|
||||
|
|
@ -1318,21 +1318,21 @@ int sym_vs_sch_pins()
|
|||
}
|
||||
load_ascii_string(&tmp,fd);
|
||||
symbol = match_symbol(name);
|
||||
my_strdup(276, &type, xctx->sym[symbol].type);
|
||||
my_strdup(_ALLOC_ID_, &type, xctx->sym[symbol].type);
|
||||
if(type && IS_PIN(type)) {
|
||||
my_strdup(292, &lab, expandlabel(get_tok_value(tmp, "lab", 0), &mult));
|
||||
my_strdup(_ALLOC_ID_, &lab, expandlabel(get_tok_value(tmp, "lab", 0), &mult));
|
||||
if(pin_cnt >= lab_array_size) {
|
||||
lab_array_size += CADCHUNKALLOC;
|
||||
my_realloc(154, &lab_array, lab_array_size * sizeof(char *));
|
||||
my_realloc(_ALLOC_ID_, &lab_array, lab_array_size * sizeof(char *));
|
||||
}
|
||||
lab_array[pin_cnt] = NULL;
|
||||
my_strdup(155, &(lab_array[pin_cnt]), lab);
|
||||
my_strdup(_ALLOC_ID_, &(lab_array[pin_cnt]), lab);
|
||||
pin_cnt++;
|
||||
pin_match = 0;
|
||||
for(j=0; j < rects; j++) {
|
||||
my_strdup(293, &pin_name,
|
||||
my_strdup(_ALLOC_ID_, &pin_name,
|
||||
expandlabel(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "name", 0), &mult));
|
||||
my_strdup(294, &pin_dir, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "dir", 0));
|
||||
my_strdup(_ALLOC_ID_, &pin_dir, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "dir", 0));
|
||||
if( pin_name && !strcmp(pin_name, lab)) {
|
||||
if(!(
|
||||
( !strcmp(type, "ipin") && !strcmp(pin_dir, "in") ) ||
|
||||
|
|
@ -1406,7 +1406,7 @@ int sym_vs_sch_pins()
|
|||
}
|
||||
}
|
||||
for(j=0; j < rects; j++) {
|
||||
my_strdup(295, &pin_name,
|
||||
my_strdup(_ALLOC_ID_, &pin_name,
|
||||
expandlabel(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "name", 0), &mult));
|
||||
pin_match = 0;
|
||||
for(k=0; k<pin_cnt; k++) {
|
||||
|
|
@ -1433,18 +1433,18 @@ int sym_vs_sch_pins()
|
|||
}
|
||||
if(lab_array_size) {
|
||||
for(k=0;k<pin_cnt;k++) {
|
||||
my_free(842, &(lab_array[k]));
|
||||
my_free(_ALLOC_ID_, &(lab_array[k]));
|
||||
}
|
||||
my_free(843, &lab_array);
|
||||
my_free(_ALLOC_ID_, &lab_array);
|
||||
lab_array_size = 0;
|
||||
pin_cnt=0;
|
||||
}
|
||||
} /* if( ... "subcircuit"... ) */
|
||||
my_free(844, &type);
|
||||
my_free(845, &tmp);
|
||||
my_free(846, &lab);
|
||||
my_free(847, &pin_name);
|
||||
my_free(848, &pin_dir);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
my_free(_ALLOC_ID_, &tmp);
|
||||
my_free(_ALLOC_ID_, &lab);
|
||||
my_free(_ALLOC_ID_, &pin_name);
|
||||
my_free(_ALLOC_ID_, &pin_dir);
|
||||
} /* for(i=0;i<n_syms;i++) */
|
||||
|
||||
while(xctx->symbols > n_syms) remove_symbol(xctx->symbols - 1);
|
||||
|
|
|
|||
|
|
@ -59,16 +59,16 @@ static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int w
|
|||
if( what==XINSERT ) /* insert data */
|
||||
{
|
||||
s=sizeof( Node_hashentry );
|
||||
entry=(Node_hashentry *)my_malloc(281, s);
|
||||
entry=(Node_hashentry *)my_malloc(_ALLOC_ID_, s);
|
||||
entry->next = NULL;
|
||||
entry->token = entry->sig_type = entry->verilog_type =
|
||||
entry->value = entry->class = entry->orig_tok = NULL;
|
||||
my_strdup(282, &(entry->token),token);
|
||||
if(sig_type &&sig_type[0]) my_strdup(283, &(entry->sig_type), sig_type);
|
||||
if(verilog_type &&verilog_type[0]) my_strdup(284, &(entry->verilog_type), verilog_type);
|
||||
if(class && class[0]) my_strdup(285, &(entry->class), class);
|
||||
if(orig_tok && orig_tok[0]) my_strdup(286, &(entry->orig_tok), orig_tok);
|
||||
if(value && value[0]) my_strdup(287, &(entry->value), value);
|
||||
my_strdup(_ALLOC_ID_, &(entry->token),token);
|
||||
if(sig_type &&sig_type[0]) my_strdup(_ALLOC_ID_, &(entry->sig_type), sig_type);
|
||||
if(verilog_type &&verilog_type[0]) my_strdup(_ALLOC_ID_, &(entry->verilog_type), verilog_type);
|
||||
if(class && class[0]) my_strdup(_ALLOC_ID_, &(entry->class), class);
|
||||
if(orig_tok && orig_tok[0]) my_strdup(_ALLOC_ID_, &(entry->orig_tok), orig_tok);
|
||||
if(value && value[0]) my_strdup(_ALLOC_ID_, &(entry->value), value);
|
||||
entry->d.port=d.port;
|
||||
entry->d.in=d.in;
|
||||
entry->d.out=d.out;
|
||||
|
|
@ -87,13 +87,13 @@ static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int w
|
|||
if(what==XDELETE) /* remove token from the hash table ... */
|
||||
{
|
||||
saveptr=entry->next;
|
||||
my_free(854, &entry->token);
|
||||
my_free(855, &entry->verilog_type);
|
||||
my_free(856, &entry->sig_type);
|
||||
my_free(857, &entry->class);
|
||||
my_free(858, &entry->orig_tok);
|
||||
my_free(859, &entry->value);
|
||||
my_free(860, &entry);
|
||||
my_free(_ALLOC_ID_, &entry->token);
|
||||
my_free(_ALLOC_ID_, &entry->verilog_type);
|
||||
my_free(_ALLOC_ID_, &entry->sig_type);
|
||||
my_free(_ALLOC_ID_, &entry->class);
|
||||
my_free(_ALLOC_ID_, &entry->orig_tok);
|
||||
my_free(_ALLOC_ID_, &entry->value);
|
||||
my_free(_ALLOC_ID_, &entry);
|
||||
*preventry=saveptr;
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -104,11 +104,11 @@ static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int w
|
|||
entry->d.out+=d.out;
|
||||
entry->d.inout+=d.inout;
|
||||
if(sig_type && sig_type[0] !='\0')
|
||||
my_strdup(288, &(entry->sig_type), sig_type);
|
||||
my_strdup(_ALLOC_ID_, &(entry->sig_type), sig_type);
|
||||
if(verilog_type && verilog_type[0] !='\0')
|
||||
my_strdup(289, &(entry->verilog_type), verilog_type);
|
||||
my_strdup(_ALLOC_ID_, &(entry->verilog_type), verilog_type);
|
||||
if(value && value[0] !='\0')
|
||||
my_strdup(290, &(entry->value), value);
|
||||
my_strdup(_ALLOC_ID_, &(entry->value), value);
|
||||
dbg(3, "node_hash_lookup(): hashing %s : value=%s\n\n",
|
||||
entry->token, entry->value? entry->value:"NULL");
|
||||
return entry;
|
||||
|
|
@ -132,12 +132,12 @@ Node_hashentry *bus_node_hash_lookup(const char *token, const char *dir, int wha
|
|||
if(token==NULL || token[0] == 0) return NULL;
|
||||
if( token[0] == '#')
|
||||
{
|
||||
my_strdup(279, &string, token);
|
||||
my_strdup(_ALLOC_ID_, &string, token);
|
||||
}
|
||||
else
|
||||
{
|
||||
dbg(3, "bus_node_hash_lookup(): expanding node: %s\n", token);
|
||||
my_strdup(280, &string, expandlabel(token,&mult));
|
||||
my_strdup(_ALLOC_ID_, &string, expandlabel(token,&mult));
|
||||
dbg(3, "bus_node_hash_lookup(): done expanding node: %s\n", token);
|
||||
}
|
||||
if(string==NULL) return NULL;
|
||||
|
|
@ -159,7 +159,7 @@ Node_hashentry *bus_node_hash_lookup(const char *token, const char *dir, int wha
|
|||
string_ptr++;
|
||||
}
|
||||
/* if something found return first pointer */
|
||||
my_free(853, &string);
|
||||
my_free(_ALLOC_ID_, &string);
|
||||
return ptr2;
|
||||
}
|
||||
|
||||
|
|
@ -169,13 +169,13 @@ static void node_hash_free_entry(Node_hashentry *entry)
|
|||
|
||||
while(entry) {
|
||||
tmp = entry->next;
|
||||
my_free(861, &entry->token);
|
||||
my_free(862, &entry->verilog_type);
|
||||
my_free(863, &entry->sig_type);
|
||||
my_free(864, &entry->class);
|
||||
my_free(865, &entry->orig_tok);
|
||||
my_free(866, &entry->value);
|
||||
my_free(867, &entry);
|
||||
my_free(_ALLOC_ID_, &entry->token);
|
||||
my_free(_ALLOC_ID_, &entry->verilog_type);
|
||||
my_free(_ALLOC_ID_, &entry->sig_type);
|
||||
my_free(_ALLOC_ID_, &entry->class);
|
||||
my_free(_ALLOC_ID_, &entry->orig_tok);
|
||||
my_free(_ALLOC_ID_, &entry->value);
|
||||
my_free(_ALLOC_ID_, &entry);
|
||||
entry = tmp;
|
||||
}
|
||||
}
|
||||
|
|
@ -278,9 +278,9 @@ void print_vhdl_signals(FILE *fd)
|
|||
dbg(2, "print_vhdl_signals(): node: %s mult: %d value=%s \n\n",
|
||||
ptr->token,mult, ptr->value?ptr->value:"NULL");
|
||||
if( ptr->class && ptr->class[0] )
|
||||
my_strdup(277, &class, ptr->class);
|
||||
my_strdup(_ALLOC_ID_, &class, ptr->class);
|
||||
else
|
||||
my_strdup(278, &class, "signal");
|
||||
my_strdup(_ALLOC_ID_, &class, "signal");
|
||||
if(mult>1) {
|
||||
for(j=mult-1;j>=0;j--) {
|
||||
fprintf(fd, "%s %s[%d] : ", class, ptr->token[0]=='#' ? ptr->token+1 : ptr->token,j);
|
||||
|
|
@ -310,7 +310,7 @@ void print_vhdl_signals(FILE *fd)
|
|||
}
|
||||
}
|
||||
if(found) fprintf(fd, "\n" );
|
||||
my_free(852, &class);
|
||||
my_free(_ALLOC_ID_, &class);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -71,11 +71,11 @@ static void check_opt(char *opt, char *optval, int type)
|
|||
|
||||
} else if( (type == LONG && !strcmp("preinit", opt)) ) {
|
||||
dbg(1, "process_options(): passing tcl command to interpreter: %s\n", optval);
|
||||
if(optval) my_strdup(1565, &cli_opt_preinit_command, optval);
|
||||
if(optval) my_strdup(_ALLOC_ID_, &cli_opt_preinit_command, optval);
|
||||
|
||||
} else if( (type == LONG && !strcmp("tcl", opt)) ) {
|
||||
dbg(1, "process_options(): passing tcl command to interpreter: %s\n", optval);
|
||||
if(optval) my_strdup(110, &cli_opt_tcl_command, optval);
|
||||
if(optval) my_strdup(_ALLOC_ID_, &cli_opt_tcl_command, optval);
|
||||
|
||||
} else if( (type == LONG && !strcmp("script", opt)) ) {
|
||||
dbg(1, "process_options(): passing tcl script file to interpreter: %s\n", optval);
|
||||
|
|
@ -83,7 +83,7 @@ static void check_opt(char *opt, char *optval, int type)
|
|||
|
||||
} else if( (type == LONG && !strcmp("command", opt)) ) {
|
||||
dbg(1, "process_options(): passing tcl command to interpreter: %s\n", optval);
|
||||
if(optval) my_strdup(661, &cli_opt_tcl_post_command, optval);
|
||||
if(optval) my_strdup(_ALLOC_ID_, &cli_opt_tcl_post_command, optval);
|
||||
|
||||
} else if( (type == LONG && !strcmp("diff", opt)) ) {
|
||||
dbg(1, "process_options(): diff with: %s\n", optval);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ extern int yylex();
|
|||
|
||||
void clear_expandlabel_data(void)
|
||||
{
|
||||
my_free(868, &dest_string.str);
|
||||
my_free(_ALLOC_ID_, &dest_string.str);
|
||||
}
|
||||
|
||||
static void str_char_replace(char s[], char chr, char repl_chr)
|
||||
|
|
@ -95,7 +95,7 @@ void parse(const char *s)
|
|||
const char *expandlabel(const char *s, int *m)
|
||||
{
|
||||
YY_BUFFER_STATE buf;
|
||||
my_free(869, &dest_string.str); /* 30102004 delete 'memory' of previous execution */
|
||||
my_free(_ALLOC_ID_, &dest_string.str); /* 30102004 delete 'memory' of previous execution */
|
||||
|
||||
if(dbg_var >= 3) fprintf(errfp, "expandlabel(): entering\n");
|
||||
buf=yy_scan_string(s);
|
||||
|
|
@ -106,13 +106,13 @@ const char *expandlabel(const char *s, int *m)
|
|||
size_t l;
|
||||
yyparse_error = -1;
|
||||
l = strlen(s)+400;
|
||||
cmd = my_malloc(526, l);
|
||||
cmd = my_malloc(_ALLOC_ID_, l);
|
||||
fprintf(errfp, "syntax error in %s\n", s);
|
||||
my_snprintf(cmd, l,
|
||||
"tk_messageBox -icon error -type ok -parent [xschem get topwindow] "
|
||||
"-message {Syntax error in identifier expansion: %s\nschematic:\n%s}", s, xctx->sch[xctx->currsch]);
|
||||
if(has_x) tcleval(cmd);
|
||||
my_free(543, &cmd);
|
||||
my_free(_ALLOC_ID_, &cmd);
|
||||
|
||||
}
|
||||
if(dbg_var >= 3)
|
||||
|
|
@ -209,14 +209,14 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z
|
|||
/* recognize AA[aa:bb:33] or AA[33:cc:dd] or AA[aa..bb..11] .... */
|
||||
({IDX_ID}{DDOT}{IDX_ID_N}{DDOT}{IDX_ID_N})|({IDX_ID_N}{DDOT}{IDX_ID}{DDOT}{IDX_ID_N})|({IDX_ID_N}{DDOT}{IDX_ID_N}{DDOT}{IDX_ID}) {
|
||||
yylval.ptr.str=NULL;
|
||||
my_strdup(428, &yylval.ptr.str, yytext);
|
||||
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext);
|
||||
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_NAME3: |%s|\n", yytext);
|
||||
return B_NAME;
|
||||
}
|
||||
|
||||
({IDX_ID}{CLN}{IDX_ID_N}{CLN}{IDX_ID_N})|({IDX_ID_N}{CLN}{IDX_ID}{CLN}{IDX_ID_N})|({IDX_ID_N}{CLN}{IDX_ID_N}{CLN}{IDX_ID}) {
|
||||
yylval.ptr.str=NULL;
|
||||
my_strdup(430, &yylval.ptr.str, yytext);
|
||||
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext);
|
||||
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_NAME2: |%s|\n", yytext);
|
||||
return B_NAME;
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z
|
|||
/* recognize AA[width-1:0], AA[0:width-1], AA[width-1..4], AA[3..width+3], AA[aa:bb] AA[aa..bb] */
|
||||
({IDX_ID}{CLN}{IDX_ID_N})|({IDX_ID_N}{CLN}{IDX_ID})|({IDX_ID}{DDOT}{IDX_ID_N})|({IDX_ID_N}{DDOT}{IDX_ID}) {
|
||||
yylval.ptr.str=NULL;
|
||||
my_strdup(92, &yylval.ptr.str, yytext);
|
||||
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext);
|
||||
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_NAME1: |%s|\n", yytext);
|
||||
return B_NAME;
|
||||
}
|
||||
|
|
@ -234,7 +234,7 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z
|
|||
^\*.* {
|
||||
yylval.ptr.str=NULL; /*19102004 */
|
||||
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_LINE: |%s|\n",yytext);
|
||||
my_strdup(299, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */
|
||||
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */
|
||||
BEGIN(INITIAL);
|
||||
return B_LINE;
|
||||
}
|
||||
|
|
@ -248,7 +248,7 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z
|
|||
/* a number: if not a multiplier nor a node index return as a node name */
|
||||
{INT} {
|
||||
yylval.ptr.str=NULL;
|
||||
my_strdup(120, &yylval.ptr.str, yytext);
|
||||
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext);
|
||||
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_NAME4: |%s|\n", yytext);
|
||||
BEGIN(INITIAL);
|
||||
return B_NAME;
|
||||
|
|
@ -267,7 +267,7 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z
|
|||
/* recognize the most esotheric identifiers */
|
||||
{ID_NUM}|{ID_EXT_PARENTHESIS} {
|
||||
yylval.ptr.str=NULL;/*19102004 */
|
||||
my_strdup(300, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */
|
||||
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */
|
||||
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_NAME0: |%s|\n", yytext);
|
||||
BEGIN(INITIAL);
|
||||
return B_NAME;
|
||||
|
|
|
|||
28
src/paste.c
28
src/paste.c
|
|
@ -46,7 +46,7 @@ static void merge_text(FILE *fd)
|
|||
xctx->text[i].font=NULL;
|
||||
xctx->text[i].sel=0;
|
||||
load_ascii_string(&xctx->text[i].prop_ptr,fd);
|
||||
my_strdup(302, &xctx->text[i].font, get_tok_value(xctx->text[i].prop_ptr, "font", 0));
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[i].font, get_tok_value(xctx->text[i].prop_ptr, "font", 0));
|
||||
|
||||
|
||||
str = get_tok_value(xctx->text[i].prop_ptr, "hcenter", 0);
|
||||
|
|
@ -85,7 +85,7 @@ static void merge_wire(FILE *fd)
|
|||
}
|
||||
load_ascii_string( &ptr, fd);
|
||||
storeobject(-1, x1,y1,x2,y2,WIRE,0,SELECTED,ptr);
|
||||
my_free(870, &ptr);
|
||||
my_free(_ALLOC_ID_, &ptr);
|
||||
select_wire(i, SELECTED, 1);
|
||||
}
|
||||
|
||||
|
|
@ -198,17 +198,17 @@ static void merge_polygon(FILE *fd)
|
|||
ptr[i].y=NULL;
|
||||
ptr[i].selected_point=NULL;
|
||||
ptr[i].prop_ptr=NULL;
|
||||
ptr[i].x = my_calloc(303, points, sizeof(double));
|
||||
ptr[i].y = my_calloc(304, points, sizeof(double));
|
||||
ptr[i].selected_point= my_calloc(305, points, sizeof(unsigned short));
|
||||
ptr[i].x = my_calloc(_ALLOC_ID_, points, sizeof(double));
|
||||
ptr[i].y = my_calloc(_ALLOC_ID_, points, sizeof(double));
|
||||
ptr[i].selected_point= my_calloc(_ALLOC_ID_, points, sizeof(unsigned short));
|
||||
ptr[i].points=points;
|
||||
ptr[i].sel=0;
|
||||
for(j=0;j<points;j++) {
|
||||
if(fscanf(fd, "%lf %lf ",&(ptr[i].x[j]), &(ptr[i].y[j]))<2) {
|
||||
fprintf(errfp,"merge_polygon(): WARNING: missing fields for POLYGON points, ignoring.\n");
|
||||
my_free(827, &ptr[i].x);
|
||||
my_free(1218, &ptr[i].y);
|
||||
my_free(1223, &ptr[i].selected_point);
|
||||
my_free(_ALLOC_ID_, &ptr[i].x);
|
||||
my_free(_ALLOC_ID_, &ptr[i].y);
|
||||
my_free(_ALLOC_ID_, &ptr[i].selected_point);
|
||||
read_line(fd, 0);
|
||||
return;
|
||||
}
|
||||
|
|
@ -278,12 +278,12 @@ static void merge_inst(int k,FILE *fd)
|
|||
load_ascii_string(&tmp, fd);
|
||||
/* avoid as much as possible calls to rel_sym_path (slow) */
|
||||
#ifdef __unix__
|
||||
if(tmp[0] == '/') my_strdup(763, &xctx->inst[i].name, rel_sym_path(tmp));
|
||||
else my_strdup(755, &xctx->inst[i].name,tmp);
|
||||
if(tmp[0] == '/') my_strdup(_ALLOC_ID_, &xctx->inst[i].name, rel_sym_path(tmp));
|
||||
else my_strdup(_ALLOC_ID_, &xctx->inst[i].name,tmp);
|
||||
#else
|
||||
my_strdup(780, &xctx->inst[i].name, rel_sym_path(tmp));
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[i].name, rel_sym_path(tmp));
|
||||
#endif
|
||||
my_free(756, &tmp);
|
||||
my_free(_ALLOC_ID_, &tmp);
|
||||
if(fscanf(fd, "%lf %lf %hd %hd",&xctx->inst[i].x0, &xctx->inst[i].y0,&xctx->inst[i].rot, &xctx->inst[i].flip) < 4) {
|
||||
fprintf(errfp,"WARNING: missing fields for INSTANCE object, ignoring.\n");
|
||||
read_line(fd, 0);
|
||||
|
|
@ -305,7 +305,7 @@ static void merge_inst(int k,FILE *fd)
|
|||
if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"highlight",0), "true"))
|
||||
xctx->inst[i].flags |= HILIGHT_CONN;
|
||||
xctx->inst[i].embed = !strcmp(get_tok_value(xctx->inst[i].prop_ptr, "embed", 2), "true");
|
||||
my_free(871, &prop_ptr);
|
||||
my_free(_ALLOC_ID_, &prop_ptr);
|
||||
xctx->instances++;
|
||||
set_modify(1);
|
||||
}
|
||||
|
|
@ -428,7 +428,7 @@ void merge_file(int selection_load, const char ext[])
|
|||
xctx->mousex_snap = 0.;
|
||||
xctx->mousey_snap = 0.;
|
||||
}
|
||||
my_free(875, &aux_ptr);
|
||||
my_free(_ALLOC_ID_, &aux_ptr);
|
||||
link_symbols_to_instances(old); /* in case of paste/merge will set instances .sel to SELECTED */
|
||||
fclose(fd);
|
||||
xctx->ui_state |= STARTMERGE;
|
||||
|
|
|
|||
|
|
@ -135,8 +135,8 @@ void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, i
|
|||
quality_attr = get_tok_value(r->prop_ptr, "jpg_quality", 0);
|
||||
if(quality_attr[0]) quality = atoi(quality_attr);
|
||||
}
|
||||
my_strdup(59, &filter, get_tok_value(r->prop_ptr, "filter", 0));
|
||||
image_data_len = my_strdup2(1183, &image_data64_ptr, get_tok_value(r->prop_ptr, "image_data", 0));
|
||||
my_strdup(_ALLOC_ID_, &filter, get_tok_value(r->prop_ptr, "filter", 0));
|
||||
image_data_len = my_strdup2(_ALLOC_ID_, &image_data64_ptr, get_tok_value(r->prop_ptr, "image_data", 0));
|
||||
|
||||
if (filter) {
|
||||
size_t filtersize = 0;
|
||||
|
|
@ -144,13 +144,13 @@ void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, i
|
|||
closure.buffer = NULL;
|
||||
filterdata = (char*)base64_decode(image_data64_ptr, image_data_len, &filtersize);
|
||||
filter_data(filterdata, filtersize, (char**)&closure.buffer, &data_size, filter);
|
||||
my_free(1661, &filterdata);
|
||||
my_free(_ALLOC_ID_, &filterdata);
|
||||
}
|
||||
else {
|
||||
closure.buffer = base64_decode(image_data64_ptr, image_data_len, &data_size);
|
||||
}
|
||||
my_free(1664, &filter);
|
||||
my_free(1184, &image_data64_ptr);
|
||||
my_free(_ALLOC_ID_, &filter);
|
||||
my_free(_ALLOC_ID_, &image_data64_ptr);
|
||||
closure.pos = 0;
|
||||
closure.size = data_size; /* should not be necessary */
|
||||
surface = cairo_image_surface_create_from_png_stream(png_reader, &closure);
|
||||
|
|
@ -159,7 +159,7 @@ void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, i
|
|||
png_size_y = cairo_image_surface_get_height(surface);
|
||||
|
||||
cairo_surface_flush(surface);
|
||||
my_free(1667, &closure.buffer);
|
||||
my_free(_ALLOC_ID_, &closure.buffer);
|
||||
png_data = cairo_image_surface_get_data(surface);
|
||||
|
||||
invertImage = !strcmp(get_tok_value(r->prop_ptr, "InvertOnExport", 0), "true");
|
||||
|
|
@ -251,7 +251,7 @@ void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, i
|
|||
|
||||
fprintf(fd, "grestore\n");
|
||||
cairo_surface_destroy(surface);
|
||||
my_free(1663, &ascii85EncodedJpeg);
|
||||
my_free(_ALLOC_ID_, &ascii85EncodedJpeg);
|
||||
free(jpgData);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -381,7 +381,7 @@ void ps_embedded_graph(xRect* r, double rx1, double ry1, double rx2, double ry2)
|
|||
|
||||
fprintf(fd, "grestore\n");
|
||||
|
||||
my_free(1666, &ascii85EncodedJpeg);
|
||||
my_free(_ALLOC_ID_, &ascii85EncodedJpeg);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
@ -675,7 +675,7 @@ static void ps_draw_string(int layer, const char *str, short rot, short flip, in
|
|||
if(rot == 3 && flip == 1 ) { x=textx1;}
|
||||
}
|
||||
llength=0;
|
||||
my_strdup2(54, &sss, str);
|
||||
my_strdup2(_ALLOC_ID_, &sss, str);
|
||||
tt=ss=sss;
|
||||
for(;;) {
|
||||
c=*ss;
|
||||
|
|
@ -693,7 +693,7 @@ static void ps_draw_string(int layer, const char *str, short rot, short flip, in
|
|||
}
|
||||
ss++;
|
||||
}
|
||||
my_free(53, &sss);
|
||||
my_free(_ALLOC_ID_, &sss);
|
||||
}
|
||||
|
||||
static void old_ps_draw_string(int gctext, const char *str,
|
||||
|
|
@ -858,16 +858,16 @@ static void ps_draw_symbol(int n,int layer, int what, short tmp_flip, short rot,
|
|||
polygon = ((xctx->inst[n].ptr+ xctx->sym)->poly[layer])[j];
|
||||
{ /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */
|
||||
int k;
|
||||
double *x = my_malloc(309, sizeof(double) * polygon.points);
|
||||
double *y = my_malloc(310, sizeof(double) * polygon.points);
|
||||
double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points);
|
||||
double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points);
|
||||
for(k=0;k<polygon.points;k++) {
|
||||
ROTATION(rot, flip, 0.0,0.0,polygon.x[k],polygon.y[k],x[k],y[k]);
|
||||
x[k]+= x0;
|
||||
y[k] += y0;
|
||||
}
|
||||
ps_drawpolygon(layer, NOW, x, y, polygon.points, polygon.fill, polygon.dash);
|
||||
my_free(876, &x);
|
||||
my_free(877, &y);
|
||||
my_free(_ALLOC_ID_, &x);
|
||||
my_free(_ALLOC_ID_, &y);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1002,7 +1002,7 @@ void create_ps(char **psfile, int what)
|
|||
}
|
||||
}
|
||||
setbuf(fd, NULL); /*To prevent buffer errors, still investigating cause. */
|
||||
ps_colors=my_calloc(311, cadlayers, sizeof(Ps_color));
|
||||
ps_colors=my_calloc(_ALLOC_ID_, cadlayers, sizeof(Ps_color));
|
||||
if(ps_colors==NULL){
|
||||
fprintf(errfp, "create_ps(): calloc error\n");
|
||||
return;
|
||||
|
|
@ -1226,7 +1226,7 @@ void create_ps(char **psfile, int what)
|
|||
fclose(fd);
|
||||
}
|
||||
tclsetboolvar("draw_grid", old_grid);
|
||||
my_free(879, &ps_colors);
|
||||
my_free(_ALLOC_ID_, &ps_colors);
|
||||
}
|
||||
|
||||
int ps_draw(int what)
|
||||
|
|
|
|||
338
src/save.c
338
src/save.c
|
|
@ -37,11 +37,11 @@ char **parse_cmd_string(const char *cmd, int *argc)
|
|||
static char *argv[PARSE_SIZE];
|
||||
char *cmd_ptr, *cmd_save;
|
||||
if(!cmd || !cmd[0]) {
|
||||
if(cmd_copy) my_free(1670, &cmd_copy);
|
||||
if(cmd_copy) my_free(_ALLOC_ID_, &cmd_copy);
|
||||
return NULL;
|
||||
}
|
||||
*argc = 0;
|
||||
my_strdup2(1669, &cmd_copy, cmd);
|
||||
my_strdup2(_ALLOC_ID_, &cmd_copy, cmd);
|
||||
cmd_ptr = cmd_copy;
|
||||
while( (argv[*argc] = my_strtok_r(cmd_ptr, " \t", "'\"", &cmd_save)) ) {
|
||||
cmd_ptr = NULL;
|
||||
|
|
@ -138,7 +138,7 @@ int filter_data(const char *din, const size_t ilen,
|
|||
close(p1[1]);
|
||||
if(!ret) {
|
||||
oalloc = bufsize + 1; /* add extra space for final '\0' */
|
||||
*dout = my_malloc(1480, oalloc);
|
||||
*dout = my_malloc(_ALLOC_ID_, oalloc);
|
||||
*olen = 0;
|
||||
while( (n = read(p2[0], *dout + *olen, bufsize)) > 0) {
|
||||
*olen += n;
|
||||
|
|
@ -147,14 +147,14 @@ int filter_data(const char *din, const size_t ilen,
|
|||
oalloc = *olen + bufsize + 1; /* add extra space for final '\0' */
|
||||
oalloc = ((oalloc << 2) + oalloc) >> 2; /* size up 1.25x */
|
||||
dbg(1, "filter_data() read %ld bytes, reallocate dout to %ld bytes, bufsize=%ld\n", n, oalloc, bufsize);
|
||||
my_realloc(1482, dout, oalloc);
|
||||
my_realloc(_ALLOC_ID_, dout, oalloc);
|
||||
}
|
||||
}
|
||||
if(*olen) (*dout)[*olen] = '\0'; /* so (if ascii) it can be used as a string */
|
||||
}
|
||||
if(n < 0 || !*olen) {
|
||||
if(oalloc) {
|
||||
my_free(1483, dout);
|
||||
my_free(_ALLOC_ID_, dout);
|
||||
*olen = 0;
|
||||
}
|
||||
fprintf(stderr, "no data read\n");
|
||||
|
|
@ -202,7 +202,7 @@ char *base64_encode(const unsigned char *data, const size_t input_length, size_t
|
|||
|
||||
*output_length = 4 * ((input_length + 2) / 3);
|
||||
alloc_length = (1 + (*output_length / 4096)) * 4096;
|
||||
encoded_data = my_malloc(1665, alloc_length);
|
||||
encoded_data = my_malloc(_ALLOC_ID_, alloc_length);
|
||||
if (encoded_data == NULL) return NULL;
|
||||
cnt = 0;
|
||||
|
||||
|
|
@ -214,7 +214,7 @@ char *base64_encode(const unsigned char *data, const size_t input_length, size_t
|
|||
if(j + 10 >= alloc_length) {
|
||||
dbg(1, "alloc-length=%ld, j=%d, output_length=%ld\n", alloc_length, j, *output_length);
|
||||
alloc_length += 4096;
|
||||
my_realloc(1471, &encoded_data, alloc_length);
|
||||
my_realloc(_ALLOC_ID_, &encoded_data, alloc_length);
|
||||
}
|
||||
if(brk && ( (cnt & 31) == 0) ) {
|
||||
*output_length += 1;
|
||||
|
|
@ -261,7 +261,7 @@ unsigned char *base64_decode(const char *data, const size_t input_length, size_t
|
|||
padding = 0;
|
||||
if (data[input_length - 1] == '=') padding++;
|
||||
if (data[input_length - 2] == '=') padding++;
|
||||
decoded_data = my_malloc(1470, *output_length);
|
||||
decoded_data = my_malloc(_ALLOC_ID_, *output_length);
|
||||
if (decoded_data == NULL) return NULL;
|
||||
cnt = 0;
|
||||
for (i = 0, j = 0; i < input_length;) {
|
||||
|
|
@ -304,12 +304,12 @@ unsigned char *ascii85_encode(const unsigned char *data, const size_t input_leng
|
|||
|
||||
int padding = (4-(input_length % 4))%4;
|
||||
static u_int32_t pow85[] = {1, 85, 7225, 614125, 52200625};
|
||||
unsigned char *paddedData = my_calloc(1469, input_length+padding, 1);
|
||||
unsigned char *paddedData = my_calloc(_ALLOC_ID_, input_length+padding, 1);
|
||||
unsigned char *encoded_data;
|
||||
int i, idx = 0;
|
||||
memcpy( paddedData, data, input_length);
|
||||
*output_length = 5*(input_length+padding)/4;
|
||||
encoded_data = my_malloc(1662, *output_length +1);
|
||||
encoded_data = my_malloc(_ALLOC_ID_, *output_length +1);
|
||||
encoded_data[*output_length]=0;
|
||||
for (i = 0; i < input_length+padding; i+=4)
|
||||
{
|
||||
|
|
@ -342,7 +342,7 @@ unsigned char *ascii85_encode(const unsigned char *data, const size_t input_leng
|
|||
encoded_data[idx]=b85_enc[encoded_data[idx]];
|
||||
idx++;
|
||||
}
|
||||
my_free(1668, &paddedData);
|
||||
my_free(_ALLOC_ID_, &paddedData);
|
||||
*output_length-=padding;
|
||||
encoded_data[*output_length]=0;
|
||||
return encoded_data;
|
||||
|
|
@ -367,11 +367,11 @@ static void read_binary_block(FILE *fd)
|
|||
}
|
||||
|
||||
/* read buffer */
|
||||
tmp = my_calloc(1405, xctx->graph_nvars, (sizeof(double *) ));
|
||||
tmp = my_calloc(_ALLOC_ID_, xctx->graph_nvars, (sizeof(double *) ));
|
||||
/* allocate storage for binary block, add one data column for custom data plots */
|
||||
if(!xctx->graph_values) xctx->graph_values = my_calloc(118, xctx->graph_nvars + 1, sizeof(SPICE_DATA *));
|
||||
if(!xctx->graph_values) xctx->graph_values = my_calloc(_ALLOC_ID_, xctx->graph_nvars + 1, sizeof(SPICE_DATA *));
|
||||
for(p = 0 ; p <= xctx->graph_nvars; p++) {
|
||||
my_realloc(372,
|
||||
my_realloc(_ALLOC_ID_,
|
||||
&xctx->graph_values[p], (offset + xctx->graph_npoints[xctx->graph_datasets]) * sizeof(SPICE_DATA));
|
||||
}
|
||||
/* read binary block */
|
||||
|
|
@ -399,7 +399,7 @@ static void read_binary_block(FILE *fd)
|
|||
xctx->graph_values[v][offset + p] = (float)tmp[v];
|
||||
}
|
||||
}
|
||||
my_free(1406, &tmp);
|
||||
my_free(_ALLOC_ID_, &tmp);
|
||||
}
|
||||
|
||||
/* parse ascii raw header section:
|
||||
|
|
@ -436,7 +436,7 @@ static int read_dataset(FILE *fd, const char *type)
|
|||
xctx->graph_sim_type = NULL;
|
||||
dbg(1, "read_dataset(): type=%s\n", type ? type : "<NULL>");
|
||||
while((line = my_fgets(fd))) {
|
||||
my_strdup2(971, &lowerline, line);
|
||||
my_strdup2(_ALLOC_ID_, &lowerline, line);
|
||||
strtolower(lowerline);
|
||||
/* this is an ASCII raw file. We don't handle this (yet) */
|
||||
if(!strcmp(line, "Values:\n") || !strcmp(line, "Values:\r\n")) {
|
||||
|
|
@ -514,7 +514,7 @@ static int read_dataset(FILE *fd, const char *type)
|
|||
return 1;
|
||||
}
|
||||
if(xctx->graph_sim_type) {
|
||||
my_realloc(1414, &xctx->graph_npoints, (xctx->graph_datasets+1) * sizeof(int));
|
||||
my_realloc(_ALLOC_ID_, &xctx->graph_npoints, (xctx->graph_datasets+1) * sizeof(int));
|
||||
xctx->graph_npoints[xctx->graph_datasets] = npoints;
|
||||
/* multi-point OP is equivalent to a DC sweep. Change xctx->graph_sim_type */
|
||||
if(xctx->graph_npoints[xctx->graph_datasets] > 1 && !strcmp(xctx->graph_sim_type, "op") ) {
|
||||
|
|
@ -551,7 +551,7 @@ static int read_dataset(FILE *fd, const char *type)
|
|||
return 1;
|
||||
}
|
||||
if(xctx->graph_sim_type) {
|
||||
my_realloc(1415, &xctx->graph_npoints, (xctx->graph_datasets+1) * sizeof(int));
|
||||
my_realloc(_ALLOC_ID_, &xctx->graph_npoints, (xctx->graph_datasets+1) * sizeof(int));
|
||||
xctx->graph_npoints[xctx->graph_datasets] = npoints;
|
||||
/* multi-point OP is equivalent to a DC sweep. Change xctx->graph_sim_type */
|
||||
if(xctx->graph_npoints[xctx->graph_datasets] > 1 && !strcmp(xctx->graph_sim_type, "op") ) {
|
||||
|
|
@ -561,8 +561,8 @@ static int read_dataset(FILE *fd, const char *type)
|
|||
}
|
||||
if(xctx->graph_sim_type && !done_header && variables) {
|
||||
/* get the list of lines with index and node name */
|
||||
if(!xctx->graph_names) xctx->graph_names = my_calloc(426, xctx->graph_nvars, sizeof(char *));
|
||||
my_realloc(1249, &varname, strlen(line) + 1) ;
|
||||
if(!xctx->graph_names) xctx->graph_names = my_calloc(_ALLOC_ID_, xctx->graph_nvars, sizeof(char *));
|
||||
my_realloc(_ALLOC_ID_, &varname, strlen(line) + 1) ;
|
||||
n = sscanf(line, "%d %s", &i, varname); /* read index and name of saved waveform */
|
||||
if(n < 2) {
|
||||
dbg(0, "read_dataset(): WAARNING: malformed raw file, aborting\n");
|
||||
|
|
@ -595,10 +595,10 @@ static int read_dataset(FILE *fd, const char *type)
|
|||
if(xctx->graph_sim_type && !strncmp(line, "Variables:", 10)) {
|
||||
variables = 1 ;
|
||||
}
|
||||
my_free(969, &line);
|
||||
my_free(_ALLOC_ID_, &line);
|
||||
} /* while((line = my_fgets(fd)) */
|
||||
my_free(1248, &lowerline);
|
||||
my_free(1382, &varname);
|
||||
my_free(_ALLOC_ID_, &lowerline);
|
||||
my_free(_ALLOC_ID_, &varname);
|
||||
if(exit_status == 0 && xctx->graph_datasets && xctx->graph_npoints) {
|
||||
dbg(dbglev, "raw file read: datasets=%d, last dataset points=%d, nvars=%d\n",
|
||||
xctx->graph_datasets, xctx->graph_npoints[xctx->graph_datasets-1], xctx->graph_nvars);
|
||||
|
|
@ -615,21 +615,21 @@ void free_rawfile(int dr)
|
|||
if(xctx->graph_names) {
|
||||
deleted = 1;
|
||||
for(i = 0 ; i < xctx->graph_nvars; i++) {
|
||||
my_free(510, &xctx->graph_names[i]);
|
||||
my_free(_ALLOC_ID_, &xctx->graph_names[i]);
|
||||
}
|
||||
my_free(968, &xctx->graph_names);
|
||||
my_free(_ALLOC_ID_, &xctx->graph_names);
|
||||
}
|
||||
if(xctx->graph_values) {
|
||||
deleted = 1;
|
||||
/* free also extra column for custom data plots */
|
||||
for(i = 0 ; i <= xctx->graph_nvars; i++) {
|
||||
my_free(512, &xctx->graph_values[i]);
|
||||
my_free(_ALLOC_ID_, &xctx->graph_values[i]);
|
||||
}
|
||||
my_free(528, &xctx->graph_values);
|
||||
my_free(_ALLOC_ID_, &xctx->graph_values);
|
||||
}
|
||||
if(xctx->graph_npoints) my_free(1413, &xctx->graph_npoints);
|
||||
if(xctx->graph_npoints) my_free(_ALLOC_ID_, &xctx->graph_npoints);
|
||||
xctx->graph_allpoints = 0;
|
||||
if(xctx->graph_raw_schname) my_free(1393, &xctx->graph_raw_schname);
|
||||
if(xctx->graph_raw_schname) my_free(_ALLOC_ID_, &xctx->graph_raw_schname);
|
||||
xctx->graph_raw_level = -1;
|
||||
tclsetintvar("graph_raw_level", -1);
|
||||
xctx->graph_datasets = 0;
|
||||
|
|
@ -652,11 +652,11 @@ char *base64_from_file(const char *f, size_t *length)
|
|||
len = st.st_size;
|
||||
fd = fopen(f, fopen_read_mode);
|
||||
if(fd) {
|
||||
s = my_malloc(1475, len);
|
||||
s = my_malloc(_ALLOC_ID_, len);
|
||||
fread(s, len, 1, fd);
|
||||
fclose(fd);
|
||||
b64s = base64_encode(s, len, length, 1);
|
||||
my_free(1477, &s);
|
||||
my_free(_ALLOC_ID_, &s);
|
||||
}
|
||||
else {
|
||||
dbg(0, "base64_from_file(): failed to open file %s for reading\n", f);
|
||||
|
|
@ -688,7 +688,7 @@ int raw_read_from_attr(const char *type)
|
|||
s = base64_decode(b64_spice_data, length, &decoded_length);
|
||||
fwrite(s, decoded_length, 1, fd);
|
||||
fclose(fd);
|
||||
my_free(1479, &s);
|
||||
my_free(_ALLOC_ID_, &s);
|
||||
res = raw_read(tmp_filename, type);
|
||||
unlink(tmp_filename);
|
||||
} else {
|
||||
|
|
@ -713,7 +713,7 @@ int raw_read(const char *f, const char *type)
|
|||
if(fd) {
|
||||
if((res = read_dataset(fd, type)) == 1) {
|
||||
int i;
|
||||
my_strdup2(1394, &xctx->graph_raw_schname, xctx->sch[xctx->currsch]);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->graph_raw_schname, xctx->sch[xctx->currsch]);
|
||||
xctx->graph_raw_level = xctx->currsch;
|
||||
tclsetintvar("graph_raw_level", xctx->currsch);
|
||||
xctx->graph_allpoints = 0;
|
||||
|
|
@ -784,18 +784,18 @@ static double ravg_store(int what , int i, int p, int last, double value)
|
|||
} else if(what == 1) {
|
||||
if(i >= imax) {
|
||||
int new_size = i + 4;
|
||||
my_realloc(1514, &arr, sizeof(double *) * new_size);
|
||||
my_realloc(_ALLOC_ID_, &arr, sizeof(double *) * new_size);
|
||||
for(j = imax; j < new_size; j++) {
|
||||
arr[j] = my_calloc(1515, last + 1, sizeof(double));
|
||||
arr[j] = my_calloc(_ALLOC_ID_, last + 1, sizeof(double));
|
||||
}
|
||||
imax = new_size;
|
||||
}
|
||||
arr[i][p] = value;
|
||||
} else if(what == 0 && imax) {
|
||||
for(j = 0; j < imax; j++) {
|
||||
my_free(1512, &arr[j]);
|
||||
my_free(_ALLOC_ID_, &arr[j]);
|
||||
}
|
||||
my_free(1513, &arr);
|
||||
my_free(_ALLOC_ID_, &arr);
|
||||
imax = 0;
|
||||
}
|
||||
return 0.0;
|
||||
|
|
@ -853,13 +853,13 @@ int plot_raw_custom_data(int sweep_idx, int first, int last, const char *expr)
|
|||
SPICE_DATA *x = xctx->graph_values[sweep_idx];
|
||||
SPICE_DATA *sweepx = xctx->graph_values[0];
|
||||
|
||||
my_strdup2(574, &ntok_copy, expr);
|
||||
my_strdup2(_ALLOC_ID_, &ntok_copy, expr);
|
||||
ntok_ptr = ntok_copy;
|
||||
dbg(1, "plot_raw_custom_data(): expr=%s\n", expr);
|
||||
while( (n = my_strtok_r(ntok_ptr, " \t\n", "", &ntok_save)) ) {
|
||||
if(stackptr1 >= STACKMAX -2) {
|
||||
dbg(0, "stack overflow in graph expression parsing. Interrupted\n");
|
||||
my_free(576, &ntok_copy);
|
||||
my_free(_ALLOC_ID_, &ntok_copy);
|
||||
return -1;
|
||||
}
|
||||
ntok_ptr = NULL;
|
||||
|
|
@ -913,7 +913,7 @@ int plot_raw_custom_data(int sweep_idx, int first, int last, const char *expr)
|
|||
idx = get_raw_index(n);
|
||||
if(idx == -1) {
|
||||
dbg(1, "plot_raw_custom_data(): no data found: %s\n", n);
|
||||
my_free(645, &ntok_copy);
|
||||
my_free(_ALLOC_ID_, &ntok_copy);
|
||||
return -1; /* no data found in raw file */
|
||||
}
|
||||
stack1[stackptr1].i = SPICE_NODE;
|
||||
|
|
@ -922,7 +922,7 @@ int plot_raw_custom_data(int sweep_idx, int first, int last, const char *expr)
|
|||
}
|
||||
dbg(1, " plot_raw_custom_data(): stack1= %d\n", stack1[stackptr1 - 1].i);
|
||||
} /* while(n = my_strtok_r(...) */
|
||||
my_free(575, &ntok_copy);
|
||||
my_free(_ALLOC_ID_, &ntok_copy);
|
||||
for(p = first ; p <= last; p++) {
|
||||
stackptr2 = 0;
|
||||
for(i = 0; i < stackptr1; i++) {
|
||||
|
|
@ -1254,7 +1254,7 @@ void read_record(int firstchar, FILE *fp, int dbg_level)
|
|||
}
|
||||
}
|
||||
dbg(dbg_level, "END SKIP RECORD\n");
|
||||
my_free(881, &str);
|
||||
my_free(_ALLOC_ID_, &str);
|
||||
}
|
||||
|
||||
/* skip line of text from file, stopping before '\n' or EOF */
|
||||
|
|
@ -1383,7 +1383,7 @@ void save_ascii_string(const char *ptr, FILE *fd, int newline)
|
|||
|
||||
if(ptr == NULL) {
|
||||
if( fd == NULL) { /* used to clear static data */
|
||||
my_free(139, &strbuf);
|
||||
my_free(_ALLOC_ID_, &strbuf);
|
||||
strbuf_size = 0;
|
||||
return;
|
||||
}
|
||||
|
|
@ -1392,11 +1392,11 @@ void save_ascii_string(const char *ptr, FILE *fd, int newline)
|
|||
return;
|
||||
}
|
||||
len = strlen(ptr) + CADCHUNKALLOC;
|
||||
if(strbuf_size < len ) my_realloc(140, &strbuf, (strbuf_size = len));
|
||||
if(strbuf_size < len ) my_realloc(_ALLOC_ID_, &strbuf, (strbuf_size = len));
|
||||
|
||||
strbuf[strbuf_pos++] = '{';
|
||||
while( (c = *ptr++) ) {
|
||||
if(strbuf_pos > strbuf_size - 6) my_realloc(525, &strbuf, (strbuf_size += CADCHUNKALLOC));
|
||||
if(strbuf_pos > strbuf_size - 6) my_realloc(_ALLOC_ID_, &strbuf, (strbuf_size += CADCHUNKALLOC));
|
||||
if( c=='\\' || c=='{' || c=='}') strbuf[strbuf_pos++] = '\\';
|
||||
strbuf[strbuf_pos++] = (char)c;
|
||||
}
|
||||
|
|
@ -1486,15 +1486,15 @@ static void save_inst(FILE *fd, int select_only)
|
|||
inst=xctx->inst;
|
||||
oldversion = !strcmp(xctx->file_version, "1.0");
|
||||
for(i=0;i<xctx->symbols;i++) xctx->sym[i].flags &=~EMBEDDED;
|
||||
embedded_saved = my_calloc(663, xctx->symbols, sizeof(int));
|
||||
embedded_saved = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(int));
|
||||
for(i=0;i<xctx->instances;i++)
|
||||
{
|
||||
if (select_only && inst[i].sel != SELECTED) continue;
|
||||
fputs("C ", fd);
|
||||
if(oldversion) {
|
||||
my_strdup2(57, &tmp, add_ext(inst[i].name, ".sym"));
|
||||
my_strdup2(_ALLOC_ID_, &tmp, add_ext(inst[i].name, ".sym"));
|
||||
save_ascii_string(tmp, fd, 0);
|
||||
my_free(882, &tmp);
|
||||
my_free(_ALLOC_ID_, &tmp);
|
||||
} else {
|
||||
save_ascii_string(inst[i].name, fd, 0);
|
||||
}
|
||||
|
|
@ -1508,7 +1508,7 @@ static void save_inst(FILE *fd, int select_only)
|
|||
xctx->sym[inst[i].ptr].flags |= EMBEDDED;
|
||||
}
|
||||
}
|
||||
my_free(539, &embedded_saved);
|
||||
my_free(_ALLOC_ID_, &embedded_saved);
|
||||
}
|
||||
|
||||
static void save_wire(FILE *fd, int select_only)
|
||||
|
|
@ -1620,12 +1620,12 @@ static void write_xschem_file(FILE *fd)
|
|||
size_t tmpstring_size;
|
||||
char *header_ptr = xctx->header_text ? xctx->header_text : "";
|
||||
tmpstring_size = strlen(header_ptr) + 100;
|
||||
tmpstring = my_malloc(1652, tmpstring_size);
|
||||
tmpstring = my_malloc(_ALLOC_ID_, tmpstring_size);
|
||||
my_snprintf(tmpstring, tmpstring_size, "xschem version=%s file_version=%s\n%s",
|
||||
XSCHEM_VERSION, XSCHEM_FILE_VERSION, header_ptr);
|
||||
fprintf(fd, "v ");
|
||||
save_ascii_string(tmpstring, fd, 1);
|
||||
my_free(1653, &tmpstring);
|
||||
my_free(_ALLOC_ID_, &tmpstring);
|
||||
|
||||
if(xctx->schvhdlprop && !xctx->schsymbolprop) {
|
||||
get_tok_value(xctx->schvhdlprop,"type",0);
|
||||
|
|
@ -1686,7 +1686,7 @@ static void load_text(FILE *fd)
|
|||
xctx->text[i].sel=0;
|
||||
load_ascii_string(&xctx->text[i].prop_ptr,fd);
|
||||
if( xctx->text[i].prop_ptr)
|
||||
my_strdup(318, &xctx->text[i].font, get_tok_value(xctx->text[i].prop_ptr, "font", 0));
|
||||
my_strdup(_ALLOC_ID_, &xctx->text[i].font, get_tok_value(xctx->text[i].prop_ptr, "font", 0));
|
||||
|
||||
str = get_tok_value(xctx->text[i].prop_ptr, "hcenter", 0);
|
||||
xctx->text[i].hcenter = strcmp(str, "true") ? 0 : 1;
|
||||
|
|
@ -1750,12 +1750,12 @@ static void load_inst(int k, FILE *fd)
|
|||
xctx->inst[i].name=NULL;
|
||||
/* avoid as much as possible calls to rel_sym_path (slow) */
|
||||
#ifdef __unix__
|
||||
if(name[0] == '/') my_strdup2(56, &xctx->inst[i].name, rel_sym_path(name));
|
||||
else my_strdup2(762, &xctx->inst[i].name, name);
|
||||
if(name[0] == '/') my_strdup2(_ALLOC_ID_, &xctx->inst[i].name, rel_sym_path(name));
|
||||
else my_strdup2(_ALLOC_ID_, &xctx->inst[i].name, name);
|
||||
#else
|
||||
my_strdup2(777, &xctx->inst[i].name, rel_sym_path(name));
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[i].name, rel_sym_path(name));
|
||||
#endif
|
||||
my_free(884, &tmp);
|
||||
my_free(_ALLOC_ID_, &tmp);
|
||||
if(fscanf(fd, "%lf %lf %hd %hd", &xctx->inst[i].x0, &xctx->inst[i].y0,
|
||||
&xctx->inst[i].rot, &xctx->inst[i].flip) < 4) {
|
||||
fprintf(errfp,"WARNING: missing fields for INSTANCE object, ignoring.\n");
|
||||
|
|
@ -1770,8 +1770,8 @@ static void load_inst(int k, FILE *fd)
|
|||
xctx->inst[i].lab=NULL; /* assigned in link_symbols_to_instances */
|
||||
xctx->inst[i].node=NULL;
|
||||
load_ascii_string(&prop_ptr,fd);
|
||||
my_strdup(319, &xctx->inst[i].prop_ptr, prop_ptr);
|
||||
my_strdup2(320, &xctx->inst[i].instname, get_tok_value(xctx->inst[i].prop_ptr, "name", 0));
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, prop_ptr);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[i].instname, get_tok_value(xctx->inst[i].prop_ptr, "name", 0));
|
||||
if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"highlight",0), "true"))
|
||||
xctx->inst[i].flags |= HILIGHT_CONN;
|
||||
|
||||
|
|
@ -1780,7 +1780,7 @@ static void load_inst(int k, FILE *fd)
|
|||
xctx->inst[i].embed = !strcmp(get_tok_value(xctx->inst[i].prop_ptr, "embed", 2), "true");
|
||||
xctx->instances++;
|
||||
}
|
||||
my_free(885, &prop_ptr);
|
||||
my_free(_ALLOC_ID_, &prop_ptr);
|
||||
}
|
||||
|
||||
static void load_polygon(FILE *fd)
|
||||
|
|
@ -1807,17 +1807,17 @@ static void load_polygon(FILE *fd)
|
|||
ptr[i].y=NULL;
|
||||
ptr[i].selected_point=NULL;
|
||||
ptr[i].prop_ptr=NULL;
|
||||
ptr[i].x = my_calloc(321, points, sizeof(double));
|
||||
ptr[i].y = my_calloc(322, points, sizeof(double));
|
||||
ptr[i].selected_point= my_calloc(323, points, sizeof(unsigned short));
|
||||
ptr[i].x = my_calloc(_ALLOC_ID_, points, sizeof(double));
|
||||
ptr[i].y = my_calloc(_ALLOC_ID_, points, sizeof(double));
|
||||
ptr[i].selected_point= my_calloc(_ALLOC_ID_, points, sizeof(unsigned short));
|
||||
ptr[i].points=points;
|
||||
ptr[i].sel=0;
|
||||
for(j=0;j<points;j++) {
|
||||
if(fscanf(fd, "%lf %lf ",&(ptr[i].x[j]), &(ptr[i].y[j]))<2) {
|
||||
fprintf(errfp,"WARNING: missing fields for POLYGON points, ignoring.\n");
|
||||
my_free(886, &ptr[i].x);
|
||||
my_free(887, &ptr[i].y);
|
||||
my_free(888, &ptr[i].selected_point);
|
||||
my_free(_ALLOC_ID_, &ptr[i].x);
|
||||
my_free(_ALLOC_ID_, &ptr[i].y);
|
||||
my_free(_ALLOC_ID_, &ptr[i].selected_point);
|
||||
read_line(fd, 0);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1985,16 +1985,16 @@ static void read_xschem_file(FILE *fd)
|
|||
|
||||
|
||||
if((ptr2 = strstr(xctx->version_string, "xschem")) && (ptr2 - xctx->version_string < 50)) {
|
||||
my_strdup2(1655, &ptr, subst_token(xctx->version_string, "xschem", NULL));
|
||||
my_strdup2(_ALLOC_ID_, &ptr, subst_token(xctx->version_string, "xschem", NULL));
|
||||
}
|
||||
my_strdup2(1656, &ptr, subst_token(ptr, "version", NULL));
|
||||
my_strdup2(1657, &ptr, subst_token(ptr, "file_version", NULL));
|
||||
my_strdup2(_ALLOC_ID_, &ptr, subst_token(ptr, "version", NULL));
|
||||
my_strdup2(_ALLOC_ID_, &ptr, subst_token(ptr, "file_version", NULL));
|
||||
|
||||
ptr2 = ptr;
|
||||
while(*ptr2 == ' ' || *ptr2 =='\t') ptr2++; /* strip leading spaces */
|
||||
if(*ptr2 == '\n') ptr2++; /* strip leading newline */
|
||||
my_strdup2(1658, &xctx->header_text, ptr2);
|
||||
my_free(1659,&ptr);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->header_text, ptr2);
|
||||
my_free(_ALLOC_ID_,&ptr);
|
||||
}
|
||||
dbg(1, "read_xschem_file(): file_version=%s\n", xctx->file_version);
|
||||
break;
|
||||
|
|
@ -2042,7 +2042,7 @@ static void read_xschem_file(FILE *fd)
|
|||
break;
|
||||
case '[':
|
||||
found=0;
|
||||
my_strdup(324, &xctx->inst[xctx->instances-1].prop_ptr,
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[xctx->instances-1].prop_ptr,
|
||||
subst_token(xctx->inst[xctx->instances-1].prop_ptr, "embed", "true"));
|
||||
if(xctx->inst[xctx->instances-1].name) {
|
||||
my_snprintf(name_embedded, S(name_embedded), "%s/.xschem_embedded_%d_%s",
|
||||
|
|
@ -2058,7 +2058,7 @@ static void read_xschem_file(FILE *fd)
|
|||
/* if loading file coming back from embedded symbol delete temporary file */
|
||||
/* symbol from this temp file has already been loaded in go_back() */
|
||||
if(!xctx->x_strcmp(name_embedded, xctx->sym[i].name)) {
|
||||
my_strdup2(325, &xctx->sym[i].name, xctx->inst[xctx->instances-1].name);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->sym[i].name, xctx->inst[xctx->instances-1].name);
|
||||
xunlink(name_embedded);
|
||||
found=1;break;
|
||||
}
|
||||
|
|
@ -2114,13 +2114,13 @@ void load_ascii_string(char **ptr, FILE *fd)
|
|||
|
||||
for(;;)
|
||||
{
|
||||
if(i+5>strlength) my_realloc(326, &str,(strlength+=CADCHUNKALLOC));
|
||||
if(i+5>strlength) my_realloc(_ALLOC_ID_, &str,(strlength+=CADCHUNKALLOC));
|
||||
c=fgetc(fd);
|
||||
if (c=='\r') continue;
|
||||
if(c==EOF) {
|
||||
fprintf(errfp, "EOF reached, malformed {...} string input, missing close brace\n");
|
||||
my_free(1149, ptr);
|
||||
my_free(889, &str);
|
||||
my_free(_ALLOC_ID_, ptr);
|
||||
my_free(_ALLOC_ID_, &str);
|
||||
return;
|
||||
}
|
||||
if(begin) {
|
||||
|
|
@ -2140,9 +2140,9 @@ void load_ascii_string(char **ptr, FILE *fd)
|
|||
} else if(c=='{') begin=1;
|
||||
}
|
||||
dbg(2, "load_ascii_string(): string read=%s\n",str? str:"<NULL>");
|
||||
my_strdup(329, ptr, str);
|
||||
my_strdup(_ALLOC_ID_, ptr, str);
|
||||
dbg(2, "load_ascii_string(): loaded %s\n",*ptr? *ptr:"<NULL>");
|
||||
my_free(891, &str);
|
||||
my_free(_ALLOC_ID_, &str);
|
||||
}
|
||||
|
||||
void make_symbol(void)
|
||||
|
|
@ -2272,7 +2272,7 @@ void link_symbols_to_instances(int from) /* from >= 0 : linking symbols from pas
|
|||
if(cond) xctx->inst[i].flags|=2; /* ordinary symbol */
|
||||
else {
|
||||
xctx->inst[i].flags &=~2; /* label or pin */
|
||||
my_strdup(1216, &xctx->inst[i].lab, get_tok_value(xctx->inst[i].prop_ptr,"lab",0));
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[i].lab, get_tok_value(xctx->inst[i].prop_ptr,"lab",0));
|
||||
}
|
||||
}
|
||||
/* symbol_bbox() might call translate() that might call prepare_netlist_structs() that
|
||||
|
|
@ -2436,7 +2436,7 @@ void delete_undo(void)
|
|||
xunlink(diff_name);
|
||||
}
|
||||
rmdir(xctx->undo_dirname);
|
||||
my_free(895, &xctx->undo_dirname);
|
||||
my_free(_ALLOC_ID_, &xctx->undo_dirname);
|
||||
xctx->undo_initialized = 0;
|
||||
}
|
||||
|
||||
|
|
@ -2445,7 +2445,7 @@ static void init_undo(void)
|
|||
{
|
||||
if(!xctx->undo_initialized) {
|
||||
/* create undo directory */
|
||||
if( !my_strdup(644, &xctx->undo_dirname, create_tmpdir("xschem_undo_") )) {
|
||||
if( !my_strdup(_ALLOC_ID_, &xctx->undo_dirname, create_tmpdir("xschem_undo_") )) {
|
||||
dbg(0, "xinit(): problems creating tmp undo dir, Undo will be disabled\n");
|
||||
dbg(0, "init_undo(): Check permissions in %s\n", tclgetvar("XSCHEM_TMP_DIR"));
|
||||
xctx->no_undo = 1; /* disable undo */
|
||||
|
|
@ -2661,7 +2661,7 @@ static void get_sym_type(const char *symname, char **type,
|
|||
/* first look in already loaded symbols in xctx->sym[] array... */
|
||||
for(i=0;i<xctx->symbols;i++) {
|
||||
if(xctx->x_strcmp(symname, xctx->sym[i].name) == 0) {
|
||||
my_strdup2(316, type, xctx->sym[i].type);
|
||||
my_strdup2(_ALLOC_ID_, type, xctx->sym[i].type);
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
|
|
@ -2682,7 +2682,7 @@ static void get_sym_type(const char *symname, char **type,
|
|||
|
||||
if(fd==NULL) {
|
||||
dbg(1, "get_sym_type(): Symbol not found: %s\n",name);
|
||||
my_strdup2(1162, type, "");
|
||||
my_strdup2(_ALLOC_ID_, type, "");
|
||||
} else {
|
||||
char *globalprop=NULL;
|
||||
int fscan_ret;
|
||||
|
|
@ -2696,12 +2696,12 @@ static void get_sym_type(const char *symname, char **type,
|
|||
case 'G':
|
||||
load_ascii_string(&globalprop,fd);
|
||||
if(!found) {
|
||||
my_strdup2(1164, type, get_tok_value(globalprop, "type", 0));
|
||||
my_strdup2(_ALLOC_ID_, type, get_tok_value(globalprop, "type", 0));
|
||||
}
|
||||
break;
|
||||
case 'K':
|
||||
load_ascii_string(&globalprop,fd);
|
||||
my_strdup2(1165, type, get_tok_value(globalprop, "type", 0));
|
||||
my_strdup2(_ALLOC_ID_, type, get_tok_value(globalprop, "type", 0));
|
||||
if(type[0]) found = 1;
|
||||
break;
|
||||
case 'B':
|
||||
|
|
@ -2730,8 +2730,8 @@ static void get_sym_type(const char *symname, char **type,
|
|||
}
|
||||
read_line(fd, 0); /* discard any remaining characters till (but not including) newline */
|
||||
}
|
||||
my_free(1166, &globalprop);
|
||||
my_free(1167, &rect.prop_ptr);
|
||||
my_free(_ALLOC_ID_, &globalprop);
|
||||
my_free(_ALLOC_ID_, &rect.prop_ptr);
|
||||
if(!embed_fd) fclose(fd);
|
||||
}
|
||||
}
|
||||
|
|
@ -2762,7 +2762,7 @@ static void align_sch_pins_with_sym(const char *name, int pos)
|
|||
name, symname);
|
||||
fail = 1;
|
||||
}
|
||||
rect = (xRect *) my_malloc(1168, sizeof(xRect) * sym_n_pins);
|
||||
rect = (xRect *) my_malloc(_ALLOC_ID_, sizeof(xRect) * sym_n_pins);
|
||||
dbg(1, "align_sch_pins_with_sym(): symbol: %s\n", symname);
|
||||
for(i=0; i < xctx->sym[pos].rects[PINLAYER]; i++) {
|
||||
Int_hashentry *entry;
|
||||
|
|
@ -2783,10 +2783,10 @@ static void align_sch_pins_with_sym(const char *name, int pos)
|
|||
xctx->sym[pos].rect[PINLAYER][i] = rect[i];
|
||||
}
|
||||
}
|
||||
my_free(1169, &rect);
|
||||
my_free(_ALLOC_ID_, &rect);
|
||||
}
|
||||
int_hash_free(&pintable);
|
||||
my_free(1170, &symtype);
|
||||
my_free(_ALLOC_ID_, &symtype);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2800,14 +2800,14 @@ static void add_pinlayer_boxes(int *lastr, xRect **bb,
|
|||
char *pin_label = NULL;
|
||||
|
||||
i = lastr[PINLAYER];
|
||||
my_realloc(652, &bb[PINLAYER], (i + 1) * sizeof(xRect));
|
||||
my_realloc(_ALLOC_ID_, &bb[PINLAYER], (i + 1) * sizeof(xRect));
|
||||
bb[PINLAYER][i].x1 = i_x0 - 2.5; bb[PINLAYER][i].x2 = i_x0 + 2.5;
|
||||
bb[PINLAYER][i].y1 = i_y0 - 2.5; bb[PINLAYER][i].y2 = i_y0 + 2.5;
|
||||
RECTORDER(bb[PINLAYER][i].x1, bb[PINLAYER][i].y1, bb[PINLAYER][i].x2, bb[PINLAYER][i].y2);
|
||||
bb[PINLAYER][i].prop_ptr = NULL;
|
||||
label = get_tok_value(prop_ptr, "lab", 0);
|
||||
save = strlen(label)+30;
|
||||
pin_label = my_malloc(315, save);
|
||||
pin_label = my_malloc(_ALLOC_ID_, save);
|
||||
pin_label[0] = '\0';
|
||||
if (!strcmp(symtype, "ipin")) {
|
||||
my_snprintf(pin_label, save, "name=%s dir=in ", label);
|
||||
|
|
@ -2816,15 +2816,15 @@ static void add_pinlayer_boxes(int *lastr, xRect **bb,
|
|||
} else if (!strcmp(symtype, "iopin")) {
|
||||
my_snprintf(pin_label, save, "name=%s dir=inout ", label);
|
||||
}
|
||||
my_strdup(463, &bb[PINLAYER][i].prop_ptr, pin_label);
|
||||
my_strdup(_ALLOC_ID_, &bb[PINLAYER][i].prop_ptr, pin_label);
|
||||
bb[PINLAYER][i].flags = 0;
|
||||
bb[PINLAYER][i].extraptr = 0;
|
||||
bb[PINLAYER][i].dash = 0;
|
||||
bb[PINLAYER][i].sel = 0;
|
||||
/* add to symbol pins remaining attributes from schematic pins, except name= and lab= */
|
||||
my_strdup(157, &pin_label, get_sym_template(prop_ptr, "lab")); /* remove name=... and lab=... */
|
||||
my_strdup(_ALLOC_ID_, &pin_label, get_sym_template(prop_ptr, "lab")); /* remove name=... and lab=... */
|
||||
my_strcat(159, &bb[PINLAYER][i].prop_ptr, pin_label);
|
||||
my_free(900, &pin_label);
|
||||
my_free(_ALLOC_ID_, &pin_label);
|
||||
lastr[PINLAYER]++;
|
||||
}
|
||||
|
||||
|
|
@ -2987,14 +2987,14 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
short inst_rot, inst_flip;
|
||||
char *symname = NULL;
|
||||
char tag[1];
|
||||
int *lastl = my_malloc(333, cadlayers * sizeof(lastl));
|
||||
int *lastr = my_malloc(334, cadlayers * sizeof(int));
|
||||
int *lastp = my_malloc(335, cadlayers * sizeof(int));
|
||||
int *lasta = my_malloc(336, cadlayers * sizeof(int));
|
||||
xLine **ll = my_malloc(337, cadlayers * sizeof(xLine *));
|
||||
xRect **bb = my_malloc(338, cadlayers * sizeof(xRect *));
|
||||
xArc **aa = my_malloc(339, cadlayers * sizeof(xArc *));
|
||||
xPoly **pp = my_malloc(340, cadlayers * sizeof(xPoly *));
|
||||
int *lastl = my_malloc(_ALLOC_ID_, cadlayers * sizeof(lastl));
|
||||
int *lastr = my_malloc(_ALLOC_ID_, cadlayers * sizeof(int));
|
||||
int *lastp = my_malloc(_ALLOC_ID_, cadlayers * sizeof(int));
|
||||
int *lasta = my_malloc(_ALLOC_ID_, cadlayers * sizeof(int));
|
||||
xLine **ll = my_malloc(_ALLOC_ID_, cadlayers * sizeof(xLine *));
|
||||
xRect **bb = my_malloc(_ALLOC_ID_, cadlayers * sizeof(xRect *));
|
||||
xArc **aa = my_malloc(_ALLOC_ID_, cadlayers * sizeof(xArc *));
|
||||
xPoly **pp = my_malloc(_ALLOC_ID_, cadlayers * sizeof(xPoly *));
|
||||
int lastt;
|
||||
xText *tt;
|
||||
int endfile;
|
||||
|
|
@ -3011,7 +3011,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
recursion_counter++;
|
||||
dbg(1, "l_s_d(): loading name=%s\n", name);
|
||||
lcc=NULL;
|
||||
my_realloc(647, &lcc, (level + 1) * sizeof(Lcc));
|
||||
my_realloc(_ALLOC_ID_, &lcc, (level + 1) * sizeof(Lcc));
|
||||
max_level = level + 1;
|
||||
if(!strcmp(xctx->file_version,"1.0")) {
|
||||
my_strncpy(sympath, abs_sym_path(name, ".sym"), S(sympath));
|
||||
|
|
@ -3056,7 +3056,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
symbol[symbols].type = NULL;
|
||||
symbol[symbols].templ = NULL;
|
||||
symbol[symbols].name=NULL;
|
||||
my_strdup2(352, &symbol[symbols].name,name);
|
||||
my_strdup2(_ALLOC_ID_, &symbol[symbols].name,name);
|
||||
/* read symbol from file */
|
||||
while(1)
|
||||
{
|
||||
|
|
@ -3065,8 +3065,8 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
if (level) {
|
||||
dbg(1, "l_s_d(): fclose1, level=%d, fd=%p\n", level, lcc[level].fd);
|
||||
fclose(lcc[level].fd);
|
||||
my_free(898, &lcc[level].prop_ptr);
|
||||
my_free(899, &lcc[level].symname);
|
||||
my_free(_ALLOC_ID_, &lcc[level].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &lcc[level].symname);
|
||||
--level;
|
||||
continue;
|
||||
} else break;
|
||||
|
|
@ -3100,9 +3100,9 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
if (level==0) {
|
||||
load_ascii_string(&symbol[symbols].prop_ptr, lcc[level].fd);
|
||||
if(!symbol[symbols].prop_ptr) break;
|
||||
my_strdup2(424, &symbol[symbols].templ,
|
||||
my_strdup2(_ALLOC_ID_, &symbol[symbols].templ,
|
||||
get_tok_value(symbol[symbols].prop_ptr, "template", 0));
|
||||
my_strdup2(515, &symbol[symbols].type,
|
||||
my_strdup2(_ALLOC_ID_, &symbol[symbols].type,
|
||||
get_tok_value(symbol[symbols].prop_ptr, "type",0));
|
||||
if(!strcmp(get_tok_value(symbol[symbols].prop_ptr,"highlight",0), "true"))
|
||||
symbol[symbols].flags |= HILIGHT_CONN;
|
||||
|
|
@ -3117,9 +3117,9 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
if (level==0 && !symbol[symbols].prop_ptr) {
|
||||
load_ascii_string(&symbol[symbols].prop_ptr, lcc[level].fd);
|
||||
if(!symbol[symbols].prop_ptr) break;
|
||||
my_strdup2(341, &symbol[symbols].templ,
|
||||
my_strdup2(_ALLOC_ID_, &symbol[symbols].templ,
|
||||
get_tok_value(symbol[symbols].prop_ptr, "template", 0));
|
||||
my_strdup2(342, &symbol[symbols].type,
|
||||
my_strdup2(_ALLOC_ID_, &symbol[symbols].type,
|
||||
get_tok_value(symbol[symbols].prop_ptr, "type",0));
|
||||
if(!strcmp(get_tok_value(symbol[symbols].prop_ptr,"highlight",0), "true"))
|
||||
symbol[symbols].flags |= HILIGHT_CONN;
|
||||
|
|
@ -3137,7 +3137,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
continue;
|
||||
}
|
||||
i=lastl[c];
|
||||
my_realloc(343, &ll[c],(i+1)*sizeof(xLine));
|
||||
my_realloc(_ALLOC_ID_, &ll[c],(i+1)*sizeof(xLine));
|
||||
if(fscanf(lcc[level].fd, "%lf %lf %lf %lf ",&ll[c][i].x1, &ll[c][i].y1,
|
||||
&ll[c][i].x2, &ll[c][i].y2) < 4 ) {
|
||||
fprintf(errfp,"l_s_d(): WARNING: missing fields for LINE object, ignoring\n");
|
||||
|
|
@ -3180,10 +3180,10 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
continue;
|
||||
}
|
||||
i=lastp[c];
|
||||
my_realloc(344, &pp[c],(i+1)*sizeof(xPoly));
|
||||
pp[c][i].x = my_calloc(345, poly_points, sizeof(double));
|
||||
pp[c][i].y = my_calloc(346, poly_points, sizeof(double));
|
||||
pp[c][i].selected_point = my_calloc(347, poly_points, sizeof(unsigned short));
|
||||
my_realloc(_ALLOC_ID_, &pp[c],(i+1)*sizeof(xPoly));
|
||||
pp[c][i].x = my_calloc(_ALLOC_ID_, poly_points, sizeof(double));
|
||||
pp[c][i].y = my_calloc(_ALLOC_ID_, poly_points, sizeof(double));
|
||||
pp[c][i].selected_point = my_calloc(_ALLOC_ID_, poly_points, sizeof(unsigned short));
|
||||
pp[c][i].points = poly_points;
|
||||
for(k=0;k<poly_points;k++) {
|
||||
if(fscanf(lcc[level].fd, "%lf %lf ",&(pp[c][i].x[k]), &(pp[c][i].y[k]) ) < 2 ) {
|
||||
|
|
@ -3221,7 +3221,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
continue;
|
||||
}
|
||||
i=lasta[c];
|
||||
my_realloc(348, &aa[c],(i+1)*sizeof(xArc));
|
||||
my_realloc(_ALLOC_ID_, &aa[c],(i+1)*sizeof(xArc));
|
||||
if( fscanf(lcc[level].fd, "%lf %lf %lf %lf %lf ",&aa[c][i].x, &aa[c][i].y,
|
||||
&aa[c][i].r, &aa[c][i].a, &aa[c][i].b) < 5 ) {
|
||||
fprintf(errfp,"l_s_d(): WARNING: missing fields for ARC object, ignoring\n");
|
||||
|
|
@ -3267,7 +3267,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
}
|
||||
if (level>0 && c == PINLAYER) c = 7; /* Don't care about pins inside SYM: set on different layer */
|
||||
i=lastr[c];
|
||||
my_realloc(349, &bb[c],(i+1)*sizeof(xRect));
|
||||
my_realloc(_ALLOC_ID_, &bb[c],(i+1)*sizeof(xRect));
|
||||
if(fscanf(lcc[level].fd, "%lf %lf %lf %lf ",&bb[c][i].x1, &bb[c][i].y1,
|
||||
&bb[c][i].x2, &bb[c][i].y2) < 4 ) {
|
||||
fprintf(errfp,"l_s_d(): WARNING: missing fields for Box object, ignoring\n");
|
||||
|
|
@ -3286,7 +3286,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
load_ascii_string( &bb[c][i].prop_ptr, lcc[level].fd);
|
||||
/* don't load graphs of LCC schematic instances */
|
||||
if(strstr(get_tok_value(bb[c][i].prop_ptr, "flags", 0), "graph")) {
|
||||
my_free(1594, &bb[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &bb[c][i].prop_ptr);
|
||||
continue;
|
||||
}
|
||||
dbg(2, "l_s_d(): loaded rect: ptr=%lx\n", (unsigned long)bb[c]);
|
||||
|
|
@ -3306,7 +3306,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
break;
|
||||
case 'T':
|
||||
i=lastt;
|
||||
my_realloc(350, &tt,(i+1)*sizeof(xText));
|
||||
my_realloc(_ALLOC_ID_, &tt,(i+1)*sizeof(xText));
|
||||
tt[i].txt_ptr=NULL;
|
||||
tt[i].font=NULL;
|
||||
load_ascii_string(&tt[i].txt_ptr, lcc[level].fd);
|
||||
|
|
@ -3321,7 +3321,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
const char* tmp = translate2(lcc, level, tt[i].txt_ptr);
|
||||
dbg(1, "l_s_d(): txt2: tt[i].txt_ptr=%s, i=%d\n", tt[i].txt_ptr, i);
|
||||
rot = lcc[level].rot; flip = lcc[level].flip;
|
||||
my_strdup2(651, &tt[i].txt_ptr, tmp);
|
||||
my_strdup2(_ALLOC_ID_, &tt[i].txt_ptr, tmp);
|
||||
dbg(1, "l_s_d(): txt3: tt[i].txt_ptr=%s, i=%d\n", tt[i].txt_ptr, i);
|
||||
/* allow annotation inside LCC instances. */
|
||||
if(!strcmp(tt[i].txt_ptr, "@spice_get_voltage")) {
|
||||
|
|
@ -3340,9 +3340,9 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
if(path) new_size += strlen(path);
|
||||
lab = get_tok_value(prop_ptr, "lab", 0);
|
||||
new_size += strlen(lab) + 21; /* @spice_get_voltage(<lab>) */
|
||||
my_realloc(1587, &tt[i].txt_ptr, new_size);
|
||||
my_realloc(_ALLOC_ID_, &tt[i].txt_ptr, new_size);
|
||||
my_snprintf(tt[i].txt_ptr, new_size, "@spice_get_voltage(%s%s)", path ? path : "", lab);
|
||||
my_free(1589, &path);
|
||||
my_free(_ALLOC_ID_, &path);
|
||||
dbg(1, " --> tt[i].txt_ptr=%s\n", tt[i].txt_ptr);
|
||||
}
|
||||
if(!strcmp(tt[i].txt_ptr, "@spice_get_current")) {
|
||||
|
|
@ -3361,9 +3361,9 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
if(path) new_size += strlen(path);
|
||||
dev = get_tok_value(prop_ptr, "name", 0);
|
||||
new_size += strlen(dev) + 21; /* @spice_get_current(<dev>) */
|
||||
my_realloc(1592, &tt[i].txt_ptr, new_size);
|
||||
my_realloc(_ALLOC_ID_, &tt[i].txt_ptr, new_size);
|
||||
my_snprintf(tt[i].txt_ptr, new_size, "@spice_get_current(%s%s)", path ? path : "", dev);
|
||||
my_free(1593, &path);
|
||||
my_free(_ALLOC_ID_, &path);
|
||||
dbg(1, " --> tt[i].txt_ptr=%s\n", tt[i].txt_ptr);
|
||||
}
|
||||
ROTATION(rot, flip, 0.0, 0.0, tt[i].x0, tt[i].y0, rx1, ry1);
|
||||
|
|
@ -3380,7 +3380,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
my_strcat(1163, &tt[i].prop_ptr, lay);
|
||||
}
|
||||
dbg(1, "l_s_d(): loaded text : t=%s p=%s\n", tt[i].txt_ptr, tt[i].prop_ptr ? tt[i].prop_ptr : "NULL");
|
||||
my_strdup(351, &tt[i].font, get_tok_value(tt[i].prop_ptr, "font", 0));
|
||||
my_strdup(_ALLOC_ID_, &tt[i].font, get_tok_value(tt[i].prop_ptr, "font", 0));
|
||||
str = get_tok_value(tt[i].prop_ptr, "hcenter", 0);
|
||||
tt[i].hcenter = strcmp(str, "true") ? 0 : 1;
|
||||
str = get_tok_value(tt[i].prop_ptr, "vcenter", 0);
|
||||
|
|
@ -3400,7 +3400,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
break;
|
||||
case 'N': /* store wires as lines on layer WIRELAYER. */
|
||||
i = lastl[WIRELAYER];
|
||||
my_realloc(314, &ll[WIRELAYER],(i+1)*sizeof(xLine));
|
||||
my_realloc(_ALLOC_ID_, &ll[WIRELAYER],(i+1)*sizeof(xLine));
|
||||
if(fscanf(lcc[level].fd, "%lf %lf %lf %lf ",&ll[WIRELAYER][i].x1, &ll[WIRELAYER][i].y1,
|
||||
&ll[WIRELAYER][i].x2, &ll[WIRELAYER][i].y2) < 4 ) {
|
||||
fprintf(errfp,"l_s_d(): WARNING: missing fields for LINE object, ignoring\n");
|
||||
|
|
@ -3503,7 +3503,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
}
|
||||
if(fd_tmp) {
|
||||
if (level+1 >= max_level) {
|
||||
my_realloc(653, &lcc, (max_level + 1) * sizeof(Lcc));
|
||||
my_realloc(_ALLOC_ID_, &lcc, (max_level + 1) * sizeof(Lcc));
|
||||
max_level++;
|
||||
}
|
||||
++level;
|
||||
|
|
@ -3530,8 +3530,8 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
lcc[level].x0 += lcc[(level-1)].x0;
|
||||
lcc[level].y0 += lcc[(level-1)].y0;
|
||||
}
|
||||
my_strdup(654, &lcc[level].prop_ptr, prop_ptr);
|
||||
my_strdup(657, &lcc[level].symname, symname);
|
||||
my_strdup(_ALLOC_ID_, &lcc[level].prop_ptr, prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &lcc[level].symname, symname);
|
||||
dbg(1, "level incremented: level=%d, symname=%s, prop_ptr=%s sympath=%s\n",
|
||||
level, symname, prop_ptr, sympath);
|
||||
}
|
||||
|
|
@ -3545,8 +3545,8 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
break;
|
||||
case ']':
|
||||
if(level) {
|
||||
my_free(1173, &lcc[level].prop_ptr);
|
||||
my_free(1174, &lcc[level].symname);
|
||||
my_free(_ALLOC_ID_, &lcc[level].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &lcc[level].symname);
|
||||
--level;
|
||||
} else {
|
||||
endfile=1;
|
||||
|
|
@ -3591,19 +3591,19 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
/* given a .sch file used as instance in LCC schematics, order its pin
|
||||
* as in corresponding .sym file if it exists */
|
||||
align_sch_pins_with_sym(name, symbols);
|
||||
my_free(910, &prop_ptr);
|
||||
my_free(901, &lastl);
|
||||
my_free(902, &lastr);
|
||||
my_free(903, &lastp);
|
||||
my_free(904, &lasta);
|
||||
my_free(905, &ll);
|
||||
my_free(906, &bb);
|
||||
my_free(907, &aa);
|
||||
my_free(908, &pp);
|
||||
my_free(909, &lcc);
|
||||
my_free(911, &aux_ptr);
|
||||
my_free(912, &symname);
|
||||
my_free(913, &symtype);
|
||||
my_free(_ALLOC_ID_, &prop_ptr);
|
||||
my_free(_ALLOC_ID_, &lastl);
|
||||
my_free(_ALLOC_ID_, &lastr);
|
||||
my_free(_ALLOC_ID_, &lastp);
|
||||
my_free(_ALLOC_ID_, &lasta);
|
||||
my_free(_ALLOC_ID_, &ll);
|
||||
my_free(_ALLOC_ID_, &bb);
|
||||
my_free(_ALLOC_ID_, &aa);
|
||||
my_free(_ALLOC_ID_, &pp);
|
||||
my_free(_ALLOC_ID_, &lcc);
|
||||
my_free(_ALLOC_ID_, &aux_ptr);
|
||||
my_free(_ALLOC_ID_, &symname);
|
||||
my_free(_ALLOC_ID_, &symtype);
|
||||
recursion_counter--;
|
||||
sort_symbol_pins(xctx->sym[xctx->symbols].rect[PINLAYER],
|
||||
xctx->sym[xctx->symbols].rects[PINLAYER],
|
||||
|
|
@ -3668,20 +3668,20 @@ void create_sch_from_sym(void)
|
|||
char *sch = NULL;
|
||||
size_t ln;
|
||||
|
||||
my_strdup(1595, &pinname[0], tcleval("rel_sym_path [find_file ipin.sym]"));
|
||||
my_strdup(1596, &pinname[1], tcleval("rel_sym_path [find_file opin.sym]"));
|
||||
my_strdup(1597, &pinname[2], tcleval("rel_sym_path [find_file iopin.sym]"));
|
||||
my_strdup(1606, &generic_pin, tcleval("rel_sym_path [find_file generic_pin.sym]"));
|
||||
my_strdup(_ALLOC_ID_, &pinname[0], tcleval("rel_sym_path [find_file ipin.sym]"));
|
||||
my_strdup(_ALLOC_ID_, &pinname[1], tcleval("rel_sym_path [find_file opin.sym]"));
|
||||
my_strdup(_ALLOC_ID_, &pinname[2], tcleval("rel_sym_path [find_file iopin.sym]"));
|
||||
my_strdup(_ALLOC_ID_, &generic_pin, tcleval("rel_sym_path [find_file generic_pin.sym]"));
|
||||
|
||||
if(pinname[0] && pinname[1] && pinname[2] && generic_pin) {
|
||||
rebuild_selected_array();
|
||||
if(xctx->lastsel > 1) return;
|
||||
if(xctx->lastsel==1 && xctx->sel_array[0].type==ELEMENT)
|
||||
{
|
||||
my_strdup2(1250, &sch,
|
||||
my_strdup2(_ALLOC_ID_, &sch,
|
||||
get_tok_value((xctx->inst[xctx->sel_array[0].n].ptr+ xctx->sym)->prop_ptr, "schematic",0 ));
|
||||
my_strncpy(schname, abs_sym_path(sch, ""), S(schname));
|
||||
my_free(1251, &sch);
|
||||
my_free(_ALLOC_ID_, &sch);
|
||||
if(!schname[0]) {
|
||||
my_strncpy(schname, add_ext(abs_sym_path(xctx->inst[xctx->sel_array[0].n].name, ""),
|
||||
".sch"), S(schname));
|
||||
|
|
@ -3713,13 +3713,13 @@ void create_sch_from_sym(void)
|
|||
rct = ptr->rect[GENERICLAYER];
|
||||
ypos=0;
|
||||
for(i=0;i<npin;i++) {
|
||||
my_strdup(356, &prop, rct[i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &prop, rct[i].prop_ptr);
|
||||
if(!prop) continue;
|
||||
sub_prop=strstr(prop,"name=")+5;
|
||||
if(!sub_prop) continue;
|
||||
x=-120.0;
|
||||
ln = 100+strlen(sub_prop);
|
||||
my_realloc(357, &str, ln);
|
||||
my_realloc(_ALLOC_ID_, &str, ln);
|
||||
my_snprintf(str, ln, "name=g%d lab=%s", p++, sub_prop);
|
||||
fprintf(fd, "C {%s} %.16g %.16g %.16g %.16g ", generic_pin, x, 20.0*(ypos++), 0.0, 0.0 );
|
||||
save_ascii_string(str, fd, 1);
|
||||
|
|
@ -3729,20 +3729,20 @@ void create_sch_from_sym(void)
|
|||
for(j=0;j<3;j++) {
|
||||
if(j==1) ypos=0;
|
||||
for(i=0;i<npin;i++) {
|
||||
my_strdup(358, &prop, rct[i].prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &prop, rct[i].prop_ptr);
|
||||
if(!prop) continue;
|
||||
sub_prop=strstr(prop,"name=")+5;
|
||||
if(!sub_prop) continue;
|
||||
/* remove dir=... from prop string 20171004 */
|
||||
my_strdup(360, &sub2_prop, subst_token(sub_prop, "dir", NULL));
|
||||
my_strdup(_ALLOC_ID_, &sub2_prop, subst_token(sub_prop, "dir", NULL));
|
||||
|
||||
my_strdup(361, &dir, get_tok_value(rct[i].prop_ptr,"dir",0));
|
||||
my_strdup(_ALLOC_ID_, &dir, get_tok_value(rct[i].prop_ptr,"dir",0));
|
||||
if(!sub2_prop) continue;
|
||||
if(!dir) continue;
|
||||
if(j==0) x=-120.0; else x=120.0;
|
||||
if(!strcmp(dir, pindir[j])) {
|
||||
ln = 100+strlen(sub2_prop);
|
||||
my_realloc(362, &str, ln);
|
||||
my_realloc(_ALLOC_ID_, &str, ln);
|
||||
my_snprintf(str, ln, "name=g%d lab=%s", p++, sub2_prop);
|
||||
fprintf(fd, "C {%s} %.16g %.16g %.16g %.16g ", pinname[j], x, 20.0*(ypos++), 0.0, 0.0);
|
||||
save_ascii_string(str, fd, 1);
|
||||
|
|
@ -3751,18 +3751,18 @@ void create_sch_from_sym(void)
|
|||
} /* for(j) */
|
||||
fclose(fd);
|
||||
} /* if(xctx->lastsel...) */
|
||||
my_free(916, &dir);
|
||||
my_free(917, &prop);
|
||||
my_free(919, &sub2_prop);
|
||||
my_free(920, &str);
|
||||
my_free(_ALLOC_ID_, &dir);
|
||||
my_free(_ALLOC_ID_, &prop);
|
||||
my_free(_ALLOC_ID_, &sub2_prop);
|
||||
my_free(_ALLOC_ID_, &str);
|
||||
} else {
|
||||
fprintf(errfp, "create_sch_from_sym(): location of schematic pins not found\n");
|
||||
tcleval("alert_ {create_sch_from_sym(): location of schematic pins not found} {}");
|
||||
}
|
||||
my_free(1602, &pinname[0]);
|
||||
my_free(1603, &pinname[1]);
|
||||
my_free(1604, &pinname[2]);
|
||||
my_free(1605, &generic_pin);
|
||||
my_free(_ALLOC_ID_, &pinname[0]);
|
||||
my_free(_ALLOC_ID_, &pinname[1]);
|
||||
my_free(_ALLOC_ID_, &pinname[2]);
|
||||
my_free(_ALLOC_ID_, &generic_pin);
|
||||
}
|
||||
|
||||
void descend_symbol(void)
|
||||
|
|
@ -3798,18 +3798,18 @@ void descend_symbol(void)
|
|||
}
|
||||
else return;
|
||||
/* build up current hierarchy path */
|
||||
my_strdup(363, &str, xctx->inst[n].instname);
|
||||
my_strdup(364, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strdup(_ALLOC_ID_, &str, xctx->inst[n].instname);
|
||||
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strcat(365, &xctx->sch_path[xctx->currsch+1], str);
|
||||
my_strcat(366, &xctx->sch_path[xctx->currsch+1], ".");
|
||||
xctx->sch_path_hash[xctx->currsch+1] = 0;
|
||||
|
||||
my_strdup(1518, &xctx->hier_attr[xctx->currsch].prop_ptr,
|
||||
my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].prop_ptr,
|
||||
xctx->inst[n].prop_ptr);
|
||||
my_strdup(1612, &xctx->hier_attr[xctx->currsch].templ,
|
||||
my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].templ,
|
||||
get_tok_value((xctx->inst[n].ptr+ xctx->sym)->prop_ptr, "template", 0));
|
||||
xctx->sch_inst_number[xctx->currsch+1] = 1;
|
||||
my_free(921, &str);
|
||||
my_free(_ALLOC_ID_, &str);
|
||||
xctx->previous_instance[xctx->currsch]=n;
|
||||
xctx->zoom_array[xctx->currsch].x=xctx->xorigin;
|
||||
xctx->zoom_array[xctx->currsch].y=xctx->yorigin;
|
||||
|
|
|
|||
|
|
@ -670,7 +670,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
char *str = NULL;
|
||||
display_hilights(&str);
|
||||
Tcl_SetResult(interp, str, TCL_VOLATILE);
|
||||
my_free(1161, &str);
|
||||
my_free(_ALLOC_ID_, &str);
|
||||
}
|
||||
else if(!strcmp(argv[1], "draw_graph"))
|
||||
{
|
||||
|
|
@ -763,10 +763,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
l = expandlabel(argv[2], &tmp);
|
||||
llen = strlen(l);
|
||||
dbg(1, "l=%s\n", l ? l : "<NULL>");
|
||||
result = my_malloc(378, llen + 30);
|
||||
result = my_malloc(_ALLOC_ID_, llen + 30);
|
||||
my_snprintf(result, llen + 30, "%s %d", l, tmp);
|
||||
Tcl_SetResult(interp, result, TCL_VOLATILE);
|
||||
my_free(927, &result);
|
||||
my_free(_ALLOC_ID_, &result);
|
||||
}
|
||||
}
|
||||
else { cmd_found = 0;}
|
||||
|
|
@ -1148,7 +1148,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
Tcl_SetResult(interp, (xctx->inst[inst].ptr+ xctx->sym)->rect[PINLAYER][n].prop_ptr, TCL_VOLATILE);
|
||||
} else {
|
||||
tmp = 100 + strlen(argv[4]) + strlen(argv[5]);
|
||||
subtok = my_malloc(83,tmp);
|
||||
subtok = my_malloc(_ALLOC_ID_,tmp);
|
||||
my_snprintf(subtok, tmp, "%s(%s)", argv[5], argv[4]);
|
||||
value = get_tok_value(xctx->inst[inst].prop_ptr,subtok,0);
|
||||
if(!value[0]) {
|
||||
|
|
@ -1167,7 +1167,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
}
|
||||
Tcl_SetResult(interp, (char *)value, TCL_VOLATILE);
|
||||
}
|
||||
my_free(924, &subtok);
|
||||
my_free(_ALLOC_ID_, &subtok);
|
||||
}
|
||||
}
|
||||
/* xschem getprop symbol lm358.sym [type] */
|
||||
|
|
@ -1213,9 +1213,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
if(argc < 4) {Tcl_SetResult(interp, "Missing arguments", TCL_STATIC);return TCL_ERROR;}
|
||||
if(argc == 5) t = atoi(argv[4]);
|
||||
else t = 0;
|
||||
my_strdup(648, &s, get_tok_value(argv[2], argv[3], t));
|
||||
my_strdup(_ALLOC_ID_, &s, get_tok_value(argv[2], argv[3], t));
|
||||
Tcl_SetResult(interp, s, TCL_VOLATILE);
|
||||
my_free(649, &s);
|
||||
my_free(_ALLOC_ID_, &s);
|
||||
}
|
||||
|
||||
else if(!strcmp(argv[1], "get_tok_size") )
|
||||
|
|
@ -1494,7 +1494,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
rct=symbol->rect[PINLAYER];
|
||||
/* slotted devices: name= U1:2, pinnumber=2:5 */
|
||||
slot = -1;
|
||||
tmpstr = my_malloc(529, sizeof(xctx->inst[i].instname));
|
||||
tmpstr = my_malloc(_ALLOC_ID_, sizeof(xctx->inst[i].instname));
|
||||
if((ss=strchr(xctx->inst[i].instname, ':')) ) {
|
||||
sscanf(ss+1, "%s", tmpstr);
|
||||
if(isonlydigit(tmpstr)) {
|
||||
|
|
@ -1517,7 +1517,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
piny0 += y0;
|
||||
my_snprintf(num, S(num), "{%s} %g %g", get_tok_value(rct[p].prop_ptr, "name", 0), pinx0, piny0);
|
||||
Tcl_SetResult(interp, num, TCL_VOLATILE);
|
||||
my_free(530, &tmpstr);
|
||||
my_free(_ALLOC_ID_, &tmpstr);
|
||||
}
|
||||
|
||||
else if(!strcmp(argv[1], "instance_pins"))
|
||||
|
|
@ -1538,7 +1538,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
if(p< no_of_pins-1) my_strcat(377, &pins, " ");
|
||||
}
|
||||
Tcl_SetResult(interp, pins, TCL_VOLATILE);
|
||||
my_free(1195, &pins);
|
||||
my_free(_ALLOC_ID_, &pins);
|
||||
}
|
||||
|
||||
else if(!strcmp(argv[1], "instance_pos"))
|
||||
|
|
@ -1594,7 +1594,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
}
|
||||
}
|
||||
Tcl_SetResult(interp, pins ? pins : "", TCL_VOLATILE);
|
||||
my_free(926, &pins);
|
||||
my_free(_ALLOC_ID_, &pins);
|
||||
}
|
||||
else { cmd_found = 0;}
|
||||
break;
|
||||
|
|
@ -1633,7 +1633,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
Tcl_ResetResult(interp);
|
||||
hier_psprint(&res, 2);
|
||||
Tcl_SetResult(interp, res, TCL_VOLATILE);
|
||||
my_free(1645, &res);
|
||||
my_free(_ALLOC_ID_, &res);
|
||||
}
|
||||
|
||||
else if(!strcmp(argv[1], "list_hilights"))
|
||||
|
|
@ -1699,7 +1699,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
dbg(1, "scheduler: undo_reset=%d\n", undo_reset);
|
||||
load_schematic(load_symbols, f, undo_reset);
|
||||
tclvareval("update_recent_file {", f, "}", NULL);
|
||||
my_strdup(375, &xctx->sch_path[xctx->currsch], ".");
|
||||
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch], ".");
|
||||
xctx->sch_path_hash[xctx->currsch] = 0;
|
||||
xctx->sch_inst_number[xctx->currsch] = 1;
|
||||
if(nofullzoom) draw();
|
||||
|
|
@ -2329,15 +2329,15 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
delete_inst_node(inst); /* 20180208 fix crashing bug: delete node info if changing symbol */
|
||||
/* if number of pins is different we must delete these data *before* */
|
||||
/* changing ysmbol, otherwise i might end up deleting non allocated data. */
|
||||
my_strdup2(369, &xctx->inst[inst].name, rel_sym_path(symbol));
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[inst].name, rel_sym_path(symbol));
|
||||
xctx->inst[inst].ptr=sym_number;
|
||||
bbox(ADD, xctx->inst[inst].x1, xctx->inst[inst].y1, xctx->inst[inst].x2, xctx->inst[inst].y2);
|
||||
my_strdup(370, &name, xctx->inst[inst].instname);
|
||||
my_strdup(_ALLOC_ID_, &name, xctx->inst[inst].instname);
|
||||
if(name && name[0] )
|
||||
{
|
||||
/* 20110325 only modify prefix if prefix not NUL */
|
||||
if(prefix) name[0]=(char)prefix; /* change prefix if changing symbol type; */
|
||||
my_strdup(371, &ptr,subst_token(xctx->inst[inst].prop_ptr, "name", name) );
|
||||
my_strdup(_ALLOC_ID_, &ptr,subst_token(xctx->inst[inst].prop_ptr, "name", name) );
|
||||
hash_all_names();
|
||||
new_prop_string(inst, ptr,0, tclgetboolvar("disable_unique_names")); /* set new prop_ptr */
|
||||
type=xctx->sym[xctx->inst[inst].ptr].type;
|
||||
|
|
@ -2345,12 +2345,12 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
if(cond) xctx->inst[inst].flags|=2;
|
||||
else {
|
||||
xctx->inst[inst].flags &=~2;
|
||||
my_strdup(872, &xctx->inst[inst].lab, get_tok_value(xctx->inst[inst].prop_ptr, "lab", 0));
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[inst].lab, get_tok_value(xctx->inst[inst].prop_ptr, "lab", 0));
|
||||
}
|
||||
xctx->inst[inst].embed = !strcmp(get_tok_value(xctx->inst[inst].prop_ptr, "embed", 2), "true");
|
||||
my_free(922, &ptr);
|
||||
my_free(_ALLOC_ID_, &ptr);
|
||||
}
|
||||
my_free(923, &name);
|
||||
my_free(_ALLOC_ID_, &name);
|
||||
/* new symbol bbox after prop changes (may change due to text length) */
|
||||
symbol_bbox(inst, &xctx->inst[inst].x1, &xctx->inst[inst].y1, &xctx->inst[inst].x2, &xctx->inst[inst].y2);
|
||||
bbox(ADD, xctx->inst[inst].x1, xctx->inst[inst].y1, xctx->inst[inst].x2, xctx->inst[inst].y2);
|
||||
|
|
@ -2512,7 +2512,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
if(exists) {
|
||||
viewer = atoi(tclgetvar("sim(spicewave,default)"));
|
||||
my_snprintf(tcl_str, S(tcl_str), "sim(spicewave,%d,name)", viewer);
|
||||
my_strdup(1267, &viewer_name, tclgetvar(tcl_str));
|
||||
my_strdup(_ALLOC_ID_, &viewer_name, tclgetvar(tcl_str));
|
||||
dbg(1, "send_to_viewer: viewer_name=%s\n", viewer_name);
|
||||
if(strstr(viewer_name, "Gaw")) viewer=GAW;
|
||||
else if(strstr(viewer_name, "Bespice")) viewer=BESPICE;
|
||||
|
|
@ -2520,7 +2520,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
hilight_net(viewer);
|
||||
redraw_hilights(0);
|
||||
}
|
||||
my_free(1268, &viewer_name);
|
||||
my_free(_ALLOC_ID_, &viewer_name);
|
||||
}
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
|
@ -2546,12 +2546,12 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
xctx->draw_window=atoi(argv[3]);
|
||||
}
|
||||
else if(!strcmp(argv[2], "format")) {
|
||||
my_strdup(1542, &xctx->format, argv[3]);
|
||||
my_strdup(_ALLOC_ID_, &xctx->format, argv[3]);
|
||||
}
|
||||
else if(!strcmp(argv[2], "header_text")) {
|
||||
if(!xctx->header_text || strcmp(xctx->header_text, argv[3])) {
|
||||
set_modify(1); xctx->push_undo();
|
||||
my_strdup2(1660, &xctx->header_text, argv[3]);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->header_text, argv[3]);
|
||||
}
|
||||
}
|
||||
else if(!strcmp(argv[2], "hide_symbols")) {
|
||||
|
|
@ -2628,10 +2628,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
{
|
||||
char *s = NULL;
|
||||
if(argc < 5) {Tcl_SetResult(interp, "Missing arguments", TCL_STATIC);return TCL_ERROR;}
|
||||
my_strdup(459, &s, argv[2]);
|
||||
my_strdup(_ALLOC_ID_, &s, argv[2]);
|
||||
set_different_token(&s, argv[3], argv[4], 0, 0);
|
||||
Tcl_SetResult(interp, s, TCL_VOLATILE);
|
||||
my_free(1156, &s);
|
||||
my_free(_ALLOC_ID_, &s);
|
||||
}
|
||||
|
||||
else if(!strcmp(argv[1], "set_modify"))
|
||||
|
|
@ -2693,7 +2693,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
if(cond) xctx->inst[inst].flags|=2;
|
||||
else {
|
||||
xctx->inst[inst].flags &=~2;
|
||||
my_strdup(1215, &xctx->inst[inst].lab, get_tok_value(xctx->inst[inst].prop_ptr, "lab", 0));
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[inst].lab, get_tok_value(xctx->inst[inst].prop_ptr, "lab", 0));
|
||||
}
|
||||
xctx->inst[inst].embed = !strcmp(get_tok_value(xctx->inst[inst].prop_ptr, "embed", 2), "true");
|
||||
if(!fast) {
|
||||
|
|
@ -2748,14 +2748,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
if(strcmp(argv[6], get_tok_value(r->prop_ptr, argv[5], 0))) {
|
||||
change_done = 1;
|
||||
if(fast == 3 || fast == 0) xctx->push_undo();
|
||||
my_strdup2(1486, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], argv[6]));
|
||||
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], argv[6]));
|
||||
}
|
||||
} else {
|
||||
get_tok_value(r->prop_ptr, argv[5], 0);
|
||||
if(xctx->tok_size) {
|
||||
change_done = 1;
|
||||
if(fast == 3 || fast == 0) xctx->push_undo();
|
||||
my_strdup2(1478, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], NULL)); /* delete attr */
|
||||
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], NULL)); /* delete attr */
|
||||
}
|
||||
}
|
||||
if(change_done) set_modify(1);
|
||||
|
|
@ -2793,9 +2793,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
{
|
||||
char *s=NULL;
|
||||
if(argc < 5) {Tcl_SetResult(interp, "Missing arguments", TCL_STATIC);return TCL_ERROR;}
|
||||
my_strdup(894, &s, subst_token(argv[2], argv[3], strcmp(argv[4], "NULL") ? argv[4] : NULL));
|
||||
my_strdup(_ALLOC_ID_, &s, subst_token(argv[2], argv[3], strcmp(argv[4], "NULL") ? argv[4] : NULL));
|
||||
Tcl_SetResult(interp, s, TCL_VOLATILE);
|
||||
my_free(1150, &s);
|
||||
my_free(_ALLOC_ID_, &s);
|
||||
}
|
||||
|
||||
else if(!strcmp(argv[1], "symbol_in_new_window"))
|
||||
|
|
@ -3193,6 +3193,6 @@ int tclvareval(const char *script, ...)
|
|||
dbg(0, "tclvareval(): error executing %s: %s\n", str, tclresult());
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
my_free(1381, &str);
|
||||
my_free(_ALLOC_ID_, &str);
|
||||
return return_code;
|
||||
}
|
||||
|
|
|
|||
32
src/select.c
32
src/select.c
|
|
@ -233,7 +233,7 @@ static void del_rect_line_arc_poly(void)
|
|||
if(c == GRIDLAYER) xctx->graph_lastsel = -1; /* invalidate last selected graph */
|
||||
j++;
|
||||
bbox(ADD, xctx->rect[c][i].x1, xctx->rect[c][i].y1, xctx->rect[c][i].x2, xctx->rect[c][i].y2);
|
||||
my_free(928, &xctx->rect[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->rect[c][i].prop_ptr);
|
||||
set_rect_extraptr(0, &xctx->rect[c][i]);
|
||||
set_modify(1);
|
||||
continue;
|
||||
|
|
@ -260,7 +260,7 @@ static void del_rect_line_arc_poly(void)
|
|||
bbox(ADD, xctx->line[c][i].x1, xctx->line[c][i].y1 , xctx->line[c][i].x2 , xctx->line[c][i].y2 );
|
||||
}
|
||||
set_modify(1);
|
||||
my_free(929, &xctx->line[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->line[c][i].prop_ptr);
|
||||
continue;
|
||||
}
|
||||
if(j)
|
||||
|
|
@ -284,7 +284,7 @@ static void del_rect_line_arc_poly(void)
|
|||
arc_bbox(xctx->arc[c][i].x, xctx->arc[c][i].y, xctx->arc[c][i].r, xctx->arc[c][i].a, xctx->arc[c][i].b,
|
||||
&tmp.x1, &tmp.y1, &tmp.x2, &tmp.y2);
|
||||
bbox(ADD, tmp.x1, tmp.y1, tmp.x2, tmp.y2);
|
||||
my_free(930, &xctx->arc[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->arc[c][i].prop_ptr);
|
||||
set_modify(1);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -312,10 +312,10 @@ static void del_rect_line_arc_poly(void)
|
|||
}
|
||||
j++;
|
||||
bbox(ADD, x1, y1, x2, y2);
|
||||
my_free(931, &xctx->poly[c][i].prop_ptr);
|
||||
my_free(932, &xctx->poly[c][i].x);
|
||||
my_free(933, &xctx->poly[c][i].y);
|
||||
my_free(934, &xctx->poly[c][i].selected_point);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[c][i].x);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[c][i].y);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[c][i].selected_point);
|
||||
/*fprintf(errfp, "bbox: %.16g %.16g %.16g %.16g\n", x1, y1, x2, y2); */
|
||||
set_modify(1);
|
||||
continue;
|
||||
|
|
@ -368,9 +368,9 @@ void delete(int to_push_undo)
|
|||
}
|
||||
#endif
|
||||
bbox(ADD, xx1, yy1, xx2, yy2 );
|
||||
my_free(935, &xctx->text[i].prop_ptr);
|
||||
my_free(936, &xctx->text[i].font);
|
||||
my_free(937, &xctx->text[i].txt_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->text[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->text[i].font);
|
||||
my_free(_ALLOC_ID_, &xctx->text[i].txt_ptr);
|
||||
set_modify(1);
|
||||
j++;
|
||||
continue;
|
||||
|
|
@ -392,12 +392,12 @@ void delete(int to_push_undo)
|
|||
set_modify(1);
|
||||
if(xctx->inst[i].prop_ptr != NULL)
|
||||
{
|
||||
my_free(938, &xctx->inst[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->inst[i].prop_ptr);
|
||||
}
|
||||
delete_inst_node(i);
|
||||
my_free(939, &xctx->inst[i].name);
|
||||
my_free(940, &xctx->inst[i].instname);
|
||||
my_free(878, &xctx->inst[i].lab);
|
||||
my_free(_ALLOC_ID_, &xctx->inst[i].name);
|
||||
my_free(_ALLOC_ID_, &xctx->inst[i].instname);
|
||||
my_free(_ALLOC_ID_, &xctx->inst[i].lab);
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -432,8 +432,8 @@ void delete(int to_push_undo)
|
|||
bbox(ADD, xctx->wire[i].x1-ov, y1 , xctx->wire[i].x2+ov , y2 );
|
||||
}
|
||||
|
||||
my_free(941, &xctx->wire[i].prop_ptr);
|
||||
my_free(942, &xctx->wire[i].node);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].node);
|
||||
|
||||
set_modify(1);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ void hier_psprint(char **res, int what) /* netlister driver */
|
|||
/* reload data without popping undo stack, this populates embedded symbols if any */
|
||||
xctx->pop_undo(2, 0);
|
||||
/* link_symbols_to_instances(-1); */ /* done in xctx->pop_undo() */
|
||||
my_strdup(1224, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strcat(1227, &xctx->sch_path[xctx->currsch+1], "->netlisting");
|
||||
xctx->sch_path_hash[xctx->currsch+1] = 0;
|
||||
xctx->currsch++;
|
||||
|
|
@ -76,13 +76,13 @@ void hier_psprint(char **res, int what) /* netlister driver */
|
|||
int flag;
|
||||
/* for printing we process also symbols that have *_ignore attribute */
|
||||
if(!xctx->sym[i].type || !xctx->sym[i].name || !xctx->sym[i].name[0]) continue; /* can not descend into */
|
||||
my_strdup2(1230, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
if(what & 1) flag = check_lib(2, abs_path); /* noprint_libs */
|
||||
else flag = check_lib(4, abs_path); /* nolist_libs */
|
||||
if(strcmp(xctx->sym[i].type,"subcircuit")==0 && flag)
|
||||
{
|
||||
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
|
||||
my_strdup(1228, &subckt_name, get_cell(xctx->sym[i].name, 0));
|
||||
my_strdup(_ALLOC_ID_, &subckt_name, get_cell(xctx->sym[i].name, 0));
|
||||
if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL)
|
||||
{
|
||||
str_hash_lookup(&subckt_table, subckt_name, "", XINSERT);
|
||||
|
|
@ -101,9 +101,9 @@ void hier_psprint(char **res, int what) /* netlister driver */
|
|||
}
|
||||
}
|
||||
}
|
||||
my_free(1231, &abs_path);
|
||||
my_free(_ALLOC_ID_, &abs_path);
|
||||
str_hash_free(&subckt_table);
|
||||
my_free(1229, &subckt_name);
|
||||
my_free(_ALLOC_ID_, &subckt_name);
|
||||
my_strncpy(xctx->sch[xctx->currsch] , "", S(xctx->sch[xctx->currsch]));
|
||||
xctx->currsch--;
|
||||
unselect_all(1);
|
||||
|
|
@ -122,18 +122,18 @@ static char *model_name(const char *m)
|
|||
char *modelname = NULL;
|
||||
int n;
|
||||
size_t l = strlen(m) + 1;
|
||||
my_strdup(255, &m_lower, m);
|
||||
my_strdup(_ALLOC_ID_, &m_lower, m);
|
||||
strtolower(m_lower);
|
||||
my_realloc(256, &modelname, l);
|
||||
my_realloc(257, &model_name_result, l);
|
||||
my_realloc(_ALLOC_ID_, &modelname, l);
|
||||
my_realloc(_ALLOC_ID_, &model_name_result, l);
|
||||
n = sscanf(m_lower, " %s %s", model_name_result, modelname);
|
||||
if(n<2) my_strncpy(model_name_result, m_lower, l);
|
||||
else {
|
||||
/* build a hash key value with no spaces to make device_model attributes with different spaces equivalent*/
|
||||
my_strcat(296, &model_name_result, modelname);
|
||||
}
|
||||
my_free(948, &modelname);
|
||||
my_free(949, &m_lower);
|
||||
my_free(_ALLOC_ID_, &modelname);
|
||||
my_free(_ALLOC_ID_, &m_lower);
|
||||
return model_name_result;
|
||||
}
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ static void spice_netlist(FILE *fd, int spice_stop )
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(388, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && IS_PIN(type) ) {
|
||||
if(top_sub && !flag) {
|
||||
fprintf(fd, "*.PININFO ");
|
||||
|
|
@ -181,7 +181,7 @@ static void spice_netlist(FILE *fd, int spice_stop )
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(390, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
|
||||
if( type && !IS_LABEL_OR_PIN(type) ) {
|
||||
/* already done in global_spice_netlist */
|
||||
|
|
@ -202,11 +202,11 @@ static void spice_netlist(FILE *fd, int spice_stop )
|
|||
m = get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "device_model", 0);
|
||||
if(m[0]) str_hash_lookup(&model_table, model_name(m), m, XINSERT);
|
||||
}
|
||||
my_free(951, &model_name_result);
|
||||
my_free(_ALLOC_ID_, &model_name_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
my_free(952, &type);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
}
|
||||
if(!spice_stop && !xctx->netlist_count) redraw_hilights(0); /* draw_hilight_net(1); */
|
||||
}
|
||||
|
|
@ -272,11 +272,11 @@ void global_spice_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(1264, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(1265, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
|
||||
if( type && !strcmp(type,"netlist_commands") ) {
|
||||
if(!place) {
|
||||
my_strdup(1266, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
|
||||
my_strdup(_ALLOC_ID_, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
|
||||
}
|
||||
if(place && !strcmp(place, "header" )) {
|
||||
if(first == 0) fprintf(fd,"**** begin user header code\n");
|
||||
|
|
@ -305,7 +305,7 @@ void global_spice_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(380, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
dbg(1, "global_spice_netlist(): |%s|\n", type);
|
||||
/*
|
||||
if( type && !strcmp(type,"netlist_options") ) {
|
||||
|
|
@ -331,11 +331,11 @@ void global_spice_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(381, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(382, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
|
||||
if( type && !strcmp(type,"netlist_commands") ) {
|
||||
if(!place) {
|
||||
my_strdup(383, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
|
||||
my_strdup(_ALLOC_ID_, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
|
||||
}
|
||||
if(!place || (strcmp(place, "end") && strcmp(place, "header")) ) {
|
||||
if(first == 0) fprintf(fd,"**** begin user architecture code\n");
|
||||
|
|
@ -376,7 +376,7 @@ void global_spice_netlist(int global) /* netlister driver */
|
|||
/* warning if two symbols perfectly overlapped */
|
||||
warning_overlapped_symbols(0);
|
||||
/* preserve current level instance flags before descending hierarchy for netlisting, restore later */
|
||||
stored_flags = my_calloc(146, xctx->instances, sizeof(unsigned int));
|
||||
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
|
||||
for(i=0;i<xctx->instances;i++) stored_flags[i] = xctx->inst[i].color;
|
||||
|
||||
if(global)
|
||||
|
|
@ -388,7 +388,7 @@ void global_spice_netlist(int global) /* netlister driver */
|
|||
dbg(1, "global_spice_netlist(): invoking pop_undo(2, 0)\n");
|
||||
xctx->pop_undo(2, 0);
|
||||
/* link_symbols_to_instances(-1); */ /* done in xctx->pop_undo() */
|
||||
my_strdup(469, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strcat(481, &xctx->sch_path[xctx->currsch+1], "->netlisting");
|
||||
xctx->sch_path_hash[xctx->currsch+1] = 0;
|
||||
xctx->currsch++;
|
||||
|
|
@ -399,11 +399,11 @@ void global_spice_netlist(int global) /* netlister driver */
|
|||
{
|
||||
if( strcmp(get_tok_value(xctx->sym[i].prop_ptr,"spice_ignore",0),"true")==0 ) continue;
|
||||
if(!xctx->sym[i].type) continue;
|
||||
my_strdup(1232, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
my_strdup(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path))
|
||||
{
|
||||
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
|
||||
my_strdup(391, &subckt_name, get_cell(xctx->sym[i].name, 0));
|
||||
my_strdup(_ALLOC_ID_, &subckt_name, get_cell(xctx->sym[i].name, 0));
|
||||
if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL)
|
||||
{
|
||||
str_hash_lookup(&subckt_table, subckt_name, "", XINSERT);
|
||||
|
|
@ -416,10 +416,10 @@ void global_spice_netlist(int global) /* netlister driver */
|
|||
spice_block_netlist(fd, i);
|
||||
}
|
||||
}
|
||||
my_free(1233, &abs_path);
|
||||
my_free(_ALLOC_ID_, &abs_path);
|
||||
}
|
||||
str_hash_free(&subckt_table);
|
||||
my_free(944, &subckt_name);
|
||||
my_free(_ALLOC_ID_, &subckt_name);
|
||||
/*clear_drawing(); */
|
||||
my_strncpy(xctx->sch[xctx->currsch] , "", S(xctx->sch[xctx->currsch]));
|
||||
xctx->currsch--;
|
||||
|
|
@ -437,7 +437,7 @@ void global_spice_netlist(int global) /* netlister driver */
|
|||
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
|
||||
propagate_hilights(1, 0, XINSERT_NOREPLACE);
|
||||
draw_hilight_net(1);
|
||||
my_free(945, &stored_flags);
|
||||
my_free(_ALLOC_ID_, &stored_flags);
|
||||
|
||||
/* print globals nodes found in netlist 28032003 */
|
||||
if(!split_f) record_global_node(0,fd,NULL);
|
||||
|
|
@ -452,15 +452,15 @@ void global_spice_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(384, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(385, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
|
||||
if( type && !strcmp(type,"netlist_commands") ) {
|
||||
if(place && !strcmp(place, "end" )) {
|
||||
if(first == 0) fprintf(fd,"**** begin user architecture code\n");
|
||||
first++;
|
||||
print_spice_element(fd, i) ;
|
||||
} else {
|
||||
my_strdup(386, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
|
||||
my_strdup(_ALLOC_ID_, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
|
||||
if(place && !strcmp(place, "end" )) {
|
||||
if(first == 0) fprintf(fd,"**** begin user architecture code\n");
|
||||
first++;
|
||||
|
|
@ -503,8 +503,8 @@ void global_spice_netlist(int global) /* netlister driver */
|
|||
}
|
||||
if(!debug_var) xunlink(netl_filename);
|
||||
}
|
||||
my_free(946, &type);
|
||||
my_free(947, &place);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
my_free(_ALLOC_ID_, &place);
|
||||
xctx->netlist_count = 0;
|
||||
}
|
||||
|
||||
|
|
@ -547,7 +547,7 @@ void spice_block_netlist(FILE *fd, int i)
|
|||
fprintf(fd, ".subckt %s ",skip_dir(xctx->sym[i].name));
|
||||
print_spice_subckt_nodes(fd, i);
|
||||
|
||||
my_strdup(387, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) );
|
||||
my_strdup(_ALLOC_ID_, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) );
|
||||
/* this is now done in print_spice_subckt_nodes */
|
||||
/*
|
||||
* fprintf(fd, "%s ", extra ? extra : "" );
|
||||
|
|
@ -555,7 +555,7 @@ void spice_block_netlist(FILE *fd, int i)
|
|||
|
||||
/* 20081206 new get_sym_template does not return token=value pairs where token listed in extra */
|
||||
fprintf(fd, "%s", get_sym_template(xctx->sym[i].templ, extra));
|
||||
my_free(950, &extra);
|
||||
my_free(_ALLOC_ID_, &extra);
|
||||
fprintf(fd, "\n");
|
||||
|
||||
spice_stop ? load_schematic(0,filename, 0) : load_schematic(1,filename, 0);
|
||||
|
|
@ -617,12 +617,12 @@ Str_hashentry *str_hash_lookup(Str_hashtable *hashtable, const char *token, cons
|
|||
if(what==XINSERT || what == XINSERT_NOREPLACE) /* insert data */
|
||||
{
|
||||
s=sizeof( Str_hashentry );
|
||||
entry=(Str_hashentry *)my_malloc(313, s);
|
||||
entry=(Str_hashentry *)my_malloc(_ALLOC_ID_, s);
|
||||
entry->next=NULL;
|
||||
entry->token=NULL;
|
||||
entry->value=NULL;
|
||||
my_strdup(297, &entry->token, token);
|
||||
my_strdup(307, &entry->value, value);
|
||||
my_strdup(_ALLOC_ID_, &entry->token, token);
|
||||
my_strdup(_ALLOC_ID_, &entry->value, value);
|
||||
entry->hash=hashcode;
|
||||
*preventry=entry;
|
||||
}
|
||||
|
|
@ -633,13 +633,13 @@ Str_hashentry *str_hash_lookup(Str_hashtable *hashtable, const char *token, cons
|
|||
if(what==XDELETE) /* remove token from the hash table ... */
|
||||
{
|
||||
saveptr=entry->next;
|
||||
my_free(953, &entry->token);
|
||||
my_free(954, &entry->value);
|
||||
my_free(955, &entry);
|
||||
my_free(_ALLOC_ID_, &entry->token);
|
||||
my_free(_ALLOC_ID_, &entry->value);
|
||||
my_free(_ALLOC_ID_, &entry);
|
||||
*preventry=saveptr;
|
||||
}
|
||||
else if(value && what == XINSERT ) {
|
||||
my_strdup(308, &entry->value, value);
|
||||
my_strdup(_ALLOC_ID_, &entry->value, value);
|
||||
}
|
||||
return entry; /* found matching entry, return the address */
|
||||
}
|
||||
|
|
@ -654,7 +654,7 @@ void str_hash_init(Str_hashtable *hashtable, int size)
|
|||
dbg(0, "str_hash_init(): Warning hash table not empty, possible data leak\n");
|
||||
}
|
||||
hashtable->size = size;
|
||||
hashtable->table = my_calloc(1574, size, sizeof(Str_hashentry *));
|
||||
hashtable->table = my_calloc(_ALLOC_ID_, size, sizeof(Str_hashentry *));
|
||||
}
|
||||
|
||||
static void str_hash_free_entry(Str_hashentry *entry)
|
||||
|
|
@ -662,9 +662,9 @@ static void str_hash_free_entry(Str_hashentry *entry)
|
|||
Str_hashentry *tmp;
|
||||
while( entry ) {
|
||||
tmp = entry -> next;
|
||||
my_free(956, &(entry->token));
|
||||
my_free(957, &(entry->value));
|
||||
my_free(958, &entry);
|
||||
my_free(_ALLOC_ID_, &(entry->token));
|
||||
my_free(_ALLOC_ID_, &(entry->value));
|
||||
my_free(_ALLOC_ID_, &entry);
|
||||
entry = tmp;
|
||||
}
|
||||
}
|
||||
|
|
@ -680,7 +680,7 @@ void str_hash_free(Str_hashtable *hashtable)
|
|||
str_hash_free_entry( table[i] );
|
||||
table[i] = NULL;
|
||||
}
|
||||
if(hashtable->table) my_free(1384, &(hashtable->table));
|
||||
if(hashtable->table) my_free(_ALLOC_ID_, &(hashtable->table));
|
||||
hashtable->size = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -718,10 +718,10 @@ Int_hashentry *int_hash_lookup(Int_hashtable *hashtable, const char *token, cons
|
|||
if(what==XINSERT || what == XINSERT_NOREPLACE) /* insert data */
|
||||
{
|
||||
s=sizeof( Int_hashentry );
|
||||
entry=(Int_hashentry *)my_malloc(659, s);
|
||||
entry=(Int_hashentry *)my_malloc(_ALLOC_ID_, s);
|
||||
entry->next=NULL;
|
||||
entry->token=NULL;
|
||||
my_strdup(658, &entry->token, token);
|
||||
my_strdup(_ALLOC_ID_, &entry->token, token);
|
||||
entry->value = value;
|
||||
entry->hash=hashcode;
|
||||
*preventry=entry;
|
||||
|
|
@ -733,8 +733,8 @@ Int_hashentry *int_hash_lookup(Int_hashtable *hashtable, const char *token, cons
|
|||
if(what==XDELETE) /* remove token from the hash table ... */
|
||||
{
|
||||
saveptr=entry->next;
|
||||
my_free(896, &entry->token);
|
||||
my_free(897, &entry);
|
||||
my_free(_ALLOC_ID_, &entry->token);
|
||||
my_free(_ALLOC_ID_, &entry);
|
||||
*preventry=saveptr;
|
||||
}
|
||||
else if(what == XINSERT ) {
|
||||
|
|
@ -753,7 +753,7 @@ void int_hash_init(Int_hashtable *hashtable, int size)
|
|||
dbg(0, "int_hash_init(): Warning hash table not empty, possible data leak\n");
|
||||
}
|
||||
hashtable->size = size;
|
||||
hashtable->table = my_calloc(1576, size, sizeof(Int_hashentry *));
|
||||
hashtable->table = my_calloc(_ALLOC_ID_, size, sizeof(Int_hashentry *));
|
||||
}
|
||||
|
||||
static void int_hash_free_entry(Int_hashentry *entry)
|
||||
|
|
@ -761,8 +761,8 @@ static void int_hash_free_entry(Int_hashentry *entry)
|
|||
Int_hashentry *tmp;
|
||||
while( entry ) {
|
||||
tmp = entry -> next;
|
||||
my_free(1171, &(entry->token));
|
||||
my_free(1172, &entry);
|
||||
my_free(_ALLOC_ID_, &(entry->token));
|
||||
my_free(_ALLOC_ID_, &entry);
|
||||
entry = tmp;
|
||||
}
|
||||
}
|
||||
|
|
@ -778,7 +778,7 @@ void int_hash_free(Int_hashtable *hashtable)
|
|||
int_hash_free_entry( table[i] );
|
||||
table[i] = NULL;
|
||||
}
|
||||
my_free(1575, &(hashtable->table));
|
||||
my_free(_ALLOC_ID_, &(hashtable->table));
|
||||
hashtable->size = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -818,10 +818,10 @@ Ptr_hashentry *ptr_hash_lookup(Ptr_hashtable *hashtable, const char *token, void
|
|||
if(what==XINSERT || what == XINSERT_NOREPLACE) /* insert data */
|
||||
{
|
||||
s=sizeof( Ptr_hashentry );
|
||||
entry=(Ptr_hashentry *)my_malloc(253, s);
|
||||
entry=(Ptr_hashentry *)my_malloc(_ALLOC_ID_, s);
|
||||
entry->next=NULL;
|
||||
entry->token=NULL;
|
||||
my_strdup(252, &entry->token, token);
|
||||
my_strdup(_ALLOC_ID_, &entry->token, token);
|
||||
entry->value = value;
|
||||
entry->hash=hashcode;
|
||||
*preventry=entry;
|
||||
|
|
@ -833,8 +833,8 @@ Ptr_hashentry *ptr_hash_lookup(Ptr_hashtable *hashtable, const char *token, void
|
|||
if(what==XDELETE) /* remove token from the hash table ... */
|
||||
{
|
||||
saveptr=entry->next;
|
||||
my_free(273, &entry->token);
|
||||
my_free(274, &entry);
|
||||
my_free(_ALLOC_ID_, &entry->token);
|
||||
my_free(_ALLOC_ID_, &entry);
|
||||
*preventry=saveptr;
|
||||
}
|
||||
else if(what == XINSERT ) {
|
||||
|
|
@ -853,7 +853,7 @@ void ptr_hash_init(Ptr_hashtable *hashtable, int size)
|
|||
dbg(0, "ptr_hash_init(): Warning hash table not empty, possible data leak\n");
|
||||
}
|
||||
hashtable->size = size;
|
||||
hashtable->table = my_calloc(1583, size, sizeof(Ptr_hashentry *));
|
||||
hashtable->table = my_calloc(_ALLOC_ID_, size, sizeof(Ptr_hashentry *));
|
||||
}
|
||||
|
||||
static void ptr_hash_free_entry(Ptr_hashentry *entry)
|
||||
|
|
@ -861,8 +861,8 @@ static void ptr_hash_free_entry(Ptr_hashentry *entry)
|
|||
Ptr_hashentry *tmp;
|
||||
while( entry ) {
|
||||
tmp = entry -> next;
|
||||
my_free(1584, &(entry->token));
|
||||
my_free(1585, &entry);
|
||||
my_free(_ALLOC_ID_, &(entry->token));
|
||||
my_free(_ALLOC_ID_, &entry);
|
||||
entry = tmp;
|
||||
}
|
||||
}
|
||||
|
|
@ -878,7 +878,7 @@ void ptr_hash_free(Ptr_hashtable *hashtable)
|
|||
ptr_hash_free_entry( table[i] );
|
||||
table[i] = NULL;
|
||||
}
|
||||
my_free(1586, &(hashtable->table));
|
||||
my_free(_ALLOC_ID_, &(hashtable->table));
|
||||
hashtable->size = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
50
src/store.c
50
src/store.c
|
|
@ -28,7 +28,7 @@ void check_wire_storage(void)
|
|||
if(xctx->wires >= xctx->maxw)
|
||||
{
|
||||
xctx->maxw=(1+xctx->wires / CADMAXWIRES)*CADMAXWIRES;
|
||||
my_realloc(392, &xctx->wire, sizeof(xWire)*xctx->maxw);
|
||||
my_realloc(_ALLOC_ID_, &xctx->wire, sizeof(xWire)*xctx->maxw);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ void check_selected_storage(void)
|
|||
if(xctx->lastsel >= xctx->maxsel)
|
||||
{
|
||||
xctx->maxsel=(1+xctx->lastsel / MAXGROUP) * MAXGROUP;
|
||||
my_realloc(393, &xctx->sel_array, sizeof(Selected)*xctx->maxsel);
|
||||
my_realloc(_ALLOC_ID_, &xctx->sel_array, sizeof(Selected)*xctx->maxsel);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ void check_text_storage(void)
|
|||
if(xctx->texts >= xctx->maxt)
|
||||
{
|
||||
xctx->maxt=(1 + xctx->texts / CADMAXTEXT) * CADMAXTEXT;
|
||||
my_realloc(394, &xctx->text, sizeof(xText)*xctx->maxt);
|
||||
my_realloc(_ALLOC_ID_, &xctx->text, sizeof(xText)*xctx->maxt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -58,42 +58,42 @@ void check_symbol_storage(void)
|
|||
dbg(1, "check_symbol_storage(): more than maxs, %s\n",
|
||||
xctx->sch[xctx->currsch] );
|
||||
xctx->maxs=(1 + xctx->symbols / ELEMDEF) * ELEMDEF;
|
||||
my_realloc(395, &xctx->sym, sizeof(xSymbol)*xctx->maxs);
|
||||
my_realloc(_ALLOC_ID_, &xctx->sym, sizeof(xSymbol)*xctx->maxs);
|
||||
for(i=xctx->symbols;i<xctx->maxs;i++) {
|
||||
xctx->sym[i].poly=my_calloc(68, cadlayers, sizeof(xPoly *));
|
||||
xctx->sym[i].poly=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
|
||||
if(xctx->sym[i].poly==NULL){
|
||||
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
|
||||
}
|
||||
|
||||
xctx->sym[i].arc=my_calloc(396, cadlayers, sizeof(xArc *));
|
||||
xctx->sym[i].arc=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
|
||||
if(xctx->sym[i].arc==NULL){
|
||||
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
|
||||
}
|
||||
|
||||
xctx->sym[i].line=my_calloc(397, cadlayers, sizeof(xLine *));
|
||||
xctx->sym[i].line=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
|
||||
if(xctx->sym[i].line==NULL){
|
||||
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
|
||||
}
|
||||
|
||||
xctx->sym[i].rect=my_calloc(398, cadlayers, sizeof(xRect *));
|
||||
xctx->sym[i].rect=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
|
||||
if(xctx->sym[i].rect==NULL){
|
||||
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
|
||||
}
|
||||
|
||||
xctx->sym[i].lines=my_calloc(399, cadlayers, sizeof(int));
|
||||
xctx->sym[i].lines=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
if(xctx->sym[i].lines==NULL){
|
||||
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
|
||||
}
|
||||
|
||||
xctx->sym[i].rects=my_calloc(400, cadlayers, sizeof(int));
|
||||
xctx->sym[i].rects=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
if(xctx->sym[i].rects==NULL){
|
||||
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
|
||||
}
|
||||
xctx->sym[i].polygons=my_calloc(401, cadlayers, sizeof(int));
|
||||
xctx->sym[i].polygons=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
if(xctx->sym[i].polygons==NULL){
|
||||
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
|
||||
}
|
||||
xctx->sym[i].arcs=my_calloc(66, cadlayers, sizeof(int));
|
||||
xctx->sym[i].arcs=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
if(xctx->sym[i].arcs==NULL){
|
||||
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
|
||||
}
|
||||
|
|
@ -109,7 +109,7 @@ void check_inst_storage(void)
|
|||
if(xctx->instances >= xctx->maxi)
|
||||
{
|
||||
xctx->maxi=(1 + xctx->instances / ELEMINST) * ELEMINST;
|
||||
my_realloc(402, &xctx->inst, sizeof(xInstance)*xctx->maxi);
|
||||
my_realloc(_ALLOC_ID_, &xctx->inst, sizeof(xInstance)*xctx->maxi);
|
||||
#ifdef ZERO_REALLOC
|
||||
memset(xctx->inst + xctx->instances, 0, sizeof(xInstance) * (xctx->maxi - xctx->instances));
|
||||
#endif
|
||||
|
|
@ -121,7 +121,7 @@ void check_arc_storage(int c)
|
|||
if(xctx->arcs[c] >= xctx->maxa[c])
|
||||
{
|
||||
xctx->maxa[c]=(1 + xctx->arcs[c] / CADMAXOBJECTS) * CADMAXOBJECTS;
|
||||
my_realloc(403, &xctx->arc[c], sizeof(xArc)*xctx->maxa[c]);
|
||||
my_realloc(_ALLOC_ID_, &xctx->arc[c], sizeof(xArc)*xctx->maxa[c]);
|
||||
#ifdef ZERO_REALLOC
|
||||
memset(xctx->arc[c] + xctx->arcs[c], 0, sizeof(xArc) * (xctx->maxa[c] - xctx->arcs[c]));
|
||||
#endif
|
||||
|
|
@ -133,7 +133,7 @@ void check_box_storage(int c)
|
|||
if(xctx->rects[c] >= xctx->maxr[c])
|
||||
{
|
||||
xctx->maxr[c]=(1 + xctx->rects[c] / CADMAXOBJECTS) * CADMAXOBJECTS;
|
||||
my_realloc(404, &xctx->rect[c], sizeof(xRect)*xctx->maxr[c]);
|
||||
my_realloc(_ALLOC_ID_, &xctx->rect[c], sizeof(xRect)*xctx->maxr[c]);
|
||||
#ifdef ZERO_REALLOC
|
||||
memset(xctx->rect[c] + xctx->rects[c], 0, sizeof(xRect) * (xctx->maxr[c] - xctx->rects[c]));
|
||||
#endif
|
||||
|
|
@ -145,7 +145,7 @@ void check_line_storage(int c)
|
|||
if(xctx->lines[c] >= xctx->maxl[c])
|
||||
{
|
||||
xctx->maxl[c]=(1 + xctx->lines[c] / CADMAXOBJECTS) * CADMAXOBJECTS;
|
||||
my_realloc(405, &xctx->line[c], sizeof(xLine)*xctx->maxl[c]);
|
||||
my_realloc(_ALLOC_ID_, &xctx->line[c], sizeof(xLine)*xctx->maxl[c]);
|
||||
#ifdef ZERO_REALLOC
|
||||
memset(xctx->line[c] + xctx->lines[c], 0, sizeof(xLine) * (xctx->maxl[c] - xctx->lines[c]));
|
||||
#endif
|
||||
|
|
@ -157,7 +157,7 @@ void check_polygon_storage(int c)
|
|||
if(xctx->polygons[c] >= xctx->maxp[c])
|
||||
{
|
||||
xctx->maxp[c]=(1 + xctx->polygons[c] / CADMAXOBJECTS) * CADMAXOBJECTS;
|
||||
my_realloc(406, &xctx->poly[c], sizeof(xPoly)*xctx->maxp[c]);
|
||||
my_realloc(_ALLOC_ID_, &xctx->poly[c], sizeof(xPoly)*xctx->maxp[c]);
|
||||
#ifdef ZERO_REALLOC
|
||||
memset(xctx->poly[c] + xctx->polygons[c], 0, sizeof(xPoly) * (xctx->maxp[c] - xctx->polygons[c]));
|
||||
#endif
|
||||
|
|
@ -185,7 +185,7 @@ void store_arc(int pos, double x, double y, double r, double a, double b,
|
|||
xctx->arc[rectc][n].a = a;
|
||||
xctx->arc[rectc][n].b = b;
|
||||
xctx->arc[rectc][n].prop_ptr = NULL;
|
||||
my_strdup(407, &xctx->arc[rectc][n].prop_ptr, prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->arc[rectc][n].prop_ptr, prop_ptr);
|
||||
xctx->arc[rectc][n].sel = sel;
|
||||
if( !strcmp(get_tok_value(xctx->arc[rectc][n].prop_ptr,"fill",0),"true") )
|
||||
xctx->arc[rectc][n].fill =1;
|
||||
|
|
@ -223,10 +223,10 @@ void store_poly(int pos, double *x, double *y, int points, unsigned int rectc,
|
|||
xctx->poly[rectc][n].y=NULL;
|
||||
xctx->poly[rectc][n].selected_point=NULL;
|
||||
xctx->poly[rectc][n].prop_ptr=NULL;
|
||||
xctx->poly[rectc][n].x= my_calloc(408, points, sizeof(double));
|
||||
xctx->poly[rectc][n].y= my_calloc(409, points, sizeof(double));
|
||||
xctx->poly[rectc][n].selected_point= my_calloc(410, points, sizeof(unsigned short));
|
||||
my_strdup(411, &xctx->poly[rectc][n].prop_ptr, prop_ptr);
|
||||
xctx->poly[rectc][n].x= my_calloc(_ALLOC_ID_, points, sizeof(double));
|
||||
xctx->poly[rectc][n].y= my_calloc(_ALLOC_ID_, points, sizeof(double));
|
||||
xctx->poly[rectc][n].selected_point= my_calloc(_ALLOC_ID_, points, sizeof(unsigned short));
|
||||
my_strdup(_ALLOC_ID_, &xctx->poly[rectc][n].prop_ptr, prop_ptr);
|
||||
for(j=0;j<points; j++) {
|
||||
xctx->poly[rectc][n].x[j] = x[j];
|
||||
xctx->poly[rectc][n].y[j] = y[j];
|
||||
|
|
@ -276,7 +276,7 @@ void storeobject(int pos, double x1,double y1,double x2,double y2,
|
|||
xctx->line[rectc][n].y1=y1;
|
||||
xctx->line[rectc][n].y2=y2;
|
||||
xctx->line[rectc][n].prop_ptr=NULL;
|
||||
my_strdup(412, &xctx->line[rectc][n].prop_ptr, prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->line[rectc][n].prop_ptr, prop_ptr);
|
||||
xctx->line[rectc][n].sel=sel;
|
||||
if( prop_ptr && !strcmp(get_tok_value(prop_ptr, "bus", 0), "true") )
|
||||
xctx->line[rectc][n].bus = 1;
|
||||
|
|
@ -309,7 +309,7 @@ void storeobject(int pos, double x1,double y1,double x2,double y2,
|
|||
xctx->rect[rectc][n].y2=y2;
|
||||
xctx->rect[rectc][n].prop_ptr=NULL;
|
||||
xctx->rect[rectc][n].extraptr=NULL;
|
||||
my_strdup(413, &xctx->rect[rectc][n].prop_ptr, prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->rect[rectc][n].prop_ptr, prop_ptr);
|
||||
xctx->rect[rectc][n].sel=sel;
|
||||
if(prop_ptr && (dash = get_tok_value(prop_ptr,"dash",0))[0]) {
|
||||
int d = atoi(dash);
|
||||
|
|
@ -349,7 +349,7 @@ void storeobject(int pos, double x1,double y1,double x2,double y2,
|
|||
xctx->wire[n].node=NULL;
|
||||
xctx->wire[n].end1=0;
|
||||
xctx->wire[n].end2=0;
|
||||
my_strdup(414, &xctx->wire[n].prop_ptr, prop_ptr);
|
||||
my_strdup(_ALLOC_ID_, &xctx->wire[n].prop_ptr, prop_ptr);
|
||||
if(prop_ptr && !strcmp(get_tok_value(prop_ptr,"bus",0), "true")) xctx->wire[n].bus=1;
|
||||
else xctx->wire[n].bus=0;
|
||||
xctx->wire[n].sel=sel;
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ static void svg_draw_string(int layer, const char *str, short rot, short flip, i
|
|||
if(rot == 3 && flip == 1 ) { x=textx1;}
|
||||
}
|
||||
llength=0;
|
||||
my_strdup2(465, &sss, str);
|
||||
my_strdup2(_ALLOC_ID_, &sss, str);
|
||||
tt=ss=sss;
|
||||
for(;;) {
|
||||
c=*ss;
|
||||
|
|
@ -309,7 +309,7 @@ static void svg_draw_string(int layer, const char *str, short rot, short flip, i
|
|||
}
|
||||
ss++;
|
||||
}
|
||||
my_free(1154, &sss);
|
||||
my_free(_ALLOC_ID_, &sss);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -489,16 +489,16 @@ static void svg_draw_symbol(int c, int n,int layer,short tmp_flip, short rot,
|
|||
polygon = (symptr->poly[layer])[j];
|
||||
{ /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */
|
||||
int k;
|
||||
double *x = my_malloc(417, sizeof(double) * polygon.points);
|
||||
double *y = my_malloc(418, sizeof(double) * polygon.points);
|
||||
double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points);
|
||||
double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points);
|
||||
for(k=0;k<polygon.points;k++) {
|
||||
ROTATION(rot, flip, 0.0,0.0,polygon.x[k],polygon.y[k],x[k],y[k]);
|
||||
x[k]+= x0;
|
||||
y[k] += y0;
|
||||
}
|
||||
svg_drawpolygon(c, NOW, x, y, polygon.points, polygon.fill, polygon.dash);
|
||||
my_free(961, &x);
|
||||
my_free(962, &y);
|
||||
my_free(_ALLOC_ID_, &x);
|
||||
my_free(_ALLOC_ID_, &y);
|
||||
}
|
||||
}
|
||||
for(j=0;j< symptr->arcs[layer];j++) {
|
||||
|
|
@ -647,7 +647,7 @@ void svg_draw(void)
|
|||
else return;
|
||||
}
|
||||
svg_restore_lw();
|
||||
svg_colors=my_calloc(419, cadlayers, sizeof(Svg_color));
|
||||
svg_colors=my_calloc(_ALLOC_ID_, cadlayers, sizeof(Svg_color));
|
||||
if(svg_colors==NULL){
|
||||
fprintf(errfp, "svg_draw(): calloc error\n");
|
||||
return;
|
||||
|
|
@ -674,7 +674,7 @@ void svg_draw(void)
|
|||
}
|
||||
my_strncpy(xctx->plotfile,"", S(xctx->plotfile));
|
||||
|
||||
unused_layer = my_calloc(873, cadlayers, sizeof(int));
|
||||
unused_layer = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
#if 0
|
||||
* /* Determine used layers. Disabled since we want hilight colors */
|
||||
* for(c=0;c<cadlayers;c++) unused_layer[c] = 1;
|
||||
|
|
@ -877,8 +877,8 @@ void svg_draw(void)
|
|||
fprintf(fd, "</svg>\n");
|
||||
fclose(fd);
|
||||
tclsetboolvar("draw_grid", old_grid);
|
||||
my_free(964, &svg_colors);
|
||||
my_free(1217, &unused_layer);
|
||||
my_free(_ALLOC_ID_, &svg_colors);
|
||||
my_free(_ALLOC_ID_, &unused_layer);
|
||||
Tcl_SetResult(interp,"",TCL_STATIC);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ static void tedax_netlist(FILE *fd, int tedax_stop )
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "tedax_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(421, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && IS_PIN(type) ) {
|
||||
print_tedax_element(fd, i) ; /* this is the element line */
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ static void tedax_netlist(FILE *fd, int tedax_stop )
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "tedax_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(423, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
|
||||
if( type && !IS_LABEL_OR_PIN(type) ) {
|
||||
/* already done in global_tedax_netlist */
|
||||
|
|
@ -68,7 +68,7 @@ static void tedax_netlist(FILE *fd, int tedax_stop )
|
|||
}
|
||||
}
|
||||
}
|
||||
my_free(967, &type);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
}
|
||||
if(!tedax_stop && !xctx->netlist_count) redraw_hilights(0); /* draw_hilight_net(1); */
|
||||
}
|
||||
|
|
@ -92,7 +92,7 @@ static void tedax_block_netlist(FILE *fd, int i)
|
|||
fprintf(fd, "begin netlist v1 %s\n",skip_dir(xctx->sym[i].name));
|
||||
print_tedax_subckt(fd, i);
|
||||
|
||||
my_strdup(420, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) );
|
||||
my_strdup(_ALLOC_ID_, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) );
|
||||
/* this is now done in print_spice_subckt */
|
||||
/*
|
||||
* fprintf(fd, "%s ", extra ? extra : "" );
|
||||
|
|
@ -100,7 +100,7 @@ static void tedax_block_netlist(FILE *fd, int i)
|
|||
|
||||
/* 20081206 new get_sym_template does not return token=value pairs where token listed in extra */
|
||||
fprintf(fd, "%s", get_sym_template(xctx->sym[i].templ, extra));
|
||||
my_free(966, &extra);
|
||||
my_free(_ALLOC_ID_, &extra);
|
||||
fprintf(fd, "\n");
|
||||
load_schematic(1,filename, 0);
|
||||
tedax_netlist(fd, tedax_stop);
|
||||
|
|
@ -175,7 +175,7 @@ void global_tedax_netlist(int global) /* netlister driver */
|
|||
/* warning if two symbols perfectly overlapped */
|
||||
warning_overlapped_symbols(0);
|
||||
/* preserve current level instance flags before descending hierarchy for netlisting, restore later */
|
||||
stored_flags = my_calloc(149, xctx->instances, sizeof(unsigned int));
|
||||
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
|
||||
for(i=0;i<xctx->instances;i++) stored_flags[i] = xctx->inst[i].color;
|
||||
|
||||
if(global) /* was if(global) ... 20180901 no hierarchical tEDAx netlist for now */
|
||||
|
|
@ -186,7 +186,7 @@ void global_tedax_netlist(int global) /* netlister driver */
|
|||
/* reload data without popping undo stack, this populates embedded symbols if any */
|
||||
xctx->pop_undo(2, 0);
|
||||
/* link_symbols_to_instances(-1); */ /* done in xctx->pop_undo() */
|
||||
my_strdup(482, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strcat(485, &xctx->sch_path[xctx->currsch+1], "->netlisting");
|
||||
xctx->sch_path_hash[xctx->currsch+1] = 0;
|
||||
xctx->currsch++;
|
||||
|
|
@ -196,13 +196,13 @@ void global_tedax_netlist(int global) /* netlister driver */
|
|||
{
|
||||
if( strcmp(get_tok_value(xctx->sym[i].prop_ptr,"tedax_ignore",0),"true")==0 ) continue;
|
||||
if(!xctx->sym[i].type) continue;
|
||||
my_strdup2(1236, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path))
|
||||
{
|
||||
tedax_block_netlist(fd, i);
|
||||
}
|
||||
}
|
||||
my_free(1237, &abs_path);
|
||||
my_free(_ALLOC_ID_, &abs_path);
|
||||
/*clear_drawing(); */
|
||||
my_strncpy(xctx->sch[xctx->currsch] , "", S(xctx->sch[xctx->currsch]));
|
||||
xctx->currsch--;
|
||||
|
|
@ -219,7 +219,7 @@ void global_tedax_netlist(int global) /* netlister driver */
|
|||
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
|
||||
propagate_hilights(1, 0, XINSERT_NOREPLACE);
|
||||
draw_hilight_net(1);
|
||||
my_free(965, &stored_flags);
|
||||
my_free(_ALLOC_ID_, &stored_flags);
|
||||
|
||||
/* print globals nodes found in netlist 28032003 */
|
||||
record_global_node(0,fd,NULL);
|
||||
|
|
|
|||
570
src/token.c
570
src/token.c
File diff suppressed because it is too large
Load Diff
|
|
@ -51,7 +51,7 @@ static void verilog_netlist(FILE *fd , int verilog_stop)
|
|||
}
|
||||
|
||||
dbg(2, "verilog_netlist(): into the netlisting loop\n");
|
||||
my_strdup(570, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type &&
|
||||
( !IS_LABEL_OR_PIN(type) &&
|
||||
strcmp(type,"netlist_commands")&&
|
||||
|
|
@ -66,7 +66,7 @@ static void verilog_netlist(FILE *fd , int verilog_stop)
|
|||
else print_verilog_element(fd, i) ; /* this is the element line */
|
||||
}
|
||||
}
|
||||
my_free(1084, &type);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
}
|
||||
dbg(1, "verilog_netlist(): end\n");
|
||||
if(!verilog_stop && !xctx->netlist_count) redraw_hilights(0); /*draw_hilight_net(1); */
|
||||
|
|
@ -129,14 +129,14 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(105, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"timescale")==0 || strcmp(type,"verilog_preprocessor")==0) )
|
||||
{
|
||||
str_tmp = get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr , fmt_attr, 2);
|
||||
if(!str_tmp[0] && strcmp(fmt_attr, "verilog_format"))
|
||||
str_tmp = get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_format", 2);
|
||||
|
||||
my_strdup(106, &tmp_string, str_tmp);
|
||||
my_strdup(_ALLOC_ID_, &tmp_string, str_tmp);
|
||||
fprintf(fd, "%s\n", str_tmp ? translate(i, tmp_string) : "(NULL)");
|
||||
}
|
||||
}
|
||||
|
|
@ -163,7 +163,7 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(546, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"opin"))==0)
|
||||
{
|
||||
if(tmp) fprintf(fd, " ,\n");
|
||||
|
|
@ -181,7 +181,7 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(547, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"iopin"))==0)
|
||||
{
|
||||
if(tmp) fprintf(fd, " ,\n");
|
||||
|
|
@ -199,7 +199,7 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(548, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"ipin"))==0)
|
||||
{
|
||||
if(tmp) fprintf(fd, " ,\n");
|
||||
|
|
@ -231,12 +231,12 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(549, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"opin"))==0)
|
||||
{
|
||||
my_strdup(550, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
|
||||
my_strdup(551, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(552, &sig_type,"wire"); /* 20070720 changed reg to wire */
|
||||
my_strdup(_ALLOC_ID_, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
|
||||
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"wire"); /* 20070720 changed reg to wire */
|
||||
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
|
||||
fprintf(fd, " output %s ;\n", str_tmp ? str_tmp : "(NULL)");
|
||||
fprintf(fd, " %s %s ", sig_type, str_tmp ? str_tmp : "(NULL)");
|
||||
|
|
@ -254,12 +254,12 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(553, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"iopin"))==0)
|
||||
{
|
||||
my_strdup(554, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
|
||||
my_strdup(555, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(556, &sig_type,"wire");
|
||||
my_strdup(_ALLOC_ID_, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
|
||||
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"wire");
|
||||
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
|
||||
fprintf(fd, " inout %s ;\n", str_tmp ? str_tmp : "(NULL)");
|
||||
fprintf(fd, " %s %s ", sig_type, str_tmp ? str_tmp : "(NULL)");
|
||||
|
|
@ -277,12 +277,12 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(557, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"ipin"))==0)
|
||||
{
|
||||
my_strdup(558, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
|
||||
my_strdup(559, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(560, &sig_type,"wire");
|
||||
my_strdup(_ALLOC_ID_, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
|
||||
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"wire");
|
||||
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
|
||||
fprintf(fd, " input %s ;\n", str_tmp ? str_tmp : "<NULL>");
|
||||
fprintf(fd, " %s %s ", sig_type, str_tmp ? str_tmp : "<NULL>");
|
||||
|
|
@ -303,7 +303,7 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(561, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if(type && !strcmp(type,"netlist_commands")) {
|
||||
fprintf(fd, "%s\n", get_tok_value(xctx->inst[i].prop_ptr,"value", 0));
|
||||
}
|
||||
|
|
@ -332,7 +332,7 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
/* warning if two symbols perfectly overlapped */
|
||||
warning_overlapped_symbols(0);
|
||||
/* preserve current level instance flags before descending hierarchy for netlisting, restore later */
|
||||
stored_flags = my_calloc(150, xctx->instances, sizeof(unsigned int));
|
||||
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
|
||||
for(i=0;i<xctx->instances;i++) stored_flags[i] = xctx->inst[i].color;
|
||||
|
||||
if(global)
|
||||
|
|
@ -343,7 +343,7 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
/* reload data without popping undo stack, this populates embedded symbols if any */
|
||||
xctx->pop_undo(2, 0);
|
||||
/* link_symbols_to_instances(-1); */ /* done in xctx->pop_undo() */
|
||||
my_strdup(487, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strcat(496, &xctx->sch_path[xctx->currsch+1], "->netlisting");
|
||||
xctx->sch_path_hash[xctx->currsch+1] = 0;
|
||||
xctx->currsch++;
|
||||
|
|
@ -354,10 +354,10 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
{
|
||||
if( strcmp(get_tok_value(xctx->sym[i].prop_ptr,"verilog_ignore",0),"true")==0 ) continue;
|
||||
if(!xctx->sym[i].type) continue;
|
||||
my_strdup2(1234, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path)) {
|
||||
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
|
||||
my_strdup(328, &subckt_name, get_cell(xctx->sym[i].name, 0));
|
||||
my_strdup(_ALLOC_ID_, &subckt_name, get_cell(xctx->sym[i].name, 0));
|
||||
if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL)
|
||||
{
|
||||
str_hash_lookup(&subckt_table, subckt_name, "", XINSERT);
|
||||
|
|
@ -371,9 +371,9 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
}
|
||||
}
|
||||
}
|
||||
my_free(1235, &abs_path);
|
||||
my_free(_ALLOC_ID_, &abs_path);
|
||||
str_hash_free(&subckt_table);
|
||||
my_free(1073, &subckt_name);
|
||||
my_free(_ALLOC_ID_, &subckt_name);
|
||||
my_strncpy(xctx->sch[xctx->currsch] , "", S(xctx->sch[xctx->currsch]));
|
||||
xctx->currsch--;
|
||||
unselect_all(1);
|
||||
|
|
@ -388,7 +388,7 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
|
||||
propagate_hilights(1, 0, XINSERT_NOREPLACE);
|
||||
draw_hilight_net(1);
|
||||
my_free(1074, &stored_flags);
|
||||
my_free(_ALLOC_ID_, &stored_flags);
|
||||
|
||||
dbg(1, "global_verilog_netlist(): starting awk on netlist!\n");
|
||||
if(!split_f) {
|
||||
|
|
@ -403,10 +403,10 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
}
|
||||
if(debug_var == 0 ) xunlink(netl_filename);
|
||||
}
|
||||
my_free(1075, &sig_type);
|
||||
my_free(1076, &port_value);
|
||||
my_free(1077, &tmp_string);
|
||||
my_free(1078, &type);
|
||||
my_free(_ALLOC_ID_, &sig_type);
|
||||
my_free(_ALLOC_ID_, &port_value);
|
||||
my_free(_ALLOC_ID_, &tmp_string);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
xctx->netlist_count = 0;
|
||||
}
|
||||
|
||||
|
|
@ -454,8 +454,8 @@ void verilog_block_netlist(FILE *fd, int i)
|
|||
} else {
|
||||
Int_hashtable table = {NULL, 0};
|
||||
int_hash_init(&table, 37);
|
||||
my_strdup(1040, &extra, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0));
|
||||
my_strdup(1563, &extra2, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0));
|
||||
my_strdup(_ALLOC_ID_, &extra, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0));
|
||||
my_strdup(_ALLOC_ID_, &extra2, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0));
|
||||
fprintf(fd, "// sch_path: %s\n", filename);
|
||||
verilog_stop? load_schematic(0,filename, 0) : load_schematic(1,filename, 0);
|
||||
/* print verilog timescale and preprocessor directives 10102004 */
|
||||
|
|
@ -467,32 +467,32 @@ void verilog_block_netlist(FILE *fd, int i)
|
|||
if(!strcmp(get_tok_value( (xctx->inst[j].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(544, &type,(xctx->inst[j].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[j].ptr+ xctx->sym)->type);
|
||||
if( type && ( strcmp(type,"timescale")==0 || strcmp(type,"verilog_preprocessor")==0) )
|
||||
{
|
||||
str_tmp = get_tok_value( (xctx->inst[j].ptr+ xctx->sym)->prop_ptr, fmt_attr, 2);
|
||||
if(!str_tmp[0] && strcmp(fmt_attr, "verilog_format"))
|
||||
str_tmp = get_tok_value( (xctx->inst[j].ptr+ xctx->sym)->prop_ptr, "verilog_format", 2);
|
||||
my_strdup(545, &tmp_string, str_tmp);
|
||||
my_strdup(_ALLOC_ID_, &tmp_string, str_tmp);
|
||||
fprintf(fd, "%s\n", str_tmp ? translate(j, tmp_string) : "(NULL)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my_strdup(1618, &verilogprefix,
|
||||
my_strdup(_ALLOC_ID_, &verilogprefix,
|
||||
get_tok_value(xctx->sym[i].prop_ptr, "verilogprefix", 0));
|
||||
if(verilogprefix) {
|
||||
my_strdup(1625, &symname, verilogprefix);
|
||||
my_strdup(_ALLOC_ID_, &symname, verilogprefix);
|
||||
my_strcat(1626, &symname, skip_dir(xctx->sym[i].name));
|
||||
} else {
|
||||
my_strdup(1627, &symname, skip_dir(xctx->sym[i].name));
|
||||
my_strdup(_ALLOC_ID_, &symname, skip_dir(xctx->sym[i].name));
|
||||
}
|
||||
my_free(1628, &verilogprefix);
|
||||
my_free(_ALLOC_ID_, &verilogprefix);
|
||||
|
||||
|
||||
|
||||
fprintf(fd, "module %s (\n", symname);
|
||||
my_free(1629, &symname);
|
||||
my_free(_ALLOC_ID_, &symname);
|
||||
/*print_generic(fd, "entity", i); */
|
||||
|
||||
dbg(1, "verilog_block_netlist(): entity ports\n");
|
||||
|
|
@ -531,15 +531,15 @@ void verilog_block_netlist(FILE *fd, int i)
|
|||
for(j=0;j<xctx->sym[i].rects[PINLAYER];j++)
|
||||
{
|
||||
if(strcmp(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"verilog_ignore",0), "true")) {
|
||||
my_strdup(564, &sig_type,get_tok_value(
|
||||
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(
|
||||
xctx->sym[i].rect[PINLAYER][j].prop_ptr,"verilog_type",0));
|
||||
my_strdup(565, &port_value,
|
||||
my_strdup(_ALLOC_ID_, &port_value,
|
||||
get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"value", 0) );
|
||||
my_strdup(566, &dir_tmp, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"dir",0) );
|
||||
my_strdup(_ALLOC_ID_, &dir_tmp, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"dir",0) );
|
||||
if(strcmp(dir_tmp,"in")){
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(567, &sig_type,"wire"); /* 20070720 changed reg to wire */
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"wire"); /* 20070720 changed reg to wire */
|
||||
} else {
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(568, &sig_type,"wire");
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"wire");
|
||||
}
|
||||
str_tmp = get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"name",0);
|
||||
if(!int_hash_lookup(&table, str_tmp, 1, XINSERT_NOREPLACE)) {
|
||||
|
|
@ -574,7 +574,7 @@ void verilog_block_netlist(FILE *fd, int i)
|
|||
if(xctx->netlist_count &&
|
||||
!strcmp(get_tok_value(xctx->inst[l].prop_ptr, "only_toplevel", 0), "true")) continue;
|
||||
|
||||
my_strdup(569, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
|
||||
if(type && !strcmp(type,"netlist_commands")) {
|
||||
fprintf(fd, "%s\n", get_tok_value(xctx->inst[l].prop_ptr,"value", 0));
|
||||
}
|
||||
|
|
@ -585,13 +585,13 @@ void verilog_block_netlist(FILE *fd, int i)
|
|||
}
|
||||
fprintf(fd,"---- end user architecture code\n");
|
||||
fprintf(fd, "endmodule\n");
|
||||
my_free(1079, &dir_tmp);
|
||||
my_free(1080, &sig_type);
|
||||
my_free(1081, &port_value);
|
||||
my_free(1082, &type);
|
||||
my_free(1083, &tmp_string);
|
||||
my_free(1561, &extra);
|
||||
my_free(1564, &extra2);
|
||||
my_free(_ALLOC_ID_, &dir_tmp);
|
||||
my_free(_ALLOC_ID_, &sig_type);
|
||||
my_free(_ALLOC_ID_, &port_value);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
my_free(_ALLOC_ID_, &tmp_string);
|
||||
my_free(_ALLOC_ID_, &extra);
|
||||
my_free(_ALLOC_ID_, &extra2);
|
||||
} /* if(!sym_def[0]) */
|
||||
if(split_f) {
|
||||
int save;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ static void vhdl_netlist(FILE *fd , int vhdl_stop)
|
|||
if(!strcmp(get_tok_value( (xctx->inst[l].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(602, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"attributes"))==0)
|
||||
{
|
||||
if(xctx->inst[l].prop_ptr) fprintf(fd, "\n%s\n", xctx->inst[l].prop_ptr);
|
||||
|
|
@ -83,7 +83,7 @@ static void vhdl_netlist(FILE *fd , int vhdl_stop)
|
|||
continue;
|
||||
}
|
||||
dbg(2, "vhdl_netlist(): into the netlisting loop\n");
|
||||
my_strdup(603, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type &&
|
||||
( !IS_LABEL_OR_PIN(type) &&
|
||||
strcmp(type,"generic")&&
|
||||
|
|
@ -106,7 +106,7 @@ static void vhdl_netlist(FILE *fd , int vhdl_stop)
|
|||
}
|
||||
}
|
||||
}
|
||||
if(type) my_free(1097, &type);
|
||||
if(type) my_free(_ALLOC_ID_, &type);
|
||||
dbg(1, "vhdl_netlist(): end\n");
|
||||
if(!vhdl_stop && !xctx->netlist_count) redraw_hilights(0); /* draw_hilight_net(1); */
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
}
|
||||
|
||||
|
||||
my_strdup(571, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"package"))==0)
|
||||
{
|
||||
if(xctx->inst[i].prop_ptr) { /* */
|
||||
|
|
@ -186,7 +186,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(572, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"use"))==0)
|
||||
{
|
||||
if(xctx->inst[i].prop_ptr) fprintf(fd, "%s\n", xctx->inst[i].prop_ptr);
|
||||
|
|
@ -255,9 +255,9 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(577, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(578, &sig_type,"std_logic");
|
||||
my_strdup(579, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"opin"))==0)
|
||||
{
|
||||
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
|
||||
|
|
@ -276,9 +276,9 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(580, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(581, &sig_type,"std_logic");
|
||||
my_strdup(582, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"iopin"))==0)
|
||||
{
|
||||
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
|
||||
|
|
@ -297,9 +297,9 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(583, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(584, &sig_type,"std_logic");
|
||||
my_strdup(585, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"ipin"))==0)
|
||||
{
|
||||
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
|
||||
|
|
@ -319,7 +319,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(586, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"port_attributes"))==0)
|
||||
{
|
||||
if(xctx->inst[i].prop_ptr) fprintf(fd, "%s\n", xctx->inst[i].prop_ptr);
|
||||
|
|
@ -339,7 +339,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
if( strcmp(get_tok_value(xctx->sym[j].prop_ptr,"vhdl_ignore",0),"true")==0 ) continue;
|
||||
if(!xctx->sym[j].type || (strcmp(xctx->sym[j].type,"primitive")!=0 &&
|
||||
strcmp(xctx->sym[j].type,"subcircuit")!=0)) continue;
|
||||
my_strdup(1240, &abs_path, abs_sym_path(xctx->sym[j].name, ""));
|
||||
my_strdup(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[j].name, ""));
|
||||
if((
|
||||
strcmp(xctx->sym[j].type,"subcircuit")==0 ||
|
||||
strcmp(xctx->sym[j].type,"primitive")==0
|
||||
|
|
@ -347,7 +347,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
)
|
||||
{
|
||||
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
|
||||
my_strdup(317, &subckt_name, get_cell(xctx->sym[j].name, 0));
|
||||
my_strdup(_ALLOC_ID_, &subckt_name, get_cell(xctx->sym[j].name, 0));
|
||||
if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL) {
|
||||
Int_hashtable table = {NULL, 0};
|
||||
str_hash_lookup(&subckt_table, subckt_name, "", XINSERT);
|
||||
|
|
@ -360,12 +360,12 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
for(i=0;i<xctx->sym[j].rects[PINLAYER];i++)
|
||||
{
|
||||
if(strcmp(get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"vhdl_ignore",0), "true")) {
|
||||
my_strdup(587, &sig_type,get_tok_value(
|
||||
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(
|
||||
xctx->sym[j].rect[PINLAYER][i].prop_ptr,"sig_type",0));
|
||||
my_strdup(588, &port_value,
|
||||
my_strdup(_ALLOC_ID_, &port_value,
|
||||
get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"value", 0) );
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(589, &sig_type,"std_logic");
|
||||
my_strdup(590, &dir_tmp, get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"dir",0) );
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
|
||||
my_strdup(_ALLOC_ID_, &dir_tmp, get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"dir",0) );
|
||||
str_tmp = get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"name",0);
|
||||
if(!int_hash_lookup(&table, str_tmp, 1, XINSERT_NOREPLACE)) {
|
||||
if(!tmp) fprintf(fd, "port (\n");
|
||||
|
|
@ -375,7 +375,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
fprintf(fd," := %s", port_value);
|
||||
tmp=1;
|
||||
}
|
||||
my_free(1085, &dir_tmp);
|
||||
my_free(_ALLOC_ID_, &dir_tmp);
|
||||
}
|
||||
}
|
||||
int_hash_free(&table);
|
||||
|
|
@ -383,10 +383,10 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
fprintf(fd, "end component ;\n\n");
|
||||
}
|
||||
}
|
||||
my_free(1241, &abs_path);
|
||||
my_free(_ALLOC_ID_, &abs_path);
|
||||
}
|
||||
str_hash_free(&subckt_table);
|
||||
my_free(1086, &subckt_name);
|
||||
my_free(_ALLOC_ID_, &subckt_name);
|
||||
|
||||
dbg(1, "global_vhdl_netlist(): netlisting top level\n");
|
||||
vhdl_netlist(fd, 0);
|
||||
|
|
@ -398,7 +398,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(591, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
|
||||
if(type && !strcmp(type,"netlist_commands")) {
|
||||
fprintf(fd, "%s\n", get_tok_value(xctx->inst[i].prop_ptr,"value", 0));
|
||||
}
|
||||
|
|
@ -426,7 +426,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
/* warning if two symbols perfectly overlapped */
|
||||
warning_overlapped_symbols(0);
|
||||
/* preserve current level instance flags before descending hierarchy for netlisting, restore later */
|
||||
stored_flags = my_calloc(151, xctx->instances, sizeof(unsigned int));
|
||||
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
|
||||
for(i=0;i<xctx->instances;i++) stored_flags[i] = xctx->inst[i].color;
|
||||
|
||||
if(global)
|
||||
|
|
@ -438,7 +438,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
/* reload data without popping undo stack, this populates embedded symbols if any */
|
||||
xctx->pop_undo(2, 0);
|
||||
/* link_symbols_to_instances(-1); */ /* done in xctx->pop_undo() */
|
||||
my_strdup(502, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
|
||||
my_strcat(509, &xctx->sch_path[xctx->currsch+1], "->netlisting");
|
||||
xctx->sch_path_hash[xctx->currsch+1] = 0;
|
||||
xctx->currsch++;
|
||||
|
|
@ -449,11 +449,11 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
{
|
||||
if( strcmp(get_tok_value(xctx->sym[i].prop_ptr,"vhdl_ignore",0),"true")==0 ) continue;
|
||||
if(!xctx->sym[i].type) continue;
|
||||
my_strdup(1242, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
my_strdup(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path))
|
||||
{
|
||||
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
|
||||
my_strdup(327, &subckt_name, get_cell(xctx->sym[i].name, 0));
|
||||
my_strdup(_ALLOC_ID_, &subckt_name, get_cell(xctx->sym[i].name, 0));
|
||||
if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL)
|
||||
{
|
||||
str_hash_lookup(&subckt_table, subckt_name, "", XINSERT);
|
||||
|
|
@ -466,10 +466,10 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
vhdl_block_netlist(fd, i);
|
||||
}
|
||||
}
|
||||
my_free(1243, &abs_path);
|
||||
my_free(_ALLOC_ID_, &abs_path);
|
||||
}
|
||||
str_hash_free(&subckt_table);
|
||||
my_free(1087, &subckt_name);
|
||||
my_free(_ALLOC_ID_, &subckt_name);
|
||||
my_strncpy(xctx->sch[xctx->currsch] , "", S(xctx->sch[xctx->currsch]));
|
||||
xctx->currsch--;
|
||||
unselect_all(1);
|
||||
|
|
@ -484,7 +484,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
|
||||
propagate_hilights(1, 0, XINSERT_NOREPLACE);
|
||||
draw_hilight_net(1);
|
||||
my_free(1088, &stored_flags);
|
||||
my_free(_ALLOC_ID_, &stored_flags);
|
||||
dbg(1, "global_vhdl_netlist(): starting awk on netlist!\n");
|
||||
if(!split_f) {
|
||||
fclose(fd);
|
||||
|
|
@ -498,9 +498,9 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
}
|
||||
if(!debug_var) xunlink(netl_filename);
|
||||
}
|
||||
my_free(1089, &sig_type);
|
||||
my_free(1090, &type);
|
||||
my_free(1091, &port_value);
|
||||
my_free(_ALLOC_ID_, &sig_type);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
my_free(_ALLOC_ID_, &port_value);
|
||||
xctx->netlist_count = 0;
|
||||
}
|
||||
|
||||
|
|
@ -584,12 +584,12 @@ void vhdl_block_netlist(FILE *fd, int i)
|
|||
for(j=0;j<xctx->sym[i].rects[PINLAYER];j++)
|
||||
{
|
||||
if(strcmp(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"vhdl_ignore",0), "true")) {
|
||||
my_strdup(592, &sig_type,
|
||||
my_strdup(_ALLOC_ID_, &sig_type,
|
||||
get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"sig_type",0));
|
||||
my_strdup(593, &port_value,
|
||||
my_strdup(_ALLOC_ID_, &port_value,
|
||||
get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"value", 0) );
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(594, &sig_type,"std_logic");
|
||||
my_strdup(595, &dir_tmp, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"dir",0) );
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
|
||||
my_strdup(_ALLOC_ID_, &dir_tmp, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"dir",0) );
|
||||
str_tmp = get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"name",0);
|
||||
if(!int_hash_lookup(&table, str_tmp, 1, XINSERT_NOREPLACE)) {
|
||||
if(tmp) fprintf(fd, " ;\n");
|
||||
|
|
@ -600,7 +600,7 @@ void vhdl_block_netlist(FILE *fd, int i)
|
|||
fprintf(fd," := %s", port_value);
|
||||
tmp=1;
|
||||
}
|
||||
my_free(1092, &dir_tmp);
|
||||
my_free(_ALLOC_ID_, &dir_tmp);
|
||||
}
|
||||
}
|
||||
int_hash_free(&table);
|
||||
|
|
@ -614,7 +614,7 @@ void vhdl_block_netlist(FILE *fd, int i)
|
|||
if(!strcmp(get_tok_value( (xctx->inst[l].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
|
||||
continue;
|
||||
}
|
||||
my_strdup(596, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
|
||||
if( type && (strcmp(type,"port_attributes"))==0)
|
||||
{
|
||||
if(xctx->inst[l].prop_ptr) fprintf(fd, "%s\n", xctx->inst[l].prop_ptr);
|
||||
|
|
@ -637,7 +637,7 @@ void vhdl_block_netlist(FILE *fd, int i)
|
|||
if(!xctx->sym[j].type || (strcmp(xctx->sym[j].type,"primitive")!=0 &&
|
||||
strcmp(xctx->sym[j].type,"subcircuit")!=0))
|
||||
continue;
|
||||
my_strdup2(1238, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
|
||||
if(( strcmp(xctx->sym[j].type,"subcircuit")==0 || strcmp(xctx->sym[j].type,"primitive")==0) &&
|
||||
check_lib(1, abs_path)
|
||||
) {
|
||||
|
|
@ -665,19 +665,19 @@ void vhdl_block_netlist(FILE *fd, int i)
|
|||
for(k=0;k<xctx->sym[j].rects[PINLAYER];k++)
|
||||
{
|
||||
if(strcmp(get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"vhdl_ignore",0), "true")) {
|
||||
my_strdup(597, &sig_type,get_tok_value(
|
||||
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(
|
||||
xctx->sym[j].rect[PINLAYER][k].prop_ptr,"sig_type",0));
|
||||
my_strdup(598, &port_value,
|
||||
my_strdup(_ALLOC_ID_, &port_value,
|
||||
get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"value", 0) );
|
||||
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(599, &sig_type,"std_logic");
|
||||
my_strdup(600, &dir_tmp, get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"dir",0) );
|
||||
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
|
||||
my_strdup(_ALLOC_ID_, &dir_tmp, get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"dir",0) );
|
||||
str_tmp = get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"name",0);
|
||||
if(!int_hash_lookup(&table, str_tmp, 1, XINSERT_NOREPLACE)) {
|
||||
if(!tmp) fprintf(fd, "port (\n");
|
||||
if(tmp) fprintf(fd, " ;\n");
|
||||
fprintf(fd," %s : %s %s",str_tmp, dir_tmp ? dir_tmp : "<NULL>", sig_type);
|
||||
my_free(1093, &dir_tmp);
|
||||
my_free(_ALLOC_ID_, &dir_tmp);
|
||||
if(port_value &&port_value[0]) fprintf(fd," := %s", port_value);
|
||||
tmp=1;
|
||||
}
|
||||
|
|
@ -689,7 +689,7 @@ void vhdl_block_netlist(FILE *fd, int i)
|
|||
}
|
||||
} /* for(j...) */
|
||||
} /* if(!vhdl_stop) */
|
||||
my_free(1239, &abs_path);
|
||||
my_free(_ALLOC_ID_, &abs_path);
|
||||
dbg(1, "vhdl_block_netlist(): netlisting %s\n", skip_dir( xctx->sch[xctx->currsch]));
|
||||
vhdl_netlist(fd, vhdl_stop);
|
||||
fprintf(fd,"//// begin user architecture code\n");
|
||||
|
|
@ -703,7 +703,7 @@ void vhdl_block_netlist(FILE *fd, int i)
|
|||
if(xctx->netlist_count &&
|
||||
!strcmp(get_tok_value(xctx->inst[l].prop_ptr, "only_toplevel", 0), "true")) continue;
|
||||
|
||||
my_strdup(601, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
|
||||
my_strdup(_ALLOC_ID_, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
|
||||
if(type && !strcmp(type,"netlist_commands")) {
|
||||
fprintf(fd, "%s\n", get_tok_value(xctx->inst[l].prop_ptr,"value", 0));
|
||||
}
|
||||
|
|
@ -711,9 +711,9 @@ void vhdl_block_netlist(FILE *fd, int i)
|
|||
|
||||
if(xctx->schvhdlprop && xctx->schvhdlprop[0]) fprintf(fd, "%s\n", xctx->schvhdlprop);
|
||||
fprintf(fd, "end arch_%s ;\n\n", skip_dir(xctx->sym[i].name) ); /* skip_dir( xctx->sch[xctx->currsch]) ); */
|
||||
my_free(1094, &sig_type);
|
||||
my_free(1095, &port_value);
|
||||
my_free(1096, &type);
|
||||
my_free(_ALLOC_ID_, &sig_type);
|
||||
my_free(_ALLOC_ID_, &port_value);
|
||||
my_free(_ALLOC_ID_, &type);
|
||||
} /* if(!sym_def[0]) */
|
||||
if(split_f) {
|
||||
int save;
|
||||
|
|
|
|||
242
src/xinit.c
242
src/xinit.c
|
|
@ -290,7 +290,7 @@ static void init_color_array(double dim, double dim_bg)
|
|||
if(g>0xff) g=0xff;
|
||||
if(b>0xff) b=0xff;
|
||||
my_snprintf(s, S(s), "#%02x%02x%02x", r, g, b);
|
||||
my_strdup(643, &xctx->color_array[i], s);
|
||||
my_strdup(_ALLOC_ID_, &xctx->color_array[i], s);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -322,64 +322,64 @@ static void free_xschem_data()
|
|||
xctx->delete_undo();
|
||||
free_simdata();
|
||||
|
||||
my_free(970, &xctx->node_table);
|
||||
my_free(1385, &xctx->inst_table);
|
||||
my_free(1387, &xctx->hilight_table);
|
||||
my_free(_ALLOC_ID_, &xctx->node_table);
|
||||
my_free(_ALLOC_ID_, &xctx->inst_table);
|
||||
my_free(_ALLOC_ID_, &xctx->hilight_table);
|
||||
|
||||
my_free(1098, &xctx->wire);
|
||||
my_free(1100, &xctx->text);
|
||||
my_free(1107, &xctx->inst);
|
||||
my_free(_ALLOC_ID_, &xctx->wire);
|
||||
my_free(_ALLOC_ID_, &xctx->text);
|
||||
my_free(_ALLOC_ID_, &xctx->inst);
|
||||
for(i=0;i<cadlayers;i++) {
|
||||
my_free(1103, &xctx->rect[i]);
|
||||
my_free(1104, &xctx->line[i]);
|
||||
my_free(1105, &xctx->poly[i]);
|
||||
my_free(1106, &xctx->arc[i]);
|
||||
my_free(_ALLOC_ID_, &xctx->rect[i]);
|
||||
my_free(_ALLOC_ID_, &xctx->line[i]);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[i]);
|
||||
my_free(_ALLOC_ID_, &xctx->arc[i]);
|
||||
}
|
||||
for(i=0;i<xctx->maxs;i++) {
|
||||
my_free(1109, &xctx->sym[i].line);
|
||||
my_free(1110, &xctx->sym[i].rect);
|
||||
my_free(1111, &xctx->sym[i].arc);
|
||||
my_free(1112, &xctx->sym[i].poly);
|
||||
my_free(1113, &xctx->sym[i].lines);
|
||||
my_free(1114, &xctx->sym[i].polygons);
|
||||
my_free(1115, &xctx->sym[i].arcs);
|
||||
my_free(1116, &xctx->sym[i].rects);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].line);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].rect);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].arc);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].poly);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].lines);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].polygons);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].arcs);
|
||||
my_free(_ALLOC_ID_, &xctx->sym[i].rects);
|
||||
}
|
||||
my_free(1117, &xctx->sym);
|
||||
my_free(1118, &xctx->rect);
|
||||
my_free(1119, &xctx->line);
|
||||
my_free(1125, &xctx->poly);
|
||||
my_free(1126, &xctx->arc);
|
||||
my_free(1124, &xctx->rects);
|
||||
my_free(1127, &xctx->polygons);
|
||||
my_free(1128, &xctx->arcs);
|
||||
my_free(1129, &xctx->lines);
|
||||
my_free(1130, &xctx->maxr);
|
||||
my_free(1131, &xctx->maxp);
|
||||
my_free(1132, &xctx->maxa);
|
||||
my_free(1133, &xctx->maxl);
|
||||
my_free(1108, &xctx->sel_array);
|
||||
my_free(_ALLOC_ID_, &xctx->sym);
|
||||
my_free(_ALLOC_ID_, &xctx->rect);
|
||||
my_free(_ALLOC_ID_, &xctx->line);
|
||||
my_free(_ALLOC_ID_, &xctx->poly);
|
||||
my_free(_ALLOC_ID_, &xctx->arc);
|
||||
my_free(_ALLOC_ID_, &xctx->rects);
|
||||
my_free(_ALLOC_ID_, &xctx->polygons);
|
||||
my_free(_ALLOC_ID_, &xctx->arcs);
|
||||
my_free(_ALLOC_ID_, &xctx->lines);
|
||||
my_free(_ALLOC_ID_, &xctx->maxr);
|
||||
my_free(_ALLOC_ID_, &xctx->maxp);
|
||||
my_free(_ALLOC_ID_, &xctx->maxa);
|
||||
my_free(_ALLOC_ID_, &xctx->maxl);
|
||||
my_free(_ALLOC_ID_, &xctx->sel_array);
|
||||
for(i=0;i<CADMAXHIER;i++) {
|
||||
if(xctx->sch_path[i]) my_free(1139, &xctx->sch_path[i]);
|
||||
if(xctx->hier_attr[i].templ) my_free(1608, &xctx->hier_attr[i].templ);
|
||||
if(xctx->hier_attr[i].prop_ptr) my_free(959, &xctx->hier_attr[i].prop_ptr);
|
||||
if(xctx->hier_attr[i].symname) my_free(960, &xctx->hier_attr[i].symname);
|
||||
if(xctx->sch_path[i]) my_free(_ALLOC_ID_, &xctx->sch_path[i]);
|
||||
if(xctx->hier_attr[i].templ) my_free(_ALLOC_ID_, &xctx->hier_attr[i].templ);
|
||||
if(xctx->hier_attr[i].prop_ptr) my_free(_ALLOC_ID_, &xctx->hier_attr[i].prop_ptr);
|
||||
if(xctx->hier_attr[i].symname) my_free(_ALLOC_ID_, &xctx->hier_attr[i].symname);
|
||||
}
|
||||
|
||||
my_free(1099, &xctx->gridpoint);
|
||||
my_free(1214, &xctx->biggridpoint);
|
||||
my_free(1135, &xctx->gc);
|
||||
my_free(1136, &xctx->gcstipple);
|
||||
for(i=0;i<cadlayers;i++) my_free(1101, &xctx->color_array[i]);
|
||||
my_free(605, &xctx->color_array);
|
||||
my_free(1123, &xctx->enable_layer);
|
||||
my_free(1121, &xctx->active_layer);
|
||||
my_free(1295, &xctx->top_path);
|
||||
my_free(1463, &xctx->current_win_path);
|
||||
my_free(1120, &xctx->fill_type);
|
||||
my_free(1543, &xctx->format);
|
||||
if(xctx->inst_redraw_table) my_free(604, &xctx->inst_redraw_table);
|
||||
my_free(269, &xctx);
|
||||
my_free(_ALLOC_ID_, &xctx->gridpoint);
|
||||
my_free(_ALLOC_ID_, &xctx->biggridpoint);
|
||||
my_free(_ALLOC_ID_, &xctx->gc);
|
||||
my_free(_ALLOC_ID_, &xctx->gcstipple);
|
||||
for(i=0;i<cadlayers;i++) my_free(_ALLOC_ID_, &xctx->color_array[i]);
|
||||
my_free(_ALLOC_ID_, &xctx->color_array);
|
||||
my_free(_ALLOC_ID_, &xctx->enable_layer);
|
||||
my_free(_ALLOC_ID_, &xctx->active_layer);
|
||||
my_free(_ALLOC_ID_, &xctx->top_path);
|
||||
my_free(_ALLOC_ID_, &xctx->current_win_path);
|
||||
my_free(_ALLOC_ID_, &xctx->fill_type);
|
||||
my_free(_ALLOC_ID_, &xctx->format);
|
||||
if(xctx->inst_redraw_table) my_free(_ALLOC_ID_, &xctx->inst_redraw_table);
|
||||
my_free(_ALLOC_ID_, &xctx);
|
||||
}
|
||||
|
||||
static void create_gc(void)
|
||||
|
|
@ -409,7 +409,7 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
|
|||
{
|
||||
int i, j;
|
||||
|
||||
xctx = my_calloc(153, 1, sizeof(Xschem_ctx));
|
||||
xctx = my_calloc(_ALLOC_ID_, 1, sizeof(Xschem_ctx));
|
||||
xctx->cur_undo_ptr = 0;
|
||||
xctx->head_undo_ptr = 0;
|
||||
xctx->tail_undo_ptr = 0;
|
||||
|
|
@ -498,10 +498,10 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
|
|||
xctx->inst_spatial_table[i][j] = NULL;
|
||||
}
|
||||
}
|
||||
xctx->node_table = my_calloc(517, HASHSIZE, sizeof(Node_hashentry *));
|
||||
xctx->node_table = my_calloc(_ALLOC_ID_, HASHSIZE, sizeof(Node_hashentry *));
|
||||
xctx->inst_table.table = NULL;
|
||||
xctx->inst_table.size = 0;
|
||||
xctx->hilight_table = my_calloc(1383, HASHSIZE, sizeof(Hilight_hashentry *));
|
||||
xctx->hilight_table = my_calloc(_ALLOC_ID_, HASHSIZE, sizeof(Hilight_hashentry *));
|
||||
|
||||
xctx->inst_redraw_table = NULL;
|
||||
xctx->inst_redraw_table_size = 0;
|
||||
|
|
@ -551,30 +551,30 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
|
|||
xctx->hier_attr[i].symname = NULL;
|
||||
xctx->hier_attr[i].fd = NULL;
|
||||
}
|
||||
my_strdup(1187, &xctx->sch_path[0],".");
|
||||
my_strdup(_ALLOC_ID_, &xctx->sch_path[0],".");
|
||||
xctx->sch_inst_number[0] = 1;
|
||||
xctx->maxt=CADMAXTEXT;
|
||||
xctx->maxw=CADMAXWIRES;
|
||||
xctx->maxi=ELEMINST;
|
||||
xctx->maxs=ELEMDEF;
|
||||
xctx->text=my_calloc(606, xctx->maxt,sizeof(xText));
|
||||
xctx->wire=my_calloc(607, xctx->maxw,sizeof(xWire));
|
||||
xctx->inst=my_calloc(609, xctx->maxi , sizeof(xInstance) );
|
||||
xctx->sym=my_calloc(610, xctx->maxs , sizeof(xSymbol) );
|
||||
xctx->text=my_calloc(_ALLOC_ID_, xctx->maxt,sizeof(xText));
|
||||
xctx->wire=my_calloc(_ALLOC_ID_, xctx->maxw,sizeof(xWire));
|
||||
xctx->inst=my_calloc(_ALLOC_ID_, xctx->maxi , sizeof(xInstance) );
|
||||
xctx->sym=my_calloc(_ALLOC_ID_, xctx->maxs , sizeof(xSymbol) );
|
||||
for(i=0;i<xctx->maxs;i++) {
|
||||
xctx->sym[i].line=my_calloc(611, cadlayers, sizeof(xLine *));
|
||||
xctx->sym[i].poly=my_calloc(612, cadlayers, sizeof(xPoly *));
|
||||
xctx->sym[i].arc=my_calloc(613, cadlayers, sizeof(xArc *));
|
||||
xctx->sym[i].rect=my_calloc(614, cadlayers, sizeof(xRect *));
|
||||
xctx->sym[i].lines=my_calloc(615, cadlayers, sizeof(int));
|
||||
xctx->sym[i].rects=my_calloc(616, cadlayers, sizeof(int));
|
||||
xctx->sym[i].arcs=my_calloc(617, cadlayers, sizeof(int));
|
||||
xctx->sym[i].polygons=my_calloc(618, cadlayers, sizeof(int));
|
||||
xctx->sym[i].line=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
|
||||
xctx->sym[i].poly=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
|
||||
xctx->sym[i].arc=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
|
||||
xctx->sym[i].rect=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
|
||||
xctx->sym[i].lines=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->sym[i].rects=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->sym[i].arcs=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->sym[i].polygons=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
}
|
||||
xctx->maxr=my_calloc(620, cadlayers, sizeof(int));
|
||||
xctx->maxa=my_calloc(621, cadlayers, sizeof(int));
|
||||
xctx->maxp=my_calloc(622, cadlayers, sizeof(int));
|
||||
xctx->maxl=my_calloc(623, cadlayers, sizeof(int));
|
||||
xctx->maxr=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->maxa=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->maxp=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->maxl=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
for(i=0;i<cadlayers;i++)
|
||||
{
|
||||
xctx->maxr[i]=CADMAXOBJECTS;
|
||||
|
|
@ -582,25 +582,25 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
|
|||
xctx->maxl[i]=CADMAXOBJECTS;
|
||||
xctx->maxa[i]=CADMAXOBJECTS;
|
||||
}
|
||||
xctx->rect=my_calloc(624, cadlayers, sizeof(xRect *));
|
||||
xctx->line=my_calloc(625, cadlayers, sizeof(xLine *));
|
||||
xctx->poly=my_calloc(626, cadlayers, sizeof(xPoly *));
|
||||
xctx->arc=my_calloc(627, cadlayers, sizeof(xArc *));
|
||||
xctx->rect=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
|
||||
xctx->line=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
|
||||
xctx->poly=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
|
||||
xctx->arc=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
|
||||
for(i=0;i<cadlayers;i++)
|
||||
{
|
||||
xctx->rect[i]=my_calloc(628, xctx->maxr[i],sizeof(xRect));
|
||||
xctx->arc[i]=my_calloc(629, xctx->maxa[i],sizeof(xArc));
|
||||
xctx->poly[i]=my_calloc(630, xctx->maxp[i],sizeof(xPoly));
|
||||
xctx->line[i]=my_calloc(631, xctx->maxl[i],sizeof(xLine));
|
||||
xctx->rect[i]=my_calloc(_ALLOC_ID_, xctx->maxr[i],sizeof(xRect));
|
||||
xctx->arc[i]=my_calloc(_ALLOC_ID_, xctx->maxa[i],sizeof(xArc));
|
||||
xctx->poly[i]=my_calloc(_ALLOC_ID_, xctx->maxp[i],sizeof(xPoly));
|
||||
xctx->line[i]=my_calloc(_ALLOC_ID_, xctx->maxl[i],sizeof(xLine));
|
||||
}
|
||||
xctx->rects=my_calloc(632, cadlayers, sizeof(int));
|
||||
xctx->polygons=my_calloc(633, cadlayers, sizeof(int));
|
||||
xctx->arcs=my_calloc(634, cadlayers, sizeof(int));
|
||||
xctx->lines=my_calloc(635, cadlayers, sizeof(int));
|
||||
xctx->rects=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->polygons=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->arcs=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->lines=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->maxsel=MAXGROUP;
|
||||
xctx->sel_array=my_calloc(619, xctx->maxsel, sizeof(Selected));
|
||||
xctx->biggridpoint=(XSegment*)my_calloc(1213, CADMAXGRIDPOINTS,sizeof(XSegment));
|
||||
xctx->gridpoint=(XPoint*)my_calloc(608, CADMAXGRIDPOINTS,sizeof(XPoint));
|
||||
xctx->sel_array=my_calloc(_ALLOC_ID_, xctx->maxsel, sizeof(Selected));
|
||||
xctx->biggridpoint=(XSegment*)my_calloc(_ALLOC_ID_, CADMAXGRIDPOINTS,sizeof(XSegment));
|
||||
xctx->gridpoint=(XPoint*)my_calloc(_ALLOC_ID_, CADMAXGRIDPOINTS,sizeof(XPoint));
|
||||
xctx->enable_drill = 0;
|
||||
xctx->prev_set_modify = -1;
|
||||
xctx->pending_fullzoom = 0;
|
||||
|
|
@ -620,21 +620,21 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
|
|||
xctx->edit_sym_i = -1;
|
||||
xctx->netlist_commands = 0;
|
||||
xctx->draw_pixmap = 1;
|
||||
xctx->gc=my_calloc(638, cadlayers, sizeof(GC));
|
||||
xctx->gcstipple=my_calloc(639, cadlayers, sizeof(GC));
|
||||
xctx->color_array=my_calloc(637, cadlayers, sizeof(char*));
|
||||
xctx->enable_layer=my_calloc(87, cadlayers, sizeof(int));
|
||||
xctx->gc=my_calloc(_ALLOC_ID_, cadlayers, sizeof(GC));
|
||||
xctx->gcstipple=my_calloc(_ALLOC_ID_, cadlayers, sizeof(GC));
|
||||
xctx->color_array=my_calloc(_ALLOC_ID_, cadlayers, sizeof(char*));
|
||||
xctx->enable_layer=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->n_active_layers = 0;
|
||||
xctx->active_layer=my_calloc(563, cadlayers, sizeof(int));
|
||||
xctx->active_layer=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->hide_symbols = 0;
|
||||
xctx->netlist_type = CAD_SPICE_NETLIST;
|
||||
xctx->format = NULL; /* custom format string for netlist, otherwise use
|
||||
* "format", "verilog_format", "vhdl_format", "tedax_format" */
|
||||
xctx->top_path = NULL;
|
||||
xctx->current_win_path = NULL;
|
||||
my_strdup2(1296, &xctx->top_path, top_path);
|
||||
my_strdup2(1462, &xctx->current_win_path, win_path);
|
||||
xctx->fill_type=my_calloc(640, cadlayers, sizeof(int));
|
||||
my_strdup2(_ALLOC_ID_, &xctx->top_path, top_path);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->current_win_path, win_path);
|
||||
xctx->fill_type=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
|
||||
xctx->case_insensitive = 0;
|
||||
xctx->show_hidden_texts = 0;
|
||||
xctx->x_strcmp = strcmp;
|
||||
|
|
@ -697,7 +697,7 @@ int compare_schematics(const char *f)
|
|||
/* HASH SCHEMATIC 1 */
|
||||
for(i = 0; i < xctx->instances; i++) {
|
||||
l = 1024 + strlen(xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
|
||||
my_realloc(1540, &s, l);
|
||||
my_realloc(_ALLOC_ID_, &s, l);
|
||||
my_snprintf(s, l, "C %s %g %g %d %d %s", xctx->inst[i].name,
|
||||
xctx->inst[i].x0, xctx->inst[i].y0, xctx->inst[i].rot, xctx->inst[i].flip,
|
||||
xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
|
||||
|
|
@ -706,7 +706,7 @@ int compare_schematics(const char *f)
|
|||
for(i=0;i<xctx->wires;i++)
|
||||
{
|
||||
l =1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : "");
|
||||
my_realloc(1541, &s, l);
|
||||
my_realloc(_ALLOC_ID_, &s, l);
|
||||
my_snprintf(s, l, "N %g %g %g %g", xctx->wire[i].x1, xctx->wire[i].y1,
|
||||
xctx->wire[i].x2, xctx->wire[i].y2);
|
||||
int_hash_lookup(&table1, s, i, XINSERT_NOREPLACE);
|
||||
|
|
@ -759,7 +759,7 @@ int compare_schematics(const char *f)
|
|||
/* HASH SCHEMATIC 2 , CHECK SCHEMATIC 2 WITH SCHEMATIC 1 */
|
||||
for(i = 0; i < xctx->instances; i++) {
|
||||
l = 1024 + strlen(xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
|
||||
my_realloc(1534, &s, l);
|
||||
my_realloc(_ALLOC_ID_, &s, l);
|
||||
my_snprintf(s, l, "C %s %g %g %d %d %s", xctx->inst[i].name,
|
||||
xctx->inst[i].x0, xctx->inst[i].y0, xctx->inst[i].rot, xctx->inst[i].flip,
|
||||
xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
|
||||
|
|
@ -776,7 +776,7 @@ int compare_schematics(const char *f)
|
|||
for(i=0;i<xctx->wires;i++)
|
||||
{
|
||||
l =1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : "");
|
||||
my_realloc(1535, &s, l);
|
||||
my_realloc(_ALLOC_ID_, &s, l);
|
||||
my_snprintf(s, l, "N %g %g %g %g", xctx->wire[i].x1, xctx->wire[i].y1,
|
||||
xctx->wire[i].x2, xctx->wire[i].y2);
|
||||
int_hash_lookup(&table2, s, i, XINSERT_NOREPLACE);
|
||||
|
|
@ -805,7 +805,7 @@ int compare_schematics(const char *f)
|
|||
/* CHECK SCHEMATIC 1 WITH SCHEMATIC 2*/
|
||||
for(i = 0; i < xctx->instances; i++) {
|
||||
l = 1024 + strlen(xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
|
||||
my_realloc(1536,&s, l);
|
||||
my_realloc(_ALLOC_ID_,&s, l);
|
||||
my_snprintf(s, l, "C %s %g %g %d %d %s", xctx->inst[i].name,
|
||||
xctx->inst[i].x0, xctx->inst[i].y0, xctx->inst[i].rot, xctx->inst[i].flip,
|
||||
xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
|
||||
|
|
@ -819,7 +819,7 @@ int compare_schematics(const char *f)
|
|||
for(i=0;i<xctx->wires;i++)
|
||||
{
|
||||
l = 1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : "");
|
||||
my_realloc(1537, &s, l);
|
||||
my_realloc(_ALLOC_ID_, &s, l);
|
||||
my_snprintf(s, l, "N %g %g %g %g", xctx->wire[i].x1, xctx->wire[i].y1,
|
||||
xctx->wire[i].x2, xctx->wire[i].y2);
|
||||
found = int_hash_lookup(&table2, s, i, XLOOKUP);
|
||||
|
|
@ -833,7 +833,7 @@ int compare_schematics(const char *f)
|
|||
int_hash_free(&table2);
|
||||
rebuild_selected_array();
|
||||
draw_selection(xctx->gc[SELLAYER], 0);
|
||||
my_free(1531, &s);
|
||||
my_free(_ALLOC_ID_, &s);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -863,18 +863,18 @@ static void xwin_exit(void)
|
|||
#else
|
||||
for(i = 0; i < cadlayers; i++) Tk_FreePixmap(display, pixmap[i]);
|
||||
#endif
|
||||
my_free(1134, &pixmap);
|
||||
my_free(_ALLOC_ID_, &pixmap);
|
||||
}
|
||||
dbg(1, "xwin_exit(): clearing drawing data structures\n");
|
||||
|
||||
/* global context - graphic preferences/settings */
|
||||
for(i=0;i<cadlayers;i++) {
|
||||
my_free(1102, &pixdata[i]);
|
||||
my_free(_ALLOC_ID_, &pixdata[i]);
|
||||
}
|
||||
my_free(1122, &pixdata);
|
||||
my_free(1138, &cli_opt_tcl_command);
|
||||
my_free(1566, &cli_opt_preinit_command);
|
||||
my_free(1070, &cli_opt_tcl_post_command);
|
||||
my_free(_ALLOC_ID_, &pixdata);
|
||||
my_free(_ALLOC_ID_, &cli_opt_tcl_command);
|
||||
my_free(_ALLOC_ID_, &cli_opt_preinit_command);
|
||||
my_free(_ALLOC_ID_, &cli_opt_tcl_post_command);
|
||||
clear_expandlabel_data();
|
||||
get_sym_template(NULL, NULL); /* clear static data in function */
|
||||
list_tokens(NULL, 0); /* clear static data in function */
|
||||
|
|
@ -885,17 +885,17 @@ static void xwin_exit(void)
|
|||
tcl_hook2(NULL); /* clear static data in function */
|
||||
save_ascii_string(NULL, NULL, 0); /* clear static data in function */
|
||||
dbg(1, "xwin_exit(): removing font\n");
|
||||
for(i=0;i<127;i++) my_free(1140, &character[i]);
|
||||
for(i=0;i<127;i++) my_free(_ALLOC_ID_, &character[i]);
|
||||
dbg(1, "xwin_exit(): closed display\n");
|
||||
my_strncpy(cli_opt_filename, "", S(cli_opt_filename));
|
||||
my_free(1143, &xschem_executable);
|
||||
my_free(_ALLOC_ID_, &xschem_executable);
|
||||
record_global_node(2, NULL, NULL); /* delete global node array */
|
||||
dbg(1, "xwin_exit(): deleted undo buffer\n");
|
||||
/* delete cmdline stuff */
|
||||
for(i = 0 ; i < cli_opt_argc; i++) {
|
||||
my_free(1141, &cli_opt_argv[i]);
|
||||
my_free(_ALLOC_ID_, &cli_opt_argv[i]);
|
||||
}
|
||||
my_free(1464, &cli_opt_argv);
|
||||
my_free(_ALLOC_ID_, &cli_opt_argv);
|
||||
if(errfp!=stderr) fclose(errfp);
|
||||
errfp=stderr;
|
||||
if(!detach) printf("\n");
|
||||
|
|
@ -1142,7 +1142,7 @@ void preview_window(const char *what, const char *win_path, const char *fname)
|
|||
if(current_file) {
|
||||
delete_schematic_data(1);
|
||||
}
|
||||
my_strdup(117, ¤t_file, fname);
|
||||
my_strdup(_ALLOC_ID_, ¤t_file, fname);
|
||||
xctx = NULL; /* reset for preview */
|
||||
alloc_xschem_data(".dialog", ".dialog.drw"); /* alloc data into xctx */
|
||||
init_pixdata(); /* populate xctx->fill_type array that is used in create_gc() to set fill styles */
|
||||
|
|
@ -1168,7 +1168,7 @@ void preview_window(const char *what, const char *win_path, const char *fname)
|
|||
}
|
||||
|
||||
Tk_DestroyWindow(tkpre_window);
|
||||
my_free(1144, ¤t_file);
|
||||
my_free(_ALLOC_ID_, ¤t_file);
|
||||
xctx = save_xctx; /* restore schematic */
|
||||
save_xctx = NULL;
|
||||
set_modify(-1);
|
||||
|
|
@ -2017,9 +2017,9 @@ int Tcl_AppInit(Tcl_Interp *inter)
|
|||
if (atoi(tclresult()) == 0)
|
||||
{
|
||||
running_in_src_dir = 1; /* no bin, so it's running in Visual studio source directory*/
|
||||
my_strdup(62, &up_hier, "../../..");
|
||||
my_strdup(_ALLOC_ID_, &up_hier, "../../..");
|
||||
}
|
||||
else my_strdup(63, &up_hier, "..");
|
||||
else my_strdup(_ALLOC_ID_, &up_hier, "..");
|
||||
/* my_strcat(415, &win_xschem_library_path, "."); */
|
||||
for (i = 0; i < WIN_XSCHEM_LIBRARY_PATH_NUM; ++i) {
|
||||
my_snprintf(tmp, S(tmp),"%s/%s/%s", install_dir, up_hier, WIN_XSCHEM_LIBRARY_PATH[i]);
|
||||
|
|
@ -2031,8 +2031,8 @@ int Tcl_AppInit(Tcl_Interp *inter)
|
|||
const char *result2 = tcleval(tmp);
|
||||
const char *win_xschem_library_path_clean = tclgetvar("tmp2");
|
||||
tclsetvar("XSCHEM_LIBRARY_PATH", win_xschem_library_path_clean);
|
||||
my_free(432, &win_xschem_library_path);
|
||||
my_free(441, &up_hier);
|
||||
my_free(_ALLOC_ID_, &win_xschem_library_path);
|
||||
my_free(_ALLOC_ID_, &up_hier);
|
||||
char *xschem_sharedir=NULL;
|
||||
if ((xschem_sharedir=getenv("XSCHEM_SHAREDIR")) != NULL) {
|
||||
if (!stat(xschem_sharedir, &buf)) {
|
||||
|
|
@ -2219,7 +2219,7 @@ int Tcl_AppInit(Tcl_Interp *inter)
|
|||
/* */
|
||||
|
||||
/* resolve absolute pathname of xschem (argv[0]) for future usage */
|
||||
my_strdup(44, &xschem_executable, get_file_path(xschem_executable));
|
||||
my_strdup(_ALLOC_ID_, &xschem_executable, get_file_path(xschem_executable));
|
||||
dbg(1, "Tcl_AppInit(): resolved xschem_executable=%s\n", xschem_executable);
|
||||
|
||||
|
||||
|
|
@ -2249,12 +2249,12 @@ int Tcl_AppInit(Tcl_Interp *inter)
|
|||
alloc_xschem_data("", ".drw");
|
||||
|
||||
/* global context / graphic preferences/settings */
|
||||
pixdata=my_calloc(641, cadlayers, sizeof(char*));
|
||||
pixdata=my_calloc(_ALLOC_ID_, cadlayers, sizeof(char*));
|
||||
for(i=0;i<cadlayers;i++)
|
||||
{
|
||||
pixdata[i]=my_calloc(642, 32, sizeof(char));
|
||||
pixdata[i]=my_calloc(_ALLOC_ID_, 32, sizeof(char));
|
||||
}
|
||||
if(has_x) pixmap=my_calloc(636, cadlayers, sizeof(Pixmap));
|
||||
if(has_x) pixmap=my_calloc(_ALLOC_ID_, cadlayers, sizeof(Pixmap));
|
||||
|
||||
my_strncpy(xctx->plotfile, cli_opt_plotfile, S(xctx->plotfile));
|
||||
xctx->draw_window = tclgetintvar("draw_window");
|
||||
|
|
|
|||
|
|
@ -123,7 +123,8 @@ extern char win_temp_dir[PATH_MAX];
|
|||
#include <tcl.h>
|
||||
#include <tk.h>
|
||||
|
||||
#define _ALLOC_ID_ 0 /* to be replaced with unique IDs in my_*() allocations for memory tracking */
|
||||
#define _ALLOC_ID_ 0 /* to be replaced with unique IDs in my_*() allocations for memory tracking
|
||||
* see create_alloc_ids.awk */
|
||||
#define CADHEIGHT 700 /* initial window size */
|
||||
#define CADWIDTH 1000
|
||||
|
||||
|
|
@ -367,7 +368,7 @@ do { \
|
|||
register size_t __str_alloc_tmp__ = add; \
|
||||
if( __str_alloc_tmp__ >= *size) { \
|
||||
*size = __str_alloc_tmp__ + CADCHUNKALLOC; \
|
||||
my_realloc(1212, dest_string, *size); \
|
||||
my_realloc(_ALLOC_ID_, dest_string, *size); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue