Discussion:
sqlite api programming question
(too old to reply)
helmut schrei
2007-12-04 17:35:13 UTC
Permalink
Hello,

in the sqllite3.h file i found this definition.
"typedef struct sqlite3 sqlite3;"

And this function.

int sqlite3_open(
const char *filename, /* Database filename (UTF-8) */
sqlite3 **ppDb /* OUT: SQLite db handle */
);

How is the corresponding component pascal code for
sqlite3 **ppDB.

Thanks.
Helmut
Chris Burrows
2007-12-04 22:56:33 UTC
Permalink
Post by helmut schrei
Hello,
in the sqllite3.h file i found this definition.
"typedef struct sqlite3 sqlite3;"
And this function.
int sqlite3_open(
const char *filename, /* Database filename (UTF-8) */
sqlite3 **ppDb /* OUT: SQLite db handle */
);
How is the corresponding component pascal code for
sqlite3 **ppDB.
*ppDb is a pointer, **ppDB means that the pointer variable is being passed
by reference (i.e. it is a VAR parameter) instead of by value. You need
something like this (* untested *):

PROCEDURE sqlite3_open(filename: WinApi.PtrSTR; VAR ppDb: WinApi.HANDLE):
INTEGER;

You should find it easier to translate a Delphi (a.k.a Object Pascal)
version of the sqlite3 definitions to Component Pascal rather than the C
versions.

e.g. Tim Anderson's "A simple Delphi wrapper for SQLIte 3"

http://www.itwriting.com/sqlitesimple.php

--
Chris Burrows
CFB Software
http://www.cfbsoftware.com/gpcp

Loading...