DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦f7564fd4c⟧ TextFile

    Length: 417 (0x1a1)
    Types: TextFile
    Names: »cistrncmp.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/euug-87hel/sec1/news/misc/search/lib/cistrncmp.c« 

TextFile

/* Case-independent strncmp. */

#include "defs.h"

int
cistrncmp(s1, s2, len)
	register char *s1, *s2;
	int len;
{
	register c1, c2;
	
	while (--len >= 0) {
		c1= *s1++;
		c2= *s2++;
		if (c1 == c2) {
			if (c1 == EOS)
				return 0;
		}
		else {
			if (isupper(c1))
				c1= _tolower(c1);
			if (isupper(c2))
				c2= _tolower(c2);
			if (c1 < c2)
				return -1;
			else if (c1 > c2)
				return 1;
		}
	}
	return 0;
}