diff options
Diffstat (limited to 'include/conio.h')
-rw-r--r-- | include/conio.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/conio.h b/include/conio.h new file mode 100644 index 000000000..820295756 --- /dev/null +++ b/include/conio.h @@ -0,0 +1,23 @@ +#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 */
|