| 37 | |
| 38 | |
| 39 | void call_bind_rule( OBJECT * target_, OBJECT * boundname_ ) |
| 40 | { |
| 41 | LIST * const bind_rule = var_get( root_module(), constant_BINDRULE ); |
| 42 | if ( !list_empty( bind_rule ) ) |
| 43 | { |
| 44 | OBJECT * target = object_copy( target_ ); |
| 45 | OBJECT * boundname = object_copy( boundname_ ); |
| 46 | if ( boundname && target ) |
| 47 | { |
| 48 | /* Prepare the argument list. */ |
| 49 | FRAME frame[ 1 ]; |
| 50 | frame_init( frame ); |
| 51 | |
| 52 | /* First argument is the target name. */ |
| 53 | lol_add( frame->args, list_new( target ) ); |
| 54 | |
| 55 | lol_add( frame->args, list_new( boundname ) ); |
| 56 | if ( lol_get( frame->args, 1 ) ) |
| 57 | { |
| 58 | OBJECT * rulename = list_front( bind_rule ); |
| 59 | list_free( evaluate_rule( bindrule( rulename, root_module() ), rulename, frame ) ); |
| 60 | } |
| 61 | |
| 62 | /* Clean up */ |
| 63 | frame_free( frame ); |
| 64 | } |
| 65 | else |
| 66 | { |
| 67 | if ( boundname ) |
| 68 | object_free( boundname ); |
| 69 | if ( target ) |
| 70 | object_free( target ); |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /* Records the binding of a target with an explicit LOCATE. */ |
| 76 | void set_explicit_binding( OBJECT * target, OBJECT * locate ) |
no test coverage detected