~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/docs/ref/arch/apis.html

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!--$Id$-->
2
 
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
 
<!--All rights reserved.-->
4
 
<!--See the file LICENSE for redistribution information.-->
5
 
<html>
6
 
<head>
7
 
<title>Berkeley DB Reference Guide: Programmatic APIs</title>
8
 
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
 
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
10
 
</head>
11
 
<body bgcolor=white>
12
 
<a name="2"><!--meow--></a>
13
 
<table width="100%"><tr valign=top>
14
 
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Architecture</dl></h3></td>
15
 
<td align=right><a href="../../ref/arch/progmodel.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/arch/script.html"><img src="../../images/next.gif" alt="Next"></a>
16
 
</td></tr></table>
17
 
<p>
18
 
<h1 align=center>Programmatic APIs</h1>
19
 
<p>The Berkeley DB subsystems can be accessed through interfaces from multiple
20
 
languages.  The standard library interface is ANSI C.  Applications can
21
 
also use Berkeley DB via C++ or Java, as well as from scripting languages.
22
 
Environments can be shared among applications written by using any of
23
 
theses APIs.  For example, you might have a local server written in C
24
 
or C++, a script for an administrator written in Perl or Tcl, and a
25
 
Web-based user interface written in Java -- all sharing a single
26
 
database environment.
27
 
<h3>C</h3>
28
 
<p>The Berkeley DB library is written entirely in ANSI C.  C applications use a
29
 
single include file:
30
 
<p><blockquote><pre>#include &lt;db.h&gt;</pre></blockquote>
31
 
<h3>C++</h3>
32
 
<p>The C++ classes provide a thin wrapper around the C API, with the major
33
 
advantages being improved encapsulation and an optional exception
34
 
mechanism for errors.  C++ applications use a single include file:
35
 
<p><blockquote><pre>#include &lt;db_cxx.h&gt;</pre></blockquote>
36
 
<p>The classes and methods are named in a fashion that directly corresponds
37
 
to structures and functions in the C interface.  Likewise, arguments to
38
 
methods appear in the same order as the C interface, except to remove the
39
 
explicit <b>this</b> pointer.  The #defines used for flags are identical
40
 
between the C and C++ interfaces.
41
 
<p>As a rule, each C++ object has exactly one structure from the underlying
42
 
C API associated with it.  The C structure is allocated with each
43
 
constructor call and deallocated with each destructor call.  Thus, the
44
 
rules the user needs to follow in allocating and deallocating structures
45
 
are the same between the C and C++ interfaces.
46
 
<p>To ensure portability to many platforms, both new and old, Berkeley DB makes
47
 
as few assumptions as possible about the C++ compiler and library.  For
48
 
example, it does not expect STL, templates, or namespaces to be
49
 
available.  The newest C++ feature used is exceptions, which are used
50
 
liberally to transmit error information.  Even the use of exceptions
51
 
can be disabled at runtime.
52
 
<h3>Java</h3>
53
 
<p>The Java classes provide a layer around the C API that is almost identical
54
 
to the C++ layer.  The classes and methods are, for the most part
55
 
identical to the C++ layer.  Berkeley DB constants and #defines are represented as
56
 
"static final int" values.  Error conditions are communicated as Java
57
 
exceptions.
58
 
<p>As in C++, each Java object has exactly one structure from the underlying
59
 
C API associated with it.  The Java structure is allocated with each
60
 
constructor or open call, but is deallocated only by the Java garbage
61
 
collector.  Because the timing of garbage collection is not predictable,
62
 
applications should take care to do a close when finished with any object
63
 
that has a close method.
64
 
<h3>Dbm/Ndbm, Hsearch</h3>
65
 
<p>Berkeley DB supports the standard UNIX interfaces <a href="../../api_c/dbm.html">dbm</a>, <a href="../../api_c/dbm.html">ndbm</a>,
66
 
and <a href="../../api_c/hsearch.html">hsearch</a>.  After including a new header file and recompiling,
67
 
programs will run orders of magnitude faster, and underlying databases
68
 
can grow as large as necessary.  Also, historic <a href="../../api_c/dbm.html">dbm</a> and
69
 
<a href="../../api_c/dbm.html">ndbm</a> applications can fail once some number of entries are
70
 
inserted into the database, in which the number depends on the
71
 
effectiveness of the internal hashing function on the particular data
72
 
set.  This is not a problem with Berkeley DB.
73
 
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/arch/progmodel.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/arch/script.html"><img src="../../images/next.gif" alt="Next"></a>
74
 
</td></tr></table>
75
 
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
76
 
</body>
77
 
</html>