xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_str_errcode.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
2.Dt SQLITE3_STR_ERRCODE 3
3.Os
4.Sh NAME
5.Nm sqlite3_str_errcode ,
6.Nm sqlite3_str_length ,
7.Nm sqlite3_str_value
8.Nd status of a dynamic string
9.Sh SYNOPSIS
10.In sqlite3.h
11.Ft int
12.Fo sqlite3_str_errcode
13.Fa "sqlite3_str*"
14.Fc
15.Ft int
16.Fo sqlite3_str_length
17.Fa "sqlite3_str*"
18.Fc
19.Ft char *
20.Fo sqlite3_str_value
21.Fa "sqlite3_str*"
22.Fc
23.Sh DESCRIPTION
24These interfaces return the current status of an sqlite3_str
25object.
26.Pp
27If any prior errors have occurred while constructing the dynamic string
28in sqlite3_str X, then the sqlite3_str_errcode(X)
29method will return an appropriate error code.
30The sqlite3_str_errcode(X) method returns SQLITE_NOMEM
31following any out-of-memory error, or SQLITE_TOOBIG if
32the size of the dynamic string exceeds SQLITE_MAX_LENGTH,
33or SQLITE_OK if there have been no errors.
34.Pp
35The sqlite3_str_length(X) method returns the current
36length, in bytes, of the dynamic string under construction in sqlite3_str
37object X.
38The length returned by sqlite3_str_length(X) does
39not include the zero-termination byte.
40.Pp
41The sqlite3_str_value(X) method returns a pointer
42to the current content of the dynamic string under construction in
43X.
44The value returned by sqlite3_str_value(X) is managed
45by the sqlite3_str object X and might be freed or altered by any subsequent
46method on the same sqlite3_str object.
47Applications must not used the pointer returned sqlite3_str_value(X)
48after any subsequent method call on the same object.
49Applications may change the content of the string returned by sqlite3_str_value(X)
50as long as they do not write into any bytes outside the range of 0
51to sqlite3_str_length(X) and do not read or write
52any byte after any subsequent sqlite3_str method call.
53.Sh IMPLEMENTATION NOTES
54These declarations were extracted from the
55interface documentation at line 8481.
56.Bd -literal
57SQLITE_API int sqlite3_str_errcode(sqlite3_str*);
58SQLITE_API int sqlite3_str_length(sqlite3_str*);
59SQLITE_API char *sqlite3_str_value(sqlite3_str*);
60.Ed
61.Sh SEE ALSO
62.Xr sqlite3_str 3 ,
63.Xr SQLITE_OK 3
64