File indexing completed on 2018-03-02 18:45:00 UTC
view on githubraw file Latest commit ec6cf3b0 on 2003-08-26 20:45:25 UTC
ec6cf3b09d Ed H*0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include <ctype.h>
0030
0031 static unsigned char upcase[256] = {
0032 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0033 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
0034 ' ','!','"','#','$','%','&', 39,'(',')','*','+',',','-','.','/',
0035 '0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?',
0036 '@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
0037 'P','Q','R','S','T','U','V','W','X','Y','Z','[', 92,']','^','_',
0038 '`','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
0039 'P','Q','R','S','T','U','V','W','X','Y','Z','{','|','}','~',127,
0040 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
0041 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
0042 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
0043 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
0044 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
0045 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
0046 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
0047 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255};
0048
0049 #define UPC(x) (upcase[(unsigned char)(x)])
0050
0051
0052
0053
0054 int
0055 strcasecmp(register char *s1, register char *s2)
0056 {
0057 register char c1;
0058 while ((c1 = *s1) && UPC(c1) == UPC(*s2)) {
0059 s1++;
0060 s2++;
0061 }
0062 return UPC(c1) - UPC(*s2);
0063 }
0064
0065
0066
0067
0068 int
0069 strncasecmp(register char *s1, register char *s2, int n)
0070 {
0071 register char c1;
0072 while (n-- && (c1 = *s1) && UPC(c1) == UPC(*s2)) {
0073 s1++;
0074 s2++;
0075 }
0076 if (n == -1) return 0;
0077 return UPC(c1) - UPC(*s2);
0078 }
0079