[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /obj/handlers/book_handler.c</h2>
This handler object deals with all the books that have been published.
It keeps a save file of every book and a current book number.
It will allow for easy finding again of preprinted books and for the
easy removal of any books that happen to contain things like quest
solutions and stuff.
<p><b>See also:</b><br>/std/book.c and /std/print_shop.c
<br /><p>Written by Pinkfish<p>Started Sun Feb  1 20:24:33 CST 1998<h2>Includes</h2>
This class includes the following files /include/language.h and /include/book_handler.h<h2>Method index</h2>
<ul>
<li><a href="#add_banished_book">add_banished_book</a>(int, string)<br/>
This method banishes a book number for a certain reason.
<li><a href="#add_book">add_book</a>(object, int, string)<br/>
Adds a newly minted book into our nice list of stuff.
<li><a href="#check_book_same">check_book_same</a>(object, int)<br/>
Checks to see if the passed in book is the same as the current book
number that is set on it.
<li><a href="#compare_page">compare_page</a>(string, string)<br/>
Compares the open pages of two books to see if the text is the
same.
<li><a href="#compare_pages">compare_pages</a>(string *, string *)<br/>
This method will try and figure out the percentage changed between the
two page arrays.
<li><a href="#load_it">load_it</a>()<br/>
Loads the state information from the save file.
<li><a href="#query_all_banished_books">query_all_banished_books</a>()<br/>
This method returns all the banished books.
<li><a href="#query_banished_book">query_banished_book</a>(int)<br/>
This method returns the banish string for the book.
<li><a href="#query_book_exists">query_book_exists</a>(int)<br/>
This tests to see if the given book number exists.
<li><a href="#query_book_owner">query_book_owner</a>(int)<br/>
This method returns the owner associated with the book of a given
number.
<li><a href="#query_book_pages">query_book_pages</a>(int)<br/>
This method returns the pages associated with the book of a given
number.
<li><a href="#query_pages">query_pages</a>(object)<br/>
This method returns the array of useful pages in a book.
<li><a href="#save_it">save_it</a>()<br/>
Saves the current state information to the save file.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="add_banished_book">
add_banished_book</a><pre class="autodocfuncdef">
int add_banished_book(int book_num,
                      string reason)
</pre><dd><br />
This method banishes a book number for a certain reason.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
book_num - the book number to banish<br />
reason - the reason it was banished<br />
<br />
<dd><b>Returns:</b>
<br />1 on success and 0 on failure.<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_banished_book">query_banished_book()</a> and <a href="#query_all_banished_books">query_all_banished_books()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="add_book">
add_book</a><pre class="autodocfuncdef">
int add_book(object book,
             int num,
             string pl_name)
</pre><dd><br />
Adds a newly minted book into our nice list of stuff.  This returns the
book number for this book.  You can use this to add a book if you already
know its book number, if it does not match to the saved book number then
it will return a new number.  If it does match it will return the
same number.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
book - the book to add<br />
num - the possible book number it already has<br />
<br />
<dd><b>See also:</b>
<br /><a href="#check_book_same">check_book_same()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="check_book_same">
check_book_same</a><pre class="autodocfuncdef">
int check_book_same(object book,
                    int num)
</pre><dd><br />
Checks to see if the passed in book is the same as the current book
number that is set on it.  We only look at the text and ignore the
type and language with which it is written.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
book - the book to check<br />
num - the book number to check against<br />
<br />
<dd><b>See also:</b>
<br /><a href="#compare_pages">compare_pages()</a> and <a href="#add_book">add_book()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="compare_page">
compare_page</a><pre class="autodocfuncdef">
int compare_page(string page1,
                 string page2)
</pre><dd><br />
Compares the open pages of two books to see if the text is the
same.  It ignores language and style of writing.  This would also
work on two pieces of paper.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
page1 - the first book<br />
page2 - the second book<br />
<br />
<dd><b>See also:</b>
<br /><a href="#check_book_same">check_book_same()</a> and <a href="#add_book">add_book()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="compare_pages">
compare_pages</a><pre class="autodocfuncdef">
int compare_pages(string * pages1,
                  string * pages2)
</pre><dd><br />
This method will try and figure out the percentage changed between the
two page arrays.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
pages1 - the first page array<br />
pages2 - the second page array<br />
<br />
<dd><b>Returns:</b>
<br />the percentage the same
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="load_it">
load_it</a><pre class="autodocfuncdef">
void load_it()
</pre><dd><br />
Loads the state information from the save file.<br />
<br /><dl>
<dd><b>See also:</b>
<br /><a href="#load_it">load_it()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_all_banished_books">
query_all_banished_books</a><pre class="autodocfuncdef">
mapping query_all_banished_books()
</pre><dd><br />
This method returns all the banished books.  The keys are the
numbers which are banished and the values are the reason for
the banishment.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the banished books mapping<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_banished_book">add_banished_book()</a> and <a href="#query_banished_book">query_banished_book()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_banished_book">
query_banished_book</a><pre class="autodocfuncdef">
string query_banished_book(int book_num)
</pre><dd><br />
This method returns the banish string for the book.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
book_num - the book number to check<br />
<br />
<dd><b>Returns:</b>
<br />the banish reason, or 0 if none<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_banished_book">add_banished_book()</a> and <a href="#query_all_banished_books">query_all_banished_books()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_book_exists">
query_book_exists</a><pre class="autodocfuncdef">
int query_book_exists(int book_num)
</pre><dd><br />
This tests to see if the given book number exists.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
book_num - the number to test.<br />
<br />
<dd><b>Returns:</b>
<br />1 if it exists, 0 if it does not.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_book_owner">
query_book_owner</a><pre class="autodocfuncdef">
string query_book_owner(int book_num)
</pre><dd><br />
This method returns the owner associated with the book of a given
number.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
book_num - the book number to get the pages for<br />
<br />
<dd><b>Returns:</b>
<br />the owner of the book<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_book_pages">query_book_pages()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_book_pages">
query_book_pages</a><pre class="autodocfuncdef">
string * query_book_pages(int book_num)
</pre><dd><br />
This method returns the pages associated with the book of a given
number.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
book_num - the book number to get the pages for<br />
<br />
<dd><b>Returns:</b>
<br />the pages for the book<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_book_owner">query_book_owner()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_pages">
query_pages</a><pre class="autodocfuncdef">
string * query_pages(object book)
</pre><dd><br />
This method returns the array of useful pages in a book.  It removes
torn out pages and pages which are added by specific things in the
game, like the print shop adding a fly leaf.  It just returns the text
for the pages, since this is what we are interested in.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
book - the book to get the pages from<br />
<br />
<dd><b>Returns:</b>
<br />the array of pages
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="save_it">
save_it</a><pre class="autodocfuncdef">
void save_it()
</pre><dd><br />
Saves the current state information to the save file.<br />
<br /><dl>
<dd><b>See also:</b>
<br /><a href="#save_it">save_it()
</a><br /><br /><br /></dl>

</dl>
[an error occurred while processing this directive]

