add function get_plot(name) to return address of named plot
This commit is contained in:
parent
29f364d475
commit
872ec89692
|
|
@ -945,6 +945,18 @@ vec_basename(struct dvec *v)
|
||||||
return (copy(s));
|
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
|
/* Make a plot the current one. This gets called by cp_usrset() when one
|
||||||
* does a 'set curplot = name'.
|
* does a 'set curplot = name'.
|
||||||
|
|
|
||||||
|
|
@ -359,6 +359,7 @@ extern void vec_new(struct dvec *d);
|
||||||
extern void plot_docoms(wordlist *wl);
|
extern void plot_docoms(wordlist *wl);
|
||||||
extern void vec_remove(char *name);
|
extern void vec_remove(char *name);
|
||||||
extern void plot_setcur(char *name);
|
extern void plot_setcur(char *name);
|
||||||
|
extern struct plot *get_plot(char* name);
|
||||||
extern void plot_new(struct plot *pl);
|
extern void plot_new(struct plot *pl);
|
||||||
extern char *vec_basename(struct dvec *v);
|
extern char *vec_basename(struct dvec *v);
|
||||||
extern bool plot_prefix(char *pre, char *str);
|
extern bool plot_prefix(char *pre, char *str);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue