hb-common.h revision cc4c096a7e08ae96b3030fe27f871ce5b797f370
164aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod/* 26c78683c042250a7b5a6fc6ebae4717b03fadf9eBehdad Esfahbod * Copyright (C) 2007,2008,2009 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 30cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#ifdef _MSC_VER 31cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#warning "Not using stdint.h. Integer types may have wrong size." 32cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef signed char int8_t; 33cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef unsigned char uint8_t; 34cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef signed short int16_t; 35cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef unsigned short uint16_t; 36cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef signed int int32_t; 37cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef unsigned int uint32_t; 38cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#ifndef __cplusplus 39cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#define inline __inline 40cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#endif 41cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#else 428dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#include <stdint.h> 43cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#endif 448dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod 458dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod# ifdef __cplusplus 46f96ffd43bce0ac6d9c897933c9be0e51d543e570Behdad Esfahbod# define HB_BEGIN_DECLS extern "C" { 47f96ffd43bce0ac6d9c897933c9be0e51d543e570Behdad Esfahbod# define HB_END_DECLS } 488dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod# else /* !__cplusplus */ 49f96ffd43bce0ac6d9c897933c9be0e51d543e570Behdad Esfahbod# define HB_BEGIN_DECLS 50f96ffd43bce0ac6d9c897933c9be0e51d543e570Behdad Esfahbod# define HB_END_DECLS 518dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod# endif /* !__cplusplus */ 528dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod 53590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbodtypedef int hb_bool_t; 54590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod 55590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbodtypedef uint32_t hb_tag_t; 56590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad 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)) 57590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod#define HB_TAG_STR(s) (HB_TAG(((const char *) s)[0], \ 58590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod ((const char *) s)[1], \ 59590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod ((const char *) s)[2], \ 60590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod ((const char *) s)[3])) 610ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod#define HB_TAG_NONE HB_TAG(0,0,0,0) 62590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod 632d15e72c75931398db5e027e660f1320bb979117Behdad Esfahbodtypedef uint32_t hb_codepoint_t; 64c7d457aa3ae7138630f52ca7263f663a3ea284c0Behdad Esfahbodtypedef int32_t hb_position_t; 65c7d457aa3ae7138630f52ca7263f663a3ea284c0Behdad Esfahbodtypedef int32_t hb_16dot16_t; 66468769b8f5332940278244e744ec2bd5a5dc5ee9Behdad Esfahbodtypedef uint32_t hb_mask_t; 67590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod 680090dc0f67b553d2f6eaaedc289c0956ade09ef6Behdad Esfahbodtypedef void (*hb_destroy_func_t) (void *user_data); 690090dc0f67b553d2f6eaaedc289c0956ade09ef6Behdad Esfahbod 708dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#endif /* HB_COMMON_H */ 71