layers.cpp
/* * CIF Layer name storage and lookup functions. * See "cif2ps.c" for authors' names and addresses. * Please honor the authors by not removing their attributions. */ #include "stdafx.h" #include "define.h" ciflayer layers[MAXLAYERS]; int order[MAXLAYERS]; int layer, numlayers; int layer_lookup(char *name) /* assigns a unique number to each CIF layer */ { int i; for (i=0; i<numlayers; i++) { if (layers[i].name==name) return(i); } /* layer was not found so define it */ if (numlayers>=MAXLAYERS) { fprintf(stderr,"Too many layers\n"); exit(1); } layers[numlayers].name = name; return(numlayers++); }
Maintained by John Loomis, updated Mon Feb 12 23:32:48 2007