main_LDADD = libharfbuzz.la $(HBLIBS)
TESTS = \
+ check-c-linkage-decls.sh \
check-header-guards.sh \
check-internal-symbols.sh \
$(NULL)
--- /dev/null
+#!/bin/sh
+
+LC_ALL=C
+export LC_ALL
+
+test -z "$srcdir" && srcdir=.
+stat=0
+
+cd "$srcdir"
+
+for x in *.c *.cc *.h *.hh ; do
+ if ! grep -q HB_BEGIN_DECLS "$x" || ! grep -q HB_END_DECLS "$x"; then
+ echo "Ouch, file $x does not HB_BEGIN_DECLS / HB_END_DECLS"
+ stat=1
+ fi
+done
+
+exit $stat
HB_BEGIN_DECLS
+
struct _hb_blob_t {
hb_reference_count_t ref_count;
extern HB_INTERNAL hb_blob_t _hb_blob_nil;
+
HB_END_DECLS
#endif /* HB_BLOB_PRIVATE_H */
#include <sys/mman.h>
#endif /* HAVE_SYS_MMAN_H */
+#include <stdio.h>
+#include <errno.h>
+
+HB_BEGIN_DECLS
+
+
#ifndef HB_DEBUG_BLOB
#define HB_DEBUG_BLOB HB_DEBUG+0
#endif
-#include <stdio.h>
-#include <errno.h>
-
hb_blob_t _hb_blob_nil = {
HB_REFERENCE_COUNT_INVALID, /* ref_count */
}
static void
-_try_writable_inplace_locked (hb_blob_t *blob)
+try_writable_inplace_locked (hb_blob_t *blob)
{
if (HB_DEBUG_BLOB)
fprintf (stderr, "%p %s: making writable\n", blob, __FUNCTION__);
hb_mutex_lock (blob->lock);
if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE)
- _try_writable_inplace_locked (blob);
+ try_writable_inplace_locked (blob);
mode = blob->mode;
hb_mutex_lock (blob->lock);
if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE)
- _try_writable_inplace_locked (blob);
+ try_writable_inplace_locked (blob);
if (blob->mode == HB_MEMORY_MODE_READONLY)
{
return mode == HB_MEMORY_MODE_WRITABLE;
}
+
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
typedef enum {
HB_MEMORY_MODE_DUPLICATE,
HB_MEMORY_MODE_READONLY,
hb_bool_t
hb_blob_try_writable (hb_blob_t *blob);
+
HB_END_DECLS
#endif /* HB_BLOB_H */
HB_BEGIN_DECLS
+
#define HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN 0xFFFF
#include <string.h>
+HB_BEGIN_DECLS
+
static hb_buffer_t _hb_buffer_nil = {
HB_REFERENCE_COUNT_INVALID, /* ref_count */
return likely (size <= buffer->allocated) ? TRUE : _hb_buffer_enlarge (buffer, size);
}
-static hb_bool_t
+static inline hb_bool_t
_hb_buffer_ensure_separate (hb_buffer_t *buffer, unsigned int size)
{
if (unlikely (!_hb_buffer_ensure (buffer, size))) return FALSE;
ADD_UTF (uint32_t);
#undef UTF_NEXT
}
+
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
typedef struct _hb_buffer_t hb_buffer_t;
typedef struct _hb_glyph_info_t {
#include "hb-private.h"
+HB_BEGIN_DECLS
+
+
hb_tag_t
hb_tag_from_string (const char *s)
{
return HB_TAG_STR (tag);
}
+
+
+HB_END_DECLS
#ifndef HB_COMMON_H
#define HB_COMMON_H
+# ifdef __cplusplus
+# define HB_BEGIN_DECLS extern "C" {
+# define HB_END_DECLS }
+# else /* !__cplusplus */
+# define HB_BEGIN_DECLS
+# define HB_END_DECLS
+# endif /* !__cplusplus */
+
+HB_BEGIN_DECLS
+
+
#ifdef _MSC_VER
#define _HB__STR2__(x) #x
#define _HB__STR1__(x) _HB__STR2__(x)
#include <stdint.h>
#endif
-# ifdef __cplusplus
-# define HB_BEGIN_DECLS extern "C" {
-# define HB_END_DECLS }
-# else /* !__cplusplus */
-# define HB_BEGIN_DECLS
-# define HB_END_DECLS
-# endif /* !__cplusplus */
-
typedef int hb_bool_t;
typedef uint32_t hb_tag_t;
#define HB_DIRECTION_REVERSE(dir) ((hb_direction_t) (((unsigned int) (dir)) ^ 1))
+HB_END_DECLS
+
#endif /* HB_COMMON_H */
HB_BEGIN_DECLS
+
/*
* hb_font_funcs_t
*/
#include <string.h>
+HB_BEGIN_DECLS
+
/*
* hb_font_funcs_t
font->y_ppem = y_ppem;
}
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
typedef struct _hb_face_t hb_face_t;
typedef struct _hb_font_t hb_font_t;
#include FT_TRUETYPE_TABLES_H
+HB_BEGIN_DECLS
+
+
static hb_codepoint_t
hb_ft_get_glyph (hb_font_t *font HB_UNUSED,
hb_face_t *face HB_UNUSED,
static hb_blob_t *
-_get_table (hb_tag_t tag, void *user_data)
+get_table (hb_tag_t tag, void *user_data)
{
FT_Face ft_face = (FT_Face) user_data;
FT_Byte *buffer;
face = hb_face_create_for_data (blob, ft_face->face_index);
hb_blob_destroy (blob);
} else {
- face = hb_face_create_for_tables (_get_table, destroy, ft_face);
+ face = hb_face_create_for_tables (get_table, destroy, ft_face);
}
return face;
return font;
}
+
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
hb_font_funcs_t *
hb_ft_get_font_funcs (void);
hb_ft_font_create (FT_Face ft_face,
hb_destroy_func_t destroy);
+
HB_END_DECLS
#endif /* HB_FT_H */
#include <glib.h>
+HB_BEGIN_DECLS
+
+
static hb_codepoint_t hb_glib_get_mirroring (hb_codepoint_t unicode) { g_unichar_get_mirror_char (unicode, &unicode); return unicode; }
static hb_category_t hb_glib_get_general_category (hb_codepoint_t unicode) { return g_unichar_type (unicode); }
static hb_script_t hb_glib_get_script (hb_codepoint_t unicode) { return g_unichar_get_script (unicode); }
{
return &glib_ufuncs;
}
+
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
hb_unicode_funcs_t *
hb_glib_get_unicode_funcs (void);
+
HB_END_DECLS
#endif /* HB_GLIB_H */
#include "hb-graphite.h"
#include <map>
+HB_BEGIN_DECLS
+
+
namespace TtfUtil
{
extern int FontAscent(const void *pOS2);
delete[] firsts;
delete[] flags;
}
+
+
+HB_END_DECLS
#include "hb-shape.h"
-
HB_BEGIN_DECLS
+
#define HB_GRAPHITE_TAG_Silf HB_TAG('S','i','l','f')
void hb_graphite_shape (hb_font_t *font,
hb_feature_t *features,
unsigned int num_features);
+
HB_END_DECLS
#endif /* HB_GRAPHITE_H */
#include <unicode/uchar.h>
#include <unicode/uscript.h>
+HB_BEGIN_DECLS
+
+
static hb_codepoint_t hb_icu_get_mirroring (hb_codepoint_t unicode) { return u_charMirror(unicode); }
static unsigned int hb_icu_get_combining_class (hb_codepoint_t unicode) { return u_getCombiningClass (unicode); }
{
return &icu_ufuncs;
}
+
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
hb_unicode_funcs_t *
hb_icu_get_unicode_funcs (void);
+
HB_END_DECLS
#endif /* HB_ICU_H */
#include "hb-language.h"
+HB_BEGIN_DECLS
+
+
static const char canon_map[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
return (const char *) language;
}
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
typedef const void *hb_language_t;
hb_language_t
const char *
hb_language_to_string (hb_language_t language);
+
HB_END_DECLS
#endif /* HB_LANGUAGE_H */
#include "hb-private.h"
+HB_BEGIN_DECLS
/* Encapsulate operations on the object's reference count */
} HB_STMT_END
+HB_END_DECLS
#endif /* HB_OBJECT_PRIVATE_H */
#include "hb-open-type-private.hh"
+HB_BEGIN_DECLS
+
/*
*
};
+HB_END_DECLS
+
#endif /* HB_OPEN_FILE_PRIVATE_HH */
#include "hb-blob.h"
+HB_BEGIN_DECLS
+HB_END_DECLS
/*
};
+HB_BEGIN_DECLS
+HB_END_DECLS
+
#endif /* HB_OPEN_TYPE_PRIVATE_HH */
#include "hb-open-type-private.hh"
+HB_BEGIN_DECLS
+
+
/*
* head
*/
};
+HB_END_DECLS
+
#endif /* HB_OT_HEAD_PRIVATE_HH */
#define NOT_COVERED ((unsigned int) 0x110000)
#define MAX_NESTING_LEVEL 8
+HB_BEGIN_DECLS
+HB_END_DECLS
+
/*
*
};
+HB_BEGIN_DECLS
+HB_END_DECLS
+
#endif /* HB_OT_LAYOUT_COMMON_PRIVATE_HH */
#include "hb-font-private.h"
+HB_BEGIN_DECLS
+
/*
* Attachment List Table
};
+HB_END_DECLS
+
#endif /* HB_OT_LAYOUT_GDEF_PRIVATE_HH */
#include "hb-ot-layout-gsubgpos-private.hh"
+HB_BEGIN_DECLS
+
#define HB_OT_LAYOUT_GPOS_NO_LAST ((unsigned int) -1)
};
+HB_BEGIN_DECLS
static inline bool position_lookup (hb_apply_context_t *c, unsigned int lookup_index);
+HB_END_DECLS
struct ContextPos : Context
{
}
+HB_END_DECLS
+
#endif /* HB_OT_LAYOUT_GPOS_PRIVATE_HH */
#include "hb-ot-layout-gsubgpos-private.hh"
+HB_BEGIN_DECLS
+
struct SingleSubstFormat1
{
};
-
+HB_BEGIN_DECLS
static inline bool substitute_lookup (hb_apply_context_t *c, unsigned int lookup_index);
+HB_END_DECLS
struct ContextSubst : Context
{
}
+HB_END_DECLS
+
#endif /* HB_OT_LAYOUT_GSUB_PRIVATE_HH */
#include "hb-buffer-private.hh"
#include "hb-ot-layout-gdef-private.hh"
+HB_BEGIN_DECLS
+
#ifndef HB_DEBUG_APPLY
#define HB_DEBUG_APPLY HB_DEBUG+0
hb_trace_t<HB_DEBUG_APPLY> trace (&c->debug_depth, "APPLY", HB_FUNC, this); \
+HB_BEGIN_DECLS
+
struct hb_apply_context_t
{
unsigned int debug_depth;
return true;
}
+HB_END_DECLS
+
struct LookupRecord
{
DEFINE_SIZE_STATIC (4);
};
+
+HB_BEGIN_DECLS
+
static inline bool apply_lookup (hb_apply_context_t *c,
unsigned int count, /* Including the first glyph */
unsigned int lookupCount,
return true;
}
+HB_END_DECLS
+
/* Contextual lookups */
};
+HB_END_DECLS
+
#endif /* HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH */
#include "hb-font-private.h"
#include "hb-buffer-private.hh"
-
HB_BEGIN_DECLS
+
typedef unsigned int hb_ot_layout_class_t;
/*
unsigned int lookup_flags,
unsigned int *property);
+
HB_END_DECLS
#endif /* HB_OT_LAYOUT_PRIVATE_HH */
#include <stdlib.h>
#include <string.h>
+HB_BEGIN_DECLS
+
hb_ot_layout_t *
_hb_ot_layout_new (hb_face_t *face)
}
}
}
+
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
#define HB_OT_TAG_GDEF HB_TAG('G','D','E','F')
#define HB_OT_TAG_GSUB HB_TAG('G','S','U','B')
#define HB_OT_TAG_GPOS HB_TAG('G','P','O','S')
#include "hb-ot-layout.h"
+HB_BEGIN_DECLS
+
+
/* XXX vertical */
hb_tag_t default_features[] = {
HB_TAG('c','a','l','t'),
buffer->direction = original_direction;
}
+
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
void
hb_ot_shape (hb_font_t *font,
hb_face_t *face,
hb_feature_t *features,
unsigned int num_features);
+
HB_END_DECLS
#endif /* HB_OT_SHAPE_H */
#include <string.h>
+HB_BEGIN_DECLS
+
/*
* Complete list at:
buf[10] = '\0';
return hb_language_from_string ((char *) buf);
}
+
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
#define HB_OT_TAG_DEFAULT_SCRIPT HB_TAG ('D', 'F', 'L', 'T')
#define HB_OT_TAG_DEFAULT_LANGUAGE HB_TAG ('d', 'f', 'l', 't')
hb_language_t
hb_ot_tag_to_language (hb_tag_t tag);
+
HB_END_DECLS
#endif /* HB_OT_TAG_H */
#include "hb-ot-shape.h"
#include "hb-ot-tag.h"
+HB_BEGIN_DECLS
+HB_END_DECLS
+
#endif /* HB_OT_H */
#include <stdio.h>
#include <errno.h>
+HB_BEGIN_DECLS
+
/* Essentials */
#include "hb-object-private.h"
+
+HB_END_DECLS
+
#endif /* HB_PRIVATE_H */
#include "hb-graphite.h"
#endif
+HB_BEGIN_DECLS
+
void
hb_shape (hb_font_t *font,
hb_ot_shape (font, face, buffer, features, num_features);
}
+
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
typedef struct _hb_feature_t {
hb_tag_t tag;
uint32_t value;
HB_BEGIN_DECLS
+
/*
* hb_unicode_funcs_t
*/
#include "hb-unicode-private.h"
+HB_BEGIN_DECLS
+
+
/*
* hb_unicode_funcs_t
*/
return horiz_dir[script];
}
+
+
+HB_END_DECLS
HB_BEGIN_DECLS
+
/* Unicode General Category property */
typedef enum
{
#include "hb-shape.h"
#include "hb-unicode.h"
+HB_BEGIN_DECLS
+HB_END_DECLS
+
#endif /* HB_H */
#include <stdlib.h>
#include <stdio.h>
+HB_BEGIN_DECLS
+
+
int
main (int argc, char **argv)
{
return 0;
}
+
+
+HB_END_DECLS