
#include <ctype.h>

int cistrcmp(const char *ps1, const char *ps2)
{
        char c1, c2;

        while (1) {
                c1 = toupper(*ps1);
                c2 = toupper(*ps2);

                if (c1 < c2)
                        return -1;
                else if (c1 > c2)
                        return 1;
                else if (c1 == '\0')
                        return 0;
                else {
                        ++ps1;
                        ++ps2;
                }
        }
}

