xref: /PHP-5.4/ext/mysqli/mysqli_report.h (revision c0d060f5)
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 5                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 1997-2014 The PHP Group                                |
6   +----------------------------------------------------------------------+
7   | This source file is subject to version 3.01 of the PHP license,      |
8   | that is bundled with this package in the file LICENSE, and is        |
9   | available through the world-wide-web at the following url:           |
10   | http://www.php.net/license/3_01.txt                                  |
11   | If you did not receive a copy of the PHP license and are unable to   |
12   | obtain it through the world-wide-web, please send a note to          |
13   | license@php.net so we can mail you a copy immediately.               |
14   +----------------------------------------------------------------------+
15   | Author: Georg Richter <georg@php.net>                                |
16   +----------------------------------------------------------------------+
17 
18   $Id$
19 */
20 
21 #ifndef __HAVE_MYSQLI_PROFILER_H__
22 #define __HAVE_MYSQLI_PROFILER_H__
23 
24 #ifdef PHP_WIN32
25 #include <process.h>
26 #include <direct.h>
27 #include "win32/time.h"
28 #else
29 #include <sys/socket.h>
30 #include <netinet/in.h>
31 #include <arpa/inet.h>
32 #include <netdb.h>
33 #include <sys/time.h>
34 #endif
35 
36 typedef struct {
37 	struct timeval	starttime,
38 					endtime;		/* execution time */
39 } PR_TIME_INFO;
40 
41 
42 #define MYSQLI_PR_REPORT_STDERR		1
43 #define MYSQLI_PR_REPORT_PORT		2
44 
45 
46 
47 /*** PROFILER MACROS ***/
48 #define MYSQLI_PROFILER_STARTTIME(ptr) if (MyG(profiler.mode)) gettimeofday(&ptr.starttime, NULL)
49 #define MYSQLI_PROFILER_ENDTIME(ptr) if (MyG(profiler.mode)) gettimeofday(&ptr.endtime, NULL)
50 #define MYSQLI_PROFILER_REPORT(_type, _time, ptr) if (MyG(profiler.mode)) php_mysqli_profiler_report(_type, _time, (void *)ptr)
51 
52 
53 
54 #endif
55 
56 /*
57  * Local variables:
58  * tab-width: 4
59  * c-basic-offset: 4
60  * indent-tabs-mode: t
61  * End:
62  * vim600: noet sw=4 ts=4 fdm=marker
63  * vim<600: noet sw=4 ts=4
64  */
65