Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:27

0001 /* FriBidi
0002  * fribidi-types.h - define data types for the rest of the library
0003  *
0004  * Author:
0005  *   Behdad Esfahbod, 2001, 2002, 2004
0006  *
0007  * Copyright (C) 2004 Sharif FarsiWeb, Inc.
0008  * Copyright (C) 2001,2002 Behdad Esfahbod
0009  * 
0010  * This library is free software; you can redistribute it and/or
0011  * modify it under the terms of the GNU Lesser General Public
0012  * License as published by the Free Software Foundation; either
0013  * version 2.1 of the License, or (at your option) any later version.
0014  * 
0015  * This library is distributed in the hope that it will be useful,
0016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0018  * Lesser General Public License for more details.
0019  * 
0020  * You should have received a copy of the GNU Lesser General Public License
0021  * along with this library, in a file named COPYING; if not, write to the
0022  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0023  * Boston, MA 02110-1301, USA
0024  *
0025  * For licensing issues, contact <fribidi.license@gmail.com>.
0026  */
0027 #ifndef _FRIBIDI_TYPES_H
0028 #define _FRIBIDI_TYPES_H
0029 
0030 #include "fribidi-common.h"
0031 
0032 #include "fribidi-begindecls.h"
0033 
0034 
0035 # if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
0036      defined (_sgi) || defined (__sun) || defined (sun) || \
0037      defined (__digital__) || defined (__HP_cc)
0038 #  include <inttypes.h>
0039 # elif defined (_AIX)
0040 #  include <sys/inttypes.h>
0041 # else
0042 #  include <stdint.h>
0043 # endif
0044 
0045 typedef int fribidi_boolean;
0046 
0047 typedef uint32_t FriBidiChar;
0048 typedef int FriBidiStrIndex;
0049 
0050 /* The MSB is used to indicate an opening bracket */
0051 typedef FriBidiChar FriBidiBracketType;
0052 
0053 /* Use FRIBIDI_NO_BRACKET for assigning to a non-bracket */
0054 #define FRIBIDI_NO_BRACKET 0
0055 
0056 /* A few macros for working with bits */
0057 
0058 #define FRIBIDI_TEST_BITS(x, mask) (((x) & (mask)) ? 1 : 0)
0059 
0060 #define FRIBIDI_INCLUDE_BITS(x, mask) ((x) | (mask))
0061 
0062 #define FRIBIDI_EXCLUDE_BITS(x, mask) ((x) & ~(mask))
0063 
0064 #define FRIBIDI_SET_BITS(x, mask)   ((x) |= (mask))
0065 
0066 #define FRIBIDI_UNSET_BITS(x, mask) ((x) &= ~(mask))
0067 
0068 #define FRIBIDI_ADJUST_BITS(x, mask, cond)  \
0069     ((x) = ((x) & ~(mask)) | ((cond) ? (mask) : 0))
0070 
0071 #define FRIBIDI_ADJUST_AND_TEST_BITS(x, mask, cond) \
0072     FRIBIDI_TEST_BITS(FRIBIDI_ADJUST_BITS((x), (mask), (cond)), (mask))
0073 
0074 #include "fribidi-enddecls.h"
0075 
0076 #endif /* !_FRIBIDI_TYPES_H */
0077 /* Editor directions:
0078  * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
0079  */