-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.h
53 lines (48 loc) · 2.72 KB
/
common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: wanghouqian <whq654321@126.com> |
+----------------------------------------------------------------------+
*/
#ifndef COMMON_H
#define COMMON_H
#define XLOG_CONTEXT_KEY_CONTROL "abcdefghijklmnopqrstuvwzxyABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_."
#define XLOG_CONTEXT_KEY_MAX_LEN 256
#define XLOG_CONTEXT_KEY_LEFT_DEILM '{'
#define XLOG_CONTEXT_KEY_RIGHT_DEILM '}'
#define XLOG_EXCEPTION_TRACE_SERIALIZE 1
#define XLOG_EXCEPTION_TRACE_PRINT 2
#ifdef WINDOWS
#define access _access
#define umask _umask
#endif
int split_string(const char *str, unsigned char split, char ***buf, int *count);
void split_string_free(char ***buf, int count);
void (*old_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
void xlog_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
void (*old_throw_exception_hook)(zval *exception TSRMLS_DC);
void xlog_throw_exception_hook(zval *exception TSRMLS_DC);
void init_error_hooks(TSRMLS_D);
void restore_error_hooks(TSRMLS_D);
int get_debug_backtrace(zval *debug TSRMLS_DC);
int get_serialize_debug_trace(char **ret, int *ret_len TSRMLS_DC);
int get_exception_trace(zval *exception, char **ret, int *ret_len ,int mode TSRMLS_DC);
int get_print_data(char **ret, int *ret_len TSRMLS_DC);
int get_var_export_data(char **ret, int *ret_len TSRMLS_DC);
int strtr_array(const char *template, int template_len, zval *context, char **ret, int *ret_len TSRMLS_DC);
int xlog_make_log_dir(char *dir TSRMLS_DC);
int xlog_get_microtime(char *ret, int max, int extra);
zval * xlog_request_query(uint type, char * name, uint len TSRMLS_DC);
int xlog_elapse_time(TSRMLS_D);
#endif