xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_str_new.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
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.In sqlite3.h
9.Ft sqlite3_str *
10.Fo sqlite3_str_new
11.Fa "sqlite3*"
12.Fc
13.Sh DESCRIPTION
14The sqlite3_str_new(D) interface allocates and initializes
15a new sqlite3_str object.
16To avoid memory leaks, the object returned by
17.Fn sqlite3_str_new
18must be freed by a subsequent call to sqlite3_str_finish(X).
19.Pp
20The sqlite3_str_new(D) interface always returns a
21pointer to a valid sqlite3_str object, though in the event
22of an out-of-memory error the returned object might be a special singleton
23that will silently reject new text, always return SQLITE_NOMEM from
24.Fn sqlite3_str_errcode ,
25always return 0 for
26.Fn sqlite3_str_length ,
27and always return NULL from sqlite3_str_finish(X).
28It is always safe to use the value returned by sqlite3_str_new(D)
29as the sqlite3_str parameter to any of the other sqlite3_str
30methods.
31.Pp
32The D parameter to sqlite3_str_new(D) may be NULL.
33If the D parameter in sqlite3_str_new(D) is not NULL,
34then the maximum length of the string contained in the sqlite3_str
35object will be the value set for sqlite3_limit(D,SQLITE_LIMIT_LENGTH)
36instead of SQLITE_MAX_LENGTH.
37.Sh IMPLEMENTATION NOTES
38These declarations were extracted from the
39interface documentation at line 8400.
40.Bd -literal
41SQLITE_API sqlite3_str *sqlite3_str_new(sqlite3*);
42.Ed
43.Sh SEE ALSO
44.Xr sqlite3_limit 3 ,
45.Xr sqlite3_str 3 ,
46.Xr sqlite3_str_errcode 3 ,
47.Xr SQLITE_LIMIT_LENGTH 3
48