~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to packages/extra/gdbm/README

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
This is the Free Pascal interface to the GDBM library routines. 
3
 
Essentially, this is a translation of the gdbm.h header files, with some
4
 
additional routines.
5
 
 
6
 
The headers translated without any problems, the only thing that should
7
 
be taken into account is that the 
8
 
GDBM_SYNC constant (for open flags) has been renamed to GDMB_DOSYNC
9
 
because it conflicts with the gdbm_sync function. 
10
 
 
11
 
Be careful: the TDatum.dptr data pointer which is allocated by the
12
 
gdbm routines should be freed by the C free() call, NOT with the 
13
 
pascal FreeMem() call.
14
 
 
15
 
A solution for this is to use the 'cmem' unit, which replaces the standard
16
 
FPC memory manager with the C memory manager. In that case, freemem()
17
 
may be used to free the dptr field of the TDatum record.
18
 
 
19
 
On top of the plain C header translations, The GDBM routines have been 
20
 
overloaded with routines that accept plain strings as key or data 
21
 
parameters. This means the following routines have been added:
22
 
 
23
 
function gdbm_open(Const para1:string; para2:longint; para3:longint; para4:longint; para5:TGDBMErrorCallBack ):PGDBM_FILE;
24
 
function gdbm_store(para1:PGDBM_FILE; Const para2:string; Const para3:string; para4:longint):Boolean;
25
 
function gdbm_fetch(para1:PGDBM_FILE; Const para2:string):string;
26
 
function gdbm_delete(para1:PGDBM_FILE; Const para2:string):boolean;
27
 
procedure gdbm_firstkey(para1:PGDBM_FILE; var key :string);
28
 
function gdbm_nextkey(para1:PGDBM_FILE; Const para2:string):string;
29
 
function gdbm_exists(para1:PGDBM_FILE; Const para2:string):boolean;
30
 
 
31
 
They are just the C routines, but with the TDatum type (a record) 
32
 
replaced by a string. The routines take automatically care of memory
33
 
deallocation.
34
 
 
35
 
Functions that returned an integer to indicate success or failure have been
36
 
replaced by functions that return a boolean.
37
 
 
38
 
Careful: 
39
 
When using ansistrings, make sure the gdbm unit has been compiled
40
 
with the -Sh switch. The unit should work with both kinds of strings.
41
 
 
42
 
There are 2 test programs:
43
 
testgdbm tests the raw C header translation
44
 
testgdbm2 tests the String interface to the GDBM routines.
45
 
 
46
 
That's about it. 
47
 
 
48
 
Enjoy!
49
 
 
50
 
Michael. (Michael.VanCanneyt@Wisa.be)