Annotation of 43BSDReno/contrib/isode-beta/compat/lexnequ.c, revision 1.1.1.1

1.1       root        1: /* lexnequ.c - Compare two strings ignoring case upto n octets */
                      2: 
                      3: #ifndef lint
                      4: static char *rcsid = "$Header: /f/osi/compat/RCS/lexnequ.c,v 7.0 89/11/23 21:23:13 mrose Rel $";
                      5: #endif
                      6: 
                      7: /*
                      8:  * $Header: /f/osi/compat/RCS/lexnequ.c,v 7.0 89/11/23 21:23:13 mrose Rel $
                      9:  *
                     10:  *
                     11:  * $Log:       lexnequ.c,v $
                     12:  * Revision 7.0  89/11/23  21:23:13  mrose
                     13:  * Release 6.0
                     14:  * 
                     15:  */
                     16: 
                     17: /*
                     18:  *                                NOTICE
                     19:  *
                     20:  *    Acquisition, use, and distribution of this module and related
                     21:  *    materials are subject to the restrictions of a license agreement.
                     22:  *    Consult the Preface in the User's Manual for the full terms of
                     23:  *    this agreement.
                     24:  *
                     25:  */
                     26: 
                     27: 
                     28: /* LINTLIBRARY */
                     29: 
                     30: #include <stdio.h>
                     31: #include "general.h"
                     32: 
                     33: /*  */
                     34: 
                     35: lexnequ (str1, str2, len)
                     36: register char   *str1,
                     37:                *str2;
                     38: int             len;
                     39: {
                     40:     register int count = 1;
                     41: 
                     42:     if (str1 == NULL)
                     43:        if (str2 == NULL)
                     44:                return (0);
                     45:        else
                     46:                return (1);
                     47: 
                     48:     if (str2 == NULL)
                     49:        return (-1);
                     50: 
                     51:     while (chrcnv[*str1] == chrcnv[*str2++]) {
                     52:        if (count++ >= len)
                     53:            return (0);
                     54:        if (*str1++ == NULL)
                     55:            return (0);
                     56:     }
                     57: 
                     58:     str2--;
                     59:     if (chrcnv[*str1] > chrcnv[*str2])
                     60:        return (1);
                     61:     else
                     62:        return (-1);
                     63: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.