api refactoring
[m6w6/ext-psi] / src / types / decl_struct_layout.h
1 #ifndef _PSI_TYPES_DECL_STRUCT_LAYOUT_H
2 #define _PSI_TYPES_DECL_STRUCT_LAYOUT_H
3
4 typedef struct decl_struct_layout {
5 size_t pos;
6 size_t len;
7 } decl_struct_layout;
8
9 static inline decl_struct_layout *init_decl_struct_layout(size_t pos, size_t len) {
10 decl_struct_layout *l = calloc(1, sizeof(*l));
11 ZEND_ASSERT(pos+len);
12 l->pos = pos;
13 l->len = len;
14 return l;
15 }
16
17 static inline void free_decl_struct_layout(decl_struct_layout *l) {
18 free(l);
19 }
20
21 #endif