Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-release > by-pkgid > 2a9a0500ba8dfb95025148f22d49b751 > files > 63

lib64caca-devel-0.99-0.beta18.13.mga6.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
    <title>libcaca documentation</title>
    <link href="doxygen.css" rel="stylesheet" type="text/css">
  </head>
  <body>
<!-- Generated by Doxygen 1.8.11 -->
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">libcaca importers/exporters from/to various</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga09c7286f79c0dd244e7e5434d2519b7a"><td class="memItemLeft" align="right" valign="top">__extern ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__importexport.html#ga09c7286f79c0dd244e7e5434d2519b7a">caca_import_canvas_from_memory</a> (<a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *, void const *, size_t, char const *)</td></tr>
<tr class="memdesc:ga09c7286f79c0dd244e7e5434d2519b7a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Import a memory buffer into a canvas.  <a href="#ga09c7286f79c0dd244e7e5434d2519b7a">More...</a><br /></td></tr>
<tr class="separator:ga09c7286f79c0dd244e7e5434d2519b7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa47bfa2ea5cfe33b87fe7a919d5ff500"><td class="memItemLeft" align="right" valign="top">__extern ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__importexport.html#gaa47bfa2ea5cfe33b87fe7a919d5ff500">caca_import_canvas_from_file</a> (<a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *, char const *, char const *)</td></tr>
<tr class="memdesc:gaa47bfa2ea5cfe33b87fe7a919d5ff500"><td class="mdescLeft">&#160;</td><td class="mdescRight">Import a file into a canvas.  <a href="#gaa47bfa2ea5cfe33b87fe7a919d5ff500">More...</a><br /></td></tr>
<tr class="separator:gaa47bfa2ea5cfe33b87fe7a919d5ff500"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4455d225b91573e265211e5c41553a37"><td class="memItemLeft" align="right" valign="top">__extern ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__importexport.html#ga4455d225b91573e265211e5c41553a37">caca_import_area_from_memory</a> (<a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *, int, int, void const *, size_t, char const *)</td></tr>
<tr class="memdesc:ga4455d225b91573e265211e5c41553a37"><td class="mdescLeft">&#160;</td><td class="mdescRight">Import a memory buffer into a canvas area.  <a href="#ga4455d225b91573e265211e5c41553a37">More...</a><br /></td></tr>
<tr class="separator:ga4455d225b91573e265211e5c41553a37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae6bcaa3e30d6ba075c14a817a2464f55"><td class="memItemLeft" align="right" valign="top">__extern ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__importexport.html#gae6bcaa3e30d6ba075c14a817a2464f55">caca_import_area_from_file</a> (<a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *, int, int, char const *, char const *)</td></tr>
<tr class="memdesc:gae6bcaa3e30d6ba075c14a817a2464f55"><td class="mdescLeft">&#160;</td><td class="mdescRight">Import a file into a canvas area.  <a href="#gae6bcaa3e30d6ba075c14a817a2464f55">More...</a><br /></td></tr>
<tr class="separator:gae6bcaa3e30d6ba075c14a817a2464f55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf49776c6092b0d3f47624e837acaa8a6"><td class="memItemLeft" align="right" valign="top">__extern char const *const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__importexport.html#gaf49776c6092b0d3f47624e837acaa8a6">caca_get_import_list</a> (void)</td></tr>
<tr class="memdesc:gaf49776c6092b0d3f47624e837acaa8a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get available import formats.  <a href="#gaf49776c6092b0d3f47624e837acaa8a6">More...</a><br /></td></tr>
<tr class="separator:gaf49776c6092b0d3f47624e837acaa8a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa5e64cff9efe9e6bdafc9a2e95b59c89"><td class="memItemLeft" align="right" valign="top">__extern void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__importexport.html#gaa5e64cff9efe9e6bdafc9a2e95b59c89">caca_export_canvas_to_memory</a> (<a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> const *, char const *, size_t *)</td></tr>
<tr class="memdesc:gaa5e64cff9efe9e6bdafc9a2e95b59c89"><td class="mdescLeft">&#160;</td><td class="mdescRight">Export a canvas into a foreign format.  <a href="#gaa5e64cff9efe9e6bdafc9a2e95b59c89">More...</a><br /></td></tr>
<tr class="separator:gaa5e64cff9efe9e6bdafc9a2e95b59c89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga026c45b9247dc7f9fb39878f9deca03c"><td class="memItemLeft" align="right" valign="top">__extern void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__importexport.html#ga026c45b9247dc7f9fb39878f9deca03c">caca_export_area_to_memory</a> (<a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> const *, int, int, int, int, char const *, size_t *)</td></tr>
<tr class="memdesc:ga026c45b9247dc7f9fb39878f9deca03c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Export a canvas portion into a foreign format.  <a href="#ga026c45b9247dc7f9fb39878f9deca03c">More...</a><br /></td></tr>
<tr class="separator:ga026c45b9247dc7f9fb39878f9deca03c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga264bcf9f821d67f33bd5ee5aa5e048a0"><td class="memItemLeft" align="right" valign="top">__extern char const *const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__importexport.html#ga264bcf9f821d67f33bd5ee5aa5e048a0">caca_get_export_list</a> (void)</td></tr>
<tr class="memdesc:ga264bcf9f821d67f33bd5ee5aa5e048a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get available export formats.  <a href="#ga264bcf9f821d67f33bd5ee5aa5e048a0">More...</a><br /></td></tr>
<tr class="separator:ga264bcf9f821d67f33bd5ee5aa5e048a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>formats</p>
<p>These functions import various file formats into a new canvas, or export the current canvas to various text formats. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga09c7286f79c0dd244e7e5434d2519b7a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern ssize_t caca_import_canvas_from_memory </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&#160;</td>
          <td class="paramname"><em>cv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Import a memory buffer into the given libcaca canvas's current frame. The current frame is resized accordingly and its contents are replaced with the imported data.</p>
<p>Valid values for <code>format</code> are:</p><ul>
<li><code>""</code>: attempt to autodetect the file format.</li>
<li><code>"caca"</code>: import native libcaca files.</li>
<li><code>"text"</code>: import ASCII text files.</li>
<li><code>"ansi"</code>: import ANSI files.</li>
<li><code>"utf8"</code>: import UTF-8 files with ANSI colour codes.</li>
</ul>
<p>The number of bytes read is returned. If the file format is valid, but not enough data was available, 0 is returned.</p>
<p>If an error occurs, -1 is returned and <b>errno</b> is set accordingly:</p><ul>
<li><code>ENOMEM</code> Not enough memory to allocate canvas.</li>
<li><code>EINVAL</code> Invalid format requested.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cv</td><td>A libcaca canvas in which to import the file. </td></tr>
    <tr><td class="paramname">data</td><td>A memory area containing the data to be loaded into the canvas. </td></tr>
    <tr><td class="paramname">len</td><td>The size in bytes of the memory area. </td></tr>
    <tr><td class="paramname">format</td><td>A string describing the input format. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes read, or 0 if there was not enough data, or -1 if an error occurred. </dd></dl>

<p>Referenced by <a class="el" href="group__caca__figfont.html#gad86d0785a97d54ebe796dcda02d7900f">caca_flush_figlet()</a>, <a class="el" href="group__caca__importexport.html#gaf49776c6092b0d3f47624e837acaa8a6">caca_get_import_list()</a>, <a class="el" href="group__caca__importexport.html#ga4455d225b91573e265211e5c41553a37">caca_import_area_from_memory()</a>, and <a class="el" href="group__caca__importexport.html#gaa47bfa2ea5cfe33b87fe7a919d5ff500">caca_import_canvas_from_file()</a>.</p>

</div>
</div>
<a class="anchor" id="gaa47bfa2ea5cfe33b87fe7a919d5ff500"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern ssize_t caca_import_canvas_from_file </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&#160;</td>
          <td class="paramname"><em>cv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Import a file into the given libcaca canvas's current frame. The current frame is resized accordingly and its contents are replaced with the imported data.</p>
<p>Valid values for <code>format</code> are:</p><ul>
<li><code>""</code>: attempt to autodetect the file format.</li>
<li><code>"caca"</code>: import native libcaca files.</li>
<li><code>"text"</code>: import ASCII text files.</li>
<li><code>"ansi"</code>: import ANSI files.</li>
<li><code>"utf8"</code>: import UTF-8 files with ANSI colour codes.</li>
</ul>
<p>The number of bytes read is returned. If the file format is valid, but not enough data was available, 0 is returned.</p>
<p>If an error occurs, -1 is returned and <b>errno</b> is set accordingly:</p><ul>
<li><code>ENOSYS</code> File access is not implemented on this system.</li>
<li><code>ENOMEM</code> Not enough memory to allocate canvas.</li>
<li><code>EINVAL</code> Invalid format requested. caca_import_file() may also fail and set <b>errno</b> for any of the errors specified for the routine fopen().</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cv</td><td>A libcaca canvas in which to import the file. </td></tr>
    <tr><td class="paramname">filename</td><td>The name of the file to load. </td></tr>
    <tr><td class="paramname">format</td><td>A string describing the input format. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes read, or 0 if there was not enough data, or -1 if an error occurred. </dd></dl>

<p>References <a class="el" href="group__caca__file.html#ga9cfbd9087b8926512a2f90a47bb5ad0a">caca_file_close()</a>, <a class="el" href="group__caca__file.html#ga24bff06701f35fa718924b7e879715cc">caca_file_eof()</a>, <a class="el" href="group__caca__file.html#ga8fa9094ea6fa527f5744e03124e15350">caca_file_open()</a>, <a class="el" href="group__caca__file.html#gaccb5348b4e700cae308b51d5f16de5c1">caca_file_read()</a>, and <a class="el" href="group__caca__importexport.html#ga09c7286f79c0dd244e7e5434d2519b7a">caca_import_canvas_from_memory()</a>.</p>

<p>Referenced by <a class="el" href="group__caca__importexport.html#gaf49776c6092b0d3f47624e837acaa8a6">caca_get_import_list()</a>, and <a class="el" href="group__caca__importexport.html#gae6bcaa3e30d6ba075c14a817a2464f55">caca_import_area_from_file()</a>.</p>

</div>
</div>
<a class="anchor" id="ga4455d225b91573e265211e5c41553a37"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern ssize_t caca_import_area_from_memory </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&#160;</td>
          <td class="paramname"><em>cv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Import a memory buffer into the given libcaca canvas's current frame, at the specified position. For more information, see <a class="el" href="group__caca__importexport.html#ga09c7286f79c0dd244e7e5434d2519b7a" title="Import a memory buffer into a canvas. ">caca_import_canvas_from_memory()</a>.</p>
<p>If an error occurs, -1 is returned and <b>errno</b> is set accordingly:</p><ul>
<li><code>EINVAL</code> Unsupported format requested or invalid coordinates.</li>
<li><code>ENOMEM</code> Not enough memory to allocate canvas.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cv</td><td>A libcaca canvas in which to import the file. </td></tr>
    <tr><td class="paramname">x</td><td>The leftmost coordinate of the area to import to. </td></tr>
    <tr><td class="paramname">y</td><td>The topmost coordinate of the area to import to. </td></tr>
    <tr><td class="paramname">data</td><td>A memory area containing the data to be loaded into the canvas. </td></tr>
    <tr><td class="paramname">len</td><td>The size in bytes of the memory area. </td></tr>
    <tr><td class="paramname">format</td><td>A string describing the input format. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes read, or 0 if there was not enough data, or -1 if an error occurred. </dd></dl>

<p>References <a class="el" href="group__caca__canvas.html#ga9cad4c6bc9bc7f43cb8403cf26ee7d0a">caca_blit()</a>, <a class="el" href="group__libcaca.html#ga00caafb33b9d7033d064a642bcad83da">caca_create_canvas()</a>, <a class="el" href="group__libcaca.html#ga12394c16c9ca94b61198be929ef8580d">caca_free_canvas()</a>, and <a class="el" href="group__caca__importexport.html#ga09c7286f79c0dd244e7e5434d2519b7a">caca_import_canvas_from_memory()</a>.</p>

</div>
</div>
<a class="anchor" id="gae6bcaa3e30d6ba075c14a817a2464f55"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern ssize_t caca_import_area_from_file </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&#160;</td>
          <td class="paramname"><em>cv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Import a file into the given libcaca canvas's current frame, at the specified position. For more information, see <a class="el" href="group__caca__importexport.html#gaa47bfa2ea5cfe33b87fe7a919d5ff500" title="Import a file into a canvas. ">caca_import_canvas_from_file()</a>.</p>
<p>If an error occurs, -1 is returned and <b>errno</b> is set accordingly:</p><ul>
<li><code>ENOSYS</code> File access is not implemented on this system.</li>
<li><code>ENOMEM</code> Not enough memory to allocate canvas.</li>
<li><code>EINVAL</code> Unsupported format requested or invalid coordinates. caca_import_file() may also fail and set <b>errno</b> for any of the errors specified for the routine fopen().</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cv</td><td>A libcaca canvas in which to import the file. </td></tr>
    <tr><td class="paramname">x</td><td>The leftmost coordinate of the area to import to. </td></tr>
    <tr><td class="paramname">y</td><td>The topmost coordinate of the area to import to. </td></tr>
    <tr><td class="paramname">filename</td><td>The name of the file to load. </td></tr>
    <tr><td class="paramname">format</td><td>A string describing the input format. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes read, or 0 if there was not enough data, or -1 if an error occurred. </dd></dl>

<p>References <a class="el" href="group__caca__canvas.html#ga9cad4c6bc9bc7f43cb8403cf26ee7d0a">caca_blit()</a>, <a class="el" href="group__libcaca.html#ga00caafb33b9d7033d064a642bcad83da">caca_create_canvas()</a>, <a class="el" href="group__libcaca.html#ga12394c16c9ca94b61198be929ef8580d">caca_free_canvas()</a>, and <a class="el" href="group__caca__importexport.html#gaa47bfa2ea5cfe33b87fe7a919d5ff500">caca_import_canvas_from_file()</a>.</p>

</div>
</div>
<a class="anchor" id="gaf49776c6092b0d3f47624e837acaa8a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern char const* const* caca_get_import_list </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Return a list of available import formats. The list is a NULL-terminated array of strings, interleaving a string containing the internal value for the import format, to be used with caca_import_canvas(), and a string containing the natural language description for that import format.</p>
<p>This function never fails.</p>
<dl class="section return"><dt>Returns</dt><dd>An array of strings. </dd></dl>

<p>References <a class="el" href="group__caca__frame.html#gab5fb0c9573f9f0ad85c4192df067c009">caca_create_frame()</a>, <a class="el" href="group__caca__frame.html#ga22531e94edf3e44b124ed84aa425372a">caca_free_frame()</a>, <a class="el" href="group__caca__frame.html#ga7dca169ceb67f3ea770a8aaaf7214957">caca_get_frame_count()</a>, <a class="el" href="group__caca__importexport.html#gaa47bfa2ea5cfe33b87fe7a919d5ff500">caca_import_canvas_from_file()</a>, <a class="el" href="group__caca__importexport.html#ga09c7286f79c0dd244e7e5434d2519b7a">caca_import_canvas_from_memory()</a>, <a class="el" href="group__caca__attributes.html#gaeec0a808344742989fd202b527993242">caca_put_attr()</a>, <a class="el" href="group__caca__canvas.html#ga21864614dada3ee29f10987a6e0d3064">caca_put_char()</a>, <a class="el" href="group__libcaca.html#ga8814d2faa76cad0d7d15381b7eeacab6">caca_set_canvas_size()</a>, and <a class="el" href="group__caca__frame.html#ga6a09db01455121e5e58d081b71c55e81">caca_set_frame()</a>.</p>

</div>
</div>
<a class="anchor" id="gaa5e64cff9efe9e6bdafc9a2e95b59c89"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern void* caca_export_canvas_to_memory </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> const *&#160;</td>
          <td class="paramname"><em>cv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>bytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function exports a libcaca canvas into various foreign formats such as ANSI art, HTML, IRC colours, etc. The returned pointer should be passed to free() to release the allocated storage when it is no longer needed.</p>
<p>Valid values for <code>format</code> are:</p><ul>
<li><code>"caca"</code>: export native libcaca files.</li>
<li><code>"ansi"</code>: export ANSI art (CP437 charset with ANSI colour codes).</li>
<li><code>"html"</code>: export an HTML page with CSS information.</li>
<li><code>"html3"</code>: export an HTML table that should be compatible with most navigators, including textmode ones.</li>
<li><code>"irc"</code>: export UTF-8 text with mIRC colour codes.</li>
<li><code>"ps"</code>: export a PostScript document.</li>
<li><code>"svg"</code>: export an SVG vector image.</li>
<li><code>"tga"</code>: export a TGA image.</li>
<li><code>"troff"</code>: export a troff source.</li>
</ul>
<p>If an error occurs, NULL is returned and <b>errno</b> is set accordingly:</p><ul>
<li><code>EINVAL</code> Unsupported format requested.</li>
<li><code>ENOMEM</code> Not enough memory to allocate output buffer.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cv</td><td>A libcaca canvas </td></tr>
    <tr><td class="paramname">format</td><td>A string describing the requested output format. </td></tr>
    <tr><td class="paramname">bytes</td><td>A pointer to a size_t where the number of allocated bytes will be written. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the exported memory area, or NULL in case of error. </dd></dl>

<p>Referenced by <a class="el" href="group__caca__importexport.html#ga026c45b9247dc7f9fb39878f9deca03c">caca_export_area_to_memory()</a>, and <a class="el" href="group__caca__importexport.html#ga264bcf9f821d67f33bd5ee5aa5e048a0">caca_get_export_list()</a>.</p>

</div>
</div>
<a class="anchor" id="ga026c45b9247dc7f9fb39878f9deca03c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern void* caca_export_area_to_memory </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#aae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> const *&#160;</td>
          <td class="paramname"><em>cv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>bytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function exports a portion of a <em>libcaca</em> canvas into various formats. For more information, see <a class="el" href="group__caca__importexport.html#gaa5e64cff9efe9e6bdafc9a2e95b59c89" title="Export a canvas into a foreign format. ">caca_export_canvas_to_memory()</a>.</p>
<p>If an error occurs, NULL is returned and <b>errno</b> is set accordingly:</p><ul>
<li><code>EINVAL</code> Unsupported format requested or invalid coordinates.</li>
<li><code>ENOMEM</code> Not enough memory to allocate output buffer.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cv</td><td>A libcaca canvas </td></tr>
    <tr><td class="paramname">x</td><td>The leftmost coordinate of the area to export. </td></tr>
    <tr><td class="paramname">y</td><td>The topmost coordinate of the area to export. </td></tr>
    <tr><td class="paramname">w</td><td>The width of the area to export. </td></tr>
    <tr><td class="paramname">h</td><td>The height of the area to export. </td></tr>
    <tr><td class="paramname">format</td><td>A string describing the requested output format. </td></tr>
    <tr><td class="paramname">bytes</td><td>A pointer to a size_t where the number of allocated bytes will be written. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the exported memory area, or NULL in case of error. </dd></dl>

<p>References <a class="el" href="group__caca__canvas.html#ga9cad4c6bc9bc7f43cb8403cf26ee7d0a">caca_blit()</a>, <a class="el" href="group__libcaca.html#ga00caafb33b9d7033d064a642bcad83da">caca_create_canvas()</a>, <a class="el" href="group__caca__importexport.html#gaa5e64cff9efe9e6bdafc9a2e95b59c89">caca_export_canvas_to_memory()</a>, and <a class="el" href="group__libcaca.html#ga12394c16c9ca94b61198be929ef8580d">caca_free_canvas()</a>.</p>

</div>
</div>
<a class="anchor" id="ga264bcf9f821d67f33bd5ee5aa5e048a0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern char const* const* caca_get_export_list </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Return a list of available export formats. The list is a NULL-terminated array of strings, interleaving a string containing the internal value for the export format, to be used with caca_export_memory(), and a string containing the natural language description for that export format.</p>
<p>This function never fails.</p>
<dl class="section return"><dt>Returns</dt><dd>An array of strings. </dd></dl>

<p>References <a class="el" href="group__caca__attributes.html#ga0ef0d3750ad64e80a73af03393ae98db">caca_attr_to_ansi_bg()</a>, <a class="el" href="group__caca__attributes.html#gaccefc87375cb11220cee48d7ba7bd2e7">caca_attr_to_ansi_fg()</a>, <a class="el" href="group__caca__attributes.html#gaa673f18e9b8b2e52f4e67788cc41df4d">caca_attr_to_argb64()</a>, <a class="el" href="group__caca__attributes.html#gaa2db22d90412331091727ccac65c95cb">caca_attr_to_rgb12_bg()</a>, <a class="el" href="group__caca__attributes.html#gac300bca11f8fd08cca06aa474bcef1fd">caca_attr_to_rgb12_fg()</a>, <a class="el" href="group__caca__attr.html#ggae0faad0902bd5034206ef3ed2beb07dfade1d8398664f21fb3ad3ea69c01b3784">CACA_BLINK</a>, <a class="el" href="group__caca__attr.html#ggae0faad0902bd5034206ef3ed2beb07dface0c843d14a1b58d3805a857262301f7">CACA_BOLD</a>, <a class="el" href="group__caca__attr.html#gga9db83488c6f07a5f7d773c380b3126a9a75851cb7e307bd85518cc33cfe8e9a89">CACA_DEFAULT</a>, <a class="el" href="group__caca__importexport.html#gaa5e64cff9efe9e6bdafc9a2e95b59c89">caca_export_canvas_to_memory()</a>, <a class="el" href="group__caca__font.html#gad4c4277906b727073789c570f9f1c47d">caca_free_font()</a>, <a class="el" href="group__libcaca.html#gaa529140e8cf31379a6b57af7c37c9d2f">caca_get_canvas_height()</a>, <a class="el" href="group__libcaca.html#gad85b2ff4c7f952b3cc32f117343a6375">caca_get_canvas_width()</a>, <a class="el" href="group__caca__font.html#gaea47dfd5abc7224d5030fdf3961e7377">caca_get_font_height()</a>, <a class="el" href="group__caca__font.html#gac5329825d3dbadf2d004ff90d808f15f">caca_get_font_list()</a>, <a class="el" href="group__caca__font.html#ga0580a5e28afd8ec5a82bc49b32d4c040">caca_get_font_width()</a>, <a class="el" href="group__libcaca.html#ga3c7edc520b7ea69a721317a9d8649440">caca_get_version()</a>, <a class="el" href="group__caca__attr.html#ggae0faad0902bd5034206ef3ed2beb07dfa01b848f5a509082459b623156f920b36">CACA_ITALICS</a>, <a class="el" href="group__caca__font.html#gaac9551a53a284e9a17e4e67d6400fbf0">caca_load_font()</a>, <a class="el" href="group__caca__canvas.html#gaf0eacf54c042ec78a69942ebc8d7ffd5">CACA_MAGIC_FULLWIDTH</a>, <a class="el" href="group__caca__font.html#ga64f055de5dd43137d099aa30e56a5dd6">caca_render_canvas()</a>, <a class="el" href="group__caca__attr.html#ggae0faad0902bd5034206ef3ed2beb07dfa1c3e0562c6fd2aab079c17a9d5ac9234">CACA_UNDERLINE</a>, <a class="el" href="group__caca__charset.html#ga5f0a8814bbd8fdb74ea835448ad6f065">caca_utf32_is_fullwidth()</a>, and <a class="el" href="group__caca__charset.html#gab9d52a659813d7b145b588cd91dbb51c">caca_utf32_to_utf8()</a>.</p>

</div>
</div>
</div><!-- contents -->
  </body>
</html>