1<!--$Id: namespace.so,v 10.22 2004/03/08 15:09:20 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB Reference Guide: Name spaces</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<a name="2"><!--meow--></a> 12<table width="100%"><tr valign=top> 13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Programmer Notes</dl></b></td> 14<td align=right><a href="/program/scope.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/program/ram.html"><img src="/images/next.gif" alt="Next"></a> 15</td></tr></table> 16<p align=center><b>Name spaces</b></p> 17<b>C Language Name Space</b> 18<p>The Berkeley DB library is careful to avoid C language programmer name spaces, 19but there are a few potential areas for concern, mostly in the Berkeley DB 20include file db.h. The db.h include file defines a number of types and 21strings. Where possible, all of these types and strings are prefixed with 22"DB_" or "db_". There are a few notable exceptions.</p> 23<p>The Berkeley DB library uses a macro named "__P" to configure for systems that 24do not provide ANSI C function prototypes. This could potentially collide 25with other systems using a "__P" macro for similar or different purposes.</p> 26<p>The Berkeley DB library needs information about specifically sized types for 27each architecture. If they are not provided by the system, they are 28typedef'd in the db.h include file. The types that may be typedef'd 29by db.h include the following: u_int8_t, int16_t, u_int16_t, int32_t, 30u_int32_t, u_char, u_short, u_int, and u_long.</p> 31<p>The Berkeley DB library declares a few external routines. All these routines 32are prefixed with the strings "db_". All internal Berkeley DB routines are 33prefixed with the strings "__XXX_", where "XXX" is the subsystem prefix 34(for example, "__db_XXX_" and "__txn_XXX_").</p> 35<b>Filesystem Name Space</b> 36<p>Berkeley DB environments create or use some number of files in environment 37home directories. These files are named <a href="/ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a>, "log.NNNNN" 38(for example, log.0000000003, where the number of digits following the 39dot is unspecified), or with the string prefix "__db" (for example, 40__db.001). Applications should never create files or databases in 41database environment home directories with names beginning with the 42characters "log" or "__db".</p> 43<p>In some cases, applications may choose to remove Berkeley DB files as part of 44their cleanup procedures, using system utilities instead of Berkeley DB 45interfaces (for example, using the UNIX rm utility instead of the 46<a href="/api_c/env_remove.html">DB_ENV->remove</a> method). This is not a problem, as long as applications 47limit themselves to removing only files named "__db.###", where "###" 48are the digits 0 through 9. Applications should never remove any files 49named with the prefix "__db" or "log", other than "__db.###" files.</p> 50<table width="100%"><tr><td><br></td><td align=right><a href="/program/scope.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/program/ram.html"><img src="/images/next.gif" alt="Next"></a> 51</td></tr></table> 52<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 53</body> 54</html> 55