xref: /php-src/ext/mysqli/mysqli_mysqlnd.h (revision b0961f2d)
1 /*
2   +----------------------------------------------------------------------+
3   | Copyright (c) The PHP Group                                          |
4   +----------------------------------------------------------------------+
5   | This source file is subject to version 3.01 of the PHP license,      |
6   | that is bundled with this package in the file LICENSE, and is        |
7   | available through the world-wide-web at the following url:           |
8   | https://www.php.net/license/3_01.txt                                 |
9   | If you did not receive a copy of the PHP license and are unable to   |
10   | obtain it through the world-wide-web, please send a note to          |
11   | license@php.net so we can mail you a copy immediately.               |
12   +----------------------------------------------------------------------+
13   | Authors: Georg Richter <georg@php.net>                               |
14   |          Andrey Hristov <andrey@php.net>                             |
15   |          Ulf Wendel <uw@php.net>                                     |
16   +----------------------------------------------------------------------+
17 
18 */
19 
20 #ifndef MYSQLI_MYSQLND_H
21 #define MYSQLI_MYSQLND_H
22 
23 #include "ext/mysqlnd/mysqlnd_libmysql_compat.h"
24 #include "ext/mysqlnd/mysqlnd_portability.h"
25 
26 /* Here comes non-libmysql API to have less ifdefs in mysqli*/
27 #define MYSQLI_CLOSE_EXPLICIT                  MYSQLND_CLOSE_EXPLICIT
28 #define MYSQLI_CLOSE_IMPLICIT                  MYSQLND_CLOSE_IMPLICIT
29 #define MYSQLI_CLOSE_DISCONNECTED              MYSQLND_CLOSE_DISCONNECTED
30 
31 #define mysqli_result_is_unbuffered(r)	((r)->unbuf)
32 #define mysqli_result_is_unbuffered_and_not_everything_is_fetched(r)	((r)->unbuf && !(r)->unbuf->eof_reached)
33 #define mysqli_server_status(c)			mysqlnd_get_server_status((c))
34 #define mysqli_stmt_get_id(s)			((s)->data->stmt_id)
35 #define mysqli_stmt_warning_count(s)	mysqlnd_stmt_warning_count((s))
36 #define mysqli_stmt_server_status(s)	mysqlnd_stmt_server_status((s))
37 #define mysqli_stmt_get_connection(s)	(s)->data->conn
38 #define mysqli_close(c, how)			mysqlnd_close((c), (how))
39 #define mysqli_stmt_close(c, implicit)	mysqlnd_stmt_close((c), (implicit))
40 #define mysqli_free_result(r, implicit)	mysqlnd_free_result((r), (implicit))
41 #define mysqli_async_query(c, q, l)		mysqlnd_async_query((c), (q), (l))
42 #define mysqli_change_user_silent(c, u, p, d, p_len)   mysqlnd_change_user_ex((c), (u), (p), (d), true, (size_t)(p_len))
43 
44 #endif
45