This file is indexed.

/usr/share/doc/kildclient/html/apes05.xhtml is in kildclient-doc 3.2.0-2.

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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><title>E.5. Conditional Loading of Plugins</title><link rel="stylesheet" type="text/css" href="docbook.css"/><link rel="stylesheet" type="text/css" href="kildclient.css"/><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/><link rel="prev" href="apes04.xhtml" title="E.4. Enabling and Disabling Plugins"/><link rel="next" href="apes06.xhtml" title="E.6. Using GTK+ From Plugins"/></head><body><header><div class="navheader"><table style="width: 100%; "><tr><th style="text-align: center; " colspan="3">E.5. Conditional Loading of Plugins</th></tr><tr><td style="width: 20%; text-align: left; "><a accesskey="p" href="apes04.xhtml">Prev</a> </td><th style="width: 60%; text-align: center; ">Appendix E. Writing Plugins</th><td style="width: 20%; text-align: right; "> <a accesskey="n" href="apes06.xhtml">Next</a></td></tr></table><hr/></div></header><section class="sect1" id="idm5350"><div class="titlepage"><div><div><h2 class="title" style="clear: both">E.5. Conditional Loading of Plugins</h2></div></div></div><p>If your plugin depends on some condition to be successfully
loaded, you should include a test for whatever is required in a
<code class="literal">BEGIN</code> block, and if the conditions are not present,
you should call the Perl <code class="function">die</code> function passing a
descriptive message telling why the plugin could not be loaded.</p><p>For example, here is part of a hypothetical spell-checker plugin
that uses the file <code class="filename">/usr/share/dict/words</code>
file:</p><div class="example" id="idm5358"><div class="example-title">Example E.2. Conditional loading of plugins</div><div class="example-contents"><pre class="programlisting">
package spellcheck;
#: Version: 1.0
#: Description: Spell Checker
#: Author: Somebody

BEGIN {
  die("Word file (/usr/share/dict/words) could not be read")
    unless -r /usr/share/dict/words;
}

...
</pre></div></div><br class="example-break"/><p>When the user tries to load that plugin, the test will be made.
If the file cannot be read (because it does not exist, or the
permissiosn are wrong, or for any other reason),
<code class="function">die</code> will be called, the plugin will not be
loaded, and the given message will be printed in the screen.</p><section class="sect2" id="sec_pluginsrequiringothers"><div class="titlepage"><div><div><h3 class="title">E.5.1. Plugins That Require Other Plugins</h3></div></div></div><p>If your plugin requires some other plugin, you should use the
<code class="function">$world-&gt;requireplugin</code> function in a
<code class="literal">BEGIN</code> block. This function will verify if the named
plugin is already loaded. If it is, it returns successfully. If it is
not loaded, the function will try to load the plugin. If it could be
loaded, the function exits successfully. If, however, the plugin
could not be loaded (because it was not found, or because it failed
some condition), <code class="function">$world-&gt;requireplugin</code> will call
<code class="function">die</code>, which will abort the loading the plugin that
required the other plugin.</p><p>As an example, consider the plugin foo, which requires the bar
sec_plugin_</p><div class="example" id="idm5373"><div class="example-title">Example E.3. A plugin that requires another</div><div class="example-contents"><pre class="programlisting">
package foo;
#: Version: 1.0
#: Description: The Super Frobnicator
#: Author: Somebody

BEGIN {
  $::world-&gt;requireplugin('bar');
}

...
</pre></div></div><br class="example-break"/><p>If foo was loaded successfully, you can be sure that the bar
plugin and its functionality is present. If bar could not be loaded,
foo will not be loaded.</p></section></section><footer><div class="navfooter"><hr/><table style="width: 100%; "><tr><td style="width: 40%; text-align: left; "><a accesskey="p" href="apes04.xhtml">Prev</a> </td><td style="width: 20%; text-align: center; "><a accesskey="u" href="ape.xhtml">Up</a></td><td style="width: 40%; text-align: right; "> <a accesskey="n" href="apes06.xhtml">Next</a></td></tr><tr><td style="width: 40%; text-align: left; vertical-align: top; ">E.4. Enabling and Disabling Plugins </td><td style="width: 20%; text-align: center; "><a accesskey="h" href="index.xhtml">Home</a></td><td style="width: 40%; text-align: right; vertical-align: top; "> E.6. Using GTK+ From Plugins</td></tr></table></div></footer></body></html>