File: new.cc

package info (click to toggle)
gri 2.4.2-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 4,540 kB
  • ctags: 1,966
  • sloc: cpp: 32,542; lisp: 3,243; perl: 806; makefile: 548; sh: 253
file content (45 lines) | stat: -rw-r--r-- 1,001 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <string>
#include <math.h>
#include <stdio.h>
#include "gr.hh"
#include "extern.hh"
#include "defaults.hh"
extern char     _grTempString[];

bool            new_pageCmd();
bool            newCmd(void);	// for synonyms and vars

bool
new_pageCmd()
{
    extern void reset_top_of_plot(void); // in set.cc
    gr_showpage();
    _need_x_axis = true;
    _need_y_axis = true;
    reset_top_of_plot();
    return true;
}

bool
newCmd()
{
    int             i;
    if (_nword == 1) {
	err("Need name of thing (synonym or variable) to make new version of");
	demonstrate_command_usage();
	return false;
    }
    for (i = 1; i < _nword; i++) {
	if (is_syn(_word[i])) {
	    /* Make new synonym */
	    create_synonym(_word[i], "");
	} else if (is_var(_word[i])) {
	    create_variable(_word[i], 0.0);
	} else {
	    demonstrate_command_usage();
	    err("`new' only works on synonyms and variables, not on an item named `\\", _word[i], "'", "\\");
	    return false;
	}
    }
    return true;
}