efl

Форк
0
61 строка · 1.7 Кб
1
/*
2
 * Emoji-related routine and data.
3
 *
4
 * Copyright (C) 2018 Andreas Röver <roever at users dot sf dot net>
5
 *
6
 * This software is provided 'as-is', without any express or implied
7
 * warranty.  In no event will the author be held liable for any damages
8
 * arising from the use of this software.
9
 *
10
 * Permission is granted to anyone to use this software for any purpose,
11
 * including commercial applications, and to alter it and redistribute
12
 * it freely, subject to the following restrictions:
13
 *
14
 * 1. The origin of this software must not be misrepresented; you must
15
 *    not claim that you wrote the original software.  If you use this
16
 *    software in a product, an acknowledgement in the product
17
 *    documentation would be appreciated but is not required.
18
 * 2. Altered source versions must be plainly marked as such, and must
19
 *    not be misrepresented as being the original software.
20
 * 3. This notice may not be removed or altered from any source
21
 *    distribution.
22
 */
23

24
/**
25
 * @file    emojidef.c
26
 *
27
 * Emoji-related routine and data that are used internally.
28
 *
29
 * @author  Andreas Röver
30
 */
31

32
#include "emojidef.h"
33
#include "emojidata.c"
34

35
/**
36
 * Finds out if a codepoint is extended pictographic.
37
 *
38
 * @param[in] ch  character to check
39
 * @return        \c true if the codepoint is extended pictographic;
40
 *                \c false otherwise
41
 */
42
bool ub_is_extended_pictographic(utf32_t ch)
43
{
44
    int min = 0;
45
    int max = ARRAY_LEN(ep_prop) - 1;
46
    int mid;
47

48
    do
49
    {
50
        mid = (min + max) / 2;
51

52
        if (ch < ep_prop[mid].start)
53
            max = mid - 1;
54
        else if (ch > ep_prop[mid].end)
55
            min = mid + 1;
56
        else
57
            return true;
58
    } while (min <= max);
59

60
    return false;
61
}
62

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.