Lines Matching defs:sym

2348 	zend_ffi_symbol *sym = Z_PTR_P(zv);
2349 zend_ffi_type_dtor(sym->type);
2350 efree(sym);
2356 zend_ffi_symbol *sym = Z_PTR_P(zv);
2357 zend_ffi_type_dtor(sym->type);
2358 free(sym);
2469 zend_ffi_symbol *sym = NULL;
2472 sym = zend_hash_find_ptr(ffi->symbols, var_name);
2473 if (sym && sym->kind != ZEND_FFI_SYM_VAR && sym->kind != ZEND_FFI_SYM_CONST && sym->kind != ZEND_FFI_SYM_FUNC) {
2474 sym = NULL;
2477 if (!sym) {
2482 if (sym->kind == ZEND_FFI_SYM_VAR) {
2483 zend_ffi_cdata_to_zval(NULL, sym->addr, ZEND_FFI_TYPE(sym->type), read_type, rv, (zend_ffi_flags)sym->is_const, 0, 0);
2484 } else if (sym->kind == ZEND_FFI_SYM_FUNC) {
2492 new_type->pointer.type = ZEND_FFI_TYPE(sym->type);
2499 cdata->ptr_holder = sym->addr;
2503 ZVAL_LONG(rv, sym->value);
2513 zend_ffi_symbol *sym = NULL;
2516 sym = zend_hash_find_ptr(ffi->symbols, var_name);
2517 if (sym && sym->kind != ZEND_FFI_SYM_VAR) {
2518 sym = NULL;
2521 if (!sym) {
2526 if (sym->is_const) {
2531 zend_ffi_zval_to_cdata(sym->addr, ZEND_FFI_TYPE(sym->type), value);
2861 zend_ffi_symbol *sym = NULL;
2885 sym = zend_hash_find_ptr(ffi->symbols, name);
2886 if (sym && sym->kind != ZEND_FFI_SYM_FUNC) {
2887 sym = NULL;
2890 if (!sym) {
2895 type = ZEND_FFI_TYPE(sym->type);
2919 func->internal_function.reserved[1] = sym->addr;
3012 zend_ffi_symbol *sym;
3014 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(FFI_G(symbols), name, sym) {
3015 if (sym->kind == ZEND_FFI_SYM_VAR) {
3021 sym->addr = addr;
3022 } else if (sym->kind == ZEND_FFI_SYM_FUNC) {
3023 zend_string *mangled_name = zend_ffi_mangled_func_name(name, ZEND_FFI_TYPE(sym->type));
3031 sym->addr = addr;
3131 static bool zend_ffi_same_symbols(zend_ffi_symbol *old, zend_ffi_symbol *sym) /* {{{ */
3133 if (old->kind != sym->kind || old->is_const != sym->is_const) {
3138 if (old->value != sym->value) {
3143 return zend_ffi_same_types(ZEND_FFI_TYPE(old->type), ZEND_FFI_TYPE(sym->type));
3201 zend_ffi_symbol *sym;
3205 ZEND_HASH_MAP_FOREACH_PTR(FFI_G(symbols), sym) {
3206 zend_ffi_subst_old_type(&sym->type, old, type);
3240 zend_ffi_symbol *sym;
3337 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(FFI_G(symbols), name, sym) {
3338 if (sym->kind == ZEND_FFI_SYM_VAR) {
3351 sym->addr = addr;
3352 } else if (sym->kind == ZEND_FFI_SYM_FUNC) {
3353 zend_string *mangled_name = zend_ffi_mangled_func_name(name, ZEND_FFI_TYPE(sym->type));
3368 sym->addr = addr;
3374 if (zend_ffi_same_symbols(old_sym, sym)) {
3375 if (ZEND_FFI_TYPE_IS_OWNED(sym->type)
3376 && ZEND_FFI_TYPE(old_sym->type) != ZEND_FFI_TYPE(sym->type)) {
3377 zend_ffi_type *type = ZEND_FFI_TYPE(sym->type);
3434 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(FFI_G(symbols), name, sym) {
3435 if (!zend_hash_add_ptr(scope->symbols, name, sym)) {
3436 zend_ffi_type_dtor(sym->type);
3437 free(sym);
3613 zend_ffi_symbol *sym;
3615 ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(FFI_G(symbols), key, sym) {
3616 if (type == ZEND_FFI_TYPE(sym->type)) {
5755 zend_ffi_symbol *sym;
5759 sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len);
5760 if (sym) {
5761 return (sym->kind == ZEND_FFI_SYM_TYPE);
5774 zend_ffi_symbol *sym;
5778 sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len);
5779 if (sym && sym->kind == ZEND_FFI_SYM_TYPE) {
5780 dcl->type = ZEND_FFI_TYPE(sym->type);;
5781 if (sym->is_const) {
5798 zend_ffi_symbol *sym;
5806 sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len);
5807 if (sym && sym->kind == ZEND_FFI_SYM_CONST) {
5808 val->i64 = sym->value;
5809 switch (sym->type->kind) {
5858 zend_ffi_symbol *sym;
5953 sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len);
5954 if (sym) {
5957 sym = pemalloc(sizeof(zend_ffi_symbol), FFI_G(persistent));
5958 sym->kind = ZEND_FFI_SYM_CONST;
5959 sym->type = (zend_ffi_type*)sym_type;
5960 sym->value = value;
5961 zend_hash_str_add_new_ptr(FFI_G(symbols), name, name_len, sym);
6523 zend_ffi_symbol *sym;
6530 sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len);
6531 if (sym) {
6533 && sym->kind == ZEND_FFI_SYM_TYPE
6534 && zend_ffi_is_same_type(ZEND_FFI_TYPE(sym->type), ZEND_FFI_TYPE(dcl->type))
6535 && sym->is_const == (bool)(dcl->attr & ZEND_FFI_ATTR_CONST)) {
6544 if (sym->kind == ZEND_FFI_SYM_FUNC
6545 && zend_ffi_same_types(ZEND_FFI_TYPE(sym->type), type)) {
6551 if (sym->kind == ZEND_FFI_SYM_VAR
6552 && zend_ffi_is_same_type(ZEND_FFI_TYPE(sym->type), type)
6553 && sym->is_const == (bool)(dcl->attr & ZEND_FFI_ATTR_CONST)) {
6579 sym = pemalloc(sizeof(zend_ffi_symbol), FFI_G(persistent));
6580 sym->kind = ZEND_FFI_SYM_TYPE;
6581 sym->type = dcl->type;
6582 sym->is_const = (bool)(dcl->attr & ZEND_FFI_ATTR_CONST);
6584 zend_hash_str_add_new_ptr(FFI_G(symbols), name, name_len, sym);
6595 sym = pemalloc(sizeof(zend_ffi_symbol), FFI_G(persistent));
6596 sym->kind = (type->kind == ZEND_FFI_TYPE_FUNC) ? ZEND_FFI_SYM_FUNC : ZEND_FFI_SYM_VAR;
6597 sym->type = dcl->type;
6598 sym->is_const = (bool)(dcl->attr & ZEND_FFI_ATTR_CONST);
6600 zend_hash_str_add_new_ptr(FFI_G(symbols), name, name_len, sym);