2 * run.h - text run data type
4 * $Id: run.h,v 1.10 2011-05-04 18:04:29 behdad Exp $
6 * $Date: 2011-05-04 18:04:29 $
8 * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/run.h,v $
11 * Behdad Esfahbod, 2001, 2002, 2004
12 * Dov Grobgeld, 1999, 2000
14 * Copyright (C) 2004 Sharif FarsiWeb, Inc
15 * Copyright (C) 2001,2002 Behdad Esfahbod
16 * Copyright (C) 1999,2000 Dov Grobgeld
18 * This library is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU Lesser General Public
20 * License as published by the Free Software Foundation; either
21 * version 2.1 of the License, or (at your option) any later version.
23 * This library is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 * Lesser General Public License for more details.
28 * You should have received a copy of the GNU Lesser General Public License
29 * along with this library, in a file named COPYING; if not, write to the
30 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
31 * Boston, MA 02110-1301, USA
33 * For licensing issues, contact <license@farsiweb.info>.
40 #include <fribidi-common.h>
42 #include <fribidi-types.h>
43 #include <fribidi-bidi-types.h>
45 #include <fribidi-begindecls.h>
47 typedef struct _FriBidiRunStruct FriBidiRun;
49 struct _FriBidiRunStruct
54 FriBidiStrIndex pos, len;
60 #define new_run FRIBIDI_PRIVATESPACE(new_run)
65 FRIBIDI_GNUC_HIDDEN FRIBIDI_GNUC_MALLOC FRIBIDI_GNUC_WARN_UNUSED;
67 #define free_run FRIBIDI_PRIVATESPACE(free_run)
70 ) FRIBIDI_GNUC_HIDDEN;
72 #define new_run_list FRIBIDI_PRIVATESPACE(new_run_list)
73 FriBidiRun *new_run_list (
76 FRIBIDI_GNUC_HIDDEN FRIBIDI_GNUC_MALLOC FRIBIDI_GNUC_WARN_UNUSED;
78 #define free_run_list FRIBIDI_PRIVATESPACE(free_run_list)
81 ) FRIBIDI_GNUC_HIDDEN;
83 #define run_list_encode_bidi_types FRIBIDI_PRIVATESPACE(run_list_encode_bidi_types)
84 FriBidiRun *run_list_encode_bidi_types (
85 const FriBidiCharType *bidi_types,
86 const FriBidiStrIndex len
88 FRIBIDI_GNUC_HIDDEN FRIBIDI_GNUC_WARN_UNUSED;
90 #define shadow_run_list FRIBIDI_PRIVATESPACE(shadow_run_list)
91 fribidi_boolean shadow_run_list (
94 fribidi_boolean preserve_length
96 FRIBIDI_GNUC_HIDDEN FRIBIDI_GNUC_WARN_UNUSED;
107 #define merge_lists(a,b) \
109 swap((a)->prev->next, (b)->prev->next); \
110 swap((a)->prev, (b)->prev); \
113 #define delete_node(x) \
115 (x)->prev->next = (x)->next; \
116 (x)->next->prev = (x)->prev; \
119 #define insert_node_before(x, list) \
121 (x)->prev = (list)->prev; \
122 (list)->prev->next = (x); \
123 (x)->next = (list); \
124 (list)->prev = (x); \
127 #define move_node_before(x, list) \
132 insert_node_before((x), (list)); \
135 #define for_run_list(x, list) \
136 for ((x) = (list)->next; (x)->type != FRIBIDI_TYPE_SENTINEL; (x) = (x)->next)
141 #define fribidi_validate_run_list FRIBIDI_PRIVATESPACE(validate_run_list)
142 void fribidi_validate_run_list (
143 FriBidiRun *run_list /* input run list */
144 ) FRIBIDI_GNUC_HIDDEN;
148 #define fribidi_validate_run_list(run_list) fribidi_assert(run_list)
152 #include <fribidi-enddecls.h>
155 /* Editor directions:
156 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent