summaryrefslogtreecommitdiff
path: root/src/locale/include/strxfrm.h
blob: a40f7596e31856599348105711babc6f85292c17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright 2023 jacqueline <me@jacqueline.id.au>
 *
 * SPDX-License-Identifier: GPL-3.0-only
 */

#pragma once

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
  uint_fast32_t nrules;
  unsigned char* rulesets;
  unsigned char* weights;
  int32_t* table;
  unsigned char* extra;
  int32_t* indirect;
} locale_data_t;

bool parse_locale_data(const void* raw_data, size_t size, locale_data_t* out);

size_t glib_strxfrm(char* dest,
                    const char* src,
                    size_t n,
                    locale_data_t* locale);

#ifdef __cplusplus
}
#endif