2018-04-25 19:30:49 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
|
2018-04-25 16:13:34 +02:00
|
|
|
#ifndef __TRANSLITERATION_H
|
|
|
|
#define __TRANSLITERATION_H
|
|
|
|
|
2018-04-25 18:54:47 +02:00
|
|
|
#include "syllable.h"
|
|
|
|
|
2018-04-25 18:11:56 +02:00
|
|
|
|
2018-04-27 18:58:07 +02:00
|
|
|
#define FLAG_REGULAR 1 << 0
|
|
|
|
#define FLAG_MODIFIER 1 << 1
|
2018-04-25 18:54:47 +02:00
|
|
|
|
2018-04-30 18:14:39 +02:00
|
|
|
typedef void (*transliteration_filter_t)(struct syllable *syllable_chain);
|
|
|
|
|
2018-04-27 18:58:07 +02:00
|
|
|
struct transliteration_letter {
|
2018-04-29 08:21:46 +02:00
|
|
|
unsigned int code;
|
2018-04-27 18:58:07 +02:00
|
|
|
unsigned int flags;
|
|
|
|
const char *data;
|
2018-04-25 18:54:47 +02:00
|
|
|
};
|
|
|
|
|
2018-04-25 18:11:56 +02:00
|
|
|
struct transliteration_context {
|
2018-04-27 18:58:07 +02:00
|
|
|
const struct transliteration_letter *table;
|
2018-04-30 18:14:39 +02:00
|
|
|
const transliteration_filter_t *filters;
|
2018-04-25 18:11:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
char *transliterate_devanagari_to_latin(const char *text,
|
|
|
|
struct transliteration_context *context);
|
2018-04-25 16:13:34 +02:00
|
|
|
|
2018-04-27 11:59:32 +02:00
|
|
|
void transliteration_context_drop(struct transliteration_context *context);
|
|
|
|
|
2018-04-25 16:13:34 +02:00
|
|
|
#endif /* __TRANSLITERATION_H */
|