Browse Source

add function get_plot(name) to return address of named plot

pre-master-46
Holger Vogt 7 years ago
parent
commit
40411197e0
  1. 12
      src/frontend/vectors.c
  2. 1
      src/include/ngspice/fteext.h

12
src/frontend/vectors.c

@ -945,6 +945,18 @@ vec_basename(struct dvec *v)
return (copy(s));
}
/* get address of plot named 'name' */
struct plot *
get_plot(char* name)
{
struct plot *pl;
for (pl = plot_list; pl; pl = pl->pl_next)
if (plot_prefix(name, pl->pl_typename))
return pl;
fprintf(cp_err, "Error: no such plot named %s\n", name);
return NULL;
}
/* Make a plot the current one. This gets called by cp_usrset() when one
* does a 'set curplot = name'.

1
src/include/ngspice/fteext.h

@ -359,6 +359,7 @@ extern void vec_new(struct dvec *d);
extern void plot_docoms(wordlist *wl);
extern void vec_remove(char *name);
extern void plot_setcur(char *name);
extern struct plot *get_plot(char* name);
extern void plot_new(struct plot *pl);
extern char *vec_basename(struct dvec *v);
extern bool plot_prefix(char *pre, char *str);

Loading…
Cancel
Save