1mysql_init(3) MariaDB Connector/C mysql_init(3)
2
3
4
5 Name
6 mysql_init - Prepares and initializes a MYSQL structure
7
8 Synopsis
9 #include <mysql.h>
10
11 MYSQL *mysql_init(MYSQL *mysql);
12
13 Description
14 Prepares and initializes a MYSQL structure to be used with mysql_re‐
15 al_connect(3). If an address of a MYSQL structure was passed as param‐
16 eter, the structure will be initialized, if NULL was passed, a new
17 structure will be allocated and initialized.
18
19 Notes: * If parameter mysql is not NULL mysql_close(3) API function
20 will not release the memory * Any subsequent calls to any function (ex‐
21 cept mysql_optionsv(3) will fail until mysql_real_connect(3) was
22 called. * Memory allocated by mysql_init() must be freed with
23 mysql_close(3).
24
25 Return value
26 The mysql_init() function returns an address of a MYSQL structure, or
27 NULL in case of memory allcation error.
28
29 See also
30 • mysql_close(3)
31
32 • mysql_optionsv(3)
33
34
35
36Version 3.2.2 mysql_init(3)