Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
1f437e6f
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1f437e6f
编写于
1月 23, 2008
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make all code NULL-free and assert-free
上级
600e5eb8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
214 addition
and
204 deletion
+214
-204
src/harfbuzz-gdef-private.h
src/harfbuzz-gdef-private.h
+61
-64
src/harfbuzz-open-private.h
src/harfbuzz-open-private.h
+149
-136
src/main.cc
src/main.cc
+4
-4
未找到文件。
src/harfbuzz-gdef-private.h
浏览文件 @
1f437e6f
...
@@ -10,22 +10,34 @@ struct GlyphClassDef : ClassDef {
...
@@ -10,22 +10,34 @@ struct GlyphClassDef : ClassDef {
static
const
uint16_t
ComponentGlyph
=
0x0004u
;
static
const
uint16_t
ComponentGlyph
=
0x0004u
;
};
};
struct
AttachPoint
;
/*
* Attachment List Table
*/
struct
AttachList
{
struct
AttachPoint
{
/* AttachPoint tables, in Coverage Index order */
/* countour point indices, in increasing numerical order */
/* TODO get attach lists */
DEFINE_ARRAY_TYPE
(
USHORT
,
pointIndex
,
pointCount
);
/* DEFINE_INDIRECT_OFFSET_ARRAY_TYPE (AttachPoint, attachPoint, glyphCount, get_coverage);
private:
USHORT
pointCount
;
/* Number of attachment points on
* this glyph */
USHORT
pointIndex
[];
/* Array of contour point indices--in
* increasing numerical order */
};
DEFINE_NULL_ASSERT_SIZE
(
AttachPoint
,
2
);
// get_coverage
struct
AttachList
{
inline
Coverage* get_default_language_system (vo
id) {
inline
const
AttachPoint
*
get_attach_points
(
uint16_t
glyph_
id
)
{
if (!defaultLangSys)
const
Coverage
&
c
=
get_coverage
();
return NULL
;
int
c_index
=
c
.
get_coverage
(
glyph_id
)
;
return
(LangSys *)((char*)this + defaultLangSys)
;
return
&
(
*
this
)[
c_index
]
;
}
}
*/
private:
/* AttachPoint tables, in Coverage Index order */
DEFINE_OFFSET_ARRAY_TYPE
(
AttachPoint
,
attachPoint
,
glyphCount
);
DEFINE_ACCESSOR
(
Coverage
,
get_coverage
,
coverage
);
private:
private:
Offset
coverage
;
/* Offset to Coverage table -- from
Offset
coverage
;
/* Offset to Coverage table -- from
...
@@ -36,18 +48,7 @@ struct AttachList {
...
@@ -36,18 +48,7 @@ struct AttachList {
* tables--from beginning of AttachList
* tables--from beginning of AttachList
* table--in Coverage Index order */
* table--in Coverage Index order */
};
};
ASSERT_SIZE
(
AttachList
,
4
);
DEFINE_NULL_ASSERT_SIZE
(
AttachList
,
4
);
struct
AttachPoint
{
/* TODO */
private:
USHORT
pointCount
;
/* Number of attachment points on
* this glyph */
USHORT
pointIndex
[];
/* Array of contour point indices--in
* increasing numerical order */
};
ASSERT_SIZE
(
AttachPoint
,
2
);
/*
/*
* Ligature Caret Table
* Ligature Caret Table
...
@@ -67,22 +68,7 @@ struct LigCaretList {
...
@@ -67,22 +68,7 @@ struct LigCaretList {
* LigCaretList table--in Coverage
* LigCaretList table--in Coverage
* Index order */
* Index order */
};
};
ASSERT_SIZE
(
LigCaretList
,
4
);
DEFINE_NULL_ASSERT_SIZE
(
LigCaretList
,
4
);
struct
LigGlyph
{
/* Caret value tables, in increasing coordinate order */
DEFINE_OFFSET_ARRAY_TYPE
(
CaretValue
,
caretValue
,
caretCount
);
/* TODO */
private:
USHORT
caretCount
;
/* Number of CaretValues for this
* ligature (components - 1) */
Offset
caretValue
[];
/* Array of offsets to CaretValue
* tables--from beginning of LigGlyph
* table--in increasing coordinate
* order */
};
ASSERT_SIZE
(
LigGlyph
,
2
);
struct
CaretValueFormat1
{
struct
CaretValueFormat1
{
...
@@ -94,7 +80,7 @@ struct CaretValueFormat1 {
...
@@ -94,7 +80,7 @@ struct CaretValueFormat1 {
USHORT
caretValueFormat
;
/* Format identifier--format = 1 */
USHORT
caretValueFormat
;
/* Format identifier--format = 1 */
SHORT
coordinate
;
/* X or Y value, in design units */
SHORT
coordinate
;
/* X or Y value, in design units */
};
};
ASSERT_SIZE
(
CaretValueFormat1
,
4
);
DEFINE_NULL_
ASSERT_SIZE
(
CaretValueFormat1
,
4
);
struct
CaretValueFormat2
{
struct
CaretValueFormat2
{
...
@@ -106,16 +92,17 @@ struct CaretValueFormat2 {
...
@@ -106,16 +92,17 @@ struct CaretValueFormat2 {
USHORT
caretValueFormat
;
/* Format identifier--format = 2 */
USHORT
caretValueFormat
;
/* Format identifier--format = 2 */
USHORT
caretValuePoint
;
/* Contour point index on glyph */
USHORT
caretValuePoint
;
/* Contour point index on glyph */
};
};
ASSERT_SIZE
(
CaretValueFormat2
,
4
);
DEFINE_NULL_
ASSERT_SIZE
(
CaretValueFormat2
,
4
);
struct
CaretValueFormat3
{
struct
CaretValueFormat3
{
inline
const
Device
*
get_device
(
void
)
const
{
inline
const
Device
&
get_device
(
void
)
const
{
return
(
const
Device
*
)((
const
char
*
)
this
+
deviceTable
);
if
(
!
deviceTable
)
return
NullDevice
;
return
*
(
const
Device
*
)((
const
char
*
)
this
+
deviceTable
);
}
}
inline
int
get_caret_value
(
int
ppem
)
const
{
inline
int
get_caret_value
(
int
ppem
)
const
{
return
/* TODO garbage */
(
coordinate
+
get_device
()
->
get_delta
(
ppem
))
/
ppem
;
return
/* TODO garbage */
(
coordinate
+
get_device
()
.
get_delta
(
ppem
))
/
ppem
;
}
}
private:
private:
...
@@ -125,7 +112,7 @@ struct CaretValueFormat3 {
...
@@ -125,7 +112,7 @@ struct CaretValueFormat3 {
* value--from beginning of CaretValue
* value--from beginning of CaretValue
* table */
* table */
};
};
ASSERT_SIZE
(
CaretValueFormat3
,
6
);
DEFINE_NULL_
ASSERT_SIZE
(
CaretValueFormat3
,
6
);
struct
CaretValue
{
struct
CaretValue
{
DEFINE_NON_INSTANTIABLE
(
CaretValue
);
DEFINE_NON_INSTANTIABLE
(
CaretValue
);
...
@@ -158,16 +145,26 @@ struct CaretValue {
...
@@ -158,16 +145,26 @@ struct CaretValue {
/* FIXME old HarfBuzz code has a format 4 here! */
/* FIXME old HarfBuzz code has a format 4 here! */
}
u
;
}
u
;
};
};
DEFINE_NULL
(
CaretValue
,
2
);
struct
LigGlyph
{
/* Caret value tables, in increasing coordinate order */
DEFINE_OFFSET_ARRAY_TYPE
(
CaretValue
,
caretValue
,
caretCount
);
/* TODO */
private:
USHORT
caretCount
;
/* Number of CaretValues for this
* ligature (components - 1) */
Offset
caretValue
[];
/* Array of offsets to CaretValue
* tables--from beginning of LigGlyph
* table--in increasing coordinate
* order */
};
DEFINE_NULL_ASSERT_SIZE
(
LigGlyph
,
2
);
#define DEFINE_ACCESSOR0(const, Type, name, Name) \
/*
inline const Type* name (void) const { \
* GDEF Header
if (!Name) return NULL; \
*/
return (const Type *)((const char*)this + Name); \
}
#define DEFINE_ACCESSOR(Type, name, Name) \
DEFINE_ACCESSOR0(const, Type, name, Name) \
DEFINE_ACCESSOR0( , Type, name, Name)
struct
GDEFHeader
{
struct
GDEFHeader
{
static
const
hb_tag_t
GDEFTag
=
HB_TAG
(
'G'
,
'D'
,
'E'
,
'F'
);
static
const
hb_tag_t
GDEFTag
=
HB_TAG
(
'G'
,
'D'
,
'E'
,
'F'
);
...
@@ -181,18 +178,18 @@ struct GDEFHeader {
...
@@ -181,18 +178,18 @@ struct GDEFHeader {
/* Returns 0 if not found. */
/* Returns 0 if not found. */
inline
int
get_glyph_class
(
uint16_t
glyph_id
)
const
{
inline
int
get_glyph_class
(
uint16_t
glyph_id
)
const
{
const
ClassDef
*
class_def
=
get_glyph_class_def
();
const
ClassDef
&
class_def
=
get_glyph_class_def
();
if
(
!
class_def
)
return
0
;
return
class_def
.
get_class
(
glyph_id
);
return
class_def
->
get_class
(
glyph_id
);
}
}
/* Returns 0 if not found. */
/* Returns 0 if not found. */
inline
int
get_mark_attachment_type
(
uint16_t
glyph_id
)
const
{
inline
int
get_mark_attachment_type
(
uint16_t
glyph_id
)
const
{
const
ClassDef
*
class_def
=
get_mark_attach_class_def
();
const
ClassDef
&
class_def
=
get_mark_attach_class_def
();
if
(
!
class_def
)
return
0
;
return
class_def
.
get_class
(
glyph_id
);
return
class_def
->
get_class
(
glyph_id
);
}
}
/* TODO get_glyph_property */
/* TODO get_attach and get_lig_caret */
/* TODO get_attach and get_lig_caret */
private:
private:
...
@@ -200,17 +197,17 @@ struct GDEFHeader {
...
@@ -200,17 +197,17 @@ struct GDEFHeader {
* 0x00010000 */
* 0x00010000 */
Offset
glyphClassDef
;
/* Offset to class definition table
Offset
glyphClassDef
;
/* Offset to class definition table
* for glyph type--from beginning of
* for glyph type--from beginning of
* GDEF header (may be N
ULL
) */
* GDEF header (may be N
ull
) */
Offset
attachList
;
/* Offset to list of glyphs with
Offset
attachList
;
/* Offset to list of glyphs with
* attachment points--from beginning
* attachment points--from beginning
* of GDEF header (may be N
ULL
) */
* of GDEF header (may be N
ull
) */
Offset
ligCaretList
;
/* Offset to list of positioning points
Offset
ligCaretList
;
/* Offset to list of positioning points
* for ligature carets--from beginning
* for ligature carets--from beginning
* of GDEF header (may be N
ULL
) */
* of GDEF header (may be N
ull
) */
Offset
markAttachClassDef
;
/* Offset to class definition table for
Offset
markAttachClassDef
;
/* Offset to class definition table for
* mark attachment type--from beginning
* mark attachment type--from beginning
* of GDEF header (may be N
ULL
) */
* of GDEF header (may be N
ull
) */
};
};
ASSERT_SIZE
(
GDEFHeader
,
12
);
DEFINE_NULL_
ASSERT_SIZE
(
GDEFHeader
,
12
);
#endif
/* HARFBUZZ_GDEF_PRIVATE_H */
#endif
/* HARFBUZZ_GDEF_PRIVATE_H */
src/harfbuzz-open-private.h
浏览文件 @
1f437e6f
...
@@ -53,12 +53,11 @@
...
@@ -53,12 +53,11 @@
* as its last item. An array object is extended with len() and size()
* as its last item. An array object is extended with len() and size()
* methods, as well as overloaded [] operator. */
* methods, as well as overloaded [] operator. */
#define DEFINE_ARRAY_TYPE(Type, array, num) \
#define DEFINE_ARRAY_TYPE(Type, array, num) \
DEFINE_INDEX_OPERATOR(const, Type, array, num) \
DEFINE_INDEX_OPERATOR(Type, array, num) \
DEFINE_INDEX_OPERATOR( , Type, array, num) \
DEFINE_LEN_AND_SIZE(Type, array, num)
DEFINE_LEN_AND_SIZE(Type, array, num)
#define DEFINE_INDEX_OPERATOR(
const,
Type, array, num) \
#define DEFINE_INDEX_OPERATOR(Type, array, num) \
inline const Type& operator[] (unsigned int i) const { \
inline const Type& operator[] (unsigned int i) const { \
assert (i < num)
; \
if (i >= num) return Null##Type
; \
return array[i]; \
return array[i]; \
}
}
...
@@ -66,34 +65,42 @@
...
@@ -66,34 +65,42 @@
* of offsets to the objects, relative to the beginning of the current
* of offsets to the objects, relative to the beginning of the current
* object. */
* object. */
#define DEFINE_OFFSET_ARRAY_TYPE(Type, array, num) \
#define DEFINE_OFFSET_ARRAY_TYPE(Type, array, num) \
DEFINE_OFFSET_INDEX_OPERATOR(const, Type, array, num) \
DEFINE_OFFSET_INDEX_OPERATOR(Type, array, num) \
DEFINE_OFFSET_INDEX_OPERATOR( , Type, array, num) \
DEFINE_LEN_AND_SIZE(Offset, array, num)
DEFINE_LEN_AND_SIZE(Offset, array, num)
#define DEFINE_OFFSET_INDEX_OPERATOR(
const,
Type, array, num) \
#define DEFINE_OFFSET_INDEX_OPERATOR(Type, array, num) \
inline const Type& operator[] (unsigned int i) const { \
inline const Type& operator[] (unsigned int i) const { \
assert (i < num)
; \
if (i >= num) return Null##Type
; \
assert (array[i]);
/* TODO: should just skip them */
\
if (!array[i]) return Null##Type;
\
return *(const Type *)((const char*)this + array[i]); \
return *(const Type *)((const char*)this + array[i]); \
}
}
#define DEFINE_RECORD_ARRAY_TYPE(Type, array, num) \
#define DEFINE_RECORD_ARRAY_TYPE(Type, array, num) \
DEFINE_RECORD_ACCESSOR(const, Type, array, num) \
DEFINE_RECORD_ACCESSOR(Type, array, num) \
DEFINE_RECORD_ACCESSOR( , Type, array, num) \
DEFINE_LEN_AND_SIZE(Record, array, num)
DEFINE_LEN_AND_SIZE(Record, array, num)
#define DEFINE_RECORD_ACCESSOR(
const,
Type, array, num) \
#define DEFINE_RECORD_ACCESSOR(Type, array, num) \
inline const Type& operator[] (unsigned int i) const { \
inline const Type& operator[] (unsigned int i) const { \
assert (i < num)
; \
if (i >= num) return Null##Type
; \
assert (array[i].offset);
/* TODO: should just skip them */
\
if (!array[i].offset) return Null##Type;
\
return *(const Type *)((const char*)this + array[i].offset); \
return *(const Type *)((const char*)this + array[i].offset); \
} \
} \
inline const Tag& get_tag (unsigned int i) const { \
inline const Tag& get_tag (unsigned int i) const { \
assert (i < num)
; \
if (i >= num) return NullTag
; \
return array[i].tag; \
return array[i].tag; \
} \
} \
/* TODO: implement find_tag() */
/* TODO: implement find_tag() */
/*
* List types
*/
#define DEFINE_LIST_ACCESSOR(Type, name) \
inline const Type##List& get_##name##_list (void) const { \
if (!name##List) return Null##Type##List; \
return *(const Type##List *)((const char*)this + name##List); \
} \
inline const Type& get_##name (unsigned int i) const { \
return get_##name##_list()[i]; \
}
/*
/*
* Class features
* Class features
...
@@ -105,6 +112,20 @@
...
@@ -105,6 +112,20 @@
private: inline Type() {}
/* cannot be instantiated */
\
private: inline Type() {}
/* cannot be instantiated */
\
public:
public:
/* defines Null##Type as a safe nil instance of Type */
#define DEFINE_NULL_DATA(Type, size, data) \
static const unsigned char Null##Type##Data[size] = data; \
DEFINE_NULL_ALIAS (Type, Type)
#define DEFINE_NULL(Type, size) \
DEFINE_NULL_DATA(Type, size, "")
#define DEFINE_NULL_ASSERT_SIZE(Type, size) \
DEFINE_NULL_ASSERT_SIZE_DATA(Type, size, "")
#define DEFINE_NULL_ASSERT_SIZE_DATA(Type, size, data) \
ASSERT_SIZE (Type, size); \
DEFINE_NULL_DATA (Type, size, data)
#define DEFINE_NULL_ALIAS(NewType, OldType) \
static const NewType &Null##NewType = *(NewType *)Null##OldType##Data
/* get_for_data() is a static class method returning a reference to an
/* get_for_data() is a static class method returning a reference to an
* instance of Type located at the input data location. It's just a
* instance of Type located at the input data location. It's just a
* fancy cast! */
* fancy cast! */
...
@@ -117,6 +138,13 @@
...
@@ -117,6 +138,13 @@
STATIC_DEFINE_GET_FOR_DATA0( , Type)
STATIC_DEFINE_GET_FOR_DATA0( , Type)
#define DEFINE_ACCESSOR(Type, name, Name) \
inline const Type& name (void) const { \
if (!Name) return Null##Type; \
return *(const Type*)((const char*)this + Name); \
}
/*
/*
*
*
...
@@ -136,17 +164,17 @@
...
@@ -136,17 +164,17 @@
DEFINE_INT_TYPE_STRUCT
(
BYTE
,
u
,
8
);
/* 8-bit unsigned integer. */
DEFINE_INT_TYPE_STRUCT
(
BYTE
,
u
,
8
);
/* 8-bit unsigned integer. */
ASSERT_SIZE
(
BYTE
,
1
);
DEFINE_NULL_
ASSERT_SIZE
(
BYTE
,
1
);
DEFINE_INT_TYPE_STRUCT
(
CHAR
,
,
8
);
/* 8-bit signed integer. */
DEFINE_INT_TYPE_STRUCT
(
CHAR
,
,
8
);
/* 8-bit signed integer. */
ASSERT_SIZE
(
CHAR
,
1
);
DEFINE_NULL_
ASSERT_SIZE
(
CHAR
,
1
);
DEFINE_INT_TYPE_STRUCT
(
USHORT
,
u
,
16
);
/* 16-bit unsigned integer. */
DEFINE_INT_TYPE_STRUCT
(
USHORT
,
u
,
16
);
/* 16-bit unsigned integer. */
ASSERT_SIZE
(
USHORT
,
2
);
DEFINE_NULL_
ASSERT_SIZE
(
USHORT
,
2
);
DEFINE_INT_TYPE_STRUCT
(
SHORT
,
,
16
);
/* 16-bit signed integer. */
DEFINE_INT_TYPE_STRUCT
(
SHORT
,
,
16
);
/* 16-bit signed integer. */
ASSERT_SIZE
(
SHORT
,
2
);
DEFINE_NULL_
ASSERT_SIZE
(
SHORT
,
2
);
DEFINE_INT_TYPE_STRUCT
(
ULONG
,
u
,
32
);
/* 32-bit unsigned integer. */
DEFINE_INT_TYPE_STRUCT
(
ULONG
,
u
,
32
);
/* 32-bit unsigned integer. */
ASSERT_SIZE
(
ULONG
,
4
);
DEFINE_NULL_
ASSERT_SIZE
(
ULONG
,
4
);
DEFINE_INT_TYPE_STRUCT
(
LONG
,
,
32
);
/* 32-bit signed integer. */
DEFINE_INT_TYPE_STRUCT
(
LONG
,
,
32
);
/* 32-bit signed integer. */
ASSERT_SIZE
(
LONG
,
4
);
DEFINE_NULL_
ASSERT_SIZE
(
LONG
,
4
);
/* Date represented in number of seconds since 12:00 midnight, January 1,
/* Date represented in number of seconds since 12:00 midnight, January 1,
* 1904. The value is represented as a signed 64-bit integer. */
* 1904. The value is represented as a signed 64-bit integer. */
...
@@ -166,7 +194,7 @@ struct Fixed {
...
@@ -166,7 +194,7 @@ struct Fixed {
SHORT
i
;
SHORT
i
;
USHORT
f
;
USHORT
f
;
};
};
ASSERT_SIZE
(
Fixed
,
4
);
DEFINE_NULL_
ASSERT_SIZE
(
Fixed
,
4
);
/* Smallest measurable distance in the em space. */
/* Smallest measurable distance in the em space. */
struct
FUNIT
;
struct
FUNIT
;
...
@@ -174,18 +202,18 @@ struct FUNIT;
...
@@ -174,18 +202,18 @@ struct FUNIT;
/* 16-bit signed integer (SHORT) that describes a quantity in FUnits. */
/* 16-bit signed integer (SHORT) that describes a quantity in FUnits. */
struct
FWORD
:
SHORT
{
struct
FWORD
:
SHORT
{
};
};
ASSERT_SIZE
(
FWORD
,
2
);
DEFINE_NULL_
ASSERT_SIZE
(
FWORD
,
2
);
/* 16-bit unsigned integer (USHORT) that describes a quantity in FUnits. */
/* 16-bit unsigned integer (USHORT) that describes a quantity in FUnits. */
struct
UFWORD
:
USHORT
{
struct
UFWORD
:
USHORT
{
};
};
ASSERT_SIZE
(
UFWORD
,
2
);
DEFINE_NULL_
ASSERT_SIZE
(
UFWORD
,
2
);
/* 16-bit signed fixed number with the low 14 bits of fraction (2.14). */
/* 16-bit signed fixed number with the low 14 bits of fraction (2.14). */
struct
F2DOT14
:
SHORT
{
struct
F2DOT14
:
SHORT
{
inline
operator
double
()
const
{
return
(
uint32_t
)
this
/
16384.
;
}
inline
operator
double
()
const
{
return
(
uint32_t
)
this
/
16384.
;
}
};
};
ASSERT_SIZE
(
F2DOT14
,
2
);
DEFINE_NULL_
ASSERT_SIZE
(
F2DOT14
,
2
);
/* Array of four uint8s (length = 32 bits) used to identify a script, language
/* Array of four uint8s (length = 32 bits) used to identify a script, language
* system, feature, or baseline */
* system, feature, or baseline */
...
@@ -205,14 +233,15 @@ struct Tag {
...
@@ -205,14 +233,15 @@ struct Tag {
char
v
[
4
];
char
v
[
4
];
};
};
ASSERT_SIZE
(
Tag
,
4
);
ASSERT_SIZE
(
Tag
,
4
);
DEFINE_NULL_DATA
(
Tag
,
5
,
" "
);
/* Glyph index number, same as uint16 (length = 16 bits) */
/* Glyph index number, same as uint16 (length = 16 bits) */
DEFINE_INT_TYPE_STRUCT
(
GlyphID
,
u
,
16
);
DEFINE_INT_TYPE_STRUCT
(
GlyphID
,
u
,
16
);
ASSERT_SIZE
(
GlyphID
,
2
);
DEFINE_NULL_
ASSERT_SIZE
(
GlyphID
,
2
);
/* Offset to a table, same as uint16 (length = 16 bits), N
ULL
offset = 0x0000 */
/* Offset to a table, same as uint16 (length = 16 bits), N
ull
offset = 0x0000 */
DEFINE_INT_TYPE_STRUCT
(
Offset
,
u
,
16
);
DEFINE_INT_TYPE_STRUCT
(
Offset
,
u
,
16
);
ASSERT_SIZE
(
Offset
,
2
);
DEFINE_NULL_
ASSERT_SIZE
(
Offset
,
2
);
/* CheckSum */
/* CheckSum */
struct
CheckSum
:
ULONG
{
struct
CheckSum
:
ULONG
{
...
@@ -225,7 +254,7 @@ struct CheckSum : ULONG {
...
@@ -225,7 +254,7 @@ struct CheckSum : ULONG {
return
Sum
;
return
Sum
;
}
}
};
};
ASSERT_SIZE
(
CheckSum
,
4
);
DEFINE_NULL_
ASSERT_SIZE
(
CheckSum
,
4
);
/*
/*
...
@@ -234,13 +263,13 @@ ASSERT_SIZE (CheckSum, 4);
...
@@ -234,13 +263,13 @@ ASSERT_SIZE (CheckSum, 4);
struct
USHORT_Version
:
USHORT
{
struct
USHORT_Version
:
USHORT
{
};
};
ASSERT_SIZE
(
USHORT_Version
,
2
);
DEFINE_NULL_
ASSERT_SIZE
(
USHORT_Version
,
2
);
struct
Fixed_Version
:
Fixed
{
struct
Fixed_Version
:
Fixed
{
inline
int16_t
major
(
void
)
const
{
return
this
->
int_part
();
}
inline
int16_t
major
(
void
)
const
{
return
this
->
int_part
();
}
inline
int16_t
minor
(
void
)
const
{
return
this
->
frac_part
();
}
inline
int16_t
minor
(
void
)
const
{
return
this
->
frac_part
();
}
};
};
ASSERT_SIZE
(
Fixed_Version
,
4
);
DEFINE_NULL_
ASSERT_SIZE
(
Fixed_Version
,
4
);
/*
/*
...
@@ -267,7 +296,7 @@ typedef struct TableDirectory {
...
@@ -267,7 +296,7 @@ typedef struct TableDirectory {
* file. */
* file. */
ULONG
length
;
/* Length of this table. */
ULONG
length
;
/* Length of this table. */
}
OpenTypeTable
;
}
OpenTypeTable
;
ASSERT_SIZE
(
TableDirectory
,
16
);
DEFINE_NULL_
ASSERT_SIZE
(
TableDirectory
,
16
);
typedef
struct
OffsetTable
{
typedef
struct
OffsetTable
{
/* OpenTypeTables, in no particular order */
/* OpenTypeTables, in no particular order */
...
@@ -282,7 +311,8 @@ typedef struct OffsetTable {
...
@@ -282,7 +311,8 @@ typedef struct OffsetTable {
USHORT
rangeShift
;
/* NumTables x 16-searchRange. */
USHORT
rangeShift
;
/* NumTables x 16-searchRange. */
TableDirectory
tableDir
[];
/* TableDirectory entries. numTables items */
TableDirectory
tableDir
[];
/* TableDirectory entries. numTables items */
}
OpenTypeFontFace
;
}
OpenTypeFontFace
;
ASSERT_SIZE
(
OffsetTable
,
12
);
DEFINE_NULL_ASSERT_SIZE
(
OffsetTable
,
12
);
DEFINE_NULL_ALIAS
(
OpenTypeFontFace
,
OffsetTable
);
/*
/*
* TrueType Collections
* TrueType Collections
...
@@ -300,7 +330,7 @@ struct TTCHeader {
...
@@ -300,7 +330,7 @@ struct TTCHeader {
ULONG
offsetTable
[];
/* Array of offsets to the OffsetTable for each font
ULONG
offsetTable
[];
/* Array of offsets to the OffsetTable for each font
* from the beginning of the file */
* from the beginning of the file */
};
};
ASSERT_SIZE
(
TTCHeader
,
12
);
DEFINE_NULL_
ASSERT_SIZE
(
TTCHeader
,
12
);
/*
/*
...
@@ -338,25 +368,18 @@ struct OpenTypeFontFile {
...
@@ -338,25 +368,18 @@ struct OpenTypeFontFile {
}
}
}
}
inline
const
OpenTypeFontFace
&
operator
[]
(
unsigned
int
i
)
const
{
inline
const
OpenTypeFontFace
&
operator
[]
(
unsigned
int
i
)
const
{
assert
(
i
<
get_len
())
;
if
(
i
>=
get_len
())
return
NullOpenTypeFontFace
;
switch
(
tag
)
{
switch
(
tag
)
{
default:
case
TrueTypeTag
:
case
CFFTag
:
return
(
const
OffsetTable
&
)
*
this
;
default:
case
TrueTypeTag
:
case
CFFTag
:
return
(
const
OffsetTable
&
)
*
this
;
case
TTCTag
:
return
((
const
TTCHeader
&
)
*
this
)[
i
];
case
TTCTag
:
return
((
const
TTCHeader
&
)
*
this
)[
i
];
}
}
}
}
inline
OpenTypeFontFace
&
operator
[]
(
unsigned
int
i
)
{
assert
(
i
<
get_len
());
switch
(
tag
)
{
default:
case
TrueTypeTag
:
case
CFFTag
:
return
(
OffsetTable
&
)
*
this
;
case
TTCTag
:
return
((
TTCHeader
&
)
*
this
)[
i
];
}
}
inline
const
Tag
&
get_tag
(
void
)
const
{
return
tag
;
}
inline
const
Tag
&
get_tag
(
void
)
const
{
return
tag
;
}
private:
private:
Tag
tag
;
/* 4-byte identifier. */
Tag
tag
;
/* 4-byte identifier. */
};
};
ASSERT_SIZE
(
OpenTypeFontFile
,
4
);
DEFINE_NULL_
ASSERT_SIZE
(
OpenTypeFontFile
,
4
);
...
@@ -370,59 +393,12 @@ ASSERT_SIZE (OpenTypeFontFile, 4);
...
@@ -370,59 +393,12 @@ ASSERT_SIZE (OpenTypeFontFile, 4);
* Script, ScriptList, LangSys, Feature, FeatureList, Lookup, LookupList
* Script, ScriptList, LangSys, Feature, FeatureList, Lookup, LookupList
*/
*/
struct
Script
;
struct
ScriptList
;
struct
LangSys
;
struct
Feature
;
struct
FeatureList
;
struct
Lookup
;
struct
LookupList
;
typedef
struct
Record
{
typedef
struct
Record
{
Tag
tag
;
/* 4-byte Tag identifier */
Tag
tag
;
/* 4-byte Tag identifier */
Offset
offset
;
/* Offset from beginning of object holding
Offset
offset
;
/* Offset from beginning of object holding
* the Record */
* the Record */
}
ScriptRecord
,
LangSysRecord
,
FeatureRecord
;
}
ScriptRecord
,
LangSysRecord
,
FeatureRecord
;
ASSERT_SIZE
(
Record
,
6
);
DEFINE_NULL_ASSERT_SIZE
(
Record
,
6
);
struct
ScriptList
{
/* Scripts, in sorted alphabetical tag order */
DEFINE_RECORD_ARRAY_TYPE
(
Script
,
scriptRecord
,
scriptCount
);
private:
USHORT
scriptCount
;
/* Number of ScriptRecords */
ScriptRecord
scriptRecord
[];
/* Array of ScriptRecords--listed alphabetically
* by ScriptTag */
};
ASSERT_SIZE
(
ScriptList
,
2
);
struct
Script
{
/* LangSys', in sorted alphabetical tag order */
DEFINE_RECORD_ARRAY_TYPE
(
LangSys
,
langSysRecord
,
langSysCount
);
/* Return NULL if none */
inline
const
LangSys
*
get_default_language_system
(
void
)
const
{
if
(
!
defaultLangSys
)
return
NULL
;
return
(
const
LangSys
*
)((
const
char
*
)
this
+
defaultLangSys
);
}
inline
LangSys
*
get_default_language_system
(
void
)
{
if
(
!
defaultLangSys
)
return
NULL
;
return
(
LangSys
*
)((
char
*
)
this
+
defaultLangSys
);
}
/* TODO implement find_language_system based on find_tag */
private:
Offset
defaultLangSys
;
/* Offset to DefaultLangSys table--from
* beginning of Script table--may be NULL */
USHORT
langSysCount
;
/* Number of LangSysRecords for this script--
* excluding the DefaultLangSys */
LangSysRecord
langSysRecord
[];
/* Array of LangSysRecords--listed
* alphabetically by LangSysTag */
};
ASSERT_SIZE
(
Script
,
4
);
struct
LangSys
{
struct
LangSys
{
/* Feature indices, in no particular order */
/* Feature indices, in no particular order */
...
@@ -438,7 +414,7 @@ struct LangSys {
...
@@ -438,7 +414,7 @@ struct LangSys {
/* TODO implement find_feature */
/* TODO implement find_feature */
private:
private:
Offset
lookupOrder
;
/* = N
ULL
(reserved for an offset to a
Offset
lookupOrder
;
/* = N
ull
(reserved for an offset to a
* reordering table) */
* reordering table) */
USHORT
reqFeatureIndex
;
/* Index of a feature required for this
USHORT
reqFeatureIndex
;
/* Index of a feature required for this
* language system--if no required features
* language system--if no required features
...
@@ -449,30 +425,52 @@ struct LangSys {
...
@@ -449,30 +425,52 @@ struct LangSys {
USHORT
featureIndex
[];
/* Array of indices into the FeatureList--in
USHORT
featureIndex
[];
/* Array of indices into the FeatureList--in
* arbitrary order. featureCount entires long */
* arbitrary order. featureCount entires long */
};
};
ASSERT_SIZE
(
LangSys
,
6
);
DEFINE_NULL_ASSERT_SIZE_DATA
(
LangSys
,
6
,
"
\0\0\xFF\xFF
"
);
struct
FeatureList
{
struct
Script
{
/* Feature indices, in sorted alphabetical tag order */
/* LangSys', in sorted alphabetical tag order */
DEFINE_RECORD_ARRAY_TYPE
(
Feature
,
featureRecord
,
featureCount
);
DEFINE_RECORD_ARRAY_TYPE
(
LangSys
,
langSysRecord
,
langSysCount
);
inline
const
bool
has_default_language_system
(
void
)
const
{
return
defaultLangSys
!=
0
;
}
inline
const
LangSys
&
get_default_language_system
(
void
)
const
{
if
(
!
defaultLangSys
)
return
NullLangSys
;
return
*
(
LangSys
*
)((
const
char
*
)
this
+
defaultLangSys
);
}
/* TODO implement find_language_system based on find_tag */
private:
private:
USHORT
featureCount
;
/* Number of FeatureRecords in this table */
Offset
defaultLangSys
;
/* Offset to DefaultLangSys table--from
FeatureRecord
featureRecord
[];
/* Array of FeatureRecords--zero-based (first
* beginning of Script table--may be Null */
* feature has FeatureIndex = 0)--listed
USHORT
langSysCount
;
/* Number of LangSysRecords for this script--
* alphabetically by FeatureTag */
* excluding the DefaultLangSys */
LangSysRecord
langSysRecord
[];
/* Array of LangSysRecords--listed
* alphabetically by LangSysTag */
};
};
ASSERT_SIZE
(
FeatureList
,
2
);
DEFINE_NULL_ASSERT_SIZE
(
Script
,
4
);
struct
ScriptList
{
/* Scripts, in sorted alphabetical tag order */
DEFINE_RECORD_ARRAY_TYPE
(
Script
,
scriptRecord
,
scriptCount
);
private:
USHORT
scriptCount
;
/* Number of ScriptRecords */
ScriptRecord
scriptRecord
[];
/* Array of ScriptRecords--listed alphabetically
* by ScriptTag */
};
DEFINE_NULL_ASSERT_SIZE
(
ScriptList
,
2
);
struct
Feature
{
struct
Feature
{
/* LookupList indices, in no particular order */
/* LookupList indices, in no particular order */
DEFINE_ARRAY_TYPE
(
USHORT
,
lookupIndex
,
lookupCount
);
DEFINE_ARRAY_TYPE
(
USHORT
,
lookupIndex
,
lookupCount
);
// TODO: implement get_feature_params()
private:
private:
Offset
featureParams
;
/* Offset to Feature Parameters table (if one
Offset
featureParams
;
/* Offset to Feature Parameters table (if one
* has been defined for the feature), relative
* has been defined for the feature), relative
* to the beginning of the Feature Table; = N
ULL
* to the beginning of the Feature Table; = N
ull
* if not required */
* if not required */
USHORT
lookupCount
;
/* Number of LookupList indices for this
USHORT
lookupCount
;
/* Number of LookupList indices for this
* feature */
* feature */
...
@@ -480,19 +478,19 @@ struct Feature {
...
@@ -480,19 +478,19 @@ struct Feature {
* feature--zero-based (first lookup is
* feature--zero-based (first lookup is
* LookupListIndex = 0) */
* LookupListIndex = 0) */
};
};
ASSERT_SIZE
(
Feature
,
4
);
DEFINE_NULL_
ASSERT_SIZE
(
Feature
,
4
);
struct
Lookup
List
{
struct
Feature
List
{
/*
Lookup
indices, in sorted alphabetical tag order */
/*
Feature
indices, in sorted alphabetical tag order */
DEFINE_
OFFSET_ARRAY_TYPE
(
Lookup
,
lookupOffset
,
lookup
Count
);
DEFINE_
RECORD_ARRAY_TYPE
(
Feature
,
featureRecord
,
feature
Count
);
private:
private:
USHORT
lookupCount
;
/* Number of lookup
s in this table */
USHORT
featureCount
;
/* Number of FeatureRecord
s in this table */
Offset
lookupOffset
[];
/* Array of offsets to Lookup tables--from
FeatureRecord
featureRecord
[];
/* Array of FeatureRecords--zero-based (first
*
beginning of LookupList--zero based (first
*
feature has FeatureIndex = 0)--listed
*
lookup is Lookup index = 0)
*/
*
alphabetically by FeatureTag
*/
};
};
ASSERT_SIZE
(
Lookup
List
,
2
);
DEFINE_NULL_ASSERT_SIZE
(
Feature
List
,
2
);
struct
LookupFlag
:
USHORT
{
struct
LookupFlag
:
USHORT
{
static
const
uint16_t
RightToLeft
=
0x0001u
;
static
const
uint16_t
RightToLeft
=
0x0001u
;
...
@@ -502,11 +500,20 @@ struct LookupFlag : USHORT {
...
@@ -502,11 +500,20 @@ struct LookupFlag : USHORT {
static
const
uint16_t
Reserved
=
0x00F0u
;
static
const
uint16_t
Reserved
=
0x00F0u
;
static
const
uint16_t
MarkAttachmentType
=
0xFF00u
;
static
const
uint16_t
MarkAttachmentType
=
0xFF00u
;
};
};
ASSERT_SIZE
(
LookupFlag
,
2
);
DEFINE_NULL_ASSERT_SIZE
(
LookupFlag
,
2
);
struct
LookupSubTable
{
DEFINE_NON_INSTANTIABLE
(
LookupSubTable
);
private:
USHORT
format
;
/* Subtable format. Different for GSUB and GPOS */
};
DEFINE_NULL_ASSERT_SIZE
(
LookupSubTable
,
2
);
struct
Lookup
{
struct
Lookup
{
/* SubTables, in the desired order */
/* SubTables, in the desired order */
DEFINE_OFFSET_ARRAY_TYPE
(
char
*
,
subTableOffset
,
subTableCount
);
DEFINE_OFFSET_ARRAY_TYPE
(
LookupSubTable
,
subTableOffset
,
subTableCount
);
inline
bool
is_right_to_left
(
void
)
const
{
return
lookupFlag
&
LookupFlag
::
RightToLeft
;
}
inline
bool
is_right_to_left
(
void
)
const
{
return
lookupFlag
&
LookupFlag
::
RightToLeft
;
}
inline
bool
ignore_base_glyphs
(
void
)
const
{
return
lookupFlag
&
LookupFlag
::
IgnoreBaseGlyphs
;
}
inline
bool
ignore_base_glyphs
(
void
)
const
{
return
lookupFlag
&
LookupFlag
::
IgnoreBaseGlyphs
;
}
...
@@ -524,7 +531,19 @@ struct Lookup {
...
@@ -524,7 +531,19 @@ struct Lookup {
Offset
subTableOffset
[];
/* Array of offsets to SubTables-from
Offset
subTableOffset
[];
/* Array of offsets to SubTables-from
* beginning of Lookup table */
* beginning of Lookup table */
};
};
ASSERT_SIZE
(
Lookup
,
6
);
DEFINE_NULL_ASSERT_SIZE
(
Lookup
,
6
);
struct
LookupList
{
/* Lookup indices, in sorted alphabetical tag order */
DEFINE_OFFSET_ARRAY_TYPE
(
Lookup
,
lookupOffset
,
lookupCount
);
private:
USHORT
lookupCount
;
/* Number of lookups in this table */
Offset
lookupOffset
[];
/* Array of offsets to Lookup tables--from
* beginning of LookupList--zero based (first
* lookup is Lookup index = 0) */
};
DEFINE_NULL_ASSERT_SIZE
(
LookupList
,
2
);
/*
/*
* Coverage Table
* Coverage Table
...
@@ -565,7 +584,7 @@ struct CoverageRangeRecord {
...
@@ -565,7 +584,7 @@ struct CoverageRangeRecord {
USHORT
startCoverageIndex
;
/* Coverage Index of first GlyphID in
USHORT
startCoverageIndex
;
/* Coverage Index of first GlyphID in
* range */
* range */
};
};
ASSERT_SIZE
(
CoverageRangeRecord
,
6
);
DEFINE_NULL_ASSERT_SIZE_DATA
(
CoverageRangeRecord
,
6
,
"
\001
"
);
struct
CoverageFormat2
{
struct
CoverageFormat2
{
/* CoverageRangeRecords, in sorted numerical start order */
/* CoverageRangeRecords, in sorted numerical start order */
...
@@ -617,6 +636,7 @@ struct Coverage {
...
@@ -617,6 +636,7 @@ struct Coverage {
CoverageFormat2
format2
;
CoverageFormat2
format2
;
}
u
;
}
u
;
};
};
DEFINE_NULL
(
Coverage
,
2
);
/*
/*
* Class Definition Table
* Class Definition Table
...
@@ -653,7 +673,7 @@ struct ClassRangeRecord {
...
@@ -653,7 +673,7 @@ struct ClassRangeRecord {
GlyphID
end
;
/* Last GlyphID in the range */
GlyphID
end
;
/* Last GlyphID in the range */
USHORT
classValue
;
/* Applied to all glyphs in the range */
USHORT
classValue
;
/* Applied to all glyphs in the range */
};
};
ASSERT_SIZE
(
ClassRangeRecord
,
6
);
DEFINE_NULL_ASSERT_SIZE_DATA
(
ClassRangeRecord
,
6
,
"
\001
"
);
struct
ClassDefFormat2
{
struct
ClassDefFormat2
{
/* ClassRangeRecords, in sorted numerical start order */
/* ClassRangeRecords, in sorted numerical start order */
...
@@ -704,6 +724,7 @@ struct ClassDef {
...
@@ -704,6 +724,7 @@ struct ClassDef {
ClassDefFormat2
format2
;
ClassDefFormat2
format2
;
}
u
;
}
u
;
};
};
DEFINE_NULL
(
ClassDef
,
2
);
/*
/*
* Device Tables
* Device Tables
...
@@ -748,23 +769,13 @@ struct Device {
...
@@ -748,23 +769,13 @@ struct Device {
USHORT
deltaFormat
;
/* Format of DeltaValue array data: 1, 2, or 3 */
USHORT
deltaFormat
;
/* Format of DeltaValue array data: 1, 2, or 3 */
USHORT
deltaValue
[];
/* Array of compressed data */
USHORT
deltaValue
[];
/* Array of compressed data */
};
};
ASSERT_SIZE
(
Device
,
6
);
DEFINE_NULL_ASSERT_SIZE
(
Device
,
6
);
#define DEFINE_LIST_ACCESSOR0(const, Type, name) \
/*
inline const Type##List* get_##name##_list (void) const { \
* GSUB/GPOS Header
assert (name##List); \
*/
return (const Type##List *)((const char*)this + name##List); \
} \
inline const Type& get_##name (unsigned int i) const { \
return (*get_##name##_list())[i]; \
}
#define DEFINE_LIST_ACCESSOR(Type, name) \
DEFINE_LIST_ACCESSOR0(const, Type, name) \
DEFINE_LIST_ACCESSOR0( , Type, name)
struct
GSUBGPOSHeader
{
typedef
struct
GSUBGPOSHeader
{
static
const
hb_tag_t
GSUBTag
=
HB_TAG
(
'G'
,
'S'
,
'U'
,
'B'
);
static
const
hb_tag_t
GSUBTag
=
HB_TAG
(
'G'
,
'S'
,
'U'
,
'B'
);
static
const
hb_tag_t
GPOSTag
=
HB_TAG
(
'G'
,
'P'
,
'O'
,
'S'
);
static
const
hb_tag_t
GPOSTag
=
HB_TAG
(
'G'
,
'P'
,
'O'
,
'S'
);
...
@@ -785,7 +796,9 @@ struct GSUBGPOSHeader {
...
@@ -785,7 +796,9 @@ struct GSUBGPOSHeader {
* GSUB/GPOS table */
* GSUB/GPOS table */
Offset
lookupList
;
/* Offset to LookupList table--from beginning of
Offset
lookupList
;
/* Offset to LookupList table--from beginning of
* GSUB/GPOS table */
* GSUB/GPOS table */
};
}
GSUBHeader
,
GPOSHeader
;
ASSERT_SIZE
(
GSUBGPOSHeader
,
10
);
DEFINE_NULL_ASSERT_SIZE
(
GSUBGPOSHeader
,
10
);
DEFINE_NULL_ALIAS
(
GSUBHeader
,
GSUBGPOSHeader
);
DEFINE_NULL_ALIAS
(
GPOSHeader
,
GSUBGPOSHeader
);
#endif
/* HARFBUZZ_OPEN_PRIVATE_H */
#endif
/* HARFBUZZ_OPEN_PRIVATE_H */
src/main.cc
浏览文件 @
1f437e6f
...
@@ -51,7 +51,7 @@ main (int argc, char **argv)
...
@@ -51,7 +51,7 @@ main (int argc, char **argv)
if
(
table
.
get_tag
()
==
"GSUB"
||
table
.
get_tag
()
==
"GPOS"
)
{
if
(
table
.
get_tag
()
==
"GSUB"
||
table
.
get_tag
()
==
"GPOS"
)
{
const
GSUBGPOSHeader
&
g
=
GSUBGPOSHeader
::
get_for_data
(
ot
[
table
]);
const
GSUBGPOSHeader
&
g
=
GSUBGPOSHeader
::
get_for_data
(
ot
[
table
]);
const
ScriptList
&
scripts
=
*
g
.
get_script_list
();
const
ScriptList
&
scripts
=
g
.
get_script_list
();
int
num_scripts
=
scripts
.
get_len
();
int
num_scripts
=
scripts
.
get_len
();
printf
(
" %d script(s) found in table
\n
"
,
num_scripts
);
printf
(
" %d script(s) found in table
\n
"
,
num_scripts
);
for
(
int
n_script
=
0
;
n_script
<
num_scripts
;
n_script
++
)
{
for
(
int
n_script
=
0
;
n_script
<
num_scripts
;
n_script
++
)
{
...
@@ -59,7 +59,7 @@ main (int argc, char **argv)
...
@@ -59,7 +59,7 @@ main (int argc, char **argv)
printf
(
" Script %2d of %2d: %.4s
\n
"
,
n_script
+
1
,
num_scripts
,
printf
(
" Script %2d of %2d: %.4s
\n
"
,
n_script
+
1
,
num_scripts
,
(
const
char
*
)
scripts
.
get_tag
(
n_script
));
(
const
char
*
)
scripts
.
get_tag
(
n_script
));
if
(
script
.
get_default_language_system
()
==
NULL
)
if
(
!
script
.
has_default_language_system
()
)
printf
(
" No default language system
\n
"
);
printf
(
" No default language system
\n
"
);
int
num_langsys
=
script
.
get_len
();
int
num_langsys
=
script
.
get_len
();
printf
(
" %d language system(s) found in script
\n
"
,
num_langsys
);
printf
(
" %d language system(s) found in script
\n
"
,
num_langsys
);
...
@@ -73,7 +73,7 @@ main (int argc, char **argv)
...
@@ -73,7 +73,7 @@ main (int argc, char **argv)
}
}
}
}
const
FeatureList
&
features
=
*
g
.
get_feature_list
();
const
FeatureList
&
features
=
g
.
get_feature_list
();
int
num_features
=
features
.
get_len
();
int
num_features
=
features
.
get_len
();
printf
(
" %d feature(s) found in table
\n
"
,
num_features
);
printf
(
" %d feature(s) found in table
\n
"
,
num_features
);
for
(
int
n_feature
=
0
;
n_feature
<
num_features
;
n_feature
++
)
{
for
(
int
n_feature
=
0
;
n_feature
<
num_features
;
n_feature
++
)
{
...
@@ -83,7 +83,7 @@ main (int argc, char **argv)
...
@@ -83,7 +83,7 @@ main (int argc, char **argv)
feature
.
get_len
());
feature
.
get_len
());
}
}
const
LookupList
&
lookups
=
*
g
.
get_lookup_list
();
const
LookupList
&
lookups
=
g
.
get_lookup_list
();
int
num_lookups
=
lookups
.
get_len
();
int
num_lookups
=
lookups
.
get_len
();
printf
(
" %d lookup(s) found in table
\n
"
,
num_lookups
);
printf
(
" %d lookup(s) found in table
\n
"
,
num_lookups
);
for
(
int
n_lookup
=
0
;
n_lookup
<
num_lookups
;
n_lookup
++
)
{
for
(
int
n_lookup
=
0
;
n_lookup
<
num_lookups
;
n_lookup
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录