Imported Upstream version 2.3.1
[platform/upstream/harfbuzz.git] / docs / html / harfbuzz-hb-blob.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>hb-blob: HarfBuzz Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="HarfBuzz Manual">
8 <link rel="up" href="ch09.html" title="Core API">
9 <link rel="prev" href="ch09.html" title="Core API">
10 <link rel="next" href="harfbuzz-hb-buffer.html" title="hb-buffer">
11 <meta name="generator" content="GTK-Doc V1.25 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
18                   <a href="#harfbuzz-hb-blob.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
19                   <a href="#harfbuzz-hb-blob.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
20 </td>
21 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
22 <td><a accesskey="u" href="ch09.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
23 <td><a accesskey="p" href="ch09.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
24 <td><a accesskey="n" href="harfbuzz-hb-buffer.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
25 </tr></table>
26 <div class="refentry">
27 <a name="harfbuzz-hb-blob"></a><div class="titlepage"></div>
28 <div class="refnamediv"><table width="100%"><tr>
29 <td valign="top">
30 <h2><span class="refentrytitle"><a name="harfbuzz-hb-blob.top_of_page"></a>hb-blob</span></h2>
31 <p>hb-blob — Binary data containers</p>
32 </td>
33 <td class="gallery_image" valign="top" align="right"></td>
34 </tr></table></div>
35 <div class="refsect1">
36 <a name="harfbuzz-hb-blob.functions"></a><h2>Functions</h2>
37 <div class="informaltable"><table class="informaltable" width="100%" border="0">
38 <colgroup>
39 <col width="150px" class="functions_return">
40 <col class="functions_name">
41 </colgroup>
42 <tbody>
43 <tr>
44 <td class="function_type">
45 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
46 </td>
47 <td class="function_name">
48 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-create" title="hb_blob_create ()">hb_blob_create</a> <span class="c_punctuation">()</span>
49 </td>
50 </tr>
51 <tr>
52 <td class="function_type">
53 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
54 </td>
55 <td class="function_name">
56 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-create-from-file" title="hb_blob_create_from_file ()">hb_blob_create_from_file</a> <span class="c_punctuation">()</span>
57 </td>
58 </tr>
59 <tr>
60 <td class="function_type">
61 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
62 </td>
63 <td class="function_name">
64 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-create-sub-blob" title="hb_blob_create_sub_blob ()">hb_blob_create_sub_blob</a> <span class="c_punctuation">()</span>
65 </td>
66 </tr>
67 <tr>
68 <td class="function_type">
69 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
70 </td>
71 <td class="function_name">
72 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-copy-writable-or-fail" title="hb_blob_copy_writable_or_fail ()">hb_blob_copy_writable_or_fail</a> <span class="c_punctuation">()</span>
73 </td>
74 </tr>
75 <tr>
76 <td class="function_type">
77 <span class="returnvalue">void</span>
78 </td>
79 <td class="function_name">
80 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-destroy" title="hb_blob_destroy ()">hb_blob_destroy</a> <span class="c_punctuation">()</span>
81 </td>
82 </tr>
83 <tr>
84 <td class="function_type">const <span class="returnvalue">char</span> *
85 </td>
86 <td class="function_name">
87 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-get-data" title="hb_blob_get_data ()">hb_blob_get_data</a> <span class="c_punctuation">()</span>
88 </td>
89 </tr>
90 <tr>
91 <td class="function_type">
92 <span class="returnvalue">char</span> *
93 </td>
94 <td class="function_name">
95 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-get-data-writable" title="hb_blob_get_data_writable ()">hb_blob_get_data_writable</a> <span class="c_punctuation">()</span>
96 </td>
97 </tr>
98 <tr>
99 <td class="function_type">
100 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
101 </td>
102 <td class="function_name">
103 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-get-empty" title="hb_blob_get_empty ()">hb_blob_get_empty</a> <span class="c_punctuation">()</span>
104 </td>
105 </tr>
106 <tr>
107 <td class="function_type">unsigned <span class="returnvalue">int</span>
108 </td>
109 <td class="function_name">
110 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-get-length" title="hb_blob_get_length ()">hb_blob_get_length</a> <span class="c_punctuation">()</span>
111 </td>
112 </tr>
113 <tr>
114 <td class="function_type">
115 <span class="returnvalue">void</span> *
116 </td>
117 <td class="function_name">
118 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-get-user-data" title="hb_blob_get_user_data ()">hb_blob_get_user_data</a> <span class="c_punctuation">()</span>
119 </td>
120 </tr>
121 <tr>
122 <td class="function_type">
123 <a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
124 </td>
125 <td class="function_name">
126 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-is-immutable" title="hb_blob_is_immutable ()">hb_blob_is_immutable</a> <span class="c_punctuation">()</span>
127 </td>
128 </tr>
129 <tr>
130 <td class="function_type">
131 <span class="returnvalue">void</span>
132 </td>
133 <td class="function_name">
134 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-make-immutable" title="hb_blob_make_immutable ()">hb_blob_make_immutable</a> <span class="c_punctuation">()</span>
135 </td>
136 </tr>
137 <tr>
138 <td class="function_type">
139 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
140 </td>
141 <td class="function_name">
142 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-reference" title="hb_blob_reference ()">hb_blob_reference</a> <span class="c_punctuation">()</span>
143 </td>
144 </tr>
145 <tr>
146 <td class="function_type">
147 <a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
148 </td>
149 <td class="function_name">
150 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-set-user-data" title="hb_blob_set_user_data ()">hb_blob_set_user_data</a> <span class="c_punctuation">()</span>
151 </td>
152 </tr>
153 </tbody>
154 </table></div>
155 </div>
156 <a name="hb-blob-t"></a><div class="refsect1">
157 <a name="harfbuzz-hb-blob.other"></a><h2>Types and Values</h2>
158 <div class="informaltable"><table class="informaltable" width="100%" border="0">
159 <colgroup>
160 <col width="150px" class="name">
161 <col class="description">
162 </colgroup>
163 <tbody>
164 <tr>
165 <td class="typedef_keyword">typedef</td>
166 <td class="function_name"><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t">hb_blob_t</a></td>
167 </tr>
168 <tr>
169 <td class="datatype_keyword">enum</td>
170 <td class="function_name"><a class="link" href="harfbuzz-hb-blob.html#hb-memory-mode-t" title="enum hb_memory_mode_t">hb_memory_mode_t</a></td>
171 </tr>
172 </tbody>
173 </table></div>
174 </div>
175 <div class="refsect1">
176 <a name="harfbuzz-hb-blob.object-hierarchy"></a><h2>Object Hierarchy</h2>
177 <pre class="screen">    <a href="/usr/share/gtk-doc/html/gobject/gobject-Boxed-Types.html">GBoxed</a>
178     <span class="lineart">╰──</span> hb_blob_t
179     <a href="/usr/share/gtk-doc/html/gobject/gobject-Enumeration-and-Flag-Types.html">GEnum</a>
180     <span class="lineart">╰──</span> hb_memory_mode_t
181 </pre>
182 </div>
183 <div class="refsect1">
184 <a name="harfbuzz-hb-blob.includes"></a><h2>Includes</h2>
185 <pre class="synopsis">#include &lt;hb.h&gt;
186 </pre>
187 </div>
188 <div class="refsect1">
189 <a name="harfbuzz-hb-blob.description"></a><h2>Description</h2>
190 <p>Blobs wrap a chunk of binary data to handle lifecycle management of data
191 while it is passed between client and HarfBuzz.  Blobs are primarily used
192 to create font faces, but also to access font face tables, as well as
193 pass around other binary data.</p>
194 </div>
195 <div class="refsect1">
196 <a name="harfbuzz-hb-blob.functions_details"></a><h2>Functions</h2>
197 <div class="refsect2">
198 <a name="hb-blob-create"></a><h3>hb_blob_create ()</h3>
199 <pre class="programlisting"><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
200 hb_blob_create (<em class="parameter"><code>const <span class="type">char</span> *data</code></em>,
201                 <em class="parameter"><code>unsigned <span class="type">int</span> length</code></em>,
202                 <em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-memory-mode-t" title="enum hb_memory_mode_t"><span class="type">hb_memory_mode_t</span></a> mode</code></em>,
203                 <em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
204                 <em class="parameter"><code><a class="link" href="harfbuzz-hb-common.html#hb-destroy-func-t" title="hb_destroy_func_t ()"><span class="type">hb_destroy_func_t</span></a> destroy</code></em>);</pre>
205 <p>Creates a new "blob" object wrapping <em class="parameter"><code>data</code></em>
206 .  The <em class="parameter"><code>mode</code></em>
207  parameter is used
208 to negotiate ownership and lifecycle of <em class="parameter"><code>data</code></em>
209 .</p>
210 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
211 <div class="refsect3">
212 <a name="hb-blob-create.parameters"></a><h4>Parameters</h4>
213 <div class="informaltable"><table class="informaltable" width="100%" border="0">
214 <colgroup>
215 <col width="150px" class="parameters_name">
216 <col class="parameters_description">
217 <col width="200px" class="parameters_annotations">
218 </colgroup>
219 <tbody>
220 <tr>
221 <td class="parameter_name"><p>data</p></td>
222 <td class="parameter_description"><p>Pointer to blob data.</p></td>
223 <td class="parameter_annotations"> </td>
224 </tr>
225 <tr>
226 <td class="parameter_name"><p>length</p></td>
227 <td class="parameter_description"><p>Length of <em class="parameter"><code>data</code></em>
228 in bytes.</p></td>
229 <td class="parameter_annotations"> </td>
230 </tr>
231 <tr>
232 <td class="parameter_name"><p>mode</p></td>
233 <td class="parameter_description"><p>Memory mode for <em class="parameter"><code>data</code></em>
234 .</p></td>
235 <td class="parameter_annotations"> </td>
236 </tr>
237 <tr>
238 <td class="parameter_name"><p>user_data</p></td>
239 <td class="parameter_description"><p>Data parameter to pass to <em class="parameter"><code>destroy</code></em>
240 .</p></td>
241 <td class="parameter_annotations"> </td>
242 </tr>
243 <tr>
244 <td class="parameter_name"><p>destroy</p></td>
245 <td class="parameter_description"><p>Callback to call when <em class="parameter"><code>data</code></em>
246 is not needed anymore.</p></td>
247 <td class="parameter_annotations"> </td>
248 </tr>
249 </tbody>
250 </table></div>
251 </div>
252 <div class="refsect3">
253 <a name="hb-blob-create.returns"></a><h4>Returns</h4>
254 <p> New blob, or the empty blob if something failed or if <em class="parameter"><code>length</code></em>
255 is
256 zero.  Destroy with <a class="link" href="harfbuzz-hb-blob.html#hb-blob-destroy" title="hb_blob_destroy ()"><code class="function">hb_blob_destroy()</code></a>.</p>
257 </div>
258 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
259 </div>
260 <hr>
261 <div class="refsect2">
262 <a name="hb-blob-create-from-file"></a><h3>hb_blob_create_from_file ()</h3>
263 <pre class="programlisting"><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
264 hb_blob_create_from_file (<em class="parameter"><code>const <span class="type">char</span> *file_name</code></em>);</pre>
265 <div class="refsect3">
266 <a name="hb-blob-create-from-file.parameters"></a><h4>Parameters</h4>
267 <div class="informaltable"><table class="informaltable" width="100%" border="0">
268 <colgroup>
269 <col width="150px" class="parameters_name">
270 <col class="parameters_description">
271 <col width="200px" class="parameters_annotations">
272 </colgroup>
273 <tbody><tr>
274 <td class="parameter_name"><p>file_name</p></td>
275 <td class="parameter_description"><p>font filename.</p></td>
276 <td class="parameter_annotations"> </td>
277 </tr></tbody>
278 </table></div>
279 </div>
280 <div class="refsect3">
281 <a name="hb-blob-create-from-file.returns"></a><h4>Returns</h4>
282 <p> A hb_blob_t pointer with the content of the file</p>
283 </div>
284 <p class="since">Since: <a class="link" href="api-index-1-7-7.html#api-index-1.7.7">1.7.7</a></p>
285 </div>
286 <hr>
287 <div class="refsect2">
288 <a name="hb-blob-create-sub-blob"></a><h3>hb_blob_create_sub_blob ()</h3>
289 <pre class="programlisting"><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
290 hb_blob_create_sub_blob (<em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="type">hb_blob_t</span></a> *parent</code></em>,
291                          <em class="parameter"><code>unsigned <span class="type">int</span> offset</code></em>,
292                          <em class="parameter"><code>unsigned <span class="type">int</span> length</code></em>);</pre>
293 <p>Returns a blob that represents a range of bytes in <em class="parameter"><code>parent</code></em>
294 .  The new
295 blob is always created with <a class="link" href="harfbuzz-hb-blob.html#HB-MEMORY-MODE-READONLY:CAPS"><code class="literal">HB_MEMORY_MODE_READONLY</code></a>, meaning that it
296 will never modify data in the parent blob.  The parent data is not
297 expected to be modified, and will result in undefined behavior if it
298 is.</p>
299 <p>Makes <em class="parameter"><code>parent</code></em>
300  immutable.</p>
301 <div class="refsect3">
302 <a name="hb-blob-create-sub-blob.parameters"></a><h4>Parameters</h4>
303 <div class="informaltable"><table class="informaltable" width="100%" border="0">
304 <colgroup>
305 <col width="150px" class="parameters_name">
306 <col class="parameters_description">
307 <col width="200px" class="parameters_annotations">
308 </colgroup>
309 <tbody>
310 <tr>
311 <td class="parameter_name"><p>parent</p></td>
312 <td class="parameter_description"><p>Parent blob.</p></td>
313 <td class="parameter_annotations"> </td>
314 </tr>
315 <tr>
316 <td class="parameter_name"><p>offset</p></td>
317 <td class="parameter_description"><p>Start offset of sub-blob within <em class="parameter"><code>parent</code></em>
318 , in bytes.</p></td>
319 <td class="parameter_annotations"> </td>
320 </tr>
321 <tr>
322 <td class="parameter_name"><p>length</p></td>
323 <td class="parameter_description"><p>Length of sub-blob.</p></td>
324 <td class="parameter_annotations"> </td>
325 </tr>
326 </tbody>
327 </table></div>
328 </div>
329 <div class="refsect3">
330 <a name="hb-blob-create-sub-blob.returns"></a><h4>Returns</h4>
331 <p> New blob, or the empty blob if something failed or if
332 <em class="parameter"><code>length</code></em>
333 is zero or <em class="parameter"><code>offset</code></em>
334 is beyond the end of <em class="parameter"><code>parent</code></em>
335 's data.  Destroy
336 with <a class="link" href="harfbuzz-hb-blob.html#hb-blob-destroy" title="hb_blob_destroy ()"><code class="function">hb_blob_destroy()</code></a>.</p>
337 </div>
338 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
339 </div>
340 <hr>
341 <div class="refsect2">
342 <a name="hb-blob-copy-writable-or-fail"></a><h3>hb_blob_copy_writable_or_fail ()</h3>
343 <pre class="programlisting"><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
344 hb_blob_copy_writable_or_fail (<em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="type">hb_blob_t</span></a> *blob</code></em>);</pre>
345 <p>Makes a writable copy of <em class="parameter"><code>blob</code></em>
346 .</p>
347 <div class="refsect3">
348 <a name="hb-blob-copy-writable-or-fail.parameters"></a><h4>Parameters</h4>
349 <div class="informaltable"><table class="informaltable" width="100%" border="0">
350 <colgroup>
351 <col width="150px" class="parameters_name">
352 <col class="parameters_description">
353 <col width="200px" class="parameters_annotations">
354 </colgroup>
355 <tbody><tr>
356 <td class="parameter_name"><p>blob</p></td>
357 <td class="parameter_description"><p>A blob.</p></td>
358 <td class="parameter_annotations"> </td>
359 </tr></tbody>
360 </table></div>
361 </div>
362 <div class="refsect3">
363 <a name="hb-blob-copy-writable-or-fail.returns"></a><h4>Returns</h4>
364 <p> New blob, or nullptr if allocation failed.</p>
365 </div>
366 <p class="since">Since: <a class="link" href="api-index-1-8-0.html#api-index-1.8.0">1.8.0</a></p>
367 </div>
368 <hr>
369 <div class="refsect2">
370 <a name="hb-blob-destroy"></a><h3>hb_blob_destroy ()</h3>
371 <pre class="programlisting"><span class="returnvalue">void</span>
372 hb_blob_destroy (<em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="type">hb_blob_t</span></a> *blob</code></em>);</pre>
373 <p>Decreases the reference count on <em class="parameter"><code>blob</code></em>
374 , and if it reaches zero, destroys
375 <em class="parameter"><code>blob</code></em>
376 , freeing all memory, possibly calling the destroy-callback the blob
377 was created for if it has not been called already.</p>
378 <p>See TODO:link object types for more information.</p>
379 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
380 <div class="refsect3">
381 <a name="hb-blob-destroy.parameters"></a><h4>Parameters</h4>
382 <div class="informaltable"><table class="informaltable" width="100%" border="0">
383 <colgroup>
384 <col width="150px" class="parameters_name">
385 <col class="parameters_description">
386 <col width="200px" class="parameters_annotations">
387 </colgroup>
388 <tbody><tr>
389 <td class="parameter_name"><p>blob</p></td>
390 <td class="parameter_description"><p>a blob.</p></td>
391 <td class="parameter_annotations"> </td>
392 </tr></tbody>
393 </table></div>
394 </div>
395 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
396 </div>
397 <hr>
398 <div class="refsect2">
399 <a name="hb-blob-get-data"></a><h3>hb_blob_get_data ()</h3>
400 <pre class="programlisting">const <span class="returnvalue">char</span> *
401 hb_blob_get_data (<em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="type">hb_blob_t</span></a> *blob</code></em>,
402                   <em class="parameter"><code>unsigned <span class="type">int</span> *length</code></em>);</pre>
403 <div class="refsect3">
404 <a name="hb-blob-get-data.parameters"></a><h4>Parameters</h4>
405 <div class="informaltable"><table class="informaltable" width="100%" border="0">
406 <colgroup>
407 <col width="150px" class="parameters_name">
408 <col class="parameters_description">
409 <col width="200px" class="parameters_annotations">
410 </colgroup>
411 <tbody>
412 <tr>
413 <td class="parameter_name"><p>blob</p></td>
414 <td class="parameter_description"><p>a blob.</p></td>
415 <td class="parameter_annotations"> </td>
416 </tr>
417 <tr>
418 <td class="parameter_name"><p>length</p></td>
419 <td class="parameter_description"><p>. </p></td>
420 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
421 </tr>
422 </tbody>
423 </table></div>
424 </div>
425 <div class="refsect3">
426 <a name="hb-blob-get-data.returns"></a><h4>Returns</h4>
427 <p>. </p>
428 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length]</span></p>
429 </div>
430 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
431 </div>
432 <hr>
433 <div class="refsect2">
434 <a name="hb-blob-get-data-writable"></a><h3>hb_blob_get_data_writable ()</h3>
435 <pre class="programlisting"><span class="returnvalue">char</span> *
436 hb_blob_get_data_writable (<em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="type">hb_blob_t</span></a> *blob</code></em>,
437                            <em class="parameter"><code>unsigned <span class="type">int</span> *length</code></em>);</pre>
438 <p>Tries to make blob data writable (possibly copying it) and
439 return pointer to data.</p>
440 <p>Fails if blob has been made immutable, or if memory allocation
441 fails.</p>
442 <div class="refsect3">
443 <a name="hb-blob-get-data-writable.parameters"></a><h4>Parameters</h4>
444 <div class="informaltable"><table class="informaltable" width="100%" border="0">
445 <colgroup>
446 <col width="150px" class="parameters_name">
447 <col class="parameters_description">
448 <col width="200px" class="parameters_annotations">
449 </colgroup>
450 <tbody>
451 <tr>
452 <td class="parameter_name"><p>blob</p></td>
453 <td class="parameter_description"><p>a blob.</p></td>
454 <td class="parameter_annotations"> </td>
455 </tr>
456 <tr>
457 <td class="parameter_name"><p>length</p></td>
458 <td class="parameter_description"><p> output length of the writable data. </p></td>
459 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
460 </tr>
461 </tbody>
462 </table></div>
463 </div>
464 <div class="refsect3">
465 <a name="hb-blob-get-data-writable.returns"></a><h4>Returns</h4>
466 <p> Writable blob data,
467 or <code class="literal">NULL</code> if failed. </p>
468 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length]</span></p>
469 </div>
470 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
471 </div>
472 <hr>
473 <div class="refsect2">
474 <a name="hb-blob-get-empty"></a><h3>hb_blob_get_empty ()</h3>
475 <pre class="programlisting"><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
476 hb_blob_get_empty (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
477 <p>Returns the singleton empty blob.</p>
478 <p>See TODO:link object types for more information.</p>
479 <div class="refsect3">
480 <a name="hb-blob-get-empty.returns"></a><h4>Returns</h4>
481 <p> the empty blob. </p>
482 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
483 </div>
484 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
485 </div>
486 <hr>
487 <div class="refsect2">
488 <a name="hb-blob-get-length"></a><h3>hb_blob_get_length ()</h3>
489 <pre class="programlisting">unsigned <span class="returnvalue">int</span>
490 hb_blob_get_length (<em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="type">hb_blob_t</span></a> *blob</code></em>);</pre>
491 <div class="refsect3">
492 <a name="hb-blob-get-length.parameters"></a><h4>Parameters</h4>
493 <div class="informaltable"><table class="informaltable" width="100%" border="0">
494 <colgroup>
495 <col width="150px" class="parameters_name">
496 <col class="parameters_description">
497 <col width="200px" class="parameters_annotations">
498 </colgroup>
499 <tbody><tr>
500 <td class="parameter_name"><p>blob</p></td>
501 <td class="parameter_description"><p>a blob.</p></td>
502 <td class="parameter_annotations"> </td>
503 </tr></tbody>
504 </table></div>
505 </div>
506 <div class="refsect3">
507 <a name="hb-blob-get-length.returns"></a><h4>Returns</h4>
508 <p> the length of blob data in bytes.</p>
509 </div>
510 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
511 </div>
512 <hr>
513 <div class="refsect2">
514 <a name="hb-blob-get-user-data"></a><h3>hb_blob_get_user_data ()</h3>
515 <pre class="programlisting"><span class="returnvalue">void</span> *
516 hb_blob_get_user_data (<em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="type">hb_blob_t</span></a> *blob</code></em>,
517                        <em class="parameter"><code><a class="link" href="harfbuzz-hb-common.html#hb-user-data-key-t"><span class="type">hb_user_data_key_t</span></a> *key</code></em>);</pre>
518 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
519 <div class="refsect3">
520 <a name="hb-blob-get-user-data.parameters"></a><h4>Parameters</h4>
521 <div class="informaltable"><table class="informaltable" width="100%" border="0">
522 <colgroup>
523 <col width="150px" class="parameters_name">
524 <col class="parameters_description">
525 <col width="200px" class="parameters_annotations">
526 </colgroup>
527 <tbody>
528 <tr>
529 <td class="parameter_name"><p>blob</p></td>
530 <td class="parameter_description"><p>a blob.</p></td>
531 <td class="parameter_annotations"> </td>
532 </tr>
533 <tr>
534 <td class="parameter_name"><p>key</p></td>
535 <td class="parameter_description"><p>key for data to get.</p></td>
536 <td class="parameter_annotations"> </td>
537 </tr>
538 </tbody>
539 </table></div>
540 </div>
541 <div class="refsect3">
542 <a name="hb-blob-get-user-data.returns"></a><h4>Returns</h4>
543 <p>. </p>
544 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
545 </div>
546 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
547 </div>
548 <hr>
549 <div class="refsect2">
550 <a name="hb-blob-is-immutable"></a><h3>hb_blob_is_immutable ()</h3>
551 <pre class="programlisting"><a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
552 hb_blob_is_immutable (<em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="type">hb_blob_t</span></a> *blob</code></em>);</pre>
553 <div class="refsect3">
554 <a name="hb-blob-is-immutable.parameters"></a><h4>Parameters</h4>
555 <div class="informaltable"><table class="informaltable" width="100%" border="0">
556 <colgroup>
557 <col width="150px" class="parameters_name">
558 <col class="parameters_description">
559 <col width="200px" class="parameters_annotations">
560 </colgroup>
561 <tbody><tr>
562 <td class="parameter_name"><p>blob</p></td>
563 <td class="parameter_description"><p>a blob.</p></td>
564 <td class="parameter_annotations"> </td>
565 </tr></tbody>
566 </table></div>
567 </div>
568 <div class="refsect3">
569 <a name="hb-blob-is-immutable.returns"></a><h4>Returns</h4>
570 <p> TODO</p>
571 </div>
572 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
573 </div>
574 <hr>
575 <div class="refsect2">
576 <a name="hb-blob-make-immutable"></a><h3>hb_blob_make_immutable ()</h3>
577 <pre class="programlisting"><span class="returnvalue">void</span>
578 hb_blob_make_immutable (<em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="type">hb_blob_t</span></a> *blob</code></em>);</pre>
579 <div class="refsect3">
580 <a name="hb-blob-make-immutable.parameters"></a><h4>Parameters</h4>
581 <div class="informaltable"><table class="informaltable" width="100%" border="0">
582 <colgroup>
583 <col width="150px" class="parameters_name">
584 <col class="parameters_description">
585 <col width="200px" class="parameters_annotations">
586 </colgroup>
587 <tbody><tr>
588 <td class="parameter_name"><p>blob</p></td>
589 <td class="parameter_description"><p>a blob.</p></td>
590 <td class="parameter_annotations"> </td>
591 </tr></tbody>
592 </table></div>
593 </div>
594 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
595 </div>
596 <hr>
597 <div class="refsect2">
598 <a name="hb-blob-reference"></a><h3>hb_blob_reference ()</h3>
599 <pre class="programlisting"><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="returnvalue">hb_blob_t</span></a> *
600 hb_blob_reference (<em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="type">hb_blob_t</span></a> *blob</code></em>);</pre>
601 <p>Increases the reference count on <em class="parameter"><code>blob</code></em>
602 .</p>
603 <p>See TODO:link object types for more information.</p>
604 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
605 <div class="refsect3">
606 <a name="hb-blob-reference.parameters"></a><h4>Parameters</h4>
607 <div class="informaltable"><table class="informaltable" width="100%" border="0">
608 <colgroup>
609 <col width="150px" class="parameters_name">
610 <col class="parameters_description">
611 <col width="200px" class="parameters_annotations">
612 </colgroup>
613 <tbody><tr>
614 <td class="parameter_name"><p>blob</p></td>
615 <td class="parameter_description"><p>a blob.</p></td>
616 <td class="parameter_annotations"> </td>
617 </tr></tbody>
618 </table></div>
619 </div>
620 <div class="refsect3">
621 <a name="hb-blob-reference.returns"></a><h4>Returns</h4>
622 <p> <em class="parameter"><code>blob</code></em>
623 .</p>
624 </div>
625 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
626 </div>
627 <hr>
628 <div class="refsect2">
629 <a name="hb-blob-set-user-data"></a><h3>hb_blob_set_user_data ()</h3>
630 <pre class="programlisting"><a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
631 hb_blob_set_user_data (<em class="parameter"><code><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t"><span class="type">hb_blob_t</span></a> *blob</code></em>,
632                        <em class="parameter"><code><a class="link" href="harfbuzz-hb-common.html#hb-user-data-key-t"><span class="type">hb_user_data_key_t</span></a> *key</code></em>,
633                        <em class="parameter"><code><span class="type">void</span> *data</code></em>,
634                        <em class="parameter"><code><a class="link" href="harfbuzz-hb-common.html#hb-destroy-func-t" title="hb_destroy_func_t ()"><span class="type">hb_destroy_func_t</span></a> destroy</code></em>,
635                        <em class="parameter"><code><a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="type">hb_bool_t</span></a> replace</code></em>);</pre>
636 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
637 <div class="refsect3">
638 <a name="hb-blob-set-user-data.parameters"></a><h4>Parameters</h4>
639 <div class="informaltable"><table class="informaltable" width="100%" border="0">
640 <colgroup>
641 <col width="150px" class="parameters_name">
642 <col class="parameters_description">
643 <col width="200px" class="parameters_annotations">
644 </colgroup>
645 <tbody>
646 <tr>
647 <td class="parameter_name"><p>blob</p></td>
648 <td class="parameter_description"><p>a blob.</p></td>
649 <td class="parameter_annotations"> </td>
650 </tr>
651 <tr>
652 <td class="parameter_name"><p>key</p></td>
653 <td class="parameter_description"><p>key for data to set.</p></td>
654 <td class="parameter_annotations"> </td>
655 </tr>
656 <tr>
657 <td class="parameter_name"><p>data</p></td>
658 <td class="parameter_description"><p>data to set.</p></td>
659 <td class="parameter_annotations"> </td>
660 </tr>
661 <tr>
662 <td class="parameter_name"><p>destroy</p></td>
663 <td class="parameter_description"><p>callback to call when <em class="parameter"><code>data</code></em>
664 is not needed anymore.</p></td>
665 <td class="parameter_annotations"> </td>
666 </tr>
667 <tr>
668 <td class="parameter_name"><p>replace</p></td>
669 <td class="parameter_description"><p>whether to replace an existing data with the same key.</p></td>
670 <td class="parameter_annotations"> </td>
671 </tr>
672 </tbody>
673 </table></div>
674 </div>
675 <p class="since">Since: <a class="link" href="api-index-0-9-2.html#api-index-0.9.2">0.9.2</a></p>
676 </div>
677 </div>
678 <div class="refsect1">
679 <a name="harfbuzz-hb-blob.other_details"></a><h2>Types and Values</h2>
680 <div class="refsect2">
681 <a name="hb-blob-t"></a><h3>hb_blob_t</h3>
682 <pre class="programlisting">typedef struct hb_blob_t hb_blob_t;
683 </pre>
684 </div>
685 <hr>
686 <div class="refsect2">
687 <a name="hb-memory-mode-t"></a><h3>enum hb_memory_mode_t</h3>
688 <div class="refsect3">
689 <a name="hb-memory-mode-t.members"></a><h4>Members</h4>
690 <div class="informaltable"><table class="informaltable" width="100%" border="0">
691 <colgroup>
692 <col width="300px" class="enum_members_name">
693 <col class="enum_members_description">
694 <col width="200px" class="enum_members_annotations">
695 </colgroup>
696 <tbody>
697 <tr>
698 <td class="enum_member_name"><p><a name="HB-MEMORY-MODE-DUPLICATE:CAPS"></a>HB_MEMORY_MODE_DUPLICATE</p></td>
699 <td> </td>
700 <td> </td>
701 </tr>
702 <tr>
703 <td class="enum_member_name"><p><a name="HB-MEMORY-MODE-READONLY:CAPS"></a>HB_MEMORY_MODE_READONLY</p></td>
704 <td> </td>
705 <td> </td>
706 </tr>
707 <tr>
708 <td class="enum_member_name"><p><a name="HB-MEMORY-MODE-WRITABLE:CAPS"></a>HB_MEMORY_MODE_WRITABLE</p></td>
709 <td> </td>
710 <td> </td>
711 </tr>
712 <tr>
713 <td class="enum_member_name"><p><a name="HB-MEMORY-MODE-READONLY-MAY-MAKE-WRITABLE:CAPS"></a>HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE</p></td>
714 <td> </td>
715 <td> </td>
716 </tr>
717 </tbody>
718 </table></div>
719 </div>
720 </div>
721 </div>
722 </div>
723 <div class="footer">
724 <hr>Generated by GTK-Doc V1.25</div>
725 </body>
726 </html>