Skip to content

Commit

Permalink
Add 8.4.0-dev structs (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
adsr committed Feb 5, 2024
1 parent 09919e4 commit b827afd
Showing 1 changed file with 137 additions and 0 deletions.
137 changes: 137 additions & 0 deletions php_structs_84.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#ifndef __php_structs_84_h
#define __php_structs_84_h

#include <stdint.h>

typedef struct _zend_executor_globals_84 zend_executor_globals_84;
typedef struct _zend_execute_data_84 zend_execute_data_84;
typedef struct _zend_op_array_84 zend_op_array_84;
typedef union _zend_function_84 zend_function_84;
typedef struct _zend_class_entry_84 zend_class_entry_84;
typedef struct _zend_string_84 zend_string_84;
typedef struct _zend_op_84 zend_op_84;
typedef struct _sapi_request_info_84 sapi_request_info_84;
typedef struct _sapi_globals_struct_84 sapi_globals_struct_84;
typedef union _zend_value_84 zend_value_84;
typedef struct _zval_84 zval_84;
typedef struct _Bucket_84 Bucket_84;
typedef struct _zend_array_84 zend_array_84;
typedef struct _zend_alloc_globals_84 zend_alloc_globals_84;
typedef struct _zend_mm_heap_84 zend_mm_heap_84;

/* Assumes 8-byte pointers */
/* offset length */
struct __attribute__((__packed__)) _zend_array_84 {
uint8_t pad0[12]; /* 0 +12 */
uint32_t nTableMask; /* 12 +4 */
Bucket_84 *arData; /* 16 +8 */
uint32_t nNumUsed; /* 24 +4 */
uint32_t nNumOfElements; /* 28 +4 */
uint32_t nTableSize; /* 32 +4 */
}; /* =36 */

struct __attribute__((__packed__)) _zend_executor_globals_84 {
uint8_t pad0[304]; /* 0 +304 */
zend_array_84 symbol_table; /* 304 +36 */
uint8_t pad1[148]; /* 340 +148 */
zend_execute_data_84 *current_execute_data; /* 488 +8 */
};

struct __attribute__((__packed__)) _zend_execute_data_84 {
zend_op_84 *opline; /* 0 +8 */
uint8_t pad0[16]; /* 8 +16 */
zend_function_84 *func; /* 24 +8 */
uint8_t pad1[16]; /* 32 +16 */
zend_execute_data_84 *prev_execute_data; /* 48 +8 */
zend_array_84 *symbol_table; /* 56 +8 */
};

struct __attribute__((__packed__)) _zend_op_array_84 {
uint8_t pad0[72]; /* 0 +72 */
int last_var; /* 72 +4 */
uint8_t pad1[28]; /* 76 +28 */
zend_string_84 **vars; /* 104 +8 */
uint8_t pad2[32]; /* 112 +32 */
zend_string_84 *filename; /* 144 +8 */
uint32_t line_start; /* 152 +4 */
};

union __attribute__((__packed__)) _zend_function_84 {
uint8_t type; /* 0 +8 */
struct {
uint8_t pad0[8]; /* 0 +8 */
zend_string_84 *function_name; /* 8 +8 */
zend_class_entry_84 *scope; /* 16 +8 */
} common;
zend_op_array_84 op_array; /* 0 +240 */
};

struct __attribute__((__packed__)) _zend_class_entry_84 {
uint8_t pad0[8]; /* 0 +8 */
zend_string_84 *name; /* 8 +8 */
};

struct __attribute__((__packed__)) _zend_string_84 {
uint8_t pad0[16]; /* 0 +16 */
size_t len; /* 16 +8 */
char val[1]; /* 24 +8 */
}; /* =32 */

struct __attribute__((__packed__)) _zend_op_84 {
uint8_t pad0[24]; /* 0 +24 */
uint32_t lineno; /* 24 +4 */
};

struct __attribute__((__packed__)) _sapi_request_info_84 {
uint8_t pad0[8]; /* 0 +8 */
char *query_string; /* 8 +8 */
char *cookie_data; /* 16 +8 */
uint8_t pad1[8]; /* 24 +8 */
char *path_translated; /* 32 +8 */
char *request_uri; /* 40 +8 */
}; /* =48 */

struct __attribute__((__packed__)) _sapi_globals_struct_84 {
uint8_t pad0[8]; /* 0 +8 */
sapi_request_info_84 request_info; /* 8 +48 */
uint8_t pad1[384]; /* 56 +384 */
double global_request_time; /* 440 +8 */
};

union __attribute__((__packed__)) _zend_value_84 {
long lval; /* 0 +8 */
double dval; /* 0 +8 */
zend_string_84 *str; /* 0 +8 */
zend_array_84 *arr; /* 0 +8 */
};

struct __attribute__((__packed__)) _zval_84 {
zend_value_84 value; /* 0 +8 */
union {
struct {
uint8_t type; /* 8 +1 */
uint8_t pad0[3]; /* 9 +3 */
} v;
} u1; /* 8 +4 */
union {
uint32_t next; /* 12 +4 */
} u2;
};

struct __attribute__((__packed__)) _Bucket_84 {
zval_84 val; /* 0 +16 */
uint64_t h; /* 16 +8 */
zend_string_84 *key; /* 24 +8 */
}; /* =32 */

struct __attribute__((__packed__)) _zend_alloc_globals_84 {
zend_mm_heap_84 *mm_heap; /* 0 +8 */
};

struct __attribute__((__packed__)) _zend_mm_heap_84 {
uint8_t pad0[16]; /* 0 +16 */
size_t size; /* 16 +8 */
size_t peak; /* 24 +8 */
};

#endif

0 comments on commit b827afd

Please sign in to comment.