int spfind(name)
char *name; /* specification to be found */
The spfind function searches for the specification name
from the **spa
list which has been created by the sp_init function earlier.
If name
is found, spfind returns the index (say i
) of name in the **spa
list. spb[i
] is then the pointer to the value of name and spshad[i
] the
pointer to the shadow characters of value. If name is not found, -1 is
returned.
int i,k,x_home,y_home;
char x[LLENGTH]; *px[2];
i=sp_init(r1+r-1); /* r1+r-1 is the current line in the edit field */
if (i<0) return;
i=spfind("HOME");
if (i>=0)
{
strcpy(x,spb[i]);
k=split(x,px,2);
if (k<0)
{
sprintf(sbuf,"\nError in spec. HOME=%s",spb[i]);
sur_print(sbuf); WAIT; return;
}
x_home=atoi(px[0]);
y_home=atoi(px[1]);
}
else x_home=y_home=0;