xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_str_appendf.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
2.Dt SQLITE3_STR_APPENDF 3
3.Os
4.Sh NAME
5.Nm sqlite3_str_appendf ,
6.Nm sqlite3_str_vappendf ,
7.Nm sqlite3_str_append ,
8.Nm sqlite3_str_appendall ,
9.Nm sqlite3_str_appendchar ,
10.Nm sqlite3_str_reset
11.Nd add content to a dynamic string
12.Sh SYNOPSIS
13.In sqlite3.h
14.Ft void
15.Fo sqlite3_str_appendf
16.Fa "sqlite3_str*"
17.Fa "const char *zFormat"
18.Fa "..."
19.Fc
20.Ft void
21.Fo sqlite3_str_vappendf
22.Fa "sqlite3_str*"
23.Fa "const char *zFormat"
24.Fa "va_list"
25.Fc
26.Ft void
27.Fo sqlite3_str_append
28.Fa "sqlite3_str*"
29.Fa "const char *zIn"
30.Fa "int N"
31.Fc
32.Ft void
33.Fo sqlite3_str_appendall
34.Fa "sqlite3_str*"
35.Fa "const char *zIn"
36.Fc
37.Ft void
38.Fo sqlite3_str_appendchar
39.Fa "sqlite3_str*"
40.Fa "int N"
41.Fa "char C"
42.Fc
43.Ft void
44.Fo sqlite3_str_reset
45.Fa "sqlite3_str*"
46.Fc
47.Sh DESCRIPTION
48These interfaces add content to an sqlite3_str object previously obtained
49from
50.Fn sqlite3_str_new .
51The sqlite3_str_appendf(X,F,...) and sqlite3_str_vappendf(X,F,V)
52interfaces uses the built-in printf functionality of
53SQLite to append formatted text onto the end of sqlite3_str
54object X.
55.Pp
56The sqlite3_str_append(X,S,N) method appends
57exactly N bytes from string S onto the end of the sqlite3_str
58object X.
59N must be non-negative.
60S must contain at least N non-zero bytes of content.
61To append a zero-terminated string in its entirety, use the
62.Fn sqlite3_str_appendall
63method instead.
64.Pp
65The sqlite3_str_appendall(X,S) method appends
66the complete content of zero-terminated string S onto the end of sqlite3_str
67object X.
68.Pp
69The sqlite3_str_appendchar(X,N,C) method
70appends N copies of the single-byte character C onto the end of sqlite3_str
71object X.
72This method can be used, for example, to add whitespace indentation.
73.Pp
74The sqlite3_str_reset(X) method resets the string
75under construction inside sqlite3_str object X back to zero
76bytes in length.
77.Pp
78These methods do not return a result code.
79If an error occurs, that fact is recorded in the sqlite3_str
80object and can be recovered by a subsequent call to sqlite3_str_errcode(X).
81.Sh IMPLEMENTATION NOTES
82These declarations were extracted from the
83interface documentation at line 8442.
84.Bd -literal
85SQLITE_API void sqlite3_str_appendf(sqlite3_str*, const char *zFormat, ...);
86SQLITE_API void sqlite3_str_vappendf(sqlite3_str*, const char *zFormat, va_list);
87SQLITE_API void sqlite3_str_append(sqlite3_str*, const char *zIn, int N);
88SQLITE_API void sqlite3_str_appendall(sqlite3_str*, const char *zIn);
89SQLITE_API void sqlite3_str_appendchar(sqlite3_str*, int N, char C);
90SQLITE_API void sqlite3_str_reset(sqlite3_str*);
91.Ed
92.Sh SEE ALSO
93.Xr sqlite3_str 3 ,
94.Xr sqlite3_str_new 3
95