Lines Matching defs:sym
2361 zend_ffi_symbol *sym = Z_PTR_P(zv);
2362 zend_ffi_type_dtor(sym->type);
2363 efree(sym);
2369 zend_ffi_symbol *sym = Z_PTR_P(zv);
2370 zend_ffi_type_dtor(sym->type);
2371 free(sym);
2482 zend_ffi_symbol *sym = NULL;
2485 sym = zend_hash_find_ptr(ffi->symbols, var_name);
2486 if (sym && sym->kind != ZEND_FFI_SYM_VAR && sym->kind != ZEND_FFI_SYM_CONST && sym->kind != ZEND_FFI_SYM_FUNC) {
2487 sym = NULL;
2490 if (!sym) {
2495 if (sym->kind == ZEND_FFI_SYM_VAR) {
2496 zend_ffi_cdata_to_zval(NULL, sym->addr, ZEND_FFI_TYPE(sym->type), read_type, rv, (zend_ffi_flags)sym->is_const, 0, 0);
2497 } else if (sym->kind == ZEND_FFI_SYM_FUNC) {
2505 new_type->pointer.type = ZEND_FFI_TYPE(sym->type);
2511 cdata->ptr_holder = sym->addr;
2515 ZVAL_LONG(rv, sym->value);
2525 zend_ffi_symbol *sym = NULL;
2528 sym = zend_hash_find_ptr(ffi->symbols, var_name);
2529 if (sym && sym->kind != ZEND_FFI_SYM_VAR) {
2530 sym = NULL;
2533 if (!sym) {
2538 if (sym->is_const) {
2543 zend_ffi_zval_to_cdata(sym->addr, ZEND_FFI_TYPE(sym->type), value);
2877 zend_ffi_symbol *sym = NULL;
2901 sym = zend_hash_find_ptr(ffi->symbols, name);
2902 if (sym && sym->kind != ZEND_FFI_SYM_FUNC) {
2903 sym = NULL;
2906 if (!sym) {
2911 type = ZEND_FFI_TYPE(sym->type);
2936 func->internal_function.reserved[1] = sym->addr;
3077 zend_ffi_symbol *sym;
3079 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(FFI_G(symbols), name, sym) {
3080 if (sym->kind == ZEND_FFI_SYM_VAR) {
3086 sym->addr = addr;
3087 } else if (sym->kind == ZEND_FFI_SYM_FUNC) {
3088 zend_string *mangled_name = zend_ffi_mangled_func_name(name, ZEND_FFI_TYPE(sym->type));
3096 sym->addr = addr;
3196 static bool zend_ffi_same_symbols(zend_ffi_symbol *old, zend_ffi_symbol *sym) /* {{{ */
3198 if (old->kind != sym->kind || old->is_const != sym->is_const) {
3203 if (old->value != sym->value) {
3208 return zend_ffi_same_types(ZEND_FFI_TYPE(old->type), ZEND_FFI_TYPE(sym->type));
3266 zend_ffi_symbol *sym;
3270 ZEND_HASH_MAP_FOREACH_PTR(FFI_G(symbols), sym) {
3271 zend_ffi_subst_old_type(&sym->type, old, type);
3305 zend_ffi_symbol *sym;
3413 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(FFI_G(symbols), name, sym) {
3414 if (sym->kind == ZEND_FFI_SYM_VAR) {
3427 sym->addr = addr;
3428 } else if (sym->kind == ZEND_FFI_SYM_FUNC) {
3429 zend_string *mangled_name = zend_ffi_mangled_func_name(name, ZEND_FFI_TYPE(sym->type));
3444 sym->addr = addr;
3450 if (zend_ffi_same_symbols(old_sym, sym)) {
3451 if (ZEND_FFI_TYPE_IS_OWNED(sym->type)
3452 && ZEND_FFI_TYPE(old_sym->type) != ZEND_FFI_TYPE(sym->type)) {
3453 zend_ffi_type *type = ZEND_FFI_TYPE(sym->type);
3510 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(FFI_G(symbols), name, sym) {
3511 if (!zend_hash_add_ptr(scope->symbols, name, sym)) {
3512 zend_ffi_type_dtor(sym->type);
3513 free(sym);
3689 zend_ffi_symbol *sym;
3691 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(FFI_G(symbols), key, sym) {
3692 if (type == ZEND_FFI_TYPE(sym->type)) {
5864 zend_ffi_symbol *sym;
5868 sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len);
5869 if (sym) {
5870 return (sym->kind == ZEND_FFI_SYM_TYPE);
5883 zend_ffi_symbol *sym;
5887 sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len);
5888 if (sym && sym->kind == ZEND_FFI_SYM_TYPE) {
5889 dcl->type = ZEND_FFI_TYPE(sym->type);
5890 if (sym->is_const) {
5907 zend_ffi_symbol *sym;
5915 sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len);
5916 if (sym && sym->kind == ZEND_FFI_SYM_CONST) {
5917 val->i64 = sym->value;
5918 switch (sym->type->kind) {
5967 zend_ffi_symbol *sym;
6062 sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len);
6063 if (sym) {
6066 sym = pemalloc(sizeof(zend_ffi_symbol), FFI_G(persistent));
6067 sym->kind = ZEND_FFI_SYM_CONST;
6068 sym->type = (zend_ffi_type*)sym_type;
6069 sym->value = value;
6070 zend_hash_str_add_new_ptr(FFI_G(symbols), name, name_len, sym);
6632 zend_ffi_symbol *sym;
6639 sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len);
6640 if (sym) {
6642 && sym->kind == ZEND_FFI_SYM_TYPE
6643 && zend_ffi_is_same_type(ZEND_FFI_TYPE(sym->type), ZEND_FFI_TYPE(dcl->type))
6644 && sym->is_const == (bool)(dcl->attr & ZEND_FFI_ATTR_CONST)) {
6653 if (sym->kind == ZEND_FFI_SYM_FUNC
6654 && zend_ffi_same_types(ZEND_FFI_TYPE(sym->type), type)) {
6660 if (sym->kind == ZEND_FFI_SYM_VAR
6661 && zend_ffi_is_same_type(ZEND_FFI_TYPE(sym->type), type)
6662 && sym->is_const == (bool)(dcl->attr & ZEND_FFI_ATTR_CONST)) {
6688 sym = pemalloc(sizeof(zend_ffi_symbol), FFI_G(persistent));
6689 sym->kind = ZEND_FFI_SYM_TYPE;
6690 sym->type = dcl->type;
6691 sym->is_const = (bool)(dcl->attr & ZEND_FFI_ATTR_CONST);
6693 zend_hash_str_add_new_ptr(FFI_G(symbols), name, name_len, sym);
6704 sym = pemalloc(sizeof(zend_ffi_symbol), FFI_G(persistent));
6705 sym->kind = (type->kind == ZEND_FFI_TYPE_FUNC) ? ZEND_FFI_SYM_FUNC : ZEND_FFI_SYM_VAR;
6706 sym->type = dcl->type;
6707 sym->is_const = (bool)(dcl->attr & ZEND_FFI_ATTR_CONST);
6709 zend_hash_str_add_new_ptr(FFI_G(symbols), name, name_len, sym);