Table of Contents


match, partialstreq - minimal match of sub-strings


int match (istring, compar, mask)
char *istring, *compar;
int *mask;
int partialstreq(a,i1,i2,b,j1,j2)
char *a, *b;
int i1, i2, j1, j2;

Descriptionmatch performs a minimal match of sub-strings in istring with
substrings in the compare string compar. The result is returned in mask:
if a match is possible with the I-th substring in compar, then the I-th bit
in mask will be set. I can be 1..sizeof(int). The comparison is only done for
all printable  ASCII characters except for the blank and the comma, since
they are used as substring delimiters. A helper function partialstreq is
used to partially compare two strings a and b from positions i1..i2 in  a,
and positions j1..j2 in b. The indeces are 0 based, i.e. the first character
in a string has i1=j1=0 
Match Error Return Code
1       no error
0    length of input string is zero
-1    length of compare string is zero
-2    a sub-string in istring can be matched in more than one sub-string in compar
-3    no sub-string in istring can be matched to any sub-string in compar.
LimitationsSince mask is used, there can only be up to sizeof(int) (normally
32) options. See Alsowild(3NEMO) AuthorPeter Teuben Update History
16-may-91    include into NEMO -adapted from Gipsy version     PJT
7-may-92    man page written    PJT

Table of Contents