Back to index

php5  5.3.10
mysqli_libmysql.h
Go to the documentation of this file.
00001 /*
00002   ----------------------------------------------------------------------
00003   | PHP Version 6                                                        |
00004   ----------------------------------------------------------------------
00005   | Copyright (c) 2007 The PHP Group                                     |
00006   ----------------------------------------------------------------------
00007   | This source file is subject to version 3.01 of the PHP license,      |
00008   | that is bundled with this package in the file LICENSE, and is        |
00009   | available through the world-wide-web at the following url:           |
00010   | http://www.php.net/license/3_01.txt                                  |
00011   | If you did not receive a copy of the PHP license and are unable to   |
00012   | obtain it through the world-wide-web, please send a note to          |
00013   | license@php.net so we can mail you a copy immediately.               |
00014   ----------------------------------------------------------------------
00015   | Authors: Georg Richter <georg@mysql.com>                             |
00016   |          Andrey Hristov <andrey@mysql.com>                           |
00017   |          Ulf Wendel <uwendel@mysql.com>                              |
00018   ----------------------------------------------------------------------
00019 
00020 */
00021 
00022 #ifndef MYSQLI_LIBMYSQL_H
00023 #define MYSQLI_LIBMYSQL_H
00024 
00025 /* These are unused */
00026 #define MYSQLI_CLOSE_EXPLICIT 0
00027 #define MYSQLI_CLOSE_IMPLICIT 1
00028 #define MYSQLI_CLOSE_DISCONNECTED 2
00029 #define MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE     200
00030 #define MYSQLND_OPT_INT_AND_YEAR_AS_INT                        201
00031 
00032 #define mysqli_result_is_unbuffered(r)           ((r)->handle && (r)->handle->status == MYSQL_STATUS_USE_RESULT && (r)->data == NULL)
00033 #define mysqli_result_is_unbuffered_and_not_everything_is_fetched(r)   mysqli_result_is_unbuffered(r)
00034 #define mysqli_server_status(c)                         (c)->server_status
00035 #define mysqli_stmt_get_id(s)                           ((s)->stmt_id)
00036 #define mysqli_stmt_warning_count(s)             mysql_warning_count((s)->mysql)
00037 #define mysqli_stmt_server_status(s)             (s)->mysql->server_status
00038 #define mysqli_stmt_get_connection(s)            (s)->mysql
00039 #define mysqli_close(c, is_forced)               mysql_close((c))
00040 #define mysqli_stmt_close(c, implicit)           mysql_stmt_close((c))
00041 #define mysqli_free_result(r, is_forced)  mysql_free_result((r))
00042 #define mysqli_change_user_silent(c, u, p, d)   mysql_change_user((c), (u), (p), (d))
00043 
00044 
00045 /*
00046   These functions also reside in ext/mysqlnd/mysqlnd_portability.h but since it is only made
00047   available if one wants to build mysqli against mysqlnd and they are useful for libmysql as
00048   well, we check whether they're not defined [build with libmysql is desired] and define them.
00049 
00050   Bit values are sent in reverted order of bytes, compared to normal !!!
00051 */
00052 
00053 
00054 #ifndef uint1korr
00055 #define uint1korr(A) (*(((uint8_t*)(A))))
00056 #endif
00057 
00058 #ifndef bit_uint2korr
00059 #define bit_uint2korr(A) ((uint16_t) (((uint16_t) (((unsigned char*) (A))[1])) +\
00060                                    ((uint16_t) (((unsigned char*) (A))[0]) << 8)))
00061 #endif
00062 
00063 #ifndef bit_uint3korr
00064 #define bit_uint3korr(A) ((uint32_t) (((uint32_t) (((unsigned char*) (A))[2])) +\
00065                                    (((uint32_t) (((unsigned char*) (A))[1])) << 8) +\
00066                                    (((uint32_t) (((unsigned char*) (A))[0])) << 16)))
00067 #endif
00068 
00069 #ifndef bit_uint4korr
00070 #define bit_uint4korr(A) ((uint32_t) (((uint32_t) (((unsigned char*) (A))[3])) +\
00071                                    (((uint32_t) (((unsigned char*) (A))[2])) << 8) +\
00072                                    (((uint32_t) (((unsigned char*) (A))[1])) << 16) +\
00073                                    (((uint32_t) (((unsigned char*) (A))[0])) << 24)))
00074 #endif
00075 
00076 #ifndef bit_uint5korr
00077 #define bit_uint5korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[4])) +\
00078                                     (((uint32_t) (((unsigned char*) (A))[3])) << 8) +\
00079                                     (((uint32_t) (((unsigned char*) (A))[2])) << 16) +\
00080                                    (((uint32_t) (((unsigned char*) (A))[1])) << 24)) +\
00081                                     (((uint64_t) (((unsigned char*) (A))[0])) << 32))
00082 #endif
00083 
00084 #ifndef bit_uint6korr
00085 #define bit_uint6korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[5])) +\
00086                                     (((uint32_t) (((unsigned char*) (A))[4])) << 8) +\
00087                                     (((uint32_t) (((unsigned char*) (A))[3])) << 16) +\
00088                                     (((uint32_t) (((unsigned char*) (A))[2])) << 24)) +\
00089                         (((uint64_t) (((uint32_t) (((unsigned char*) (A))[1])) +\
00090                                     (((uint32_t) (((unsigned char*) (A))[0]) << 8)))) <<\
00091                                      32))
00092 #endif
00093 
00094 #ifndef bit_uint7korr
00095 #define bit_uint7korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[6])) +\
00096                                     (((uint32_t) (((unsigned char*) (A))[5])) << 8) +\
00097                                     (((uint32_t) (((unsigned char*) (A))[4])) << 16) +\
00098                                    (((uint32_t) (((unsigned char*) (A))[3])) << 24)) +\
00099                         (((uint64_t) (((uint32_t) (((unsigned char*) (A))[2])) +\
00100                                     (((uint32_t) (((unsigned char*) (A))[1])) << 8) +\
00101                                     (((uint32_t) (((unsigned char*) (A))[0])) << 16))) <<\
00102                                      32))
00103 #endif
00104 
00105 #ifndef bit_uint8korr
00106 #define bit_uint8korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[7])) +\
00107                                     (((uint32_t) (((unsigned char*) (A))[6])) << 8) +\
00108                                     (((uint32_t) (((unsigned char*) (A))[5])) << 16) +\
00109                                     (((uint32_t) (((unsigned char*) (A))[4])) << 24)) +\
00110                         (((uint64_t) (((uint32_t) (((unsigned char*) (A))[3])) +\
00111                                     (((uint32_t) (((unsigned char*) (A))[2])) << 8) +\
00112                                     (((uint32_t) (((unsigned char*) (A))[1])) << 16) +\
00113                                     (((uint32_t) (((unsigned char*) (A))[0])) << 24))) <<\
00114                                     32))
00115 #endif
00116 
00117 #endif /* MYSQLI_LIBMYSQL_H */
00118