Subversion Repositories HelenOS

Rev

Rev 3261 | Rev 3274 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3261 Rev 3271
Line 144... Line 144...
144
   
144
   
145
    while (a[c] && b[c] && (!(a[c] - b[c])))
145
    while (a[c] && b[c] && (!(a[c] - b[c])))
146
        c++;
146
        c++;
147
   
147
   
148
    return (a[c] - b[c]);
148
    return (a[c] - b[c]);
149
   
-
 
150
}
149
}
151
 
150
 
152
int strncmp(const char *a, const char *b, size_t n)
151
int strncmp(const char *a, const char *b, size_t n)
153
{
152
{
154
    size_t c = 0;
153
    size_t c = 0;
Line 158... Line 157...
158
   
157
   
159
    return ( c < n ? a[c] - b[c] : 0);
158
    return ( c < n ? a[c] - b[c] : 0);
160
   
159
   
161
}
160
}
162
 
161
 
-
 
162
int stricmp(const char *a, const char *b)
-
 
163
{
-
 
164
    int c = 0;
-
 
165
   
-
 
166
    while (a[c] && b[c] && (!(tolower(a[c]) - tolower(b[c]))))
-
 
167
        c++;
-
 
168
   
-
 
169
    return (tolower(a[c]) - tolower(b[c]));
-
 
170
}
-
 
171
 
163
/** Return pointer to the first occurence of character c in string.
172
/** Return pointer to the first occurence of character c in string.
164
 *
173
 *
165
 * @param str       Scanned string.
174
 * @param str       Scanned string.
166
 * @param c     Searched character (taken as one byte).
175
 * @param c     Searched character (taken as one byte).
167
 * @return      Pointer to the matched character or NULL if it is not
176
 * @return      Pointer to the matched character or NULL if it is not