This file is indexed.

/usr/share/doc/racket/raco/c-mods.html is in racket-doc 6.7-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>12.2&nbsp;Embedding Modules via C</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9658;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco</span>:<span class="mywbr"> &nbsp;</span> Racket Command-<wbr></wbr>Line Tools</a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="make.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco make</span>:<span class="mywbr"> &nbsp;</span> Compiling Source to Bytecode</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="exe.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco exe</span>:<span class="mywbr"> &nbsp;</span> Creating Stand-<wbr></wbr>Alone Executables</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="exe-dist.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco distribute</span>:<span class="mywbr"> &nbsp;</span> Sharing Stand-<wbr></wbr>Alone Executables</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="planet.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco planet</span>:<span class="mywbr"> &nbsp;</span> Automatic Package Distribution</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="pkg.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco pkg</span>:<span class="mywbr"> &nbsp;</span> Package Management</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="setup.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco setup</span>:<span class="mywbr"> &nbsp;</span> Installation Management</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="decompile.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco decompile</span>:<span class="mywbr"> &nbsp;</span> Decompiling Bytecode</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="demod.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco demod</span>:<span class="mywbr"> &nbsp;</span> Demodularizing Programs</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="link.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco link</span>:<span class="mywbr"> &nbsp;</span> Library Collection Links</a></td></tr><tr><td align="right">10&nbsp;</td><td><a href="plt.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco pack</span>:<span class="mywbr"> &nbsp;</span> Packing Library Collections</a></td></tr><tr><td align="right">11&nbsp;</td><td><a href="unpack.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco unpack</span>:<span class="mywbr"> &nbsp;</span> Unpacking Library Collections</a></td></tr><tr><td align="right">12&nbsp;</td><td><a href="ctool.html" class="tocviewselflink" data-pltdoc="x"><span class="stt">raco ctool</span>:<span class="mywbr"> &nbsp;</span> Working with C Code</a></td></tr><tr><td align="right">13&nbsp;</td><td><a href="test.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco test</span>:<span class="mywbr"> &nbsp;</span> Run tests</a></td></tr><tr><td align="right">14&nbsp;</td><td><a href="docs.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco docs</span>:<span class="mywbr"> &nbsp;</span> Documentation Search</a></td></tr><tr><td align="right">15&nbsp;</td><td><a href="expand.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco expand</span>:<span class="mywbr"> &nbsp;</span> Macro Expansion</a></td></tr><tr><td align="right">16&nbsp;</td><td><a href="read.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco read</span>:<span class="mywbr"> &nbsp;</span> Reading and Pretty-<wbr></wbr>Printing</a></td></tr><tr><td align="right">17&nbsp;</td><td><a href="scribble.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco scribble</span>:<span class="mywbr"> &nbsp;</span> Building Documentation</a></td></tr><tr><td align="right">18&nbsp;</td><td><a href="command.html" class="tocviewlink" data-pltdoc="x">Adding a <span class="stt">raco</span> Command</a></td></tr><tr><td align="right">19&nbsp;</td><td><a href="config-file.html" class="tocviewlink" data-pltdoc="x">Installation Configuration and Search Paths</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_1&quot;);">&#9660;</a></td><td>12&nbsp;</td><td><a href="ctool.html" class="tocviewlink" data-pltdoc="x"><span class="stt">raco ctool</span>:<span class="mywbr"> &nbsp;</span> Working with C Code</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">12.1&nbsp;</td><td><a href="cc.html" class="tocviewlink" data-pltdoc="x">Compiling and Linking C Extensions</a></td></tr><tr><td align="right">12.2&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">Embedding Modules via C</a></td></tr></table></div></div></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;6.7&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.7&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="cc.html" title="backward to &quot;12.1 Compiling and Linking C Extensions&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="ctool.html" title="up to &quot;12 raco ctool: Working with C Code&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="test.html" title="forward to &quot;13 raco test: Run tests&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h4 x-source-module="(lib &quot;scribblings/raco/raco.scrbl&quot;)" x-source-pkg="racket-doc" x-part-tag="&quot;c-mods&quot;">12.2<tt>&nbsp;</tt><a name="(part._c-mods)"></a>Embedding Modules via C</h4><p>The <span class="nobreak"><span class="stt">--c-mods</span></span> mode for <span class="stt">raco ctool</span> takes a set of Racket
modules and generates a C source file that can be used as part of
program that embeds the Racket run-time system. See <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=inside&amp;rel=embedding.html&amp;version=6.7" class="Sq" data-pltdoc="x">Embedding into a Program</a> in <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=inside&amp;rel=index.html&amp;version=6.7" class="Sq" data-pltdoc="x">Inside: Racket C API</a> for an
explanation of embedding programs.</p><p>The generated source file embeds the specified modules, and it defines
a <span class="stt">declare_modules</span> function that puts the module declarations into
a namespace. Thus, using the output of <span class="stt">raco ctool --c-mods</span>, a
program can embed Racket with a set of modules so that it does not
need a <span class="stt">"collects"</span> directory to load modules at run time.</p><p>If the embedded modules refer to runtime files, the files can be
gathers by supplying the <span class="nobreak"><span class="stt">--runtime</span></span> argument to <span class="stt">raco ctool
--cmods</span>, specifying a directory <span class="sroman">&#8249;<span style="font-style: italic">dir</span>&#8250;</span> to hold the files.
Normally, <span class="sroman">&#8249;<span style="font-style: italic">dir</span>&#8250;</span> is a relative path, and files are found at run
time in <span class="sroman">&#8249;<span style="font-style: italic">dir</span>&#8250;</span> relative to the executable, but a separate path
(usually relative) for run time can be specified with
<span class="nobreak"><span class="stt">--runtime-access</span></span>.</p><p>Typically, <span class="stt">raco ctool --c-mods</span> is used with <span class="nobreak"><span class="stt">++lib</span></span> to
specify a collection-based module path. For example,</p><p><span class="hspace">&nbsp;&nbsp;</span><span class="stt">raco ctool --c-mods base.c ++lib racket/base</span></p><p>generates a <span class="stt">"base.c"</span> whose <span class="stt">declare_modules</span> function
makes <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&amp;rel=index.html&amp;version=6.7" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket/base</span></a> available for use via the
<span class="stt">scheme_namespace_require</span> or <span class="stt">scheme_dynamic_require</span> functions
within the embedding application.</p><p>When a module file is provided to <span class="stt">raco ctool --c-mods</span>, then
<span class="stt">declare_modules</span> declares a module with the symbolic name of the
module file. For example,</p><p><span class="hspace">&nbsp;&nbsp;</span><span class="stt">raco ctool --c-mods base.c hello.rkt</span></p><p>creates a <span class="stt">declare_modules</span> that defines the module
<span class="RktVal">'</span><span class="RktVal">hello</span>, which could be required into the current namespace
with <span class="RktPn">(</span><span class="RktSym">namespace-require</span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">'</span><span class="RktVal">hello</span><span class="RktPn">)</span> or similarly at the C level:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace">&nbsp;&nbsp;</span><span class="stt">p = scheme_make_pair(scheme_intern_symbol("quote"),</span></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;</span><span class="stt"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="stt">scheme_make_pair(scheme_intern_symbol("hello"),</span></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;</span><span class="stt"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="stt">scheme_make_null()));</span></p></td></tr><tr><td><p><span class="hspace">&nbsp;&nbsp;</span><span class="stt">scheme_namespace_require(p);</span></p></td></tr></table></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;6.7&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.7&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="cc.html" title="backward to &quot;12.1 Compiling and Linking C Extensions&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="ctool.html" title="up to &quot;12 raco ctool: Working with C Code&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="test.html" title="forward to &quot;13 raco test: Run tests&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>