/*
 * solid_compat.c — Solid-C compatibility helpers that need real code
 * (rather than just header macros).
 *
 * CP866 Cyrillic support: strlwr/strupr handle uppercase/lowercase
 * conversion for both Latin and Cyrillic characters in CP866 code page
 * (bytes 0x80–0xFF).
 */

#include <sprinter_compat.h>
#include <ctype.h>

char *strupr(char *s)
{
    char *p = s;
    while (*p) {
        if ((*p >= 'a' && *p <= 'z') || (*p >= 0xA0 && *p <= 0xAF)) *p -= 'a' - 'A';
        else if ((*p >= 0xE0 && *p <= 0xEF)) *p -= 0x50;
        else if ((*p == 0xF1)) *p = 0xF0;
        p++;
    }
    return s;
}
