This file is indexed.

/usr/share/doc/refdb/refdb-manual/ch21.html is in refdb-doc 1.0.2-3.

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

The actual contents of the file can be viewed below.

1
2
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 21. Using the backend API to implement new output formats</title><link rel="stylesheet" type="text/css" href="manual.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="RefDB handbook" /><link rel="up" href="pt05.html" title="Part V. Programmer's manual" /><link rel="prev" href="ch20s02.html" title="Classes and their functions" /><link rel="next" href="ch21s02.html" title="How to insert a new backend into RefDB" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 21. Using the backend API to implement new output formats</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch20s02.html">Prev</a> </td><th width="60%" align="center">Part V. Programmer's manual</th><td width="20%" align="right"> <a accesskey="n" href="ch21s02.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="chapter-backend-api"></a>Chapter 21. Using the backend API to implement new output formats</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="ch21.html#idp68264560">The backend API</a></span></dt><dt><span class="sect1"><a href="ch21s02.html">How to insert a new backend into RefDB</a></span></dt></dl></div><p>While there is nothing like a runtime-plugin mechanism to add new output formats, the RefDB code is sufficiently modularized to make the implementation of a new format a fairly easy task. You don't have to parse the query results directly, but you call wrapper functions instead. This also has the nice advantage that changes in the database design show up only in one place and thus are less likely to break the backend implementations.</p><p>We will first have a look at the API that <code class="filename">backend.c</code> provides. Then we'll have a look at those parts in the existing code that need to be modified in order to accept a new backend.</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idp68264560"></a>The backend API</h2></div></div></div><p>In general, the backend API provides a <code class="function">get_foo()</code> for every tag <em class="wordasword">foo</em> in the RIS specification. There are, however, two fundamentally different types of tag retrieval functions:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>The simple retrievals pull out values from the main table (t_refdb) of the database with a single function call.</p></li><li class="listitem"><p>The compound retrievals need three functions: A <code class="function">request_foo()</code> obtains an array of possible values. A <code class="function">get_foo()</code> retrieves one or more of these values and can be used in a loop to retrieve all values. Finally, the <code class="function">clean_request()</code> frees the allocated memory. Compound retrievals are used to get at values which are stored outside the main table, like authors or keywords.</p></li></ol></div><p>The prototypes of these functions can be found in <code class="filename">backend.h</code>, and their use is shown in the existing backends <code class="filename">backend-scrn.c</code>, <code class="filename">backend-ris.c</code>, <code class="filename">backend-db31.c</code>, and <code class="filename">backend-bibtex.c</code>.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch20s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt05.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch21s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Classes and their functions </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> How to insert a new backend into RefDB</td></tr></table></div></body></html>