|
|
|
@ -17,7 +17,9 @@ Author: 1987 Jeffrey M. Hsu |
|
|
|
#include "variable.h" |
|
|
|
|
|
|
|
|
|
|
|
static void common(char *string, struct wordlist *wl, struct comm *command); |
|
|
|
static void common(const char *string, const struct wordlist *wl, |
|
|
|
const struct comm *command); |
|
|
|
static int countargs(const wordlist *wl); |
|
|
|
|
|
|
|
|
|
|
|
/* returns a private copy of the string */ |
|
|
|
@ -39,11 +41,10 @@ prompt(FILE *fp) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int |
|
|
|
countargs(wordlist *wl) |
|
|
|
static int countargs(const wordlist *wl) |
|
|
|
{ |
|
|
|
int number = 0; |
|
|
|
wordlist *w; |
|
|
|
const wordlist *w; |
|
|
|
|
|
|
|
for (w = wl; w; w = w->wl_next) |
|
|
|
number++; |
|
|
|
@ -63,42 +64,42 @@ process(wordlist *wlist) |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
arg_print(wordlist *wl, struct comm *command) |
|
|
|
arg_print(const wordlist *wl, const struct comm *command) |
|
|
|
{ |
|
|
|
common("which variable", wl, command); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
arg_plot(wordlist *wl, struct comm *command) |
|
|
|
arg_plot(const wordlist *wl, const struct comm *command) |
|
|
|
{ |
|
|
|
common("which variable", wl, command); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
arg_load(wordlist *wl, struct comm *command) |
|
|
|
arg_load(wordlist *wl, const struct comm *command) |
|
|
|
{ |
|
|
|
/* just call com_load */ |
|
|
|
command->co_func(wl); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void arg_let(wordlist *wl, struct comm *command) |
|
|
|
void arg_let(const wordlist *wl, const struct comm *command) |
|
|
|
{ |
|
|
|
common("which vector", wl, command); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
arg_set(wordlist *wl, struct comm *command) |
|
|
|
arg_set(const wordlist *wl, const struct comm *command) |
|
|
|
{ |
|
|
|
common("which variable", wl, command); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
arg_display(wordlist *wl, struct comm *command) |
|
|
|
arg_display(const wordlist *wl, const struct comm *command) |
|
|
|
{ |
|
|
|
NG_IGNORE(wl); |
|
|
|
NG_IGNORE(command); |
|
|
|
@ -108,8 +109,8 @@ arg_display(wordlist *wl, struct comm *command) |
|
|
|
|
|
|
|
|
|
|
|
/* a common prompt routine */ |
|
|
|
static void |
|
|
|
common(char *string, struct wordlist *wl, struct comm *command) |
|
|
|
static void common(const char *string, const struct wordlist *wl, |
|
|
|
const struct comm *command) |
|
|
|
{ |
|
|
|
struct wordlist *w; |
|
|
|
char *buf; |
|
|
|
@ -125,11 +126,11 @@ common(char *string, struct wordlist *wl, struct comm *command) |
|
|
|
/* O.K. now call fn */ |
|
|
|
command->co_func(w); |
|
|
|
} |
|
|
|
} |
|
|
|
} /* end of function common */ |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
outmenuprompt(char *string) |
|
|
|
outmenuprompt(const char *string) |
|
|
|
{ |
|
|
|
fprintf(cp_out, "%s: ", string); |
|
|
|
fflush(cp_out); |
|
|
|
|