hb-common.h revision f96ffd43bce0ac6d9c897933c9be0e51d543e570
164aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod/*
264aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * Copyright (C) 2007,2008  Red Hat, Inc.
364aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod *
464aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod *  This is part of HarfBuzz, an OpenType Layout engine library.
564aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod *
664aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * Permission is hereby granted, without written agreement and without
764aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * license or royalty fees, to use, copy, modify, and distribute this
864aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * software and its documentation for any purpose, provided that the
964aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * above copyright notice and the following two paragraphs appear in
1064aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * all copies of this software.
1164aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod *
1264aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
1364aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
1464aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
1564aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
1664aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * DAMAGE.
1764aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod *
1864aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
1964aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
2064aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
2164aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
2264aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
2364aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod *
2464aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * Red Hat Author(s): Behdad Esfahbod
2564aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod */
2664aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod
278dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#ifndef HB_COMMON_H
288dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#define HB_COMMON_H
298dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod
308dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#include <stdint.h>
318dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod
328dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod# ifdef __cplusplus
33f96ffd43bce0ac6d9c897933c9be0e51d543e570Behdad Esfahbod#  define HB_BEGIN_DECLS	extern "C" {
34f96ffd43bce0ac6d9c897933c9be0e51d543e570Behdad Esfahbod#  define HB_END_DECLS		}
358dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod# else /* !__cplusplus */
36f96ffd43bce0ac6d9c897933c9be0e51d543e570Behdad Esfahbod#  define HB_BEGIN_DECLS
37f96ffd43bce0ac6d9c897933c9be0e51d543e570Behdad Esfahbod#  define HB_END_DECLS
388dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod# endif /* !__cplusplus */
398dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod
40590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbodtypedef int hb_bool_t;
41590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod
42590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbodtypedef uint32_t hb_tag_t;
43590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod#define HB_TAG(a,b,c,d) ((hb_tag_t)(((uint8_t)a<<24)|((uint8_t)b<<16)|((uint8_t)c<<8)|(uint8_t)d))
44590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod#define HB_TAG_STR(s)   (HB_TAG(((const char *) s)[0], \
45590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod				((const char *) s)[1], \
46590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod				((const char *) s)[2], \
47590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod				((const char *) s)[3]))
48590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod
492d15e72c75931398db5e027e660f1320bb979117Behdad Esfahbodtypedef uint32_t hb_codepoint_t;
50c7d457aa3ae7138630f52ca7263f663a3ea284c0Behdad Esfahbodtypedef int32_t hb_position_t;
51c7d457aa3ae7138630f52ca7263f663a3ea284c0Behdad Esfahbodtypedef int32_t hb_16dot16_t;
52590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod
538dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#endif /* HB_COMMON_H */
54