File: isfunc.c

package info (click to toggle)
wcalc 2.2.2-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,228 kB
  • ctags: 698
  • sloc: ansic: 6,918; objc: 1,835; sh: 766; yacc: 644; lex: 573; makefile: 78
file content (31 lines) | stat: -rw-r--r-- 670 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
#include <string.h>
#ifdef MEMWATCH
#include "memwatch.h"
#endif

static char *funcs[] = { "sin", "cos", "tan", "cot",
    "asin", "acos", "atan", "acot",
    "arcsin", "arccos", "arctan", "arccot",
    "sinh", "cosh", "tanh", "coth",
    "asinh", "acosh", "atanh", "acoth",
    "areasinh", "areacosh", "areatanh", "areacoth",
    "log", "logtwo", "ln",
    "round", "abs", "floor", "ceil", "ceiling",
    "sqrt", "cbrt",
    "exp", "fact", "comp",
    "rand", "irand",
    "Gamma","lngamma","lnGamma","zeta","sinc",
    0
};

int isfunc(char *str)
{
    size_t i;

    for (i = 0; funcs[i]; i++) {
	if (!strcmp(funcs[i], str)) {
	    return 1;
	}
    }
    return 0;
}