// WARNING: This file is automatically generated by: scripts/update-keysyms-case-mappings.py
#pragma once

#include "config.h"

#include <stdint.h>
#include <unicode/uchar.h>

/* Unicode code points used in case mapping exceptions */
#define LATIN_SMALL_LETTER_SHARP_S   0x00df // ß
#define LATIN_CAPITAL_LETTER_SHARP_S 0x1e9e // ẞ

static inline uint32_t
to_simple_lower(uint32_t cp)
{
    return (uint32_t)u_tolower((UChar32) cp);
}

static inline uint32_t
to_simple_upper(uint32_t cp)
{
    switch (cp) {
    /* Some exceptions */
    case LATIN_SMALL_LETTER_SHARP_S:
        return LATIN_CAPITAL_LETTER_SHARP_S;
    /* Default to the Unicode simple mapping */
    default:
        return (uint32_t)u_toupper((UChar32) cp);
    }
}
