File: isconst.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 (27 lines) | stat: -rw-r--r-- 699 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
#include <string.h>
#ifdef MEMWATCH
#include "memwatch.h"
#endif

static char *consts[] = {
    "e","pi","PI","pI","Pi","random","irandom","Na","NA",
    "k","Cc","ec","R","G","g","Me","Mp","Mn","Md","u",
    "amu","c","h","mu0","muzero","muZERO","epsilonzero",
    "epsilonZERO","epsilon0","EPSILONzero","EPSILONZERO","EPSILON0",
    "muB","b","ao","F","Vm","NAk","eV","sigma","alpha","gamma","re",
    "Kj","Rk","Rinf","Eh","Gf","Mmu","Mt","Mtau","Mh","Malpha","n0",
    "nzero","c1","c2","G0","Gzero","Z0","Zzero","Phi0","Phizero","PhiZERO",
    0
};

int isconst(char *str)
{
    size_t i;

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