types refactoring
[m6w6/ext-psi] / src / types / impl_val.h
1 /*******************************************************************************
2 Copyright (c) 2016, Michael Wallner <mike@php.net>.
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7
8 * Redistributions of source code must retain the above copyright notice,
9 this list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in the
12 documentation and/or other materials provided with the distribution.
13
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
18 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *******************************************************************************/
25
26 #ifndef PSI_TYPES_IMPL_VAL_H
27 #define PSI_TYPES_IMPL_VAL_H
28
29 #include "Zend/zend_types.h"
30 #include "Zend/zend_API.h"
31
32 typedef struct zend_fcall {
33 zend_fcall_info fci;
34 zend_fcall_info_cache fcc;
35 } zend_fcall;
36
37 typedef union impl_val {
38 char cval;
39 int8_t i8;
40 uint8_t u8;
41 short sval;
42 int16_t i16;
43 uint16_t u16;
44 int ival;
45 int32_t i32;
46 uint32_t u32;
47 long lval;
48 int64_t i64;
49 uint64_t u64;
50 float fval;
51 double dval;
52 #ifdef HAVE_LONG_DOUBLE
53 long double ldval;
54 #endif
55 union {
56 zend_bool bval;
57 zend_long lval;
58 zend_string *str;
59 zend_fcall *cb;
60 } zend;
61 void *ptr;
62 } impl_val;
63
64 #endif