File: linebreak_8h-source.html

package info (click to toggle)
liblinebreak2 2.1-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,964 kB
  • sloc: sh: 8,914; ansic: 2,501; makefile: 62; sed: 3
file content (102 lines) | stat: -rw-r--r-- 10,567 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>liblinebreak: linebreak.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.2 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    <li><a href="globals.html"><span>Globals</span></a></li>
  </ul>
</div>
<h1>linebreak.h</h1><a href="linebreak_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* vim: set tabstop=4 shiftwidth=4: */</span>
<a name="l00002"></a>00002 
<a name="l00003"></a>00003 <span class="comment">/*</span>
<a name="l00004"></a>00004 <span class="comment"> * Line breaking in a Unicode sequence.  Designed to be used in a</span>
<a name="l00005"></a>00005 <span class="comment"> * generic text renderer.</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * Copyright (C) 2008-2011 Wu Yongwei &lt;wuyongwei at gmail dot com&gt;</span>
<a name="l00008"></a>00008 <span class="comment"> *</span>
<a name="l00009"></a>00009 <span class="comment"> * This software is provided 'as-is', without any express or implied</span>
<a name="l00010"></a>00010 <span class="comment"> * warranty.  In no event will the author be held liable for any damages</span>
<a name="l00011"></a>00011 <span class="comment"> * arising from the use of this software.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * Permission is granted to anyone to use this software for any purpose,</span>
<a name="l00014"></a>00014 <span class="comment"> * including commercial applications, and to alter it and redistribute</span>
<a name="l00015"></a>00015 <span class="comment"> * it freely, subject to the following restrictions:</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> * 1. The origin of this software must not be misrepresented; you must</span>
<a name="l00018"></a>00018 <span class="comment"> *    not claim that you wrote the original software.  If you use this</span>
<a name="l00019"></a>00019 <span class="comment"> *    software in a product, an acknowledgement in the product</span>
<a name="l00020"></a>00020 <span class="comment"> *    documentation would be appreciated but is not required.</span>
<a name="l00021"></a>00021 <span class="comment"> * 2. Altered source versions must be plainly marked as such, and must</span>
<a name="l00022"></a>00022 <span class="comment"> *    not be misrepresented as being the original software.</span>
<a name="l00023"></a>00023 <span class="comment"> * 3. This notice may not be removed or altered from any source</span>
<a name="l00024"></a>00024 <span class="comment"> *    distribution.</span>
<a name="l00025"></a>00025 <span class="comment"> *</span>
<a name="l00026"></a>00026 <span class="comment"> * The main reference is Unicode Standard Annex 14 (UAX #14):</span>
<a name="l00027"></a>00027 <span class="comment"> *      &lt;URL:http://www.unicode.org/reports/tr14/&gt;</span>
<a name="l00028"></a>00028 <span class="comment"> *</span>
<a name="l00029"></a>00029 <span class="comment"> * When this library was designed, this annex was at Revision 19, for</span>
<a name="l00030"></a>00030 <span class="comment"> * Unicode 5.0.0:</span>
<a name="l00031"></a>00031 <span class="comment"> *      &lt;URL:http://www.unicode.org/reports/tr14/tr14-19.html&gt;</span>
<a name="l00032"></a>00032 <span class="comment"> *</span>
<a name="l00033"></a>00033 <span class="comment"> * This library has been updated according to Revision 26, for</span>
<a name="l00034"></a>00034 <span class="comment"> * Unicode 6.0.0:</span>
<a name="l00035"></a>00035 <span class="comment"> *      &lt;URL:http://www.unicode.org/reports/tr14/tr14-26.html&gt;</span>
<a name="l00036"></a>00036 <span class="comment"> *</span>
<a name="l00037"></a>00037 <span class="comment"> * The Unicode Terms of Use are available at</span>
<a name="l00038"></a>00038 <span class="comment"> *      &lt;URL:http://www.unicode.org/copyright.html&gt;</span>
<a name="l00039"></a>00039 <span class="comment"> */</span>
<a name="l00040"></a>00040 
<a name="l00050"></a>00050 <span class="preprocessor">#ifndef LINEBREAK_H</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#define LINEBREAK_H</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span>
<a name="l00053"></a>00053 <span class="preprocessor">#include &lt;stddef.h&gt;</span>
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00056"></a>00056 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
<a name="l00057"></a>00057 <span class="preprocessor">#endif</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span>
<a name="l00059"></a><a class="code" href="linebreak_8h.html#83634cb3df4ba09faf22ba687ffc4c02">00059</a> <span class="preprocessor">#define LINEBREAK_VERSION   0x0201  </span>
<a name="l00060"></a>00060 <span class="preprocessor">extern const int linebreak_version;</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span>
<a name="l00062"></a>00062 <span class="preprocessor">#ifndef LINEBREAK_UTF_TYPES_DEFINED</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#define LINEBREAK_UTF_TYPES_DEFINED</span>
<a name="l00064"></a><a class="code" href="linebreak_8h.html#6103b2105588f239c593e779e605038a">00064</a> <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>   <a class="code" href="linebreak_8h.html#6103b2105588f239c593e779e605038a" title="Type for UTF-8 data points.">utf8_t</a>;     
<a name="l00065"></a><a class="code" href="linebreak_8h.html#4dce96cad338d9281612277b2d80950c">00065</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>  <a class="code" href="linebreak_8h.html#4dce96cad338d9281612277b2d80950c" title="Type for UTF-16 data points.">utf16_t</a>;    
<a name="l00066"></a><a class="code" href="linebreak_8h.html#4f775bae0642c213be2c526018283c25">00066</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    <a class="code" href="linebreak_8h.html#4f775bae0642c213be2c526018283c25" title="Type for UTF-32 data points.">utf32_t</a>;    
<a name="l00067"></a>00067 <span class="preprocessor">#endif</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span>
<a name="l00069"></a><a class="code" href="linebreak_8h.html#367d64258fd90864a467687cd1736b77">00069</a> <span class="preprocessor">#define LINEBREAK_MUSTBREAK     0   </span>
<a name="l00070"></a><a class="code" href="linebreak_8h.html#229f34b0b72ccb2e53d0936a1e61a363">00070</a> <span class="preprocessor">#define LINEBREAK_ALLOWBREAK    1   </span>
<a name="l00071"></a><a class="code" href="linebreak_8h.html#dd176a107633817050bedf6eb4f491cc">00071</a> <span class="preprocessor">#define LINEBREAK_NOBREAK       2   </span>
<a name="l00072"></a><a class="code" href="linebreak_8h.html#5adf3d4831b89cb3e40e9bd31a73a39d">00072</a> <span class="preprocessor">#define LINEBREAK_INSIDEACHAR   3   </span>
<a name="l00074"></a>00074 <span class="preprocessor">void init_linebreak(void);</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="linebreak_8c.html#b426e9cf68117faf583a0ed54742cb28" title="Sets the line breaking information for a UTF-8 input string.">set_linebreaks_utf8</a>(
<a name="l00076"></a>00076         <span class="keyword">const</span> utf8_t *s, <span class="keywordtype">size_t</span> len, <span class="keyword">const</span> <span class="keywordtype">char</span>* lang, <span class="keywordtype">char</span> *brks);
<a name="l00077"></a>00077 <span class="keywordtype">void</span> <a class="code" href="linebreak_8c.html#1d56bce2d32cd986052172638cec43c8" title="Sets the line breaking information for a UTF-16 input string.">set_linebreaks_utf16</a>(
<a name="l00078"></a>00078         <span class="keyword">const</span> utf16_t *s, <span class="keywordtype">size_t</span> len, <span class="keyword">const</span> <span class="keywordtype">char</span>* lang, <span class="keywordtype">char</span> *brks);
<a name="l00079"></a>00079 <span class="keywordtype">void</span> <a class="code" href="linebreak_8c.html#9fdce33b4ded9d586888c16228ae9e1f" title="Sets the line breaking information for a UTF-32 input string.">set_linebreaks_utf32</a>(
<a name="l00080"></a>00080         <span class="keyword">const</span> utf32_t *s, <span class="keywordtype">size_t</span> len, <span class="keyword">const</span> <span class="keywordtype">char</span>* lang, <span class="keywordtype">char</span> *brks);
<a name="l00081"></a>00081 <span class="keywordtype">int</span> <a class="code" href="linebreak_8c.html#5761f60559b5ddb61bb095f00c7deb5c" title="Tells whether a line break can occur between two Unicode characters.">is_line_breakable</a>(utf32_t char1, utf32_t char2, <span class="keyword">const</span> <span class="keywordtype">char</span>* lang);
<a name="l00082"></a>00082 
<a name="l00083"></a>00083 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span>}
<a name="l00085"></a>00085 <span class="preprocessor">#endif</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span>
<a name="l00087"></a>00087 <span class="preprocessor">#endif </span><span class="comment">/* LINEBREAK_H */</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Sat May 14 15:01:38 2011 for liblinebreak by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address>
</body>
</html>