1 /* fribidi-brackets.h - get bracket character property
3 * Copyright (C) 2004 Sharif FarsiWeb, Inc
4 * Copyright (C) 2001, 2002, 2004 Behdad Esfahbod
5 * Copyright (C) 1999, 2000, 2017 Dov Grobgeld
7 * This file is part of GNU FriBidi.
9 * GNU FriBidi is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GNU FriBidi is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with GNU FriBidi; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 * For licensing issues, contact <fribidi.license@gmail.com> or write to
24 * Sharif FarsiWeb, Inc., PO Box 13445-389, Tehran, Iran.
27 * Behdad Esfahbod, 2001, 2002, 2004
28 * Dov Grobgeld, 1999, 2000, 2017
30 #ifndef _FRIBIDI_BRACKETS_H
31 #define _FRIBIDI_BRACKETS_H
33 #include "fribidi-common.h"
35 #include "fribidi-types.h"
36 #include "fribidi-bidi-types.h"
38 #include "fribidi-begindecls.h"
40 /* fribidi_get_bracket - get bracketed character
42 * This function finds the bracketed equivalent of a character as defined in
43 * the file BidiBrackets.txt of the Unicode Character Database available at
44 * http://www.unicode.org/Public/UNIDATA/BidiBrackets.txt.
46 * If the input character is a declared as a brackets character in the
47 * Unicode standard and has a bracketed equivalent. The matching bracketed
48 * character is put in the output, otherwise the input character itself is
51 * Returns: The bracket type of the character. Use the
52 * FRIBIDI_IS_BRACKET(FriBidiBracketType) to test if it is a valid
55 FRIBIDI_ENTRY FriBidiBracketType fribidi_get_bracket (
56 FriBidiChar ch /* input character */
59 /* fribidi_get_bracket_types - get bracketed characters
61 * This function finds the bracketed characters of an string of characters.
62 * See fribidi_get_bracket() for more information about the bracketed
63 * characters returned by this function.
66 fribidi_get_bracket_types (
67 const FriBidiChar *str, /* input string */
68 const FriBidiStrIndex len, /* input string length */
69 const FriBidiCharType *types, /* input bidi types */
70 FriBidiBracketType *btypes /* output bracketed characters */
73 #define FRIBIDI_BRACKET_OPEN_MASK 0x80000000
74 #define FRIBIDI_BRACKET_ID_MASK 0x7fffffff
75 #define FRIBIDI_IS_BRACKET_OPEN(bt) ((bt & FRIBIDI_BRACKET_OPEN_MASK)>0)
76 #define FRIBIDI_BRACKET_ID(bt) ((bt & FRIBIDI_BRACKET_ID_MASK))
78 #include "fribidi-enddecls.h"
80 #endif /* !_FRIBIDI_BRACKETS_H */
88 * vim: textwidth=78: autoindent: cindent: shiftwidth=2: tabstop=8: