xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_file_control.3 (revision 022f005200bc25af02826a05c8d86d0ef18232dc)
1.Dd March 11, 2017
2.Dt SQLITE3_FILE_CONTROL 3
3.Os
4.Sh NAME
5.Nm sqlite3_file_control
6.Nd Low-Level Control Of Database Files
7.Sh SYNOPSIS
8.Ft int
9.Fo sqlite3_file_control
10.Fa "sqlite3*"
11.Fa "const char *zDbName"
12.Fa "int op"
13.Fa "void*"
14.Fc
15.Sh DESCRIPTION
16The sqlite3_file_control() interface makes a
17direct call to the xFileControl method for the sqlite3_io_methods
18object associated with a particular database identified by the second
19argument.
20The name of the database is "main" for the main database or "temp"
21for the TEMP database, or the name that appears after the AS keyword
22for databases that are added using the ATTACH SQL command.
23A NULL pointer can be used in place of "main" to refer to the main
24database file.
25The third and fourth parameters to this routine are passed directly
26through to the second and third parameters of the xFileControl method.
27The return value of the xFileControl method becomes the return value
28of this routine.
29.Pp
30The SQLITE_FCNTL_FILE_POINTER value for the op parameter causes a pointer
31to the underlying sqlite3_file object to be written into
32the space pointed to by the 4th parameter.
33The SQLITE_FCNTL_FILE_POINTER case is a short-circuit path which does
34not actually invoke the underlying sqlite3_io_methods.xFileControl
35method.
36.Pp
37If the second parameter (zDbName) does not match the name of any open
38database file, then SQLITE_ERROR is returned.
39This error code is not remembered and will not be recalled by sqlite3_errcode()
40or sqlite3_errmsg().
41The underlying xFileControl method might also return SQLITE_ERROR.
42There is no way to distinguish between an incorrect zDbName and an
43SQLITE_ERROR return from the underlying xFileControl method.
44.Pp
45.Sh SEE ALSO
46.Xr sqlite3_errcode 3 ,
47.Xr sqlite3_file 3 ,
48.Xr sqlite3_file_control 3 ,
49.Xr sqlite3_io_methods 3 ,
50.Xr SQLITE_FCNTL_LOCKSTATE 3
51