Imported Upstream version 0.19.7
[platform/upstream/fribidi.git] / lib / fribidi-shape.c
1 /* FriBidi
2  * fribidi-shape.c - shaping
3  *
4  * $Id: fribidi-shape.c,v 1.1 2005-11-03 01:39:01 behdad Exp $
5  * $Author: behdad $
6  * $Date: 2005-11-03 01:39:01 $
7  * $Revision: 1.1 $
8  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-shape.c,v $
9  *
10  * Authors:
11  *   Behdad Esfahbod, 2001, 2002, 2004
12  *   Dov Grobgeld, 1999, 2000
13  *
14  * Copyright (C) 2005 Behdad Esfahbod
15  * 
16  * This library is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU Lesser General Public
18  * License as published by the Free Software Foundation; either
19  * version 2.1 of the License, or (at your option) any later version.
20  * 
21  * This library is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24  * Lesser General Public License for more details.
25  * 
26  * You should have received a copy of the GNU Lesser General Public License
27  * along with this library, in a file named COPYING; if not, write to the
28  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
29  * Boston, MA 02110-1301, USA
30  * 
31  * For licensing issues, contact <license@farsiweb.info>.
32  */
33
34 #include "common.h"
35
36 #include <fribidi-shape.h>
37 #include <fribidi-mirroring.h>
38 #include <fribidi-arabic.h>
39
40
41 FRIBIDI_ENTRY void
42 fribidi_shape (
43   /* input */
44   FriBidiFlags flags,
45   const FriBidiLevel *embedding_levels,
46   const FriBidiStrIndex len,
47   /* input and output */
48   FriBidiArabicProp *ar_props,
49   FriBidiChar *str
50 )
51 {
52   if UNLIKELY
53     (len == 0 || !str) return;
54
55   DBG ("in fribidi_shape");
56
57   fribidi_assert (embedding_levels);
58
59   if (ar_props)
60     fribidi_shape_arabic (flags, embedding_levels, len, ar_props, str);
61
62   if (FRIBIDI_TEST_BITS (flags, FRIBIDI_FLAG_SHAPE_MIRRORING))
63     fribidi_shape_mirroring (embedding_levels, len, str);
64 }
65
66
67 /* Editor directions:
68  * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
69  */