| 625 | } |
| 626 | |
| 627 | void soar_remove_callback(agent* thisAgent, |
| 628 | SOAR_CALLBACK_TYPE callback_type, |
| 629 | soar_callback_id id) |
| 630 | { |
| 631 | cons* c; |
| 632 | cons* prev_c = NULL; /* Initialized to placate gcc -Wall */ |
| 633 | list* head; |
| 634 | |
| 635 | head = thisAgent->soar_callbacks[callback_type]; |
| 636 | |
| 637 | for (c = head; c != NIL; c = c->rest) |
| 638 | { |
| 639 | soar_callback* cb; |
| 640 | |
| 641 | cb = static_cast< soar_callback* >(c->first); |
| 642 | |
| 643 | if (cb->id == id) |
| 644 | { |
| 645 | if (c != head) |
| 646 | { |
| 647 | prev_c->rest = c->rest; |
| 648 | soar_destroy_callback(cb); |
| 649 | free_cons(thisAgent, c); |
| 650 | return; |
| 651 | } |
| 652 | else |
| 653 | { |
| 654 | thisAgent->soar_callbacks[callback_type] = head->rest; |
| 655 | soar_destroy_callback(cb); |
| 656 | free_cons(thisAgent, c); |
| 657 | return; |
| 658 | } |
| 659 | } |
| 660 | prev_c = c; |
| 661 | } |
| 662 | } |
| 663 | |
| 664 | void soar_callback_test_callback(agent* /*the_agent*/, |
| 665 | soar_callback_data data, |
no test coverage detected