ldraw/mklist/include/conio.h

24 lines
564 B
C
Raw Normal View History

2020-09-19 23:38:13 +02:00
#ifndef CONIO_H
#define CONIO_H
#define getch() getc(stdin)
int stricmp(const char *str1, const char *str2)
{
const unsigned char * ptr1 = (unsigned char *) str1;
const unsigned char * ptr2 = (unsigned char *) str2;
unsigned char c1, c2;
while ((c1 = toupper(*ptr1++)) == (c2 = toupper(*ptr2++)))
{
if (!c1)
{
return(0); // end of both strings reached, so they match
}
}
// first non-matching char was reached, including possibly 0 on one or the other string
return(c1 - c2);
}
#endif /* CONIO_H */