xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_str_new.3 (revision cef8759bd76c1b621f8eab8faa6f208faabc2e15)
1.Dd December 19, 2018
2.Dt SQLITE3_STR_NEW 3
3.Os
4.Sh NAME
5.Nm sqlite3_str_new
6.Nd Create A New Dynamic String Object
7.Sh SYNOPSIS
8.Ft sqlite3_str *
9.Fo sqlite3_str_new
10.Fa "sqlite3*"
11.Fc
12.Sh DESCRIPTION
13The sqlite3_str_new(D) interface allocates and initializes
14a new sqlite3_str object.
15To avoid memory leaks, the object returned by sqlite3_str_new()
16must be freed by a subsequent call to sqlite3_str_finish(X).
17.Pp
18The sqlite3_str_new(D) interface always returns a
19pointer to a valid sqlite3_str object, though in the event
20of an out-of-memory error the returned object might be a special singleton
21that will silently reject new text, always return SQLITE_NOMEM from
22sqlite3_str_errcode(), always return 0 for sqlite3_str_length(),
23and always return NULL from sqlite3_str_finish(X).
24It is always safe to use the value returned by sqlite3_str_new(D)
25as the sqlite3_str parameter to any of the other sqlite3_str
26methods.
27.Pp
28The D parameter to sqlite3_str_new(D) may be NULL.
29If the D parameter in sqlite3_str_new(D) is not NULL,
30then the maximum length of the string contained in the sqlite3_str
31object will be the value set for sqlite3_limit(D,SQLITE_LIMIT_LENGTH)
32instead of SQLITE_MAX_LENGTH.
33.Sh SEE ALSO
34.Xr sqlite3_limit 3 ,
35.Xr sqlite3_str 3 ,
36.Xr sqlite3_str_errcode 3 ,
37.Xr sqlite3_str_new 3 ,
38.Xr SQLITE_LIMIT_LENGTH 3
39