] * sizeof(token_type)); *np = n_lhs[i]; } list_proc(equation, *np, false); fprintf(gfp, "\n"); return cp2; } return parse_section(equation, np, cp); } /* * Get an expression from the user. * The prompt must be previously copied into the global prompt_str[]. * * Return true if successful. */ int get_expr(equation, np) token_type *equation; /* where the parsed expression is stored (equation side) */ int *np; /* pointer to the returned parsed expression length */ { char buf[DEFAULT_N_TOKENS]; char *cp; for (;;) { if ((cp = get_string(buf, sizeof(buf))) == NULL) { return false; } if (!case_sensitive_flag) { str_tolower(cp); } cp = parse_expr(equation, np, cp); if (cp && !extra_characters(cp)) { break; } } return(*np > 0); } /* * Prompt for a variable name from the user. * * Return true if successful. */ int prompt_var(vp) long *vp; /* pointer to the returned variable */ { char buf[MAX_CMD_LEN]; char *cp; for (;;) { my_strlcpy(prompt_str, _("Enter variable: "), sizeof(prompt_str)); if ((cp = get_string(buf, sizeof(buf))) == NULL) { return false; } if (*cp == '\0') { return false; } cp = parse_var2(vp, cp); if (cp == NULL || extra_characters(cp)) { continue; } return true; } } /* * Return true and display a message if equation "i" is undefined. */ int not_defined(i) int i; /* equation space number */ { if (i < 0 || i >= n_equations) { error(_("Invalid equation number.")); return true; } if (n_lhs[i] <= 0) { error(_("Equation space is empty.")); return true; } return false; } /* * Verify that a current equation or expression is loaded. * * Return true and display a message if current equation