summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorandmarti1424 <andmarti@gmail.com>2015-08-05 09:54:35 -0300
committerandmarti1424 <andmarti@gmail.com>2015-08-05 09:54:35 -0300
commitf5da82418a2b7a972bcfce06d034277f6142a557 (patch)
treea84c8ded95c23275aebe50e8217a41e055037e5d /src
parentdceeb89ef73a17debe6f3ae2bd0d5d2edf255d38 (diff)
changed debug, error and info calls to scdebug, scerror and scinfo
Diffstat (limited to 'src')
-rw-r--r--src/interp.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/interp.c b/src/interp.c
index 8b1a1eb..5f034c1 100644
--- a/src/interp.c
+++ b/src/interp.c
@@ -143,7 +143,7 @@ double finfunc(int fun, double v1, double v2, double v3) {
}
break;
default:
- error("Unknown function in finfunc");
+ scerror("Unknown function in finfunc");
cellerror = CELLERROR;
return ((double)0);
}
@@ -204,7 +204,7 @@ double doindex(int minr, int minc, int maxr, int maxc, struct enode *val) {
r = minr + (int) eval(val) - 1;
c = minc;
} else {
- error("Improper indexing operation");
+ scerror("Improper indexing operation");
return (double) 0;
}
@@ -239,7 +239,7 @@ double dolookup(struct enode * val, int minr, int minc, int maxr, int maxc, int
else // useful when the lookup ends up in a cell with no value
p = *ATBL(tbl, fndr, fndc);
else {
- error(" range specified to @[hv]lookup");
+ scerror(" range specified to @[hv]lookup");
cellerror = CELLERROR;
}
if (p && p->flags&is_valid) {
@@ -263,7 +263,7 @@ double dolookup(struct enode * val, int minr, int minc, int maxr, int maxc, int
if (p->cellerror)
cellerror = CELLINVALID;
} else {
- error(" range specified to @[hv]lookup");
+ scerror(" range specified to @[hv]lookup");
cellerror = CELLERROR;
}
break;
@@ -502,7 +502,7 @@ double dodts(int e1, int e2, int e3) {
t.tm_isdst = -1;
if (mo < 0 || mo > 11 || day < 1 || day > mdays[mo] || (secs = mktime(&t)) == -1) {
- error("@dts: invalid argument or date out of range");
+ scerror("@dts: invalid argument or date out of range");
cellerror = CELLERROR;
return (0.0);
}
@@ -512,7 +512,7 @@ double dodts(int e1, int e2, int e3) {
double dotts(int hr, int min, int sec) {
if (hr < 0 || hr > 23 || min < 0 || min > 59 || sec < 0 || sec > 59) {
- error ("@tts: Invalid argument");
+ scerror ("@tts: Invalid argument");
cellerror = CELLERROR;
return ((double) 0);
}
@@ -911,7 +911,7 @@ double eval(register struct enode *e) {
case MAGENTA: return ((double) COLOR_MAGENTA);
case CYAN: return ((double) COLOR_CYAN);
case WHITE: return ((double) COLOR_WHITE);
- default: error ("Illegal numeric expression");
+ default: scerror ("Illegal numeric expression");
exprerr = 1;
}
cellerror = CELLERROR;
@@ -920,7 +920,7 @@ double eval(register struct enode *e) {
void eval_fpe() { /* Trap for FPE errors in eval */
#if defined(i386)
- debug("eval_fpe i386");
+ scdebug("eval_fpe i386");
asm(" fnclex");
asm(" fwait");
#else
@@ -1042,13 +1042,13 @@ char * doext(struct enode *se) {
command = seval(se->e.o.left);
value = eval(se->e.o.right);
if ( ! atoi(get_conf_value("external_functions")) ) {
- error("Warning: external functions disabled; using %s value",
+ scerror("Warning: external functions disabled; using %s value",
(se->e.o.s && *se->e.o.s) ? "previous" : "null");
if (command) scxfree(command);
} else {
if ((! command) || (! *command)) {
- error ("Warning: external function given null command name");
+ scerror ("Warning: external function given null command name");
cellerror = CELLERROR;
if (command) scxfree(command);
} else {
@@ -1057,18 +1057,18 @@ char * doext(struct enode *se) {
(void) sprintf(buff, "%s %g", command, value); /* build cmd line */
scxfree(command);
- error("Running external function...");
+ scerror("Running external function...");
//(void) refresh();
if ((pp = popen(buff, "r")) == (FILE *) NULL) { /* run it */
- error("Warning: running \"%s\" failed", buff);
+ scerror("Warning: running \"%s\" failed", buff);
cellerror = CELLERROR;
} else {
if (fgets(buff, sizeof(buff)-1, pp) == NULL) { /* one line */
- error("Warning: external function returned nothing");
+ scerror("Warning: external function returned nothing");
} else {
char *cp;
- error(""); /* erase notice */
+ //scerror(""); /* erase notice */
buff[sizeof(buff)-1] = '\0';
if ((cp = strchr(buff, '\n'))) /* contains newline */
@@ -1275,7 +1275,7 @@ char * seval(register struct enode *se) {
return (p);
}
default:
- error("Illegal string expression");
+ scerror("Illegal string expression");
exprerr = 1;
return (NULL);
}
@@ -1297,7 +1297,7 @@ int repct = 1; /* Make repct a global variable so that the
void setiterations(int i) {
if (i < 1) {
- error("iteration count must be at least 1");
+ scerror("iteration count must be at least 1");
propagation = 1;
} else
propagation = i;
@@ -1310,8 +1310,8 @@ void EvalAll() {
(void) signal(SIGFPE, eval_fpe);
while ((lastcnt = RealEvalAll()) && (++repct <= propagation));
- if ((propagation > 1) && (lastcnt > 0)) {
- error("Still changing after %d iterations", repct - 1);
+ if ((propagation > 1) && (lastcnt > 0) && ! atoi(get_conf_value("nocurses"))) {
+ scerror("Still changing after %d iterations", repct - 1);
}
/*
if (usecurses && color && has_colors()) {
@@ -1329,7 +1329,7 @@ void EvalAll() {
color = 0;
attron(COLOR_PAIR(0));
color_set(0, NULL);
- error("Error in color 1: color turned off");
+ scerror("Error in color 1: color turned off");
}
}
}
@@ -1361,7 +1361,7 @@ int RealEvalAll() {
}
}
else {
- error("Internal error calc_order");
+ scerror("Internal error calc_order");
}
return (chgct);
}
@@ -1372,7 +1372,7 @@ void RealEvalOne(register struct ent *p, int i, int j, int *chgct) {
if (p->flags & is_strexpr) {
char *v;
if (setjmp(fpe_save)) {
- error("Floating point exception %s", v_name(i, j));
+ scerror("Floating point exception %s", v_name(i, j));
cellerror = CELLERROR;
v = "";
} else {
@@ -1393,7 +1393,7 @@ void RealEvalOne(register struct ent *p, int i, int j, int *chgct) {
} else {
double v;
if (setjmp(fpe_save)) {
- error("Floating point exception %s", v_name(i, j));
+ scerror("Floating point exception %s", v_name(i, j));
cellerror = CELLERROR;
v = (double)0.0;
} else {
@@ -1560,7 +1560,7 @@ void copy(struct ent *dv1, struct ent *dv2, struct ent *v1, struct ent *v2) {
sync_refs();
flush_saved();
- error("Copying...");
+ scerror("Copying...");
if (!loading)
refresh();
// p = delbuf[dbidx];
@@ -1598,7 +1598,7 @@ void copy(struct ent *dv1, struct ent *dv2, struct ent *v1, struct ent *v2) {
// }
qbuf = 0;
}
- error("Copy done.");
+ scerror("Copy done.");
}
void copydbuf(int deltar, int deltac) {
@@ -1688,7 +1688,7 @@ void go_last() {
switch (gs.g_type) {
case G_NONE:
- error("Nothing to repeat");
+ scerror("Nothing to repeat");
break;
case G_NUM:
num_search(gs.g_n, gs.g_row, gs.g_col,
@@ -1706,7 +1706,7 @@ void go_last() {
break;
default:
- error("go_last: internal error");
+ scerror("go_last: internal error");
}
}
@@ -1738,7 +1738,7 @@ void moveto(int row, int col, int lastrow, int lastcol, int cornerrow, int corne
for (rowsinrange = 0, i = row; i <= lastrow; i++) {
if (row_hidden[i]) {
- info("Cell's row is hidden");
+ scinfo("Cell's row is hidden");
continue;
}
rowsinrange++;
@@ -1746,7 +1746,7 @@ void moveto(int row, int col, int lastrow, int lastcol, int cornerrow, int corne
for (colsinrange = 0, i = col; i <= lastcol; i++) {
if (col_hidden[i]) {
colsinrange = 0;
- info("Cell's col is hidden");
+ scinfo("Cell's col is hidden");
continue;
}
colsinrange += fwidth[i];
@@ -1804,9 +1804,9 @@ void num_search(double n, int firstrow, int firstcol, int lastrow, int lastcol,
break;
if (r == endr && c == endc) {
if (errsearch) {
- error("no %s cell found", errsearch == CELLERROR ? "ERROR" : "INVALID");
+ scerror("no %s cell found", errsearch == CELLERROR ? "ERROR" : "INVALID");
} else {
- error("Number not found");
+ scerror("Number not found");
}
return;
}
@@ -1840,7 +1840,7 @@ void str_search(char *s, int firstrow, int firstcol, int lastrow, int lastcol, i
scxfree(s);
tmp = scxmalloc((size_t)160);
regerror(errcode, &preg, tmp, sizeof(tmp));
- error(tmp);
+ scerror(tmp);
scxfree(tmp);
return;
}
@@ -1848,7 +1848,7 @@ void str_search(char *s, int firstrow, int firstcol, int lastrow, int lastcol, i
#if defined(RE_COMP)
if ((tmp = re_comp(s)) != NULL) {
scxfree(s);
- error(tmp);
+ scerror(tmp);
return;
}
#endif
@@ -1856,7 +1856,7 @@ void str_search(char *s, int firstrow, int firstcol, int lastrow, int lastcol, i
if ((tmp = regcmp(s, NULL)) == NULL) {
scxfree(s);
cellerror = CELLERROR;
- error("Invalid search string");
+ scerror("Invalid search string");
return;
}
#endif
@@ -1952,7 +1952,7 @@ void str_search(char *s, int firstrow, int firstcol, int lastrow, int lastcol, i
break;
}
if (r == endr && c == endc) {
- error("String not found");
+ scerror("String not found");
#if defined(REGCOMP)
regfree(&preg);
#endif
@@ -2021,7 +2021,7 @@ void fill(struct ent *v1, struct ent *v2, double start, double inc) {
}
}
else {
- error(" Internal error calc_order");
+ scerror(" Internal error calc_order");
}
changed++;
}
@@ -2114,7 +2114,7 @@ void let(struct ent *v, struct enode *e) {
exprerr = 0;
(void) signal(SIGFPE, eval_fpe);
if (setjmp(fpe_save)) {
- error("Floating point exception in cell %s", v_name(v->row, v->col));
+ scerror("Floating point exception in cell %s", v_name(v->row, v->col));
val = (double)0.0;
cellerror = CELLERROR;
} else {
@@ -2169,7 +2169,7 @@ void slet(struct ent *v, struct enode *se, int flushdir) {
exprerr = 0;
(void) signal(SIGFPE, eval_fpe);
if (setjmp(fpe_save)) {
- error ("Floating point exception in cell %s", v_name(v->row, v->col));
+ scerror ("Floating point exception in cell %s", v_name(v->row, v->col));
cellerror = CELLERROR;
p = "";
} else {